aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-12-23 16:42:58 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-12-23 16:42:58 -0500
commitdda687ed2a748cb262b317e0c7fdf4a9c4ae2d31 (patch)
tree144fba235fec87d74deff110aaa71891174b3eef /test/features
parent0.9.36 testing (diff)
downloadfirejail-dda687ed2a748cb262b317e0c7fdf4a9c4ae2d31.tar.gz
firejail-dda687ed2a748cb262b317e0c7fdf4a9c4ae2d31.tar.zst
firejail-dda687ed2a748cb262b317e0c7fdf4a9c4ae2d31.zip
0.9.36 testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/1.1.exp31
-rwxr-xr-xtest/features/1.10.exp32
-rwxr-xr-xtest/features/1.2.exp78
-rwxr-xr-xtest/features/1.4.exp54
-rwxr-xr-xtest/features/1.5.exp30
-rwxr-xr-xtest/features/1.6.exp30
-rwxr-xr-xtest/features/1.7.exp30
-rwxr-xr-xtest/features/1.8.exp40
-rwxr-xr-xtest/features/2.1.exp62
-rwxr-xr-xtest/features/2.2.exp46
-rwxr-xr-xtest/features/2.3.exp174
-rwxr-xr-xtest/features/2.4.exp116
-rwxr-xr-xtest/features/2.5.exp54
-rwxr-xr-xtest/features/2.6.exp31
-rwxr-xr-xtest/features/3.1.exp34
-rwxr-xr-xtest/features/3.2.exp34
-rwxr-xr-xtest/features/3.3.exp31
-rwxr-xr-xtest/features/3.4.exp30
-rwxr-xr-xtest/features/test.sh51
19 files changed, 516 insertions, 472 deletions
diff --git a/test/features/1.1.exp b/test/features/1.1.exp
index dafa4630e..0d02b54c1 100755
--- a/test/features/1.1.exp
+++ b/test/features/1.1.exp
@@ -7,6 +7,7 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0] 9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
10 11
11# 12#
12# N 13# N
@@ -52,21 +53,23 @@ if { $overlay == "overlay" } {
52# 53#
53# C 54# C
54# 55#
55send -- "firejail --noprofile --chroot=/tmp/chroot\r" 56if { $chroot == "chroot" } {
56expect { 57 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
57 timeout {puts "TESTING ERROR 4\n";exit} 58 expect {
58 "Child process initialized" 59 timeout {puts "TESTING ERROR 4\n";exit}
59} 60 "Child process initialized"
60sleep 1 61 }
61 62 sleep 1
62send -- "ls -l /boot\r" 63
63expect { 64 send -- "ls -l /boot\r"
64 timeout {puts "TESTING ERROR 5\n";exit} 65 expect {
65 "Permission denied" 66 timeout {puts "TESTING ERROR 5\n";exit}
67 "Permission denied"
68 }
69 after 100
70 send -- "exit\r"
71 sleep 1
66} 72}
67after 100
68send -- "exit\r"
69sleep 1
70 73
71 74
72puts "\nall done\n" 75puts "\nall done\n"
diff --git a/test/features/1.10.exp b/test/features/1.10.exp
index 96e3c38d1..978b0a594 100755
--- a/test/features/1.10.exp
+++ b/test/features/1.10.exp
@@ -54,22 +54,24 @@ if { $overlay == "overlay" } {
54# 54#
55# C 55# C
56# 56#
57send -- "firejail --noprofile --chroot=/tmp/chroot\r" 57if { $chroot == "chroot" } {
58expect { 58 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
59 timeout {puts "TESTING ERROR 4\n";exit} 59 expect {
60 "Child process initialized" 60 timeout {puts "TESTING ERROR 4\n";exit}
61} 61 "Child process initialized"
62sleep 1 62 }
63 63 sleep 1
64send -- "ls -l /selinux\r" 64
65expect { 65 send -- "ls -l /selinux\r"
66 timeout {puts "TESTING ERROR 5\n";exit} 66 expect {
67 "Permission denied" {puts "denied\n"} 67 timeout {puts "TESTING ERROR 5\n";exit}
68 "No such file or directory" {puts "no file\n"} 68 "Permission denied" {puts "denied\n"}
69 "No such file or directory" {puts "no file\n"}
70 }
71 after 100
72 send -- "exit\r"
73 sleep 1
69} 74}
70after 100
71send -- "exit\r"
72sleep 1
73 75
74 76
75puts "\nall done\n" 77puts "\nall done\n"
diff --git a/test/features/1.2.exp b/test/features/1.2.exp
index d487537e4..0e62895dd 100755
--- a/test/features/1.2.exp
+++ b/test/features/1.2.exp
@@ -100,45 +100,47 @@ if { $overlay == "overlay" } {
100# 100#
101# C 101# C
102# 102#
103send -- "firejail --noprofile --chroot=/tmp/chroot\r" 103if { $chroot == "chroot" } {
104expect { 104 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
105 timeout {puts "TESTING ERROR 4\n";exit} 105 expect {
106 "Child process initialized" 106 timeout {puts "TESTING ERROR 4\n";exit}
107} 107 "Child process initialized"
108sleep 1 108 }
109 109 sleep 1
110send -- "cat /proc/mounts | grep proc\r" 110
111expect { 111 send -- "cat /proc/mounts | grep proc\r"
112 timeout {puts "TESTING ERROR 5.1\n";exit} 112 expect {
113 "proc /proc proc" 113 timeout {puts "TESTING ERROR 5.1\n";exit}
114} 114 "proc /proc proc"
115expect { 115 }
116 timeout {puts "TESTING ERROR 5.2\n";exit} 116 expect {
117 "proc /proc proc" 117 timeout {puts "TESTING ERROR 5.2\n";exit}
118} 118 "proc /proc proc"
119expect { 119 }
120 timeout {puts "TESTING ERROR 5.3\n";exit} 120 expect {
121 "proc /proc/sys proc" 121 timeout {puts "TESTING ERROR 5.3\n";exit}
122} 122 "proc /proc/sys proc"
123expect { 123 }
124 timeout {puts "TESTING ERROR 5.4\n";exit} 124 expect {
125 "proc /proc/sysrq-trigger proc" 125 timeout {puts "TESTING ERROR 5.4\n";exit}
126} 126 "proc /proc/sysrq-trigger proc"
127expect { 127 }
128 timeout {puts "TESTING ERROR 5.5\n";exit} 128 expect {
129 "proc /proc/sys/kernel/hotplug" 129 timeout {puts "TESTING ERROR 5.5\n";exit}
130} 130 "proc /proc/sys/kernel/hotplug"
131expect { 131 }
132 timeout {puts "TESTING ERROR 5.6\n";exit} 132 expect {
133 "proc /proc/irq proc" 133 timeout {puts "TESTING ERROR 5.6\n";exit}
134} 134 "proc /proc/irq proc"
135expect { 135 }
136 timeout {puts "TESTING ERROR 5.7\n";exit} 136 expect {
137 "proc /proc/bus proc" 137 timeout {puts "TESTING ERROR 5.7\n";exit}
138 "proc /proc/bus proc"
139 }
140 after 100
141 send -- "exit\r"
142 sleep 1
138} 143}
139after 100
140send -- "exit\r"
141sleep 1
142 144
143 145
144puts "\nall done\n" 146puts "\nall done\n"
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
index 113a328c9..6de8b614f 100755
--- a/test/features/1.4.exp
+++ b/test/features/1.4.exp
@@ -77,33 +77,35 @@ if { $overlay == "overlay" } {
77# 77#
78# C 78# C
79# 79#
80send -- "firejail --noprofile --chroot=/tmp/chroot\r" 80if { $chroot == "chroot" } {
81expect { 81 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
82 timeout {puts "TESTING ERROR 4\n";exit} 82 expect {
83 "Child process initialized" 83 timeout {puts "TESTING ERROR 4\n";exit}
84} 84 "Child process initialized"
85sleep 1 85 }
86 86 sleep 1
87send -- "ls -l /home | wc -l\r" 87
88expect { 88 send -- "ls -l /home | wc -l\r"
89 timeout {puts "TESTING ERROR 5\n";exit} 89 expect {
90 "2" 90 timeout {puts "TESTING ERROR 5\n";exit}
91} 91 "2"
92after 100 92 }
93send -- "cat /etc/passwd | grep 1001 | wc -l\r" 93 after 100
94expect { 94 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
95 timeout {puts "TESTING ERROR 5.1\n";exit} 95 expect {
96 "0" 96 timeout {puts "TESTING ERROR 5.1\n";exit}
97} 97 "0"
98after 100 98 }
99send -- "cat /etc/group | grep 1001 | wc -l\r" 99 after 100
100expect { 100 send -- "cat /etc/group | grep 1001 | wc -l\r"
101 timeout {puts "TESTING ERROR 5.2\n";exit} 101 expect {
102 "0" 102 timeout {puts "TESTING ERROR 5.2\n";exit}
103 "0"
104 }
105 after 100
106 send -- "exit\r"
107 sleep 1
103} 108}
104after 100
105send -- "exit\r"
106sleep 1
107 109
108 110
109puts "\nall done\n" 111puts "\nall done\n"
diff --git a/test/features/1.5.exp b/test/features/1.5.exp
index 5a2643ede..02f2bd77f 100755
--- a/test/features/1.5.exp
+++ b/test/features/1.5.exp
@@ -52,21 +52,23 @@ if { $overlay == "overlay" } {
52# 52#
53# C 53# C
54# 54#
55send -- "firejail --noprofile --chroot=/tmp/chroot\r" 55if { $chroot == "chroot" } {
56expect { 56 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
57 timeout {puts "TESTING ERROR 4\n";exit} 57 expect {
58 "Child process initialized" 58 timeout {puts "TESTING ERROR 4\n";exit}
59} 59 "Child process initialized"
60sleep 1 60 }
61 61 sleep 1
62send -- "ps aux | wc -l \r" 62
63expect { 63 send -- "ps aux | wc -l \r"
64 timeout {puts "TESTING ERROR 5\n";exit} 64 expect {
65 "5" 65 timeout {puts "TESTING ERROR 5\n";exit}
66 "5"
67 }
68 after 100
69 send -- "exit\r"
70 sleep 1
66} 71}
67after 100
68send -- "exit\r"
69sleep 1
70 72
71 73
72puts "\nall done\n" 74puts "\nall done\n"
diff --git a/test/features/1.6.exp b/test/features/1.6.exp
index 8ed20fa46..4e3b2e74c 100755
--- a/test/features/1.6.exp
+++ b/test/features/1.6.exp
@@ -52,21 +52,23 @@ if { $overlay == "overlay" } {
52# 52#
53# C 53# C
54# 54#
55send -- "firejail --noprofile --chroot=/tmp/chroot\r" 55if { $chroot == "chroot" } {
56expect { 56 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
57 timeout {puts "TESTING ERROR 4\n";exit} 57 expect {
58 "Child process initialized" 58 timeout {puts "TESTING ERROR 4\n";exit}
59} 59 "Child process initialized"
60sleep 1 60 }
61 61 sleep 1
62send -- "ls -l /var/log/syslog | wc -l\r" 62
63expect { 63 send -- "ls -l /var/log/syslog | wc -l\r"
64 timeout {puts "TESTING ERROR 5\n";exit} 64 expect {
65 "0" 65 timeout {puts "TESTING ERROR 5\n";exit}
66 "0"
67 }
68 after 100
69 send -- "exit\r"
70 sleep 1
66} 71}
67after 100
68send -- "exit\r"
69sleep 1
70 72
71 73
72puts "\nall done\n" 74puts "\nall done\n"
diff --git a/test/features/1.7.exp b/test/features/1.7.exp
index 35351b7d9..5dcded422 100755
--- a/test/features/1.7.exp
+++ b/test/features/1.7.exp
@@ -54,21 +54,23 @@ if { $overlay == "overlay" } {
54# 54#
55# C 55# C
56# 56#
57send -- "firejail --noprofile --chroot=/tmp/chroot\r" 57if { $chroot == "chroot" } {
58expect { 58 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
59 timeout {puts "TESTING ERROR 4\n";exit} 59 expect {
60 "Child process initialized" 60 timeout {puts "TESTING ERROR 4\n";exit}
61} 61 "Child process initialized"
62sleep 1 62 }
63 63 sleep 1
64send -- "ls -l /var/tmp/somefile | wc -l\r" 64
65expect { 65 send -- "ls -l /var/tmp/somefile | wc -l\r"
66 timeout {puts "TESTING ERROR 5\n";exit} 66 expect {
67 "0" 67 timeout {puts "TESTING ERROR 5\n";exit}
68 "0"
69 }
70 after 100
71 send -- "exit\r"
72 sleep 1
68} 73}
69after 100
70send -- "exit\r"
71sleep 1
72 74
73 75
74puts "\nall done\n" 76puts "\nall done\n"
diff --git a/test/features/1.8.exp b/test/features/1.8.exp
index 293864671..29e23c885 100755
--- a/test/features/1.8.exp
+++ b/test/features/1.8.exp
@@ -65,26 +65,28 @@ if { $overlay == "overlay" } {
65# 65#
66# C 66# C
67# 67#
68send -- "firejail --noprofile --chroot=/tmp/chroot\r" 68if { $chroot == "chroot" } {
69expect { 69 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
70 timeout {puts "TESTING ERROR 4\n";exit} 70 expect {
71 "Child process initialized" 71 timeout {puts "TESTING ERROR 4\n";exit}
72} 72 "Child process initialized"
73sleep 1 73 }
74send -- "ls /etc/firejail\r" 74 sleep 1
75expect { 75 send -- "ls /etc/firejail\r"
76 timeout {puts "TESTING ERROR 5\n";exit} 76 expect {
77 "Permission denied" 77 timeout {puts "TESTING ERROR 5\n";exit}
78} 78 "Permission denied"
79after 100 79 }
80send -- "ls ~/.config/firejail\r" 80 after 100
81expect { 81 send -- "ls ~/.config/firejail\r"
82 timeout {puts "TESTING ERROR 5.1\n";exit} 82 expect {
83 "Permission denied" 83 timeout {puts "TESTING ERROR 5.1\n";exit}
84 "Permission denied"
85 }
86 after 100
87 send -- "exit\r"
88 sleep 1
84} 89}
85after 100
86send -- "exit\r"
87sleep 1
88 90
89 91
90puts "\nall done\n" 92puts "\nall done\n"
diff --git a/test/features/2.1.exp b/test/features/2.1.exp
index 5f188988b..2e9bef8f4 100755
--- a/test/features/2.1.exp
+++ b/test/features/2.1.exp
@@ -84,37 +84,39 @@ if { $overlay == "overlay" } {
84# 84#
85# C 85# C
86# 86#
87send -- "firejail --noprofile --hostname=bingo --chroot=/tmp/chroot\r" 87if { $chroot == "chroot" } {
88expect { 88 send -- "firejail --noprofile --hostname=bingo --chroot=/tmp/chroot\r"
89 timeout {puts "TESTING ERROR 4\n";exit} 89 expect {
90 "Child process initialized" 90 timeout {puts "TESTING ERROR 4\n";exit}
91} 91 "Child process initialized"
92sleep 1 92 }
93 93 sleep 1
94send -- "hostname\r" 94
95expect { 95 send -- "hostname\r"
96 timeout {puts "TESTING ERROR 5\n";exit} 96 expect {
97 "bingo" 97 timeout {puts "TESTING ERROR 5\n";exit}
98} 98 "bingo"
99after 100 99 }
100send -- "cat /etc/hostname\r" 100 after 100
101expect { 101 send -- "cat /etc/hostname\r"
102 timeout {puts "TESTING ERROR 5.0\n";exit} 102 expect {
103 "bingo" 103 timeout {puts "TESTING ERROR 5.0\n";exit}
104} 104 "bingo"
105after 100 105 }
106send -- "getent hosts bingo\r" 106 after 100
107expect { 107 send -- "getent hosts bingo\r"
108 timeout {puts "TESTING ERROR 5.1\n";exit} 108 expect {
109 "127.0.0.1" 109 timeout {puts "TESTING ERROR 5.1\n";exit}
110} 110 "127.0.0.1"
111expect { 111 }
112 timeout {puts "TESTING ERROR 5.2\n";exit} 112 expect {
113 "bingo" 113 timeout {puts "TESTING ERROR 5.2\n";exit}
114 "bingo"
115 }
116 after 100
117 send -- "exit\r"
118 sleep 1
114} 119}
115after 100
116send -- "exit\r"
117sleep 1
118 120
119 121
120puts "\nall done\n" 122puts "\nall done\n"
diff --git a/test/features/2.2.exp b/test/features/2.2.exp
index 186da98fb..d25238107 100755
--- a/test/features/2.2.exp
+++ b/test/features/2.2.exp
@@ -68,29 +68,31 @@ if { $overlay == "overlay" } {
68# 68#
69# C 69# C
70# 70#
71send -- "firejail --noprofile --dns=4.2.2.1 --chroot=/tmp/chroot\r" 71if { $chroot == "chroot" } {
72expect { 72 send -- "firejail --noprofile --dns=4.2.2.1 --chroot=/tmp/chroot\r"
73 timeout {puts "TESTING ERROR 4\n";exit} 73 expect {
74 "Child process initialized" 74 timeout {puts "TESTING ERROR 4\n";exit}
75} 75 "Child process initialized"
76sleep 1 76 }
77 77 sleep 1
78send -- "dig google.com\r" 78
79expect { 79 send -- "dig google.com\r"
80 timeout {puts "TESTING ERROR 5\n";exit} 80 expect {
81 "ANSWER SECTION" 81 timeout {puts "TESTING ERROR 5\n";exit}
82} 82 "ANSWER SECTION"
83expect { 83 }
84 timeout {puts "TESTING ERROR 5.1\n";exit} 84 expect {
85 "google.com" 85 timeout {puts "TESTING ERROR 5.1\n";exit}
86} 86 "google.com"
87expect { 87 }
88 timeout {puts "TESTING ERROR 5.3\n";exit} 88 expect {
89 "SERVER: 4.2.2.1" 89 timeout {puts "TESTING ERROR 5.3\n";exit}
90 "SERVER: 4.2.2.1"
91 }
92 after 100
93 send -- "exit\r"
94 sleep 1
90} 95}
91after 100
92send -- "exit\r"
93sleep 1
94 96
95 97
96puts "\nall done\n" 98puts "\nall done\n"
diff --git a/test/features/2.3.exp b/test/features/2.3.exp
index 9201696c2..097050935 100755
--- a/test/features/2.3.exp
+++ b/test/features/2.3.exp
@@ -196,93 +196,95 @@ if { $overlay == "overlay" } {
196# 196#
197# C 197# C
198# 198#
199send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r" 199if { $chroot == "chroot" } {
200expect { 200 send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
201 timeout {puts "TESTING ERROR 4\n";exit} 201 expect {
202 "Child process initialized" 202 timeout {puts "TESTING ERROR 4\n";exit}
203} 203 "Child process initialized"
204sleep 1 204 }
205 205 sleep 1
206send -- "dig google.com\r" 206
207expect { 207 send -- "dig google.com\r"
208 timeout {puts "TESTING ERROR 5\n";exit} 208 expect {
209 "ANSWER SECTION" 209 timeout {puts "TESTING ERROR 5\n";exit}
210} 210 "ANSWER SECTION"
211expect { 211 }
212 timeout {puts "TESTING ERROR 5.1\n";exit} 212 expect {
213 "google.com" 213 timeout {puts "TESTING ERROR 5.1\n";exit}
214} 214 "google.com"
215expect { 215 }
216 timeout {puts "TESTING ERROR 5.3\n";exit} 216 expect {
217 "SERVER:" 217 timeout {puts "TESTING ERROR 5.3\n";exit}
218} 218 "SERVER:"
219after 100 219 }
220 220 after 100
221send -- "/sbin/ifconfig\r" 221
222expect { 222 send -- "/sbin/ifconfig\r"
223 timeout {puts "TESTING ERROR 5.4\n";exit} 223 expect {
224 "eth0" 224 timeout {puts "TESTING ERROR 5.4\n";exit}
225} 225 "eth0"
226expect { 226 }
227 timeout {puts "TESTING ERROR 5.5\n";exit} 227 expect {
228 "Link" 228 timeout {puts "TESTING ERROR 5.5\n";exit}
229} 229 "Link"
230expect { 230 }
231 timeout {puts "TESTING ERROR 5.6\n";exit} 231 expect {
232 "192.168.1" 232 timeout {puts "TESTING ERROR 5.6\n";exit}
233} 233 "192.168.1"
234expect { 234 }
235 timeout {puts "TESTING ERROR 5.7\n";exit} 235 expect {
236 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 236 timeout {puts "TESTING ERROR 5.7\n";exit}
237} 237 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
238after 100 238 }
239 239 after 100
240send -- "exit\r" 240
241sleep 3 241 send -- "exit\r"
242 242 sleep 3
243send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r" 243
244expect { 244 send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
245 timeout {puts "TESTING ERROR 4\n";exit} 245 expect {
246 "Child process initialized" 246 timeout {puts "TESTING ERROR 4\n";exit}
247} 247 "Child process initialized"
248sleep 1 248 }
249 249 sleep 1
250send -- "dig google.com\r" 250
251expect { 251 send -- "dig google.com\r"
252 timeout {puts "TESTING ERROR 5\n";exit} 252 expect {
253 "ANSWER SECTION" 253 timeout {puts "TESTING ERROR 5\n";exit}
254} 254 "ANSWER SECTION"
255expect { 255 }
256 timeout {puts "TESTING ERROR 5.1\n";exit} 256 expect {
257 "google.com" 257 timeout {puts "TESTING ERROR 5.1\n";exit}
258} 258 "google.com"
259expect { 259 }
260 timeout {puts "TESTING ERROR 5.3\n";exit} 260 expect {
261 "SERVER:" 261 timeout {puts "TESTING ERROR 5.3\n";exit}
262} 262 "SERVER:"
263after 100 263 }
264 264 after 100
265send -- "/sbin/ifconfig\r" 265
266expect { 266 send -- "/sbin/ifconfig\r"
267 timeout {puts "TESTING ERROR 5.4\n";exit} 267 expect {
268 "eth0" 268 timeout {puts "TESTING ERROR 5.4\n";exit}
269} 269 "eth0"
270expect { 270 }
271 timeout {puts "TESTING ERROR 5.5\n";exit} 271 expect {
272 "Link" 272 timeout {puts "TESTING ERROR 5.5\n";exit}
273} 273 "Link"
274expect { 274 }
275 timeout {puts "TESTING ERROR 5.6\n";exit} 275 expect {
276 "192.168.1.244" 276 timeout {puts "TESTING ERROR 5.6\n";exit}
277} 277 "192.168.1.244"
278expect { 278 }
279 timeout {puts "TESTING ERROR 5.7\n";exit} 279 expect {
280 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 280 timeout {puts "TESTING ERROR 5.7\n";exit}
281 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
282 }
283 after 100
284
285 send -- "exit\r"
286 sleep 1
281} 287}
282after 100
283
284send -- "exit\r"
285sleep 1
286 288
287 289
288puts "\nall done\n" 290puts "\nall done\n"
diff --git a/test/features/2.4.exp b/test/features/2.4.exp
index 424d4fead..3291c046c 100755
--- a/test/features/2.4.exp
+++ b/test/features/2.4.exp
@@ -170,65 +170,65 @@ if { $overlay == "overlay" } {
170# 170#
171# C 171# C
172# 172#
173send -- "firejail --noprofile --net=br0 --chroot=/tmp/chroot\r" 173if { $chroot == "chroot" } {
174expect { 174 send -- "firejail --noprofile --net=br0 --chroot=/tmp/chroot\r"
175 timeout {puts "TESTING ERROR 4\n";exit} 175 expect {
176 "Child process initialized" 176 timeout {puts "TESTING ERROR 4\n";exit}
177} 177 "Child process initialized"
178sleep 1 178 }
179 179 sleep 1
180send -- "/sbin/ifconfig\r" 180
181expect { 181 send -- "/sbin/ifconfig\r"
182 timeout {puts "TESTING ERROR 5.4\n";exit} 182 expect {
183 "eth0" 183 timeout {puts "TESTING ERROR 5.4\n";exit}
184} 184 "eth0"
185expect { 185 }
186 timeout {puts "TESTING ERROR 5.5\n";exit} 186 expect {
187 "Link" 187 timeout {puts "TESTING ERROR 5.5\n";exit}
188} 188 "Link"
189expect { 189 }
190 timeout {puts "TESTING ERROR 5.6\n";exit} 190 expect {
191 "10.10.20" 191 timeout {puts "TESTING ERROR 5.6\n";exit}
192} 192 "10.10.20"
193expect { 193 }
194 timeout {puts "TESTING ERROR 5.7\n";exit} 194 expect {
195 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 195 timeout {puts "TESTING ERROR 5.7\n";exit}
196} 196 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
197after 100 197 }
198 198 after 100
199send -- "exit\r" 199
200sleep 1 200 send -- "exit\r"
201 201 sleep 1
202send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --chroot=/tmp/chroot\r" 202
203expect { 203 send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --chroot=/tmp/chroot\r"
204 timeout {puts "TESTING ERROR 4\n";exit} 204 expect {
205 "Child process initialized" 205 timeout {puts "TESTING ERROR 4\n";exit}
206} 206 "Child process initialized"
207sleep 1 207 }
208 208 sleep 1
209send -- "/sbin/ifconfig\r" 209
210expect { 210 send -- "/sbin/ifconfig\r"
211 timeout {puts "TESTING ERROR 5.4\n";exit} 211 expect {
212 "eth0" 212 timeout {puts "TESTING ERROR 5.4\n";exit}
213} 213 "eth0"
214expect { 214 }
215 timeout {puts "TESTING ERROR 5.5\n";exit} 215 expect {
216 "Link" 216 timeout {puts "TESTING ERROR 5.5\n";exit}
217} 217 "Link"
218expect { 218 }
219 timeout {puts "TESTING ERROR 5.6\n";exit} 219 expect {
220 "10.10.20.4" 220 timeout {puts "TESTING ERROR 5.6\n";exit}
221} 221 "10.10.20.4"
222expect { 222 }
223 timeout {puts "TESTING ERROR 5.7\n";exit} 223 expect {
224 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 224 timeout {puts "TESTING ERROR 5.7\n";exit}
225 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
226 }
227 after 100
228
229 send -- "exit\r"
230 sleep 1
225} 231}
226after 100
227
228send -- "exit\r"
229sleep 1
230
231
232 232
233 233
234puts "\nall done\n" 234puts "\nall done\n"
diff --git a/test/features/2.5.exp b/test/features/2.5.exp
index e189f145b..44c9b5949 100755
--- a/test/features/2.5.exp
+++ b/test/features/2.5.exp
@@ -75,33 +75,35 @@ if { $overlay == "overlay" } {
75# 75#
76# C 76# C
77# 77#
78send -- "firejail --noprofile --chroot=/tmp/chroot --interface=eth0.7\r" 78if { $chroot == "chroot" } {
79expect { 79 send -- "firejail --noprofile --chroot=/tmp/chroot --interface=eth0.7\r"
80 timeout {puts "TESTING ERROR 4\n";exit} 80 expect {
81 "Child process initialized" 81 timeout {puts "TESTING ERROR 4\n";exit}
82} 82 "Child process initialized"
83sleep 1 83 }
84 84 sleep 1
85send -- "/sbin/ifconfig\r" 85
86expect { 86 send -- "/sbin/ifconfig\r"
87 timeout {puts "TESTING ERROR 5.4\n";exit} 87 expect {
88 "eth0.7" 88 timeout {puts "TESTING ERROR 5.4\n";exit}
89} 89 "eth0.7"
90expect { 90 }
91 timeout {puts "TESTING ERROR 5.5n";exit} 91 expect {
92 "Link" 92 timeout {puts "TESTING ERROR 5.5n";exit}
93} 93 "Link"
94expect { 94 }
95 timeout {puts "TESTING ERROR 5.6\n";exit} 95 expect {
96 "10.10.207.10" 96 timeout {puts "TESTING ERROR 5.6\n";exit}
97} 97 "10.10.207.10"
98expect { 98 }
99 timeout {puts "TESTING ERROR 5.7\n";exit} 99 expect {
100 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 100 timeout {puts "TESTING ERROR 5.7\n";exit}
101 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
102 }
103 after 100
104 send -- "exit\r"
105 sleep 1
101} 106}
102after 100
103send -- "exit\r"
104sleep 1
105 107
106 108
107puts "\nall done\n" 109puts "\nall done\n"
diff --git a/test/features/2.6.exp b/test/features/2.6.exp
index 77bd8cab0..92322d7ec 100755
--- a/test/features/2.6.exp
+++ b/test/features/2.6.exp
@@ -51,21 +51,22 @@ if { $overlay == "overlay" } {
51# 51#
52# C 52# C
53# 53#
54send -- "firejail --noprofile --chroot=/tmp/chroot --net=eth0 --defaultgw=192.168.1.10\r" 54if { $chroot == "chroot" } {
55expect { 55 send -- "firejail --noprofile --chroot=/tmp/chroot --net=eth0 --defaultgw=192.168.1.10\r"
56 timeout {puts "TESTING ERROR 4\n";exit} 56 expect {
57 "Child process initialized" 57 timeout {puts "TESTING ERROR 4\n";exit}
58} 58 "Child process initialized"
59sleep 1 59 }
60 60 sleep 1
61send -- "netstat -rn\r" 61
62expect { 62 send -- "netstat -rn\r"
63 timeout {puts "TESTING ERROR 5\n";exit} 63 expect {
64 "0.0.0.0 192.168.1.10" 64 timeout {puts "TESTING ERROR 5\n";exit}
65 "0.0.0.0 192.168.1.10"
66 }
67 after 100
68 send -- "exit\r"
69 sleep 1
65} 70}
66after 100
67send -- "exit\r"
68sleep 1
69
70 71
71puts "\nall done\n" 72puts "\nall done\n"
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
index 13ec1b6be..3ee04c4de 100755
--- a/test/features/3.1.exp
+++ b/test/features/3.1.exp
@@ -53,23 +53,25 @@ if { $overlay == "overlay" } {
53# 53#
54# C 54# C
55# 55#
56send -- "touch /tmp/chroot/home/netblue/.config/firejail-test-file\r" 56if { $chroot == "chroot" } {
57sleep 1 57 send -- "touch /tmp/chroot/home/netblue/.config/firejail-test-file\r"
58send -- "firejail --noprofile --chroot=/tmp/chroot --tmpfs=/home/netblue/.config\r" 58 sleep 1
59expect { 59 send -- "firejail --noprofile --chroot=/tmp/chroot --tmpfs=/home/netblue/.config\r"
60 timeout {puts "TESTING ERROR 4\n";exit} 60 expect {
61 "Child process initialized" 61 timeout {puts "TESTING ERROR 4\n";exit}
62} 62 "Child process initialized"
63sleep 1 63 }
64 64 sleep 1
65send -- "ls ~/.config | wc -l\r" 65
66expect { 66 send -- "ls ~/.config | wc -l\r"
67 timeout {puts "TESTING ERROR 5\n";exit} 67 expect {
68 "0" 68 timeout {puts "TESTING ERROR 5\n";exit}
69 "0"
70 }
71 after 100
72 send -- "exit\r"
73 sleep 1
69} 74}
70after 100
71send -- "exit\r"
72sleep 1
73 75
74 76
75puts "\nall done\n" 77puts "\nall done\n"
diff --git a/test/features/3.2.exp b/test/features/3.2.exp
index 49d8d27c1..bcb4b48b0 100755
--- a/test/features/3.2.exp
+++ b/test/features/3.2.exp
@@ -53,23 +53,25 @@ if { $overlay == "overlay" } {
53# 53#
54# C 54# C
55# 55#
56send -- "rm -f /tmp/chroot/home/netblue/.config/firejail-test-file\r" 56if { $chroot == "chroot" } {
57sleep 1 57 send -- "rm -f /tmp/chroot/home/netblue/.config/firejail-test-file\r"
58send -- "firejail --noprofile --chroot=/tmp/chroot --read-only=/home/netblue/.config\r" 58 sleep 1
59expect { 59 send -- "firejail --noprofile --chroot=/tmp/chroot --read-only=/home/netblue/.config\r"
60 timeout {puts "TESTING ERROR 4\n";exit} 60 expect {
61 "Child process initialized" 61 timeout {puts "TESTING ERROR 4\n";exit}
62} 62 "Child process initialized"
63sleep 1 63 }
64 64 sleep 1
65send -- "touch ~/.config/firejail-test-file\r" 65
66expect { 66 send -- "touch ~/.config/firejail-test-file\r"
67 timeout {puts "TESTING ERROR 5\n";exit} 67 expect {
68 "Read-only file system" 68 timeout {puts "TESTING ERROR 5\n";exit}
69 "Read-only file system"
70 }
71 after 100
72 send -- "exit\r"
73 sleep 1
69} 74}
70after 100
71send -- "exit\r"
72sleep 1
73 75
74 76
75puts "\nall done\n" 77puts "\nall done\n"
diff --git a/test/features/3.3.exp b/test/features/3.3.exp
index a53a4ade5..0539a1d40 100755
--- a/test/features/3.3.exp
+++ b/test/features/3.3.exp
@@ -52,21 +52,22 @@ if { $overlay == "overlay" } {
52# 52#
53# C 53# C
54# 54#
55send -- "firejail --noprofile --chroot=/tmp/chroot --blacklist=/home/netblue/.config\r" 55if { $chroot == "chroot" } {
56expect { 56 send -- "firejail --noprofile --chroot=/tmp/chroot --blacklist=/home/netblue/.config\r"
57 timeout {puts "TESTING ERROR 4\n";exit} 57 expect {
58 "Child process initialized" 58 timeout {puts "TESTING ERROR 4\n";exit}
59} 59 "Child process initialized"
60sleep 1 60 }
61 61 sleep 1
62send -- "cd ~/.config\r" 62
63expect { 63 send -- "cd ~/.config\r"
64 timeout {puts "TESTING ERROR 5\n";exit} 64 expect {
65 "Permission denied" 65 timeout {puts "TESTING ERROR 5\n";exit}
66 "Permission denied"
67 }
68 after 100
69 send -- "exit\r"
70 sleep 1
66} 71}
67after 100
68send -- "exit\r"
69sleep 1
70
71 72
72puts "\nall done\n" 73puts "\nall done\n"
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
index da6dd3ff0..2a6e4da41 100755
--- a/test/features/3.4.exp
+++ b/test/features/3.4.exp
@@ -52,21 +52,23 @@ if { $overlay == "overlay" } {
52# 52#
53# C 53# C
54# 54#
55send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r" 55if { $chroot == "chroot" } {
56expect { 56 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r"
57 timeout {puts "TESTING ERROR 4\n";exit} 57 expect {
58 "Child process initialized" 58 timeout {puts "TESTING ERROR 4\n";exit}
59} 59 "Child process initialized"
60sleep 1 60 }
61 61 sleep 1
62send -- "ls -al ~/. | wc -l\r" 62
63expect { 63 send -- "ls -al ~/. | wc -l\r"
64 timeout {puts "TESTING ERROR 1\n";exit} 64 expect {
65 "6" 65 timeout {puts "TESTING ERROR 1\n";exit}
66 "6"
67 }
68 after 100
69 send -- "exit\r"
70 sleep 1
66} 71}
67after 100
68send -- "exit\r"
69sleep 1
70 72
71 73
72puts "\nall done\n" 74puts "\nall done\n"
diff --git a/test/features/test.sh b/test/features/test.sh
index b600cec31..c3a4f21ae 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -1,13 +1,17 @@
1#!/bin/bash 1#!/bin/bash
2OVERLAY="overlay" 2OVERLAY="overlay"
3CHROOT="chroot"
3 4
4while [ $# -gt 0 ]; do # Until you run out of parameters . . . 5while [ $# -gt 0 ]; do # Until you run out of parameters . . .
5 case "$1" in 6 case "$1" in
6 --nooverlay) 7 --nooverlay)
7 OVERLAY="" 8 OVERLAY="none"
9 ;;
10 --nochroot)
11 CHROOT="none"
8 ;; 12 ;;
9 --help) 13 --help)
10 echo "./test.sh [--nooverlay|--help] | grep TESTING" 14 echo "./test.sh [--nooverlay|--nochroot|--help] | grep TESTING"
11 exit 15 exit
12 ;; 16 ;;
13 esac 17 esac
@@ -21,59 +25,66 @@ done
21# Feature testing 25# Feature testing
22# 26#
23 27
28####################
24# Default features 29# Default features
30####################
25echo "TESTING: 1.1 disable /boot" 31echo "TESTING: 1.1 disable /boot"
26./1.1.exp $OVERLAY 32./1.1.exp $OVERLAY $CHROOT
27 33
28echo "TESTING: 1.2 new /proc" 34echo "TESTING: 1.2 new /proc"
29./1.2.exp $OVERLAY 35./1.2.exp $OVERLAY $CHROOT
30 36
31echo "TESTING: 1.4 mask other users" 37echo "TESTING: 1.4 mask other users"
32./1.4.exp $OVERLAY 38./1.4.exp $OVERLAY $CHROOT
33 39
34echo "TESTING: 1.5 PID namespace" 40echo "TESTING: 1.5 PID namespace"
35./1.5.exp $OVERLAY 41./1.5.exp $OVERLAY $CHROOT
36 42
37echo "TESTING: 1.6 new /var/log" 43echo "TESTING: 1.6 new /var/log"
38./1.6.exp $OVERLAY 44./1.6.exp $OVERLAY $CHROOT
39 45
40echo "TESTING: 1.7 new /var/tmp" 46echo "TESTING: 1.7 new /var/tmp"
41./1.7.exp $OVERLAY 47./1.7.exp $OVERLAY $CHROOT
42 48
43echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail" 49echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail"
44./1.8.exp $OVERLAY 50./1.8.exp $OVERLAY $CHROOT
45 51
46echo "TESTING: 1.10 disable /selinux" 52echo "TESTING: 1.10 disable /selinux"
47./1.10.exp $OVERLAY 53./1.10.exp $OVERLAY $CHROOT
48 54
55####################
49# networking features 56# networking features
57####################
50echo "TESTING: 2.1 hostname" 58echo "TESTING: 2.1 hostname"
51./2.1.exp $OVERLAY 59./2.1.exp $OVERLAY $CHROOT
52 60
53echo "TESTING: 2.2 DNS" 61echo "TESTING: 2.2 DNS"
54./2.2.exp $OVERLAY 62./2.2.exp $OVERLAY $CHROOT
55 63
56echo "TESTING: 2.3 mac-vlan" 64echo "TESTING: 2.3 mac-vlan"
57./2.3.exp $OVERLAY 65./2.3.exp $OVERLAY $CHROOT
58 66
59echo "TESTING: 2.4 bridge" 67echo "TESTING: 2.4 bridge"
60./2.4.exp $OVERLAY 68./2.4.exp $OVERLAY $CHROOT
61 69
62echo "TESTING: 2.5 interface" 70echo "TESTING: 2.5 interface"
63./2.5.exp $OVERLAY 71./2.5.exp $OVERLAY $CHROOT
64 72
65echo "TESTING: 2.6 Default gateway" 73echo "TESTING: 2.6 Default gateway"
66./2.6.exp $OVERLAY 74./2.6.exp $OVERLAY $CHROOT
67 75
76####################
77# filesystem features
78####################
68echo "TESTING: 3.1 tmpfs" 79echo "TESTING: 3.1 tmpfs"
69./3.1.exp $OVERLAY 80./3.1.exp $OVERLAY $CHROOT
70 81
71echo "TESTING: 3.2 read-only" 82echo "TESTING: 3.2 read-only"
72./3.2.exp $OVERLAY 83./3.2.exp $OVERLAY $CHROOT
73 84
74echo "TESTING: 3.3 blacklist" 85echo "TESTING: 3.3 blacklist"
75./3.3.exp $OVERLAY 86./3.3.exp $OVERLAY $CHROOT
76 87
77echo "TESTING: 3.4 whitelist" 88echo "TESTING: 3.4 whitelist"
78./3.4.exp $OVERLAY 89./3.4.exp $OVERLAY $CHROOT
79 90