06 Oct, 2017

2 commits

  • The previous commit fixed a problem in FAT code where going back to the
    root directory using '..' wouldn't work correctly on FAT12 or FAT16.
    Add a test to exercise this case (which was once fixed in commit
    18a10d46f26 "fat: handle paths that include ../" but reintroduced due to
    the directory iterator refactoring).

    This test only very barely catches the problem - without the fix the
    size command still gives valid output but the additional spurious
    "Invalid FAT entry" error message makes it not get caught in the
    'egrep -A3 ' output. I tried to make a proper test that grows the root
    directory to two clusters lots of with dummy files but that causes the
    write tests to crash the sandbox totally...

    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Tom Rini

    Tuomas Tynkkynen
     
  • Currently we can only test FAT32 which is the default FAT version that
    mkfs.vfat creates by default. Instead make it explicitly create either a
    FAT16 or a FAT32 volume. This allows us to exercise more code, for
    instance the root directory handling is done differently in FAT32 than
    the older FATs.

    Adding FAT12 support is a much bigger job since the test creates a 2.5GB
    file and the FAT12 maximum partition size is way smaller than that.

    Signed-off-by: Tuomas Tynkkynen
    Reviewed-by: Tom Rini

    Tuomas Tynkkynen
     

22 Nov, 2016

1 commit


23 Sep, 2016

6 commits


23 Aug, 2016

1 commit

  • The fs-test.sh script expected there to be a \n\r style newline at the
    end of the output. This is no longer the case, so use 'tr' to remove the
    \r that we get.

    Fixes: (c5917b4b054d "dm: serial-uclass: Move a carriage return before a
    line feed")
    Signed-off-by: Tom Rini

    Tom Rini
     

14 Jan, 2016

1 commit

  • - Use "mkdir -p" to avoid errors when intermediate directories are
    missing.
    - Fall back to "dd" when "fallocate" fails. For example, fallocate isn't
    supported on ext4.
    - Add error checking for test image generation. Without this, the test
    simply plows on spewing all kinds of errors which are hard to
    immediately root-cause.

    Signed-off-by: Stephen Warren

    Stephen Warren
     

19 Nov, 2015

1 commit

  • Check the result code of all command that are executed. Without this,
    if the fallocate invocation fails (this feature is not supported on ext3
    filesystems for example) then a zero-length output file will be created,
    and subsequent the mkfs and mount invocations will fail, which will cause
    the subsequent dd invocation to attempt to fill up the host's entire free
    disk space. That's not a nice user experience!

    Related, if fallocate does fail, try to create the test disk image using
    dd instead. That should work everywhere.

    Fixes: 4a28274227d0 ("test: fat: add test of non-contiguous file reads")
    Signed-off-by: Stephen Warren

    Stephen Warren
     

25 Oct, 2015

2 commits

  • In the following snippet:

    if [ ! -x `which $prereq` ]; then

    When $prereq does not exist, `which $prereq` evaluates to the empty string,
    which results in *no* argument being passed to the -x operator, which then
    evaluates to true, which is the equivalent of the prereq having been found. In
    order for this to fail as expected, we must pass an empty argument, which then
    causes -x to fail. Do this by wrapping the `` in quotes so there's always an
    argument to -x, even if the value of the argument is zero-length.

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass
    Tested-by: Simon Glass

    Stephen Warren
     
  • In my patch series to replace fs/fat with "ff.c", I enhanced ff.c to
    optimize file reading, so that reads of contiguous clusters are submitted
    to the IO device as a single read. This test attempts to torture-test
    edge-cases of that enhancement.

    BTW, the only way I found to validate that this script actually does
    create non-contiguous files was to manually inspect the FAT bitmap in a
    hex dump of the FAT image. hdparm --fibmap doesn't work on loop-mounted
    filesystems. filefrag -v -e seems to lie about files being contiguous
    when they aren't.

    Signed-off-by: Stephen Warren
    Reviewed-by: Simon Glass
    Tested-by: Simon Glass

    Stephen Warren
     

12 Oct, 2015

1 commit

  • With the changes in 7a3e70c we now get read(2) behavior so trying to
    read 2MB with 1MB left in the file results in 1MB read and a warning.
    We update the test logic here to make sure we read back 1MB as expected.
    This change however changes the overall summary as while EXT4 continues
    to not have offset support the test now fails when expected to pass
    rather than fails when expected to fail (and we report that as pass).

    Signed-off-by: Tom Rini

    Tom Rini
     

19 Aug, 2015

1 commit

  • - Re-direct stderr into the log files, so any errors U-Boot emits are
    visible in the logs. This is relevant if the "reset" shell command
    attempts to report that it's not supported on the sandbox board.
    - Fix test_fs_nonfs() to name the files it created differently for each
    invocation. Otherwise, the logs from different tests overwrite
    each-other.

    Signed-off-by: Stephen Warren
    Acked-by: Suriyan Ramasami

    Stephen Warren
     

23 Nov, 2014

1 commit