]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
fstests: generic/733: avoid output difference due to bash's version v2025.09.07
authorQu Wenruo <wqu@suse.com>
Thu, 4 Sep 2025 21:44:15 +0000 (07:14 +0930)
committerZorro Lang <zlang@kernel.org>
Fri, 5 Sep 2025 15:54:31 +0000 (23:54 +0800)
commit911e9f16800437cc96349f85c6c916c9d8c2d317
tree6ecde88bf46ea77a9754b24cd5574b797be97b80
parent8dd133d0763bdc92f8e0a53fa706ea9e09b390ce
fstests: generic/733: avoid output difference due to bash's version

[FALSE ALERT]
When running generic/733 with bash 5.3.3 (any thing newer than 5.3.0
will reproduce the bug), the test case will fail like the following:

generic/733 19s ... - output mismatch (see /home/adam/xfstests/results//generic/733.out.bad)
    --- tests/generic/733.out 2025-09-04 17:30:08.568000000 +0930
    +++ /home/adam/xfstests/results//generic/733.out.bad 2025-09-04 17:30:32.898475103 +0930
    @@ -2,5 +2,5 @@
     Format and mount
     Create a many-block file
     Reflink the big file
    -Terminated
    +Terminated                 $here/src/t_reflink_read_race "$testdir/file1" "$testdir/file2" "$testdir/outcome" &>> $seqres.full
     test completed successfully
    ...
    (Run 'diff -u /home/adam/xfstests/tests/generic/733.out /home/adam/xfstests/results//generic/733.out.bad'  to see the entire diff)

[CAUSE]
The failure is fs independent, but bash version dependent.

In bash v5.3.x, the job control will output the command which triggered
the job control (from termination to core dump etc).

The "Terminated" message is not from the program, but from bash's job
control, thus redirection won't hide that message.

[FIX]
Run the command in a command group, which will be executed in a
subshell.

By this we can redirect the output of the subshell, including the job
control message, thus hide the different output pattern caused by
different bash versions.

Thankfully this particular test case does extra checks on the outcome
file to determine if the program is properly terminated, thus we are
safe to move the "Terminated" line from the golden output to
seqres.full.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/733
tests/generic/733.out