diff options
Diffstat (limited to 'test/chroot/fs_chroot.exp')
-rwxr-xr-x | test/chroot/fs_chroot.exp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp new file mode 100755 index 000000000..295ff8ff9 --- /dev/null +++ b/test/chroot/fs_chroot.exp | |||
@@ -0,0 +1,54 @@ | |||
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 /home;pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
18 | "home" | ||
19 | } | ||
20 | sleep 1 | ||
21 | send -- "bash\r" | ||
22 | sleep 1 | ||
23 | send -- "ls /\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
26 | "this-is-my-chroot" | ||
27 | } | ||
28 | after 100 | ||
29 | |||
30 | send -- "ps aux\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 1\n";exit} | ||
33 | "/bin/bash" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 2\n";exit} | ||
37 | "bash" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 3\n";exit} | ||
41 | "ps aux" | ||
42 | } | ||
43 | after 100 | ||
44 | |||
45 | send -- "ps aux | wc -l; pwd\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 5\n";exit} | ||
48 | "6" | ||
49 | } | ||
50 | after 100 | ||
51 | |||
52 | |||
53 | puts "all done\n" | ||
54 | |||