aboutsummaryrefslogtreecommitdiffstats
path: root/test/chroot/fs_chroot.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/chroot/fs_chroot.exp')
-rwxr-xr-xtest/chroot/fs_chroot.exp48
1 files changed, 27 insertions, 21 deletions
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp
index 545de0c66..eb1349112 100755
--- a/test/chroot/fs_chroot.exp
+++ b/test/chroot/fs_chroot.exp
@@ -10,55 +10,61 @@ match_max 100000
10send -- "firejail --chroot=/tmp/chroot\r" 10send -- "firejail --chroot=/tmp/chroot\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Error: --chroot option is not available on Grsecurity systems" {puts "\nall done\n"; exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"}; 13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"};
15} 14}
16sleep 1 15sleep 1
17 16
18send -- "cd /home;pwd\r" 17send -- "pwd\r"
19expect { 18expect {
20 timeout {puts "TESTING ERROR 0.1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
21 "home" 20 "/home"
22} 21}
23sleep 1 22after 100
24send -- "bash\r"
25sleep 1
26send -- "ls /\r" 23send -- "ls /\r"
27expect { 24expect {
28 timeout {puts "TESTING ERROR 0.2\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
29 "this-is-my-chroot" 26 "this-is-my-chroot"
30} 27}
31after 100 28after 100
32 29
33send -- "ps aux\r" 30send -- "ps aux\r"
34expect { 31expect {
35 timeout {puts "TESTING ERROR 1\n";exit} 32 timeout {puts "TESTING ERROR 3\n";exit}
36 "/bin/bash" 33 "/bin/bash"
37} 34}
38expect { 35expect {
39 timeout {puts "TESTING ERROR 2\n";exit} 36 timeout {puts "TESTING ERROR 4\n";exit}
40 "bash"
41}
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "ps aux" 37 "ps aux"
45} 38}
46after 100 39after 100
47 40
48send -- "ps aux | wc -l; pwd\r" 41# check /sys directory
42send -- "ls /sys\r"
49expect { 43expect {
50 timeout {puts "TESTING ERROR 5\n";exit} 44 timeout {puts "TESTING ERROR 5\n";exit}
51 "6" 45 "block"
52} 46}
53after 100
54
55# check /sys directory
56send -- "ls /sys\r"
57expect { 47expect {
58 timeout {puts "TESTING ERROR 6\n";exit} 48 timeout {puts "TESTING ERROR 6\n";exit}
59 "block" 49 "class"
50}
51expect {
52 timeout {puts "TESTING ERROR 7\n";exit}
53 "dev"
60} 54}
61after 100 55after 100
62 56
57# check /bin directory
58send -- "ls /bin/find\r"
59expect {
60 timeout {puts "TESTING ERROR 8\n";exit}
61 "No such file or directory"
62}
63after 100
64send -- "/bin/ping 1.1.1.1\r"
65expect {
66 timeout {puts "TESTING ERROR 9\n";exit}
67 "Operation not permitted"
68}
63 69
64puts "all done\n" 70puts "all done\n"