summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-07-08 17:38:02 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-07-08 17:46:02 -0400
commit6c99c19a7663248a85df81f2db24a323d2956606 (patch)
tree2b214bd28bb3b1a788b70e90a572f2e5da6dbe22 /test
parent6e79b08e5b984b8dbfc97d5029707719e30a3749 (diff)
test: librechroot: verify that the `-n` flag works
Diffstat (limited to 'test')
-rw-r--r--test/librechroot-test.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh
index d225834..42d4803 100644
--- a/test/librechroot-test.sh
+++ b/test/librechroot-test.sh
@@ -82,6 +82,17 @@ it_displays_help_and_fails_with_0_args() {
[[ "$(sed -n 2p $tmpdir/stderr)" =~ Usage:.* ]]
}
+it_obeys_the_n_flag() {
+ require network sudo || return 0
+
+ not test -f "$chrootdir/$roundup_test_name/$roundup_test_name/$roundup_test_name.stamp"
+
+ libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty
+ testsudo librechroot -n "$roundup_test_name" -l "$roundup_test_name" run touch /"$roundup_test_name.stamp"
+
+ test -f "$chrootdir/$roundup_test_name/$roundup_test_name/$roundup_test_name.stamp"
+}
+
# requires sudo so we know it's not failing because it needs root
it_fails_for_unknown_commands() {
require sudo || return 0