summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 08:44:40 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 08:44:40 -0500
commite7486b39795847043cd16c55a1c8142770c77de8 (patch)
treed0f11ceffdbfde9c792ab856016d4219acfc21b2
parent0.9.38 testing (diff)
downloadfirejail-e7486b39795847043cd16c55a1c8142770c77de8.tar.gz
firejail-e7486b39795847043cd16c55a1c8142770c77de8.tar.zst
firejail-e7486b39795847043cd16c55a1c8142770c77de8.zip
0.9.38 testing
-rwxr-xr-xtest/features/1.2.exp16
-rwxr-xr-xtest/features/3.1.exp117
-rwxr-xr-xtest/features/3.4.exp143
-rw-r--r--test/features/features.txt4
-rwxr-xr-xtest/features/test.sh2
-rwxr-xr-xtest/invalid_filename.exp16
-rwxr-xr-xtest/private-keep.exp192
-rwxr-xr-xtest/test.sh25
8 files changed, 246 insertions, 269 deletions
diff --git a/test/features/1.2.exp b/test/features/1.2.exp
index fe61bf482..65fcd54ae 100755
--- a/test/features/1.2.exp
+++ b/test/features/1.2.exp
@@ -69,10 +69,6 @@ if { $overlay == "overlay" } {
69 timeout {puts "TESTING ERROR 3.1\n";exit} 69 timeout {puts "TESTING ERROR 3.1\n";exit}
70 "proc /proc proc" 70 "proc /proc proc"
71 } 71 }
72# expect {
73# timeout {puts "TESTING ERROR 3.2\n";exit}
74# "proc /proc proc"
75# }
76 expect { 72 expect {
77 timeout {puts "TESTING ERROR 3.3\n";exit} 73 timeout {puts "TESTING ERROR 3.3\n";exit}
78 "proc /proc/sys proc" 74 "proc /proc/sys proc"
@@ -115,10 +111,6 @@ if { $chroot == "chroot" } {
115 "proc /proc proc" 111 "proc /proc proc"
116 } 112 }
117 expect { 113 expect {
118 timeout {puts "TESTING ERROR 5.2\n";exit}
119 "proc /proc proc"
120 }
121 expect {
122 timeout {puts "TESTING ERROR 5.3\n";exit} 114 timeout {puts "TESTING ERROR 5.3\n";exit}
123 "proc /proc/sys proc" 115 "proc /proc/sys proc"
124 } 116 }
@@ -126,10 +118,10 @@ if { $chroot == "chroot" } {
126 timeout {puts "TESTING ERROR 5.4\n";exit} 118 timeout {puts "TESTING ERROR 5.4\n";exit}
127 "proc /proc/sysrq-trigger proc" 119 "proc /proc/sysrq-trigger proc"
128 } 120 }
129 expect { 121# expect {
130 timeout {puts "TESTING ERROR 5.5\n";exit} 122# timeout {puts "TESTING ERROR 5.5\n";exit}
131 "proc /proc/sys/kernel/hotplug" 123# "proc /proc/sys/kernel/hotplug"
132 } 124# }
133 expect { 125 expect {
134 timeout {puts "TESTING ERROR 5.6\n";exit} 126 timeout {puts "TESTING ERROR 5.6\n";exit}
135 "proc /proc/irq proc" 127 "proc /proc/irq proc"
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
index bcac4bf04..52a929651 100755
--- a/test/features/3.1.exp
+++ b/test/features/3.1.exp
@@ -12,20 +12,49 @@ set chroot [lindex $argv 1]
12# 12#
13# N 13# N
14# 14#
15send -- "touch ~/.config/firejail-test-file\r" 15send -- "firejail --noprofile --private\r"
16sleep 1
17send -- "firejail --noprofile --tmpfs=/home/netblue/.config\r"
18expect { 16expect {
19 timeout {puts "TESTING ERROR 0\n";exit} 17 timeout {puts "TESTING ERROR 0\n";exit}
20 "Child process initialized" 18 "Child process initialized"
21} 19}
22sleep 1 20sleep 1
23 21
24send -- "ls ~/.config | wc -l\r" 22send -- "ls -al | wc -l\r"
23expect {
24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "5"
26}
27
28send -- "ls -al .bashrc\r"
29expect {
30 timeout {puts "TESTING ERROR 1.2\n";exit}
31 "netblue"
32}
33expect {
34 timeout {puts "TESTING ERROR 1.3\n";exit}
35 "netblue"
36}
37expect {
38 timeout {puts "TESTING ERROR 1.4\n";exit}
39 ".bashrc"
40}
41
42send -- "ls -al .Xauthority\r"
43expect {
44 timeout {puts "TESTING ERROR 1.5\n";exit}
45 "netblue"
46}
25expect { 47expect {
26 timeout {puts "TESTING ERROR 1\n";exit} 48 timeout {puts "TESTING ERROR 1.6\n";exit}
27 "0" 49 "netblue"
28} 50}
51expect {
52 timeout {puts "TESTING ERROR 1.7\n";exit}
53 ".Xauthority"
54}
55
56
57
29after 100 58after 100
30send -- "exit\r" 59send -- "exit\r"
31sleep 1 60sleep 1
@@ -34,18 +63,47 @@ sleep 1
34# O 63# O
35# 64#
36if { $overlay == "overlay" } { 65if { $overlay == "overlay" } {
37 send -- "firejail --noprofile --overlay --tmpfs=/home/netblue/.config\r" 66 send -- "firejail --noprofile --overlay --private\r"
38 expect { 67 expect {
39 timeout {puts "TESTING ERROR 2\n";exit} 68 timeout {puts "TESTING ERROR 2\n";exit}
40 "Child process initialized" 69 "Child process initialized"
41 } 70 }
42 sleep 1 71 sleep 1
43 72
44 send -- "ls ~/.config | wc -l\r" 73 send -- "ls -al | wc -l\r"
74 expect {
75 timeout {puts "TESTING ERROR 3.1\n";exit}
76 "5"
77 }
78
79 send -- "ls -al .bashrc\r"
80 expect {
81 timeout {puts "TESTING ERROR 3.2\n";exit}
82 "netblue"
83 }
84 expect {
85 timeout {puts "TESTING ERROR 3.3\n";exit}
86 "netblue"
87 }
45 expect { 88 expect {
46 timeout {puts "TESTING ERROR 3\n";exit} 89 timeout {puts "TESTING ERROR 3.4\n";exit}
47 "0" 90 ".bashrc"
48 } 91 }
92
93 send -- "ls -al .Xauthority\r"
94 expect {
95 timeout {puts "TESTING ERROR 3.5\n";exit}
96 "netblue"
97 }
98 expect {
99 timeout {puts "TESTING ERROR 3.6\n";exit}
100 "netblue"
101 }
102 expect {
103 timeout {puts "TESTING ERROR 3.7\n";exit}
104 ".Xauthority"
105 }
106
49 after 100 107 after 100
50 send -- "exit\r" 108 send -- "exit\r"
51 sleep 1 109 sleep 1
@@ -55,20 +113,47 @@ if { $overlay == "overlay" } {
55# C 113# C
56# 114#
57if { $chroot == "chroot" } { 115if { $chroot == "chroot" } {
58 send -- "touch /tmp/chroot/home/netblue/.config/firejail-test-file\r" 116 send -- "firejail --noprofile --chroot=/tmp/chroot --private\r"
59 sleep 1
60 send -- "firejail --noprofile --chroot=/tmp/chroot --tmpfs=/home/netblue/.config\r"
61 expect { 117 expect {
62 timeout {puts "TESTING ERROR 4\n";exit} 118 timeout {puts "TESTING ERROR 4\n";exit}
63 "Child process initialized" 119 "Child process initialized"
64 } 120 }
65 sleep 1 121 sleep 1
66 122
67 send -- "ls ~/.config | wc -l\r" 123 send -- "ls -al | wc -l\r"
124 expect {
125 timeout {puts "TESTING ERROR 5.1\n";exit}
126 "5"
127 }
128
129 send -- "ls -al .bashrc\r"
68 expect { 130 expect {
69 timeout {puts "TESTING ERROR 5\n";exit} 131 timeout {puts "TESTING ERROR 5.2\n";exit}
70 "0" 132 "netblue"
71 } 133 }
134 expect {
135 timeout {puts "TESTING ERROR 5.3\n";exit}
136 "netblue"
137 }
138 expect {
139 timeout {puts "TESTING ERROR 5.4\n";exit}
140 ".bashrc"
141 }
142
143 send -- "ls -al .Xauthority\r"
144 expect {
145 timeout {puts "TESTING ERROR 5.5\n";exit}
146 "netblue"
147 }
148 expect {
149 timeout {puts "TESTING ERROR 5.6\n";exit}
150 "netblue"
151 }
152 expect {
153 timeout {puts "TESTING ERROR 5.7\n";exit}
154 ".Xauthority"
155 }
156
72 after 100 157 after 100
73 send -- "exit\r" 158 send -- "exit\r"
74 sleep 1 159 sleep 1
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
index f81dc6e0a..996312334 100755
--- a/test/features/3.4.exp
+++ b/test/features/3.4.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# 2#
3# whitelist 3# whitelist home
4# 4#
5 5
6set timeout 10 6set timeout 10
@@ -19,11 +19,54 @@ expect {
19} 19}
20sleep 1 20sleep 1
21 21
22send -- "ls -al ~/. | wc -l\r" 22send -- "ls -al | wc -l\r"
23expect { 23expect {
24 timeout {puts "TESTING ERROR 1\n";exit} 24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "6" 25 "6"
26} 26}
27
28send -- "ls -al .bashrc\r"
29expect {
30 timeout {puts "TESTING ERROR 1.2\n";exit}
31 "netblue"
32}
33expect {
34 timeout {puts "TESTING ERROR 1.3\n";exit}
35 "netblue"
36}
37expect {
38 timeout {puts "TESTING ERROR 1.4\n";exit}
39 ".bashrc"
40}
41
42send -- "ls -al .Xauthority\r"
43expect {
44 timeout {puts "TESTING ERROR 1.5\n";exit}
45 "netblue"
46}
47expect {
48 timeout {puts "TESTING ERROR 1.6\n";exit}
49 "netblue"
50}
51expect {
52 timeout {puts "TESTING ERROR 1.7\n";exit}
53 ".Xauthority"
54}
55
56send -- "ls -al | grep config\r"
57expect {
58 timeout {puts "TESTING ERROR 1.8\n";exit}
59 "netblue"
60}
61expect {
62 timeout {puts "TESTING ERROR 1.9\n";exit}
63 "netblue"
64}
65expect {
66 timeout {puts "TESTING ERROR 1.10\n";exit}
67 ".config"
68}
69
27after 100 70after 100
28send -- "exit\r" 71send -- "exit\r"
29sleep 1 72sleep 1
@@ -40,11 +83,54 @@ if { $overlay == "overlay" } {
40 } 83 }
41 sleep 1 84 sleep 1
42 85
43 send -- "ls -al ~/. | wc -l\r" 86 send -- "ls -al | wc -l\r"
44 expect { 87 expect {
45 timeout {puts "TESTING ERROR 1\n";exit} 88 timeout {puts "TESTING ERROR 3.1\n";exit}
46 "6" 89 "6"
47 } 90 }
91
92 send -- "ls -al .bashrc\r"
93 expect {
94 timeout {puts "TESTING ERROR 3.2\n";exit}
95 "netblue"
96 }
97 expect {
98 timeout {puts "TESTING ERROR 3.3\n";exit}
99 "netblue"
100 }
101 expect {
102 timeout {puts "TESTING ERROR 3.4\n";exit}
103 ".bashrc"
104 }
105
106 send -- "ls -al .Xauthority\r"
107 expect {
108 timeout {puts "TESTING ERROR 3.5\n";exit}
109 "netblue"
110 }
111 expect {
112 timeout {puts "TESTING ERROR 3.6\n";exit}
113 "netblue"
114 }
115 expect {
116 timeout {puts "TESTING ERROR 3.7\n";exit}
117 ".Xauthority"
118 }
119
120 send -- "ls -al | grep config\r"
121 expect {
122 timeout {puts "TESTING ERROR 3.8\n";exit}
123 "netblue"
124 }
125 expect {
126 timeout {puts "TESTING ERROR 3.9\n";exit}
127 "netblue"
128 }
129 expect {
130 timeout {puts "TESTING ERROR 3.10\n";exit}
131 ".config"
132 }
133
48 after 100 134 after 100
49 send -- "exit\r" 135 send -- "exit\r"
50 sleep 1 136 sleep 1
@@ -61,11 +147,54 @@ if { $chroot == "chroot" } {
61 } 147 }
62 sleep 1 148 sleep 1
63 149
64 send -- "ls -al ~/. | wc -l\r" 150 send -- "ls -al | wc -l\r"
65 expect { 151 expect {
66 timeout {puts "TESTING ERROR 1\n";exit} 152 timeout {puts "TESTING ERROR 5.1\n";exit}
67 "6" 153 "6"
68 } 154 }
155
156 send -- "ls -al .bashrc\r"
157 expect {
158 timeout {puts "TESTING ERROR 5.2\n";exit}
159 "netblue"
160 }
161 expect {
162 timeout {puts "TESTING ERROR 5.3\n";exit}
163 "netblue"
164 }
165 expect {
166 timeout {puts "TESTING ERROR 5.4\n";exit}
167 ".bashrc"
168 }
169
170 send -- "ls -al .Xauthority\r"
171 expect {
172 timeout {puts "TESTING ERROR 5.5\n";exit}
173 "netblue"
174 }
175 expect {
176 timeout {puts "TESTING ERROR 5.6\n";exit}
177 "netblue"
178 }
179 expect {
180 timeout {puts "TESTING ERROR 5.7\n";exit}
181 ".Xauthority"
182 }
183
184 send -- "ls -al | grep config\r"
185 expect {
186 timeout {puts "TESTING ERROR 5.8\n";exit}
187 "netblue"
188 }
189 expect {
190 timeout {puts "TESTING ERROR 5.9\n";exit}
191 "netblue"
192 }
193 expect {
194 timeout {puts "TESTING ERROR 5.10\n";exit}
195 ".config"
196 }
197
69 after 100 198 after 100
70 send -- "exit\r" 199 send -- "exit\r"
71 sleep 1 200 sleep 1
diff --git a/test/features/features.txt b/test/features/features.txt
index d372d2f7a..1dedff357 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -69,7 +69,7 @@ C - chroot filesystem
69 69
703. Filesystem features (use --noprofile) 703. Filesystem features (use --noprofile)
71 71
723.1 tmpfs 723.1 private
733.2 read-only 733.2 read-only
743.3 blacklist 743.3 blacklist
753.4 whitelist 753.4 whitelist home
diff --git a/test/features/test.sh b/test/features/test.sh
index d4bcead0b..56b6289b4 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -83,7 +83,7 @@ fi
83#################### 83####################
84# filesystem features 84# filesystem features
85#################### 85####################
86echo "TESTING: 3.1 tmpfs" 86echo "TESTING: 3.1 private"
87./3.1.exp $OVERLAY $CHROOT 87./3.1.exp $OVERLAY $CHROOT
88 88
89echo "TESTING: 3.2 read-only" 89echo "TESTING: 3.2 read-only"
diff --git a/test/invalid_filename.exp b/test/invalid_filename.exp
index 26563aa43..dd1fa4634 100755
--- a/test/invalid_filename.exp
+++ b/test/invalid_filename.exp
@@ -124,22 +124,6 @@ expect {
124} 124}
125after 100 125after 100
126 126
127send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r"
128expect {
129 timeout {puts "TESTING ERROR 8.1\n";exit}
130 "Checking filename bla&&bla"
131}
132expect {
133 timeout {puts "TESTING ERROR 8.2\n";exit}
134 "Error:"
135}
136expect {
137 timeout {puts "TESTING ERROR 8.3\n";exit}
138 "is an invalid filename"
139}
140after 100
141
142
143send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" 127send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r"
144expect { 128expect {
145 timeout {puts "TESTING ERROR 9.1\n";exit} 129 timeout {puts "TESTING ERROR 9.1\n";exit}
diff --git a/test/private-keep.exp b/test/private-keep.exp
deleted file mode 100755
index 163aa2741..000000000
--- a/test/private-keep.exp
+++ /dev/null
@@ -1,192 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7#**************************************************************
8send -- "firejail --noprofile --private-home=.mozilla,.config/firejail\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "Child process initialized"
12}
13sleep 1
14
15send -- "ls -al\r"
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 ".config"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.2\n";exit}
22 ".mozilla"
23}
24sleep 1
25
26send -- "find .config\r"
27expect {
28 timeout {puts "TESTING ERROR 0.3\n";exit}
29 ".config"
30}
31expect {
32 timeout {puts "TESTING ERROR 0.4\n";exit}
33 ".config/firejail"
34}
35sleep 1
36puts "\n"
37send -- "exit\r"
38sleep 2
39
40
41#**************************************************************
42send -- "firejail --profile=private-keep.profile\r"
43expect {
44 timeout {puts "TESTING ERROR 1.0\n";exit}
45 "Child process initialized"
46}
47sleep 1
48
49send -- "ls -al\r"
50expect {
51 timeout {puts "TESTING ERROR 1.1\n";exit}
52 ".config"
53}
54expect {
55 timeout {puts "TESTING ERROR 1.2\n";exit}
56 ".mozilla"
57}
58sleep 1
59
60send -- "find .config\r"
61expect {
62 timeout {puts "TESTING ERROR 1.3\n";exit}
63 ".config"
64}
65expect {
66 timeout {puts "TESTING ERROR 1.4\n";exit}
67 ".config/firejail"
68}
69sleep 1
70puts "\n"
71send -- "exit\r"
72sleep 2
73
74
75#**************************************************************
76send -- "firejail --noprofile --private-home=~/.mozilla,~/.config/firejail\r"
77expect {
78 timeout {puts "TESTING ERROR 2\n";exit}
79 "Child process initialized"
80}
81sleep 1
82
83send -- "ls -al\r"
84expect {
85 timeout {puts "TESTING ERROR 2.1\n";exit}
86 ".config"
87}
88expect {
89 timeout {puts "TESTING ERROR 2.2\n";exit}
90 ".mozilla"
91}
92sleep 1
93
94send -- "find .config\r"
95expect {
96 timeout {puts "TESTING ERROR 2.3\n";exit}
97 ".config"
98}
99expect {
100 timeout {puts "TESTING ERROR 2.4\n";exit}
101 ".config/firejail"
102}
103sleep 1
104puts "\n"
105send -- "exit\r"
106sleep 2
107
108
109#**************************************************************
110send -- "firejail --noprofile --private-home=~/.mozilla,~/.config/firejail\r"
111expect {
112 timeout {puts "TESTING ERROR 3\n";exit}
113 "Child process initialized"
114}
115sleep 1
116
117send -- "ls -al\r"
118expect {
119 timeout {puts "TESTING ERROR 3.1\n";exit}
120 ".config"
121}
122expect {
123 timeout {puts "TESTING ERROR 3.2\n";exit}
124 ".mozilla"
125}
126sleep 1
127
128send -- "find .config\r"
129expect {
130 timeout {puts "TESTING ERROR 3.3\n";exit}
131 ".config"
132}
133expect {
134 timeout {puts "TESTING ERROR 3.4\n";exit}
135 ".config/firejail"
136}
137sleep 1
138puts "\n"
139send -- "exit\r"
140sleep 2
141
142#**************************************************************
143send -- "firejail --noprofile --private-home=/home/netblue/.mozilla,/home/netblue/.config/firejail\r"
144expect {
145 timeout {puts "TESTING ERROR 4\n";exit}
146 "Child process initialized"
147}
148sleep 1
149
150send -- "ls -al\r"
151expect {
152 timeout {puts "TESTING ERROR 4.1\n";exit}
153 ".config"
154}
155expect {
156 timeout {puts "TESTING ERROR 4.2\n";exit}
157 ".mozilla"
158}
159sleep 1
160
161send -- "find .config\r"
162expect {
163 timeout {puts "TESTING ERROR 4.3\n";exit}
164 ".config"
165}
166expect {
167 timeout {puts "TESTING ERROR 4.4\n";exit}
168 ".config/firejail"
169}
170sleep 1
171puts "\n"
172send -- "exit\r"
173sleep 2
174
175#**************************************************************
176send -- "firejail --noprofile --private-home=/home/netblue/../netblue/.mozilla,/home/netblue/.config/firejail\r"
177expect {
178 timeout {puts "TESTING ERROR 5\n";exit}
179 "Error: invalid private-home list"
180}
181sleep 1
182
183#**************************************************************
184send -- "firejail --noprofile --private-home=/root\r"
185expect {
186 timeout {puts "TESTING ERROR 6\n";exit}
187 "Error: only files or directories created by the current user are allowed"
188}
189sleep 1
190
191puts "all done\n"
192
diff --git a/test/test.sh b/test/test.sh
index ad6599848..6273c0a1b 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -190,29 +190,8 @@ mkdir dirprivate
190./private_dir_profile.exp 190./private_dir_profile.exp
191rm -fr dirprivate 191rm -fr dirprivate
192 192
193echo "TESTING: private keep" 193echo "TESTING: overlayfs"
194./private-keep.exp 194./fs_overlay.exp
195
196uname -r | grep "3.18"
197if [ "$?" -eq 0 ];
198then
199 echo "TESTING: overlayfs on 3.18 kernel"
200 ./fs_overlay.exp
201fi
202
203grep "openSUSE" /etc/os-release
204if [ "$?" -eq 0 ];
205then
206 echo "TESTING: overlayfs"
207 ./fs_overlay.exp
208fi
209
210grep "Ubuntu" /etc/os-release
211if [ "$?" -eq 0 ];
212then
213 echo "TESTING: overlayfs"
214 ./fs_overlay.exp
215fi
216 195
217echo "TESTING: seccomp debug" 196echo "TESTING: seccomp debug"
218./seccomp-debug.exp 197./seccomp-debug.exp