aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs_chroot.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs_chroot.exp')
-rwxr-xr-xtest/fs_chroot.exp54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/fs_chroot.exp b/test/fs_chroot.exp
new file mode 100755
index 000000000..ba832337b
--- /dev/null
+++ b/test/fs_chroot.exp
@@ -0,0 +1,54 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "cd /home;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 "home"
18}
19sleep 1
20send -- "bash\r"
21sleep 1
22send -- "ps aux; pwd\r"
23expect {
24 timeout {puts "TESTING ERROR 1\n";exit}
25 "/bin/bash"
26}
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "bash"
30}
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "ps aux"
34}
35expect {
36 timeout {puts "TESTING ERROR 4\n";exit}
37 "home"
38}
39sleep 1
40
41
42send -- "ps aux |wc -l; pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "5"
46}
47expect {
48 timeout {puts "TESTING ERROR 6\n";exit}
49 "home"
50}
51sleep 1
52
53puts "\n"
54