summaryrefslogtreecommitdiff
path: root/test/librechroot-test.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-02-14 15:26:13 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-02-14 16:04:24 -0500
commit3b76f7dbfcec18ad22663663acf0355a61f4eb60 (patch)
tree01a9a31c6ea9116bd933a39dd530491ddf791356 /test/librechroot-test.sh
parent05fc5ece05f10b593c378c0b5f1170107dcfe1b6 (diff)
Add librechroot delete tests.
Diffstat (limited to 'test/librechroot-test.sh')
-rw-r--r--test/librechroot-test.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh
index 667246c..51a43bd 100644
--- a/test/librechroot-test.sh
+++ b/test/librechroot-test.sh
@@ -127,3 +127,25 @@ it_fails_when_syncing_a_copy_with_itself() {
true;;
esac
}
+
+it_deletes_copies() {
+ require network sudo || return 0
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ testsudo librechroot -l "$roundup_test_name" make
+ test -d "$chrootdir/default/$roundup_test_name"
+ testsudo librechroot -l "$roundup_test_name" delete
+ not test -e "$chrootdir/default/$roundup_test_name"
+}
+
+it_deletes_subvolumes_recursively() {
+ require network sudo btrfs || return 0
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ testsudo librechroot -l "$roundup_test_name" make
+ testsudo librechroot -l "$roundup_test_name" install-name btrfs-progs
+ test -d "$chrootdir/default/$roundup_test_name"
+ not test -e "$chrootdir/default/$roundup_test_name/var/subvolume"
+ testsudo librechroot -l "$roundup_test_name" run btrfs subvolume create /var/subvolume
+ test -d "$chrootdir/default/$roundup_test_name/var/subvolume"
+ testsudo librechroot -l "$roundup_test_name" delete
+ not test -e "$chrootdir/default/$roundup_test_name"
+}