diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-20 16:05:45 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-20 16:05:45 -0500 |
commit | 80cc5fa809ebb3f213852312dea15cded00cc069 (patch) | |
tree | 2f233a23c075a0dd2e89b32b37b09fce06b13058 /test/chroot/unchroot-as-root.exp | |
parent | seccomp work 2 (diff) | |
download | firejail-80cc5fa809ebb3f213852312dea15cded00cc069.tar.gz firejail-80cc5fa809ebb3f213852312dea15cded00cc069.tar.zst firejail-80cc5fa809ebb3f213852312dea15cded00cc069.zip |
chroot testing
Diffstat (limited to 'test/chroot/unchroot-as-root.exp')
-rwxr-xr-x | test/chroot/unchroot-as-root.exp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/chroot/unchroot-as-root.exp b/test/chroot/unchroot-as-root.exp new file mode 100755 index 000000000..9f8a1d784 --- /dev/null +++ b/test/chroot/unchroot-as-root.exp | |||
@@ -0,0 +1,27 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --chroot=/tmp/chroot\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Error: --chroot option is not available on Grsecurity systems" {puts "\nall done\n"; exit} | ||
11 | "Child process initialized" {puts "chroot available\n"}; | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "cd /\r" | ||
16 | after 100 | ||
17 | |||
18 | |||
19 | send -- "./unchroot\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "Bad system call" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | puts "all done\n" | ||
27 | |||