diff options
Diffstat (limited to 'test/features/3.10.exp')
-rwxr-xr-x | test/features/3.10.exp | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/test/features/3.10.exp b/test/features/3.10.exp new file mode 100755 index 000000000..47da7f1c2 --- /dev/null +++ b/test/features/3.10.exp | |||
@@ -0,0 +1,183 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # whitelist tmp | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | set overlay [lindex $argv 0] | ||
10 | set chroot [lindex $argv 1] | ||
11 | |||
12 | # | ||
13 | # N | ||
14 | # | ||
15 | send -- "mkdir /tmp/test1dir\r" | ||
16 | sleep 1 | ||
17 | send -- "touch /tmp/test1dir/test1\r" | ||
18 | sleep 1 | ||
19 | send -- "firejail --noprofile --whitelist=/tmp/test1dir\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | "Child process initialized" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "ls -l /tmp | wc -l\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
29 | "2" | ||
30 | } | ||
31 | send -- "ls -l /tmp\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
34 | "netblue" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
38 | "netblue" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
42 | "test1dir" | ||
43 | } | ||
44 | |||
45 | send -- "ls -l /tmp/test1dir | wc -l\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
48 | "2" | ||
49 | } | ||
50 | send -- "ls -l /tmp/test1dir\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
53 | "netblue" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
57 | "netblue" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 1.8\n";exit} | ||
61 | "test1" | ||
62 | } | ||
63 | |||
64 | |||
65 | after 100 | ||
66 | send -- "exit\r" | ||
67 | sleep 1 | ||
68 | |||
69 | |||
70 | # | ||
71 | # O | ||
72 | # | ||
73 | if { $overlay == "overlay" } { | ||
74 | send -- "firejail --noprofile --overlay --whitelist=/tmp/test1dir\r" | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 2\n";exit} | ||
77 | "Child process initialized" | ||
78 | } | ||
79 | sleep 1 | ||
80 | |||
81 | send -- "ls -l /tmp | wc -l\r" | ||
82 | expect { | ||
83 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
84 | "2" | ||
85 | } | ||
86 | send -- "ls -l /tmp\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
89 | "netblue" | ||
90 | } | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
93 | "netblue" | ||
94 | } | ||
95 | expect { | ||
96 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
97 | "test1dir" | ||
98 | } | ||
99 | |||
100 | send -- "ls -l /tmp/test1dir | wc -l\r" | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
103 | "2" | ||
104 | } | ||
105 | send -- "ls -l /tmp/test1dir\r" | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
108 | "netblue" | ||
109 | } | ||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
112 | "netblue" | ||
113 | } | ||
114 | expect { | ||
115 | timeout {puts "TESTING ERROR 3.8\n";exit} | ||
116 | "test1" | ||
117 | } | ||
118 | |||
119 | after 100 | ||
120 | send -- "exit\r" | ||
121 | sleep 1 | ||
122 | } | ||
123 | |||
124 | # | ||
125 | # C | ||
126 | # | ||
127 | if { $chroot == "chroot" } { | ||
128 | send -- "mkdir /tmp/chroot/tmp/test1dir\r" | ||
129 | sleep 1 | ||
130 | send -- "touch /tmp/chroot/tmp/test1dir/test1\r" | ||
131 | sleep 1 | ||
132 | send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/tmp/test1dir\r" | ||
133 | expect { | ||
134 | timeout {puts "TESTING ERROR 4\n";exit} | ||
135 | "Child process initialized" | ||
136 | } | ||
137 | sleep 1 | ||
138 | |||
139 | send -- "ls -l /tmp | wc -l\r" | ||
140 | expect { | ||
141 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
142 | "2" | ||
143 | } | ||
144 | send -- "ls -l /tmp\r" | ||
145 | expect { | ||
146 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
147 | "netblue" | ||
148 | } | ||
149 | expect { | ||
150 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
151 | "netblue" | ||
152 | } | ||
153 | expect { | ||
154 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
155 | "test1dir" | ||
156 | } | ||
157 | |||
158 | send -- "ls -l /tmp/test1dir | wc -l\r" | ||
159 | expect { | ||
160 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
161 | "2" | ||
162 | } | ||
163 | send -- "ls -l /tmp/test1dir\r" | ||
164 | expect { | ||
165 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
166 | "netblue" | ||
167 | } | ||
168 | expect { | ||
169 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
170 | "netblue" | ||
171 | } | ||
172 | expect { | ||
173 | timeout {puts "TESTING ERROR 5.8\n";exit} | ||
174 | "test1" | ||
175 | } | ||
176 | |||
177 | after 100 | ||
178 | send -- "exit\r" | ||
179 | sleep 1 | ||
180 | } | ||
181 | |||
182 | |||
183 | puts "\nall done\n" | ||