mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <ari@tuxera.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
0e01e7f639
commit
ea002f7e4e
+1
-1
@@ -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() {
|
||||
|
||||
+1
-1
@@ -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() {
|
||||
|
||||
+4
-4
@@ -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
|
||||
|
||||
+4
-4
@@ -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"
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user