]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/63{4,5}: Modify criteria for passing test
authorJoanne Chang <joannechien@google.com>
Tue, 2 Jun 2026 07:19:11 +0000 (07:19 +0000)
committerZorro Lang <zlang@kernel.org>
Wed, 17 Jun 2026 19:28:41 +0000 (03:28 +0800)
The two tests pass when a timestamp is not preserved after the remount,
because "cmp -s" does not print to the output file, and status is set to
0 regardless of the return value of cmp. So, use "diff" instead to
correctly fail the test and flag the error case in the output file.

Also, as the tests are focused on timestamps, don't print file contents
so the tests can still pass if only the file contents differ.

Signed-off-by: Joanne Chang <joannechien@google.com>
Reviewed-by: Zorro Lang <zlang@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/634
tests/generic/635

index 8a4210a3f69eaeec2469a9f96e924b08edc3d6ac..d7dd9dd8e9731e84310edd9b82fd513fdca426bb 100755 (executable)
@@ -52,7 +52,7 @@ touchme() {
 report() {
        local files=($SCRATCH_MNT/t_*)
        for file in "${files[@]}"; do
-               echo "${file}: $(cat "${file}")"
+               echo "${file}:"
                TZ=UTC stat -c '%y %Y %n' "${file}"
                test $test_statx -gt 0 && \
                        $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime'
@@ -98,7 +98,7 @@ report > $tmp.after_remount
 cat $tmp.after_remount >> $seqres.full
 
 # Did they match?
-cmp -s $tmp.before_remount $tmp.after_remount
+diff $tmp.before_remount $tmp.after_remount
 
 # success, all done
 echo Silence is golden.
index 018b868cb6cea6205966aad0ecd6cf5bfd481113..f74d0cd7066a6e0528a9a4251260237607514fb5 100755 (executable)
@@ -55,7 +55,7 @@ touchme() {
 report() {
        local files=($SCRATCH_MNT/t_*)
        for file in "${files[@]}"; do
-               echo "${file}: $(cat "${file}")"
+               echo "${file}:"
                TZ=UTC stat -c '%y %Y %n' "${file}"
                test $test_statx -gt 0 && \
                        $XFS_IO_PROG -c 'statx -r' "${file}" | grep 'stat.mtime'
@@ -102,7 +102,7 @@ report > $tmp.after_crash
 cat $tmp.after_crash >> $seqres.full
 
 # Did they match?
-cmp -s $tmp.before_crash $tmp.after_crash
+diff $tmp.before_crash $tmp.after_crash
 
 # success, all done
 status=0