Merge git://git.denx.de/u-boot-fsl-qoriq
[oweals/u-boot.git] / test / fs / fs-test.sh
index 0ac34983a1ec738c6dc93bd9b7bd825ac349df64..20d5dd8a47d90a2f5ff85598a4f9e2914fd24589 100755 (executable)
@@ -9,18 +9,18 @@
 # It currently tests the fs/sb and native commands for ext4 and fat partitions
 # Expected results are as follows:
 # EXT4 tests:
-# fs-test.sb.ext4.out: Summary: PASS: 23 FAIL: 0
-# fs-test.ext4.out: Summary: PASS: 23 FAIL: 0
-# fs-test.fs.ext4.out: Summary: PASS: 23 FAIL: 0
+# fs-test.sb.ext4.out: Summary: PASS: 24 FAIL: 0
+# fs-test.ext4.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fs.ext4.out: Summary: PASS: 24 FAIL: 0
 # FAT16 tests:
-# fs-test.sb.fat16.out: Summary: PASS: 23 FAIL: 0
-# fs-test.fat16.out: Summary: PASS: 20 FAIL: 3
-# fs-test.fs.fat16.out: Summary: PASS: 20 FAIL: 3
+# fs-test.sb.fat16.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fat16.out: Summary: PASS: 21 FAIL: 3
+# fs-test.fs.fat16.out: Summary: PASS: 21 FAIL: 3
 # FAT32 tests:
-# fs-test.sb.fat32.out: Summary: PASS: 23 FAIL: 0
-# fs-test.fat32.out: Summary: PASS: 20 FAIL: 3
-# fs-test.fs.fat32.out: Summary: PASS: 20 FAIL: 3
-# Total Summary: TOTAL PASS: 195 TOTAL FAIL: 12
+# fs-test.sb.fat32.out: Summary: PASS: 24 FAIL: 0
+# fs-test.fat32.out: Summary: PASS: 21 FAIL: 3
+# fs-test.fs.fat32.out: Summary: PASS: 21 FAIL: 3
+# Total Summary: TOTAL PASS: 204 TOTAL FAIL: 12
 
 # pre-requisite binaries list.
 PREREQ_BINS="md5sum mkfs mount umount dd fallocate mkdir"
@@ -229,10 +229,14 @@ ${PREFIX}ls host${SUFFIX} $6
 # We want ${PREFIX}size host 0:0 $3 for host commands and
 # sb size hostfs - $3 for hostfs commands.
 # 1MB is 0x0010 0000
-# Test Case 2 - size of small file
+# Test Case 2a - size of small file
 ${PREFIX}size host${SUFFIX} ${FPATH}$FILE_SMALL
 printenv filesize
 setenv filesize
+# Test Case 2b - size of small file via a path using '..'
+${PREFIX}size host${SUFFIX} ${FPATH}SUBDIR/../$FILE_SMALL
+printenv filesize
+setenv filesize
 
 # 2.5GB (1024*1024*2500) is 0x9C40 0000
 # Test Case 3 - size of big file
@@ -347,6 +351,9 @@ function create_files() {
        mkdir -p "$MOUNT_DIR"
        sudo mount -o loop,rw "$1" "$MOUNT_DIR"
 
+       # Create a subdirectory.
+       sudo mkdir -p "$MOUNT_DIR/SUBDIR"
+
        # Create big file in this image.
        # Note that we work only on the start 1MB, couple MBs in the 2GB range
        # and the last 1 MB of the huge 2.5GB file.
@@ -453,16 +460,19 @@ function check_results() {
        FAIL=0
 
        # Check if the ls is showing correct results for 2.5 gb file
-       grep -A6 "Test Case 1 " "$1" | egrep -iq "2621440000 *$4"
+       grep -A7 "Test Case 1 " "$1" | egrep -iq "2621440000 *$4"
        pass_fail "TC1: ls of $4"
 
        # Check if the ls is showing correct results for 1 mb file
-       grep -A6 "Test Case 1 " "$1" | egrep -iq "1048576 *$3"
+       grep -A7 "Test Case 1 " "$1" | egrep -iq "1048576 *$3"
        pass_fail "TC1: ls of $3"
 
        # Check size command on 1MB.file
-       egrep -A3 "Test Case 2 " "$1" | grep -q "filesize=100000"
+       egrep -A3 "Test Case 2a " "$1" | grep -q "filesize=100000"
        pass_fail "TC2: size of $3"
+       # Check size command on 1MB.file via a path using '..'
+       egrep -A3 "Test Case 2b " "$1" | grep -q "filesize=100000"
+       pass_fail "TC2: size of $3 via a path using '..'"
 
        # Check size command on 2.5GB.file
        egrep -A3 "Test Case 3 " "$1" | grep -q "filesize=9c400000"