aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-12-23 12:38:13 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-12-23 12:38:13 -0500
commit686bc51e38b0718651e82818871b0bf1451c8b21 (patch)
tree521f5fc2123c4782493fc86b46cc41533acb85db /test/features
parent0.9.36 testing (diff)
downloadfirejail-686bc51e38b0718651e82818871b0bf1451c8b21.tar.gz
firejail-686bc51e38b0718651e82818871b0bf1451c8b21.tar.zst
firejail-686bc51e38b0718651e82818871b0bf1451c8b21.zip
0.9.36 testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/1.1.exp31
-rwxr-xr-xtest/features/1.10.exp38
-rwxr-xr-xtest/features/1.2.exp79
-rwxr-xr-xtest/features/1.4.exp55
-rwxr-xr-xtest/features/1.5.exp31
-rwxr-xr-xtest/features/1.6.exp31
-rwxr-xr-xtest/features/1.7.exp31
-rwxr-xr-xtest/features/1.8.exp43
-rwxr-xr-xtest/features/2.1.exp63
-rwxr-xr-xtest/features/2.2.exp47
-rwxr-xr-xtest/features/2.3.exp183
-rwxr-xr-xtest/features/2.4.exp148
-rwxr-xr-xtest/features/2.5.exp55
-rwxr-xr-xtest/features/2.6.exp31
-rwxr-xr-xtest/features/3.1.exp31
-rwxr-xr-xtest/features/3.2.exp31
-rwxr-xr-xtest/features/3.3.exp31
-rwxr-xr-xtest/features/3.4.exp31
-rwxr-xr-xtest/features/test.sh53
19 files changed, 558 insertions, 485 deletions
diff --git a/test/features/1.1.exp b/test/features/1.1.exp
index 06c42c815..dafa4630e 100755
--- a/test/features/1.1.exp
+++ b/test/features/1.1.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -30,21 +31,23 @@ sleep 1
30# 31#
31# O 32# O
32# 33#
33send -- "firejail --noprofile --overlay\r" 34if { $overlay == "overlay" } {
34expect { 35 send -- "firejail --noprofile --overlay\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 36 expect {
36 "Child process initialized" 37 timeout {puts "TESTING ERROR 2\n";exit}
38 "Child process initialized"
39 }
40 sleep 1
41
42 send -- "ls -l /boot\r"
43 expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "Permission denied"
46 }
47 after 100
48 send -- "exit\r"
49 sleep 1
37} 50}
38sleep 1
39
40send -- "ls -l /boot\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "Permission denied"
44}
45after 100
46send -- "exit\r"
47sleep 1
48 51
49# 52#
50# C 53# C
diff --git a/test/features/1.10.exp b/test/features/1.10.exp
index a6e0f9281..96e3c38d1 100755
--- a/test/features/1.10.exp
+++ b/test/features/1.10.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -20,7 +21,8 @@ sleep 1
20send -- "ls -l /selinux\r" 21send -- "ls -l /selinux\r"
21expect { 22expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 23 timeout {puts "TESTING ERROR 1\n";exit}
23 "Permission denied" 24 "Permission denied" {puts "denied\n"}
25 "No such file or directory" {puts "no file\n"}
24} 26}
25after 100 27after 100
26send -- "exit\r" 28send -- "exit\r"
@@ -30,21 +32,24 @@ sleep 1
30# 32#
31# O 33# O
32# 34#
33send -- "firejail --noprofile --overlay\r" 35if { $overlay == "overlay" } {
34expect { 36 send -- "firejail --noprofile --overlay\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 37 expect {
36 "Child process initialized" 38 timeout {puts "TESTING ERROR 2\n";exit}
37} 39 "Child process initialized"
38sleep 1 40 }
39 41 sleep 1
40send -- "ls -l /selinux\r" 42
41expect { 43 send -- "ls -l /selinux\r"
42 timeout {puts "TESTING ERROR 3\n";exit} 44 expect {
43 "Permission denied" 45 timeout {puts "TESTING ERROR 3\n";exit}
46 "Permission denied" {puts "denied\n"}
47 "No such file or directory" {puts "no file\n"}
48 }
49 after 100
50 send -- "exit\r"
51 sleep 1
44} 52}
45after 100
46send -- "exit\r"
47sleep 1
48 53
49# 54#
50# C 55# C
@@ -59,7 +64,8 @@ sleep 1
59send -- "ls -l /selinux\r" 64send -- "ls -l /selinux\r"
60expect { 65expect {
61 timeout {puts "TESTING ERROR 5\n";exit} 66 timeout {puts "TESTING ERROR 5\n";exit}
62 "Permission denied" 67 "Permission denied" {puts "denied\n"}
68 "No such file or directory" {puts "no file\n"}
63} 69}
64after 100 70after 100
65send -- "exit\r" 71send -- "exit\r"
diff --git a/test/features/1.2.exp b/test/features/1.2.exp
index 399e9948b..d487537e4 100755
--- a/test/features/1.2.exp
+++ b/test/features/1.2.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -54,45 +55,47 @@ sleep 1
54# 55#
55# O 56# O
56# 57#
57send -- "firejail --noprofile --overlay\r" 58if { $overlay == "overlay" } {
58expect { 59 send -- "firejail --noprofile --overlay\r"
59 timeout {puts "TESTING ERROR 2\n";exit} 60 expect {
60 "Child process initialized" 61 timeout {puts "TESTING ERROR 2\n";exit}
61} 62 "Child process initialized"
62sleep 1 63 }
63 64 sleep 1
64send -- "cat /proc/mounts | grep proc\r" 65
65expect { 66 send -- "cat /proc/mounts | grep proc\r"
66 timeout {puts "TESTING ERROR 3.1\n";exit} 67 expect {
67 "proc /proc proc" 68 timeout {puts "TESTING ERROR 3.1\n";exit}
69 "proc /proc proc"
70 }
71 expect {
72 timeout {puts "TESTING ERROR 3.2\n";exit}
73 "proc /proc proc"
74 }
75 expect {
76 timeout {puts "TESTING ERROR 3.3\n";exit}
77 "proc /proc/sys proc"
78 }
79 expect {
80 timeout {puts "TESTING ERROR 3.4\n";exit}
81 "proc /proc/sysrq-trigger proc"
82 }
83 expect {
84 timeout {puts "TESTING ERROR 3.5\n";exit}
85 "proc /proc/sys/kernel/hotplug"
86 }
87 expect {
88 timeout {puts "TESTING ERROR 3.6\n";exit}
89 "proc /proc/irq proc"
90 }
91 expect {
92 timeout {puts "TESTING ERROR 3.7\n";exit}
93 "proc /proc/bus proc"
94 }
95 after 100
96 send -- "exit\r"
97 sleep 1
68} 98}
69expect {
70 timeout {puts "TESTING ERROR 3.2\n";exit}
71 "proc /proc proc"
72}
73expect {
74 timeout {puts "TESTING ERROR 3.3\n";exit}
75 "proc /proc/sys proc"
76}
77expect {
78 timeout {puts "TESTING ERROR 3.4\n";exit}
79 "proc /proc/sysrq-trigger proc"
80}
81expect {
82 timeout {puts "TESTING ERROR 3.5\n";exit}
83 "proc /proc/sys/kernel/hotplug"
84}
85expect {
86 timeout {puts "TESTING ERROR 3.6\n";exit}
87 "proc /proc/irq proc"
88}
89expect {
90 timeout {puts "TESTING ERROR 3.7\n";exit}
91 "proc /proc/bus proc"
92}
93after 100
94send -- "exit\r"
95sleep 1
96 99
97# 100#
98# C 101# C
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
index 82d683175..113a328c9 100755
--- a/test/features/1.4.exp
+++ b/test/features/1.4.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -43,33 +44,35 @@ sleep 1
43# 44#
44# O 45# O
45# 46#
46send -- "firejail --noprofile --overlay\r" 47if { $overlay == "overlay" } {
47expect { 48 send -- "firejail --noprofile --overlay\r"
48 timeout {puts "TESTING ERROR 2\n";exit} 49 expect {
49 "Child process initialized" 50 timeout {puts "TESTING ERROR 2\n";exit}
51 "Child process initialized"
52 }
53 sleep 1
54
55 send -- "ls -l /home | wc -l\r"
56 expect {
57 timeout {puts "TESTING ERROR 3\n";exit}
58 "2"
59 }
60 after 100
61 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
62 expect {
63 timeout {puts "TESTING ERROR 3.1\n";exit}
64 "0"
65 }
66 after 100
67 send -- "cat /etc/group | grep 1001 | wc -l\r"
68 expect {
69 timeout {puts "TESTING ERROR 3.2\n";exit}
70 "0"
71 }
72 after 100
73 send -- "exit\r"
74 sleep 1
50} 75}
51sleep 1
52
53send -- "ls -l /home | wc -l\r"
54expect {
55 timeout {puts "TESTING ERROR 3\n";exit}
56 "2"
57}
58after 100
59send -- "cat /etc/passwd | grep 1001 | wc -l\r"
60expect {
61 timeout {puts "TESTING ERROR 3.1\n";exit}
62 "0"
63}
64after 100
65send -- "cat /etc/group | grep 1001 | wc -l\r"
66expect {
67 timeout {puts "TESTING ERROR 3.2\n";exit}
68 "0"
69}
70after 100
71send -- "exit\r"
72sleep 1
73 76
74# 77#
75# C 78# C
diff --git a/test/features/1.5.exp b/test/features/1.5.exp
index 84c00937f..5a2643ede 100755
--- a/test/features/1.5.exp
+++ b/test/features/1.5.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -30,21 +31,23 @@ sleep 1
30# 31#
31# O 32# O
32# 33#
33send -- "firejail --noprofile --overlay\r" 34if { $overlay == "overlay" } {
34expect { 35 send -- "firejail --noprofile --overlay\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 36 expect {
36 "Child process initialized" 37 timeout {puts "TESTING ERROR 2\n";exit}
38 "Child process initialized"
39 }
40 sleep 1
41
42 send -- "ps aux | wc -l \r"
43 expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "5"
46 }
47 after 100
48 send -- "exit\r"
49 sleep 1
37} 50}
38sleep 1
39
40send -- "ps aux | wc -l \r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "5"
44}
45after 100
46send -- "exit\r"
47sleep 1
48 51
49# 52#
50# C 53# C
diff --git a/test/features/1.6.exp b/test/features/1.6.exp
index 0a4b788b8..8ed20fa46 100755
--- a/test/features/1.6.exp
+++ b/test/features/1.6.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -30,21 +31,23 @@ sleep 1
30# 31#
31# O 32# O
32# 33#
33send -- "firejail --noprofile --overlay\r" 34if { $overlay == "overlay" } {
34expect { 35 send -- "firejail --noprofile --overlay\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 36 expect {
36 "Child process initialized" 37 timeout {puts "TESTING ERROR 2\n";exit}
38 "Child process initialized"
39 }
40 sleep 1
41
42 send -- "ls -l /var/log/syslog | wc -l\r"
43 expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "0"
46 }
47 after 100
48 send -- "exit\r"
49 sleep 1
37} 50}
38sleep 1
39
40send -- "ls -l /var/log/syslog | wc -l\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "0"
44}
45after 100
46send -- "exit\r"
47sleep 1
48 51
49# 52#
50# C 53# C
diff --git a/test/features/1.7.exp b/test/features/1.7.exp
index c95184fd1..35351b7d9 100755
--- a/test/features/1.7.exp
+++ b/test/features/1.7.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -32,21 +33,23 @@ sleep 1
32# 33#
33# O 34# O
34# 35#
35send -- "firejail --noprofile --overlay\r" 36if { $overlay == "overlay" } {
36expect { 37 send -- "firejail --noprofile --overlay\r"
37 timeout {puts "TESTING ERROR 2\n";exit} 38 expect {
38 "Child process initialized" 39 timeout {puts "TESTING ERROR 2\n";exit}
40 "Child process initialized"
41 }
42 sleep 1
43
44 send -- "ls -l /var/tmp/somefile | wc -l\r"
45 expect {
46 timeout {puts "TESTING ERROR 3\n";exit}
47 "0"
48 }
49 after 100
50 send -- "exit\r"
51 sleep 1
39} 52}
40sleep 1
41
42send -- "ls -l /var/tmp/somefile | wc -l\r"
43expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "0"
46}
47after 100
48send -- "exit\r"
49sleep 1
50 53
51# 54#
52# C 55# C
diff --git a/test/features/1.8.exp b/test/features/1.8.exp
index aefe9d8c5..293864671 100755
--- a/test/features/1.8.exp
+++ b/test/features/1.8.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -37,27 +38,29 @@ sleep 1
37# 38#
38# O 39# O
39# 40#
40send -- "firejail --noprofile --overlay\r" 41if { $overlay == "overlay" } {
41expect { 42 send -- "firejail --noprofile --overlay\r"
42 timeout {puts "TESTING ERROR 2\n";exit} 43 expect {
43 "Child process initialized" 44 timeout {puts "TESTING ERROR 2\n";exit}
44} 45 "Child process initialized"
45sleep 1 46 }
46send -- "ls /etc/firejail\r" 47 sleep 1
47expect { 48 send -- "ls /etc/firejail\r"
48 timeout {puts "TESTING ERROR 3\n";exit} 49 expect {
49 "Permission denied" 50 timeout {puts "TESTING ERROR 3\n";exit}
50} 51 "Permission denied"
51after 100 52 }
52send -- "ls ~/.config/firejail\r" 53 after 100
53expect { 54 send -- "ls ~/.config/firejail\r"
54 timeout {puts "TESTING ERROR 3.1\n";exit} 55 expect {
55 "Permission denied" 56 timeout {puts "TESTING ERROR 3.1\n";exit}
57 "Permission denied"
58 }
59 after 100
60
61 send -- "exit\r"
62 sleep 1
56} 63}
57after 100
58
59send -- "exit\r"
60sleep 1
61 64
62# 65#
63# C 66# C
diff --git a/test/features/2.1.exp b/test/features/2.1.exp
index a2ae321ce..5f188988b 100755
--- a/test/features/2.1.exp
+++ b/test/features/2.1.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -46,37 +47,39 @@ sleep 1
46# 47#
47# O 48# O
48# 49#
49send -- "firejail --noprofile --hostname=bingo --overlay\r" 50if { $overlay == "overlay" } {
50expect { 51 send -- "firejail --noprofile --hostname=bingo --overlay\r"
51 timeout {puts "TESTING ERROR 2\n";exit} 52 expect {
52 "Child process initialized" 53 timeout {puts "TESTING ERROR 2\n";exit}
53} 54 "Child process initialized"
54sleep 1 55 }
55 56 sleep 1
56send -- "hostname\r" 57
57expect { 58 send -- "hostname\r"
58 timeout {puts "TESTING ERROR 3\n";exit} 59 expect {
59 "bingo" 60 timeout {puts "TESTING ERROR 3\n";exit}
60} 61 "bingo"
61after 100 62 }
62send -- "cat /etc/hostname\r" 63 after 100
63expect { 64 send -- "cat /etc/hostname\r"
64 timeout {puts "TESTING ERROR 3.0\n";exit} 65 expect {
65 "bingo" 66 timeout {puts "TESTING ERROR 3.0\n";exit}
66} 67 "bingo"
67after 100 68 }
68send -- "getent hosts bingo\r" 69 after 100
69expect { 70 send -- "getent hosts bingo\r"
70 timeout {puts "TESTING ERROR 3.1\n";exit} 71 expect {
71 "127.0.0.1" 72 timeout {puts "TESTING ERROR 3.1\n";exit}
73 "127.0.0.1"
74 }
75 expect {
76 timeout {puts "TESTING ERROR 3.2\n";exit}
77 "bingo"
78 }
79 after 100
80 send -- "exit\r"
81 sleep 1
72} 82}
73expect {
74 timeout {puts "TESTING ERROR 3.2\n";exit}
75 "bingo"
76}
77after 100
78send -- "exit\r"
79sleep 1
80 83
81# 84#
82# C 85# C
diff --git a/test/features/2.2.exp b/test/features/2.2.exp
index c562328fd..186da98fb 100755
--- a/test/features/2.2.exp
+++ b/test/features/2.2.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -38,29 +39,31 @@ sleep 1
38# 39#
39# O 40# O
40# 41#
41send -- "firejail --noprofile --dns=4.2.2.1 --overlay\r" 42if { $overlay == "overlay" } {
42expect { 43 send -- "firejail --noprofile --dns=4.2.2.1 --overlay\r"
43 timeout {puts "TESTING ERROR 2\n";exit} 44 expect {
44 "Child process initialized" 45 timeout {puts "TESTING ERROR 2\n";exit}
46 "Child process initialized"
47 }
48 sleep 1
49
50 send -- "dig google.com\r"
51 expect {
52 timeout {puts "TESTING ERROR 3\n";exit}
53 "ANSWER SECTION"
54 }
55 expect {
56 timeout {puts "TESTING ERROR 3.1\n";exit}
57 "google.com"
58 }
59 expect {
60 timeout {puts "TESTING ERROR 3.3\n";exit}
61 "SERVER: 4.2.2.1"
62 }
63 after 100
64 send -- "exit\r"
65 sleep 1
45} 66}
46sleep 1
47
48send -- "dig google.com\r"
49expect {
50 timeout {puts "TESTING ERROR 3\n";exit}
51 "ANSWER SECTION"
52}
53expect {
54 timeout {puts "TESTING ERROR 3.1\n";exit}
55 "google.com"
56}
57expect {
58 timeout {puts "TESTING ERROR 3.3\n";exit}
59 "SERVER: 4.2.2.1"
60}
61after 100
62send -- "exit\r"
63sleep 1
64 67
65# 68#
66# C 69# C
diff --git a/test/features/2.3.exp b/test/features/2.3.exp
index dd4bdace7..9201696c2 100755
--- a/test/features/2.3.exp
+++ b/test/features/2.3.exp
@@ -6,11 +6,12 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
12# 13#
13send -- "firejail --noprofile --net=eth0\r" 14send -- "firejail --noprofile --net=eth0 --dns=8.8.8.8 --dns=8.8.4.4\r"
14expect { 15expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 16 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized" 17 "Child process initialized"
@@ -54,7 +55,7 @@ after 100
54send -- "exit\r" 55send -- "exit\r"
55sleep 3 56sleep 3
56 57
57send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244\r" 58send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --dns=8.8.8.8 --dns=8.8.4.4\r"
58expect { 59expect {
59 timeout {puts "TESTING ERROR 0\n";exit} 60 timeout {puts "TESTING ERROR 0\n";exit}
60 "Child process initialized" 61 "Child process initialized"
@@ -101,99 +102,101 @@ sleep 3
101# 102#
102# O 103# O
103# 104#
104send -- "firejail --noprofile --net=eth0 --overlay\r" 105if { $overlay == "overlay" } {
105expect { 106 send -- "firejail --noprofile --net=eth0 --overlay --dns=8.8.8.8 --dns=8.8.4.4\r"
106 timeout {puts "TESTING ERROR 2\n";exit} 107 expect {
107 "Child process initialized" 108 timeout {puts "TESTING ERROR 2\n";exit}
108} 109 "Child process initialized"
109sleep 1 110 }
110 111 sleep 1
111send -- "dig google.com\r" 112
112expect { 113 send -- "dig google.com\r"
113 timeout {puts "TESTING ERROR 3\n";exit} 114 expect {
114 "ANSWER SECTION" 115 timeout {puts "TESTING ERROR 3\n";exit}
115} 116 "ANSWER SECTION"
116expect { 117 }
117 timeout {puts "TESTING ERROR 3.1\n";exit} 118 expect {
118 "google.com" 119 timeout {puts "TESTING ERROR 3.1\n";exit}
119} 120 "google.com"
120expect { 121 }
121 timeout {puts "TESTING ERROR 3.3\n";exit} 122 expect {
122 "SERVER" 123 timeout {puts "TESTING ERROR 3.3\n";exit}
123} 124 "SERVER"
124after 100 125 }
125 126 after 100
126send -- "/sbin/ifconfig\r" 127
127expect { 128 send -- "/sbin/ifconfig\r"
128 timeout {puts "TESTING ERROR 3.4\n";exit} 129 expect {
129 "eth0" 130 timeout {puts "TESTING ERROR 3.4\n";exit}
130} 131 "eth0"
131expect { 132 }
132 timeout {puts "TESTING ERROR 3.5\n";exit} 133 expect {
133 "Link" 134 timeout {puts "TESTING ERROR 3.5\n";exit}
134} 135 "Link"
135expect { 136 }
136 timeout {puts "TESTING ERROR 3.6\n";exit} 137 expect {
137 "192.168.1" 138 timeout {puts "TESTING ERROR 3.6\n";exit}
138} 139 "192.168.1"
139expect { 140 }
140 timeout {puts "TESTING ERROR 3.7\n";exit} 141 expect {
141 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" 142 timeout {puts "TESTING ERROR 3.7\n";exit}
142} 143 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
143after 100 144 }
144 145 after 100
145send -- "exit\r" 146
146sleep 3 147 send -- "exit\r"
147 148 sleep 3
148send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay\r" 149
149expect { 150 send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay --dns=8.8.8.8 --dns=8.8.4.4\r"
150 timeout {puts "TESTING ERROR 2\n";exit} 151 expect {
151 "Child process initialized" 152 timeout {puts "TESTING ERROR 2\n";exit}
152} 153 "Child process initialized"
153sleep 1 154 }
154 155 sleep 1
155send -- "dig google.com\r" 156
156expect { 157 send -- "dig google.com\r"
157 timeout {puts "TESTING ERROR 3\n";exit} 158 expect {
158 "ANSWER SECTION" 159 timeout {puts "TESTING ERROR 3\n";exit}
160 "ANSWER SECTION"
161 }
162 expect {
163 timeout {puts "TESTING ERROR 3.1\n";exit}
164 "google.com"
165 }
166 expect {
167 timeout {puts "TESTING ERROR 3.3\n";exit}
168 "SERVER"
169 }
170 after 100
171
172 send -- "/sbin/ifconfig\r"
173 expect {
174 timeout {puts "TESTING ERROR 3.4\n";exit}
175 "eth0"
176 }
177 expect {
178 timeout {puts "TESTING ERROR 3.5\n";exit}
179 "Link"
180 }
181 expect {
182 timeout {puts "TESTING ERROR 3.6\n";exit}
183 "192.168.1.244"
184 }
185 expect {
186 timeout {puts "TESTING ERROR 3.7\n";exit}
187 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
188 }
189 after 100
190
191 send -- "exit\r"
192 sleep 3
159} 193}
160expect {
161 timeout {puts "TESTING ERROR 3.1\n";exit}
162 "google.com"
163}
164expect {
165 timeout {puts "TESTING ERROR 3.3\n";exit}
166 "SERVER"
167}
168after 100
169
170send -- "/sbin/ifconfig\r"
171expect {
172 timeout {puts "TESTING ERROR 3.4\n";exit}
173 "eth0"
174}
175expect {
176 timeout {puts "TESTING ERROR 3.5\n";exit}
177 "Link"
178}
179expect {
180 timeout {puts "TESTING ERROR 3.6\n";exit}
181 "192.168.1.244"
182}
183expect {
184 timeout {puts "TESTING ERROR 3.7\n";exit}
185 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
186}
187after 100
188
189send -- "exit\r"
190sleep 3
191 194
192 195
193# 196#
194# C 197# C
195# 198#
196send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot\r" 199send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
197expect { 200expect {
198 timeout {puts "TESTING ERROR 4\n";exit} 201 timeout {puts "TESTING ERROR 4\n";exit}
199 "Child process initialized" 202 "Child process initialized"
@@ -237,7 +240,7 @@ after 100
237send -- "exit\r" 240send -- "exit\r"
238sleep 3 241sleep 3
239 242
240send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot\r" 243send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
241expect { 244expect {
242 timeout {puts "TESTING ERROR 4\n";exit} 245 timeout {puts "TESTING ERROR 4\n";exit}
243 "Child process initialized" 246 "Child process initialized"
diff --git a/test/features/2.4.exp b/test/features/2.4.exp
index a995322b9..424d4fead 100755
--- a/test/features/2.4.exp
+++ b/test/features/2.4.exp
@@ -7,6 +7,7 @@
7set timeout 10 7set timeout 10
8spawn $env(SHELL) 8spawn $env(SHELL)
9match_max 100000 9match_max 100000
10set overlay [lindex $argv 0]
10 11
11# 12#
12# N 13# N
@@ -89,80 +90,81 @@ sleep 1
89# 90#
90# O 91# O
91# 92#
92send -- "firejail --noprofile --net=br0 --overlay\r" 93if { $overlay == "overlay" } {
93expect { 94 send -- "firejail --noprofile --net=br0 --overlay\r"
94 timeout {puts "TESTING ERROR 2\n";exit} 95 expect {
95 "Child process initialized" 96 timeout {puts "TESTING ERROR 2\n";exit}
96} 97 "Child process initialized"
97sleep 1 98 }
98 99 sleep 1
99send -- "ping -c 3 10.10.20.1\r" 100
100expect { 101 send -- "ping -c 3 10.10.20.1\r"
101 timeout {puts "TESTING ERROR 3\n";exit} 102 expect {
102 " packets transmitted, 3 received, 0% packet loss" 103 timeout {puts "TESTING ERROR 3\n";exit}
103} 104 " packets transmitted, 3 received, 0% packet loss"
104sleep 1 105 }
105 106 sleep 1
106 107
107send -- "/sbin/ifconfig\r" 108
108expect { 109 send -- "/sbin/ifconfig\r"
109 timeout {puts "TESTING ERROR 3.4\n";exit} 110 expect {
110 "eth0" 111 timeout {puts "TESTING ERROR 3.4\n";exit}
112 "eth0"
113 }
114 expect {
115 timeout {puts "TESTING ERROR 3.5\n";exit}
116 "Link"
117 }
118 expect {
119 timeout {puts "TESTING ERROR 3.6\n";exit}
120 "10.10.20"
121 }
122 expect {
123 timeout {puts "TESTING ERROR 3.7\n";exit}
124 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
125 }
126 after 100
127
128 send -- "exit\r"
129 sleep 1
130
131 send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --overlay\r"
132 expect {
133 timeout {puts "TESTING ERROR 2\n";exit}
134 "Child process initialized"
135 }
136 sleep 1
137
138 send -- "ping -c 3 10.10.20.1\r"
139 expect {
140 timeout {puts "TESTING ERROR 3\n";exit}
141 " packets transmitted, 3 received, 0% packet loss"
142 }
143 sleep 1
144
145
146 send -- "/sbin/ifconfig\r"
147 expect {
148 timeout {puts "TESTING ERROR 3.4\n";exit}
149 "eth0"
150 }
151 expect {
152 timeout {puts "TESTING ERROR 3.5\n";exit}
153 "Link"
154 }
155 expect {
156 timeout {puts "TESTING ERROR 3.6\n";exit}
157 "10.10.20.4"
158 }
159 expect {
160 timeout {puts "TESTING ERROR 3.7\n";exit}
161 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
162 }
163 after 100
164
165 send -- "exit\r"
166 sleep 1
111} 167}
112expect {
113 timeout {puts "TESTING ERROR 3.5\n";exit}
114 "Link"
115}
116expect {
117 timeout {puts "TESTING ERROR 3.6\n";exit}
118 "10.10.20"
119}
120expect {
121 timeout {puts "TESTING ERROR 3.7\n";exit}
122 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
123}
124after 100
125
126send -- "exit\r"
127sleep 1
128
129send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --overlay\r"
130expect {
131 timeout {puts "TESTING ERROR 2\n";exit}
132 "Child process initialized"
133}
134sleep 1
135
136send -- "ping -c 3 10.10.20.1\r"
137expect {
138 timeout {puts "TESTING ERROR 3\n";exit}
139 " packets transmitted, 3 received, 0% packet loss"
140}
141sleep 1
142
143
144send -- "/sbin/ifconfig\r"
145expect {
146 timeout {puts "TESTING ERROR 3.4\n";exit}
147 "eth0"
148}
149expect {
150 timeout {puts "TESTING ERROR 3.5\n";exit}
151 "Link"
152}
153expect {
154 timeout {puts "TESTING ERROR 3.6\n";exit}
155 "10.10.20.4"
156}
157expect {
158 timeout {puts "TESTING ERROR 3.7\n";exit}
159 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
160}
161after 100
162
163send -- "exit\r"
164sleep 1
165
166 168
167 169
168# 170#
diff --git a/test/features/2.5.exp b/test/features/2.5.exp
index 4ba1f5a28..e189f145b 100755
--- a/test/features/2.5.exp
+++ b/test/features/2.5.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -41,33 +42,35 @@ sleep 1
41# 42#
42# O 43# O
43# 44#
44send -- "firejail --noprofile --overlay --interface=eth0.6\r" 45if { $overlay == "overlay" } {
45expect { 46 send -- "firejail --noprofile --overlay --interface=eth0.6\r"
46 timeout {puts "TESTING ERROR 2\n";exit} 47 expect {
47 "Child process initialized" 48 timeout {puts "TESTING ERROR 2\n";exit}
48} 49 "Child process initialized"
49sleep 1 50 }
50 51 sleep 1
51send -- "/sbin/ifconfig\r" 52
52expect { 53 send -- "/sbin/ifconfig\r"
53 timeout {puts "TESTING ERROR 3.4\n";exit} 54 expect {
54 "eth0.6" 55 timeout {puts "TESTING ERROR 3.4\n";exit}
55} 56 "eth0.6"
56expect { 57 }
57 timeout {puts "TESTING ERROR 3.5n";exit} 58 expect {
58 "Link" 59 timeout {puts "TESTING ERROR 3.5n";exit}
59} 60 "Link"
60expect { 61 }
61 timeout {puts "TESTING ERROR 3.6\n";exit} 62 expect {
62 "10.10.206.10" 63 timeout {puts "TESTING ERROR 3.6\n";exit}
64 "10.10.206.10"
65 }
66 expect {
67 timeout {puts "TESTING ERROR 3.7\n";exit}
68 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
69 }
70 after 100
71 send -- "exit\r"
72 sleep 1
63} 73}
64expect {
65 timeout {puts "TESTING ERROR 3.7\n";exit}
66 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
67}
68after 100
69send -- "exit\r"
70sleep 1
71 74
72# 75#
73# C 76# C
diff --git a/test/features/2.6.exp b/test/features/2.6.exp
index dc2381393..77bd8cab0 100755
--- a/test/features/2.6.exp
+++ b/test/features/2.6.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -29,21 +30,23 @@ sleep 1
29# 30#
30# O 31# O
31# 32#
32send -- "firejail --noprofile --overlay --net=eth0 --defaultgw=192.168.1.10\r" 33if { $overlay == "overlay" } {
33expect { 34 send -- "firejail --noprofile --overlay --net=eth0 --defaultgw=192.168.1.10\r"
34 timeout {puts "TESTING ERROR 2\n";exit} 35 expect {
35 "Child process initialized" 36 timeout {puts "TESTING ERROR 2\n";exit}
37 "Child process initialized"
38 }
39 sleep 1
40
41 send -- "netstat -rn\r"
42 expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "0.0.0.0 192.168.1.10"
45 }
46 after 100
47 send -- "exit\r"
48 sleep 1
36} 49}
37sleep 1
38
39send -- "netstat -rn\r"
40expect {
41 timeout {puts "TESTING ERROR 3\n";exit}
42 "0.0.0.0 192.168.1.10"
43}
44after 100
45send -- "exit\r"
46sleep 1
47 50
48# 51#
49# C 52# C
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
index 6abbf94a5..13ec1b6be 100755
--- a/test/features/3.1.exp
+++ b/test/features/3.1.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -31,21 +32,23 @@ sleep 1
31# 32#
32# O 33# O
33# 34#
34send -- "firejail --noprofile --overlay --tmpfs=/home/netblue/.config\r" 35if { $overlay == "overlay" } {
35expect { 36 send -- "firejail --noprofile --overlay --tmpfs=/home/netblue/.config\r"
36 timeout {puts "TESTING ERROR 2\n";exit} 37 expect {
37 "Child process initialized" 38 timeout {puts "TESTING ERROR 2\n";exit}
39 "Child process initialized"
40 }
41 sleep 1
42
43 send -- "ls ~/.config | wc -l\r"
44 expect {
45 timeout {puts "TESTING ERROR 3\n";exit}
46 "0"
47 }
48 after 100
49 send -- "exit\r"
50 sleep 1
38} 51}
39sleep 1
40
41send -- "ls ~/.config | wc -l\r"
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "0"
45}
46after 100
47send -- "exit\r"
48sleep 1
49 52
50# 53#
51# C 54# C
diff --git a/test/features/3.2.exp b/test/features/3.2.exp
index 44d9b73f3..49d8d27c1 100755
--- a/test/features/3.2.exp
+++ b/test/features/3.2.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -31,21 +32,23 @@ sleep 1
31# 32#
32# O 33# O
33# 34#
34send -- "firejail --noprofile --overlay --read-only=/home/netblue/.config\r" 35if { $overlay == "overlay" } {
35expect { 36 send -- "firejail --noprofile --overlay --read-only=/home/netblue/.config\r"
36 timeout {puts "TESTING ERROR 2\n";exit} 37 expect {
37 "Child process initialized" 38 timeout {puts "TESTING ERROR 2\n";exit}
39 "Child process initialized"
40 }
41 sleep 1
42
43 send -- "touch ~/.config/firejail-test-file\r"
44 expect {
45 timeout {puts "TESTING ERROR 3\n";exit}
46 "Read-only file system"
47 }
48 after 100
49 send -- "exit\r"
50 sleep 1
38} 51}
39sleep 1
40
41send -- "touch ~/.config/firejail-test-file\r"
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "Read-only file system"
45}
46after 100
47send -- "exit\r"
48sleep 1
49 52
50# 53#
51# C 54# C
diff --git a/test/features/3.3.exp b/test/features/3.3.exp
index 432a135d7..a53a4ade5 100755
--- a/test/features/3.3.exp
+++ b/test/features/3.3.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -30,21 +31,23 @@ sleep 1
30# 31#
31# O 32# O
32# 33#
33send -- "firejail --noprofile --overlay --blacklist=/home/netblue/.config\r" 34if { $overlay == "overlay" } {
34expect { 35 send -- "firejail --noprofile --overlay --blacklist=/home/netblue/.config\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 36 expect {
36 "Child process initialized" 37 timeout {puts "TESTING ERROR 2\n";exit}
38 "Child process initialized"
39 }
40 sleep 1
41
42 send -- "cd ~/.config\r"
43 expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "Permission denied"
46 }
47 after 100
48 send -- "exit\r"
49 sleep 1
37} 50}
38sleep 1
39
40send -- "cd ~/.config\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "Permission denied"
44}
45after 100
46send -- "exit\r"
47sleep 1
48 51
49# 52#
50# C 53# C
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
index bc6e10733..da6dd3ff0 100755
--- a/test/features/3.4.exp
+++ b/test/features/3.4.exp
@@ -6,6 +6,7 @@
6set timeout 10 6set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set overlay [lindex $argv 0]
9 10
10# 11#
11# N 12# N
@@ -30,21 +31,23 @@ sleep 1
30# 31#
31# O 32# O
32# 33#
33send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r" 34if { $overlay == "overlay" } {
34expect { 35 send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r"
35 timeout {puts "TESTING ERROR 2\n";exit} 36 expect {
36 "Child process initialized" 37 timeout {puts "TESTING ERROR 2\n";exit}
37} 38 "Child process initialized"
38sleep 1 39 }
39 40 sleep 1
40send -- "ls -al ~/. | wc -l\r" 41
41expect { 42 send -- "ls -al ~/. | wc -l\r"
42 timeout {puts "TESTING ERROR 1\n";exit} 43 expect {
43 "6" 44 timeout {puts "TESTING ERROR 1\n";exit}
45 "6"
46 }
47 after 100
48 send -- "exit\r"
49 sleep 1
44} 50}
45after 100
46send -- "exit\r"
47sleep 1
48 51
49# 52#
50# C 53# C
diff --git a/test/features/test.sh b/test/features/test.sh
index e49dfc3f0..b600cec31 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -1,4 +1,21 @@
1#!/bin/bash 1#!/bin/bash
2OVERLAY="overlay"
3
4while [ $# -gt 0 ]; do # Until you run out of parameters . . .
5 case "$1" in
6 --nooverlay)
7 OVERLAY=""
8 ;;
9 --help)
10 echo "./test.sh [--nooverlay|--help] | grep TESTING"
11 exit
12 ;;
13 esac
14 shift # Check next set of parameters.
15done
16
17
18
2 19
3# 20#
4# Feature testing 21# Feature testing
@@ -6,57 +23,57 @@
6 23
7# Default features 24# Default features
8echo "TESTING: 1.1 disable /boot" 25echo "TESTING: 1.1 disable /boot"
9./1.1.exp 26./1.1.exp $OVERLAY
10 27
11echo "TESTING: 1.2 new /proc" 28echo "TESTING: 1.2 new /proc"
12./1.2.exp 29./1.2.exp $OVERLAY
13 30
14echo "TESTING: 1.4 mask other users" 31echo "TESTING: 1.4 mask other users"
15./1.4.exp 32./1.4.exp $OVERLAY
16 33
17echo "TESTING: 1.5 PID namespace" 34echo "TESTING: 1.5 PID namespace"
18./1.5.exp 35./1.5.exp $OVERLAY
19 36
20echo "TESTING: 1.6 new /var/log" 37echo "TESTING: 1.6 new /var/log"
21./1.6.exp 38./1.6.exp $OVERLAY
22 39
23echo "TESTING: 1.7 new /var/tmp" 40echo "TESTING: 1.7 new /var/tmp"
24./1.7.exp 41./1.7.exp $OVERLAY
25 42
26echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail" 43echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail"
27./1.8.exp 44./1.8.exp $OVERLAY
28 45
29echo "TESTING: 1.10 disable /selinux" 46echo "TESTING: 1.10 disable /selinux"
30./1.10.exp 47./1.10.exp $OVERLAY
31 48
32# networking features 49# networking features
33echo "TESTING: 2.1 hostname" 50echo "TESTING: 2.1 hostname"
34./2.1.exp 51./2.1.exp $OVERLAY
35 52
36echo "TESTING: 2.2 DNS" 53echo "TESTING: 2.2 DNS"
37./2.2.exp 54./2.2.exp $OVERLAY
38 55
39echo "TESTING: 2.3 mac-vlan" 56echo "TESTING: 2.3 mac-vlan"
40./2.3.exp 57./2.3.exp $OVERLAY
41 58
42echo "TESTING: 2.4 bridge" 59echo "TESTING: 2.4 bridge"
43./2.4.exp 60./2.4.exp $OVERLAY
44 61
45echo "TESTING: 2.5 interface" 62echo "TESTING: 2.5 interface"
46./2.5.exp 63./2.5.exp $OVERLAY
47 64
48echo "TESTING: 2.6 Default gateway" 65echo "TESTING: 2.6 Default gateway"
49./2.6.exp 66./2.6.exp $OVERLAY
50 67
51echo "TESTING: 3.1 tmpfs" 68echo "TESTING: 3.1 tmpfs"
52./3.1.exp 69./3.1.exp $OVERLAY
53 70
54echo "TESTING: 3.2 read-only" 71echo "TESTING: 3.2 read-only"
55./3.2.exp 72./3.2.exp $OVERLAY
56 73
57echo "TESTING: 3.3 blacklist" 74echo "TESTING: 3.3 blacklist"
58./3.3.exp 75./3.3.exp $OVERLAY
59 76
60echo "TESTING: 3.4 whitelist" 77echo "TESTING: 3.4 whitelist"
61./3.4.exp 78./3.4.exp $OVERLAY
62 79