Commit Graph

5 Commits

Author SHA1 Message Date
Stephen Warren
47b7164450 fs-test.sh: fix pre-requisite detection
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 <swarren@wwwdotorg.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2015-10-24 13:50:34 -04:00
Stephen Warren
4a28274227 test: fat: add test of non-contiguous file reads
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 <swarren@wwwdotorg.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2015-10-24 13:50:34 -04:00
Tom Rini
e8de6d7b4a test/fs/fs-test.sh: Update expected results and TC10 logic
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 <trini@konsulko.com>
2015-10-11 17:12:14 -04:00
Stephen Warren
04812605f3 fs-test.sh: minor fixes
- 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 <swarren@wwwdotorg.org>
Acked-by: Suriyan Ramasami <suriyan.r@gmail.com>
2015-08-18 13:45:59 -04:00
Suriyan Ramasami
6c016485a6 sandbox: script for testing sandbox/ext4/fat/fs commands
Test size/read/write commands in a sandbox environment.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>

Acked-by: Simon Glass <sjg@chromium.org>
2014-11-23 06:49:05 -05:00