summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuoyu Ou <benogy@gmail.com>2024-02-13 15:13:25 +0800
committerKent Overstreet <kent.overstreet@linux.dev>2024-02-16 22:17:13 -0500
commit91c9a633292e771822cb161aac0e5075bc8f1cee (patch)
tree019376c5fb26908094024f6b2d2de6221f223fd1
parentd717304cdfad607db695357529230b88d02dd245 (diff)
ktest: add a test case for rmdir empty snapshot
Signed-off-by: Guoyu Ou <benogy@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rwxr-xr-xtests/bcachefs/subvol.ktest18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/bcachefs/subvol.ktest b/tests/bcachefs/subvol.ktest
index 1915d84..4a50da2 100755
--- a/tests/bcachefs/subvol.ktest
+++ b/tests/bcachefs/subvol.ktest
@@ -718,4 +718,22 @@ test_subvol_mv()
bcachefs fsck ${ktest_scratch_dev[0]}
}
+test_subvol_rmdir_empty_snapshot()
+{
+ run_quiet "" bcachefs format -f ${ktest_scratch_dev[0]}
+ mount -t bcachefs ${ktest_scratch_dev[0]} /mnt
+
+ cd /mnt
+ bcachefs subvolume create ./sub
+ cd sub
+ bcachefs subvolume create ./sub2
+ bcachefs subvolume snapshot . ./snap
+ rmdir ./snap
+
+ cd /
+ umount /mnt
+
+ bcachefs fsck ${ktest_scratch_dev[0]}
+}
+
main "$@"