From e3a24cf11a8f8342d45f51d498596f6056d6c86e Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Mon, 13 Feb 2023 13:26:33 +0800 Subject: [PATCH] btrfs-progs: tests: fix cli/017 test case failure [BUG] Test case cli/017 fails with the following errors: [TEST] cli-tests.sh [TEST/cli] 017-fi-show-missing didn't find exact missing device test failed for case 017-fi-show-missing [CAUSE] After kernel commit cb3e217bdb39 ("btrfs: use btrfs_dev_name() helper to handle missing devices better"), all dev info ioctl call on missing device would only return "" for its path. Thus "btrfs filesystem show" would never report detailed device path for missing disks. [FIX] Instead of relying on the device path, change the check to rely on devid instead. Now cli/017 can properly pass. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- tests/cli-tests/017-fi-show-missing/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cli-tests/017-fi-show-missing/test.sh b/tests/cli-tests/017-fi-show-missing/test.sh index 25e4c60a..67757e20 100755 --- a/tests/cli-tests/017-fi-show-missing/test.sh +++ b/tests/cli-tests/017-fi-show-missing/test.sh @@ -23,7 +23,7 @@ run_check $SUDO_HELPER mv "$dev2" /dev/loop-non-existent run_check $SUDO_HELPER mount -o degraded $dev1 $TEST_MNT if ! run_check_stdout $SUDO_HELPER "$TOP/btrfs" filesystem show "$TEST_MNT" | \ - grep -q "$dev2 MISSING"; then + grep -q -e "devid[[:space:]]\+2.*MISSING"; then _fail "didn't find exact missing device" fi