summaryrefslogtreecommitdiff
path: root/tests/misc-tests/011-delete-missing-device/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc-tests/011-delete-missing-device/test.sh')
-rwxr-xr-xtests/misc-tests/011-delete-missing-device/test.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/misc-tests/011-delete-missing-device/test.sh b/tests/misc-tests/011-delete-missing-device/test.sh
index 4c97642..a6b2e29 100755
--- a/tests/misc-tests/011-delete-missing-device/test.sh
+++ b/tests/misc-tests/011-delete-missing-device/test.sh
@@ -44,6 +44,22 @@ test_delete_missing()
run_check_umount_test_dev
}
+test_missing_error()
+{
+ local out
+
+ run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$TEST_DEV"
+ run_check_mount_test_dev
+ out=$(run_mustfail_stdout "device remove succeeded" \
+ $SUDO_HELPER "$TOP/btrfs" device remove missing "$TEST_MNT")
+
+ if ! echo "$out" | grep -q "no missing devices found to remove"; then
+ _fail "IOCTL returned unexpected error value"
+ fi
+
+ run_check_umount_test_dev
+}
+
setup_loopdevs 4
prepare_loopdevs
dev1=${loopdevs[1]}
@@ -53,5 +69,6 @@ TEST_DEV=$dev1
test_do_mkfs -m raid1 -d raid1
test_wipefs
test_delete_missing
+test_missing_error
cleanup_loopdevs