From 6c99c19a7663248a85df81f2db24a323d2956606 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 8 Jul 2017 17:38:02 -0400 Subject: test: librechroot: verify that the `-n` flag works --- test/librechroot-test.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test') 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 -- cgit v1.2.2