Skip to content

Commit bde1d48

Browse files
committed
btrfs-progs: tests: fix the mount failure detection
[BUG] After commit "btrfs-progs: tests: dump dmesg if a mount fails", test case misc/041 would output the following error: [TEST/misc] 041-subvolume-delete-during-send cat: invalid option -- 'f' Try 'cat --help' for more information. failed: /home/adam/btrfs-progs/btrfs send -f stream19752.out /home/adam/btrfs-progs/tests/mnt/snap1 [CAUSE] The send command would fail anyway, but the error message is from the mount detection, which goes like this: if cat "${cmd_array[@]}" | grep -q mount; then Obviously cat is not the correct animal to print cmd_array to stdout. [FIX] I should go "echo" no matter how I enjoy petting a cat. It's better to fold this into commit "btrfs-progs: tests: dump dmesg if a mount fails". Signed-off-by: Qu Wenruo <[email protected]>
1 parent 42b1891 commit bde1d48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/common

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ run_check()
238238

239239
"${cmd_array[@]}" >> "$RESULTS" 2>&1
240240
if [ "$?" -ne 0 ]; then
241-
if cat "${cmd_array[@]}" | grep -q mount; then
241+
if echo "${cmd_array[@]}" | grep -q mount; then
242242
dmesg | tail -n 15 >> "$RESULTS"
243243
fi
244244
_fail "failed: ${cmd_array[@]}"

0 commit comments

Comments
 (0)