actions: Move defconfig options to Kconfig
[oweals/u-boot.git] / test / fs / fs-test.sh
index 2e8d5ee4df94047818ffde88ce397fc65b97b854..b87748106c7a3c9b3be6dcf405366aa33e7cd036 100755 (executable)
@@ -7,18 +7,20 @@
 # 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: 24 FAIL: 0
-# fs-test.ext4.out: Summary: PASS: 24 FAIL: 0
-# fs-test.fs.ext4.out: Summary: PASS: 24 FAIL: 0
+# fs-test.sb.ext4      Summary: PASS: 24 FAIL: 0
+# fs-test.nonfs.ext4   Summary: PASS: 24 FAIL: 0
+# fs-test.fs.ext4      Summary: PASS: 24 FAIL: 0
 # FAT16 tests:
-# 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
+# fs-test.sb.fat16     Summary: PASS: 24 FAIL: 0
+# fs-test.nonfs.fat16  Summary: PASS: 24 FAIL: 0
+# fs-test.fs.fat16     Summary: PASS: 24 FAIL: 0
 # FAT32 tests:
-# 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
+# fs-test.sb.fat32     Summary: PASS: 24 FAIL: 0
+# fs-test.nonfs.fat32  Summary: PASS: 24 FAIL: 0
+# fs-test.fs.fat32     Summary: PASS: 24 FAIL: 0
+# --------------------------------------------
+# Total Summary: TOTAL PASS: 216 TOTAL FAIL: 0
+# --------------------------------------------
 
 # pre-requisite binaries list.
 PREREQ_BINS="md5sum mkfs mount umount dd fallocate mkdir"
@@ -85,7 +87,7 @@ function check_clean() {
 # Generate sandbox U-Boot - gleaned from /test/dm/test-dm.sh
 function compile_sandbox() {
        unset CROSS_COMPILE
-       NUM_CPUS=$(cat /proc/cpuinfo |grep -c processor)
+       NUM_CPUS=$(nproc)
        make O=sandbox sandbox_config
        make O=sandbox -s -j${NUM_CPUS}
 
@@ -192,7 +194,7 @@ function test_image() {
                ;;
 
                sb)
-               PREFIX="sb "
+               PREFIX="host "
                WRITE="save"
                SUFFIX="fs -"
                ;;
@@ -215,11 +217,11 @@ function test_image() {
 
        # In u-boot commands, <interface> stands for host or hostfs
        # hostfs maps to the host fs.
-       # host maps to the "sb bind" that we do
+       # host maps to the "host bind" that we do
 
        $UBOOT << EOF
 sb=$5
-setenv bind 'if test "\$sb" != sb; then sb bind 0 "$1"; fi'
+setenv bind 'if test "\$sb" != sb; then host bind 0 "$1"; fi'
 run bind
 # Test Case 1 - ls
 ${PREFIX}ls host${SUFFIX} $6
@@ -227,7 +229,7 @@ ${PREFIX}ls host${SUFFIX} $6
 ${PREFIX}ls host${SUFFIX} invalid_d
 #
 # We want ${PREFIX}size host 0:0 $3 for host commands and
-# sb size hostfs - $3 for hostfs commands.
+# host size hostfs - $3 for hostfs commands.
 # 1MB is 0x0010 0000
 # Test Case 2a - size of small file
 ${PREFIX}size host${SUFFIX} ${FPATH}$FILE_SMALL
@@ -522,7 +524,7 @@ function check_results() {
                "TC11: 1MB write to $3.w - content verified"
 
        # Check lookup of 'dot' directory
-       grep -A4 "Test Case 12 " "$1" | grep -q 'Unable to write file'
+       grep -A4 "Test Case 12 " "$1" | grep -q 'Unable to write'
        pass_fail "TC12: 1MB write to . - write denied"
 
        # Check directory traversal
@@ -573,7 +575,7 @@ TOTAL_PASS=0
 
 # In each loop, for a given file system image, we test both the
 # fs command, like load/size/write, the file system specific command
-# like: ext4load/ext4size/ext4write and the sb load/ls/save commands.
+# like: ext4load/ext4size/ext4write and the host load/ls/save commands.
 for fs in ext4 fat16 fat32; do
 
        echo "Creating $fs image if not already present."
@@ -581,11 +583,11 @@ for fs in ext4 fat16 fat32; do
        MD5_FILE_FS="${MD5_FILE}.${fs}"
        create_image $IMAGE $fs
 
-       # sb commands test
+       # host commands test
        echo "Creating files in $fs image if not already present."
        create_files $IMAGE $MD5_FILE_FS
 
-       # Lets mount the image and test sb hostfs commands
+       # Lets mount the image and test host hostfs commands
        mkdir -p "$MOUNT_DIR"
        case "$fs" in
                fat*)