From: Ari Sundholm Date: Mon, 29 Sep 2014 03:07:26 +0000 (+1000) Subject: tests: Use stat -c X-Git-Tag: v2022.05.01~3059 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ea002f7e4e7ccad1a63b24c9dbf16b59fc4c2510;p=xfstests-dev.git tests: Use stat -c Change all occurrences of stat --format and stat --printf to stat -c so that the tests work correctly on BusyBox systems. Signed-off-by: Ari Sundholm Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/tests/generic/003 b/tests/generic/003 index 5c2d3837..83d6f900 100755 --- a/tests/generic/003 +++ b/tests/generic/003 @@ -52,7 +52,7 @@ _require_relatime rm -f $seqres.full _stat() { - stat --printf="%x;%y;%z" $1 + stat -c "%x;%y;%z" $1 } _compare_stat_times() { diff --git a/tests/generic/192 b/tests/generic/192 index f630be9c..b2da3588 100755 --- a/tests/generic/192 +++ b/tests/generic/192 @@ -35,7 +35,7 @@ trap "exit \$status" 0 1 2 3 15 _access_time() { - stat --format=%X $1 + stat -c %X $1 } is_noatime_set() { diff --git a/tests/generic/215 b/tests/generic/215 index 6ddd1fcf..80df55d9 100755 --- a/tests/generic/215 +++ b/tests/generic/215 @@ -53,8 +53,8 @@ echo echo "creating test file" dd if=/dev/zero of=$testfile count=4096 -mtime1=`stat --printf="%Y" $testfile` -ctime1=`stat --printf="%Z" $testfile` +mtime1=`stat -c "%Y" $testfile` +ctime1=`stat -c "%Z" $testfile` sleep 2 @@ -65,8 +65,8 @@ $XFS_IO_PROG -f \ -c 'mwrite 0 4096' \ $testfile | _filter_xfs_io_unique -mtime2=`stat --printf="%Y" $testfile` -ctime2=`stat --printf="%Z" $testfile` +mtime2=`stat -c "%Y" $testfile` +ctime2=`stat -c "%Z" $testfile` let mtime_diff=$mtime2-$mtime1 let ctime_diff=$ctime2-$ctime1 diff --git a/tests/generic/286 b/tests/generic/286 index 94c22c62..f6bf3569 100755 --- a/tests/generic/286 +++ b/tests/generic/286 @@ -73,7 +73,7 @@ test01() $here/src/seek_copy_test $src $dest - test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) || + test $(stat -c "%s" $src) = $(stat -c "%s" $dest) || _fail "TEST01: file size check failed" cmp $src $dest || _fail "TEST01: file bytes check failed" @@ -101,7 +101,7 @@ test02() $here/src/seek_copy_test $src $dest - test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) || + test $(stat -c "%s" $src) = $(stat -c "%s" $dest) || _fail "TEST02: file size check failed" cmp $src $dest || _fail "TEST02: file bytes check failed" @@ -143,7 +143,7 @@ test03() echo >>$seqres.full $here/src/seek_copy_test $src $dest - test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) || + test $(stat -c "%s" $src) = $(stat -c "%s" $dest) || _fail "TEST03: file size check failed" cmp $src $dest || _fail "TEST03: file bytes check failed" @@ -185,7 +185,7 @@ test04() echo >>$seqres.full $here/src/seek_copy_test $src $dest - test $(stat --printf "%s" $src) = $(stat --printf "%s" $dest) || + test $(stat -c "%s" $src) = $(stat -c "%s" $dest) || _fail "TEST04: file size check failed" cmp $src $dest || _fail "TEST04: file bytes check failed" diff --git a/tests/xfs/195 b/tests/xfs/195 index 6abddbca..c7bc7b81 100755 --- a/tests/xfs/195 +++ b/tests/xfs/195 @@ -69,7 +69,7 @@ _require_user echo "Preparing subtree" mkdir $TEST_DIR/d touch $TEST_DIR/d/t -inum=`stat --format "%i" $TEST_DIR/d/t` +inum=`stat -c "%i" $TEST_DIR/d/t` echo "No dump exclude flag set (should not be skipped)" _do_dump