diff options
-rwxr-xr-x | test/features/1.2.exp | 16 | ||||
-rwxr-xr-x | test/features/3.1.exp | 117 | ||||
-rwxr-xr-x | test/features/3.4.exp | 143 | ||||
-rw-r--r-- | test/features/features.txt | 4 | ||||
-rwxr-xr-x | test/features/test.sh | 2 | ||||
-rwxr-xr-x | test/invalid_filename.exp | 16 | ||||
-rwxr-xr-x | test/private-keep.exp | 192 | ||||
-rwxr-xr-x | test/test.sh | 25 |
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 | # |
15 | send -- "touch ~/.config/firejail-test-file\r" | 15 | send -- "firejail --noprofile --private\r" |
16 | sleep 1 | ||
17 | send -- "firejail --noprofile --tmpfs=/home/netblue/.config\r" | ||
18 | expect { | 16 | expect { |
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 | } |
22 | sleep 1 | 20 | sleep 1 |
23 | 21 | ||
24 | send -- "ls ~/.config | wc -l\r" | 22 | send -- "ls -al | wc -l\r" |
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
25 | "5" | ||
26 | } | ||
27 | |||
28 | send -- "ls -al .bashrc\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
31 | "netblue" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
35 | "netblue" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
39 | ".bashrc" | ||
40 | } | ||
41 | |||
42 | send -- "ls -al .Xauthority\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
45 | "netblue" | ||
46 | } | ||
25 | expect { | 47 | expect { |
26 | timeout {puts "TESTING ERROR 1\n";exit} | 48 | timeout {puts "TESTING ERROR 1.6\n";exit} |
27 | "0" | 49 | "netblue" |
28 | } | 50 | } |
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
53 | ".Xauthority" | ||
54 | } | ||
55 | |||
56 | |||
57 | |||
29 | after 100 | 58 | after 100 |
30 | send -- "exit\r" | 59 | send -- "exit\r" |
31 | sleep 1 | 60 | sleep 1 |
@@ -34,18 +63,47 @@ sleep 1 | |||
34 | # O | 63 | # O |
35 | # | 64 | # |
36 | if { $overlay == "overlay" } { | 65 | if { $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 | # |
57 | if { $chroot == "chroot" } { | 115 | if { $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 | ||
6 | set timeout 10 | 6 | set timeout 10 |
@@ -19,11 +19,54 @@ expect { | |||
19 | } | 19 | } |
20 | sleep 1 | 20 | sleep 1 |
21 | 21 | ||
22 | send -- "ls -al ~/. | wc -l\r" | 22 | send -- "ls -al | wc -l\r" |
23 | expect { | 23 | expect { |
24 | timeout {puts "TESTING ERROR 1\n";exit} | 24 | timeout {puts "TESTING ERROR 1.1\n";exit} |
25 | "6" | 25 | "6" |
26 | } | 26 | } |
27 | |||
28 | send -- "ls -al .bashrc\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
31 | "netblue" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
35 | "netblue" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
39 | ".bashrc" | ||
40 | } | ||
41 | |||
42 | send -- "ls -al .Xauthority\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
45 | "netblue" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
49 | "netblue" | ||
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
53 | ".Xauthority" | ||
54 | } | ||
55 | |||
56 | send -- "ls -al | grep config\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 1.8\n";exit} | ||
59 | "netblue" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 1.9\n";exit} | ||
63 | "netblue" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 1.10\n";exit} | ||
67 | ".config" | ||
68 | } | ||
69 | |||
27 | after 100 | 70 | after 100 |
28 | send -- "exit\r" | 71 | send -- "exit\r" |
29 | sleep 1 | 72 | sleep 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 | ||
70 | 3. Filesystem features (use --noprofile) | 70 | 3. Filesystem features (use --noprofile) |
71 | 71 | ||
72 | 3.1 tmpfs | 72 | 3.1 private |
73 | 3.2 read-only | 73 | 3.2 read-only |
74 | 3.3 blacklist | 74 | 3.3 blacklist |
75 | 3.4 whitelist | 75 | 3.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 | #################### |
86 | echo "TESTING: 3.1 tmpfs" | 86 | echo "TESTING: 3.1 private" |
87 | ./3.1.exp $OVERLAY $CHROOT | 87 | ./3.1.exp $OVERLAY $CHROOT |
88 | 88 | ||
89 | echo "TESTING: 3.2 read-only" | 89 | echo "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 | } |
125 | after 100 | 125 | after 100 |
126 | 126 | ||
127 | send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r" | ||
128 | expect { | ||
129 | timeout {puts "TESTING ERROR 8.1\n";exit} | ||
130 | "Checking filename bla&&bla" | ||
131 | } | ||
132 | expect { | ||
133 | timeout {puts "TESTING ERROR 8.2\n";exit} | ||
134 | "Error:" | ||
135 | } | ||
136 | expect { | ||
137 | timeout {puts "TESTING ERROR 8.3\n";exit} | ||
138 | "is an invalid filename" | ||
139 | } | ||
140 | after 100 | ||
141 | |||
142 | |||
143 | send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" | 127 | send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" |
144 | expect { | 128 | expect { |
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 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | #************************************************************** | ||
8 | send -- "firejail --noprofile --private-home=.mozilla,.config/firejail\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "ls -al\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
18 | ".config" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
22 | ".mozilla" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "find .config\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
29 | ".config" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
33 | ".config/firejail" | ||
34 | } | ||
35 | sleep 1 | ||
36 | puts "\n" | ||
37 | send -- "exit\r" | ||
38 | sleep 2 | ||
39 | |||
40 | |||
41 | #************************************************************** | ||
42 | send -- "firejail --profile=private-keep.profile\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.0\n";exit} | ||
45 | "Child process initialized" | ||
46 | } | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "ls -al\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
52 | ".config" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
56 | ".mozilla" | ||
57 | } | ||
58 | sleep 1 | ||
59 | |||
60 | send -- "find .config\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
63 | ".config" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
67 | ".config/firejail" | ||
68 | } | ||
69 | sleep 1 | ||
70 | puts "\n" | ||
71 | send -- "exit\r" | ||
72 | sleep 2 | ||
73 | |||
74 | |||
75 | #************************************************************** | ||
76 | send -- "firejail --noprofile --private-home=~/.mozilla,~/.config/firejail\r" | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 2\n";exit} | ||
79 | "Child process initialized" | ||
80 | } | ||
81 | sleep 1 | ||
82 | |||
83 | send -- "ls -al\r" | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
86 | ".config" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
90 | ".mozilla" | ||
91 | } | ||
92 | sleep 1 | ||
93 | |||
94 | send -- "find .config\r" | ||
95 | expect { | ||
96 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
97 | ".config" | ||
98 | } | ||
99 | expect { | ||
100 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
101 | ".config/firejail" | ||
102 | } | ||
103 | sleep 1 | ||
104 | puts "\n" | ||
105 | send -- "exit\r" | ||
106 | sleep 2 | ||
107 | |||
108 | |||
109 | #************************************************************** | ||
110 | send -- "firejail --noprofile --private-home=~/.mozilla,~/.config/firejail\r" | ||
111 | expect { | ||
112 | timeout {puts "TESTING ERROR 3\n";exit} | ||
113 | "Child process initialized" | ||
114 | } | ||
115 | sleep 1 | ||
116 | |||
117 | send -- "ls -al\r" | ||
118 | expect { | ||
119 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
120 | ".config" | ||
121 | } | ||
122 | expect { | ||
123 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
124 | ".mozilla" | ||
125 | } | ||
126 | sleep 1 | ||
127 | |||
128 | send -- "find .config\r" | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
131 | ".config" | ||
132 | } | ||
133 | expect { | ||
134 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
135 | ".config/firejail" | ||
136 | } | ||
137 | sleep 1 | ||
138 | puts "\n" | ||
139 | send -- "exit\r" | ||
140 | sleep 2 | ||
141 | |||
142 | #************************************************************** | ||
143 | send -- "firejail --noprofile --private-home=/home/netblue/.mozilla,/home/netblue/.config/firejail\r" | ||
144 | expect { | ||
145 | timeout {puts "TESTING ERROR 4\n";exit} | ||
146 | "Child process initialized" | ||
147 | } | ||
148 | sleep 1 | ||
149 | |||
150 | send -- "ls -al\r" | ||
151 | expect { | ||
152 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
153 | ".config" | ||
154 | } | ||
155 | expect { | ||
156 | timeout {puts "TESTING ERROR 4.2\n";exit} | ||
157 | ".mozilla" | ||
158 | } | ||
159 | sleep 1 | ||
160 | |||
161 | send -- "find .config\r" | ||
162 | expect { | ||
163 | timeout {puts "TESTING ERROR 4.3\n";exit} | ||
164 | ".config" | ||
165 | } | ||
166 | expect { | ||
167 | timeout {puts "TESTING ERROR 4.4\n";exit} | ||
168 | ".config/firejail" | ||
169 | } | ||
170 | sleep 1 | ||
171 | puts "\n" | ||
172 | send -- "exit\r" | ||
173 | sleep 2 | ||
174 | |||
175 | #************************************************************** | ||
176 | send -- "firejail --noprofile --private-home=/home/netblue/../netblue/.mozilla,/home/netblue/.config/firejail\r" | ||
177 | expect { | ||
178 | timeout {puts "TESTING ERROR 5\n";exit} | ||
179 | "Error: invalid private-home list" | ||
180 | } | ||
181 | sleep 1 | ||
182 | |||
183 | #************************************************************** | ||
184 | send -- "firejail --noprofile --private-home=/root\r" | ||
185 | expect { | ||
186 | timeout {puts "TESTING ERROR 6\n";exit} | ||
187 | "Error: only files or directories created by the current user are allowed" | ||
188 | } | ||
189 | sleep 1 | ||
190 | |||
191 | puts "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 |
191 | rm -fr dirprivate | 191 | rm -fr dirprivate |
192 | 192 | ||
193 | echo "TESTING: private keep" | 193 | echo "TESTING: overlayfs" |
194 | ./private-keep.exp | 194 | ./fs_overlay.exp |
195 | |||
196 | uname -r | grep "3.18" | ||
197 | if [ "$?" -eq 0 ]; | ||
198 | then | ||
199 | echo "TESTING: overlayfs on 3.18 kernel" | ||
200 | ./fs_overlay.exp | ||
201 | fi | ||
202 | |||
203 | grep "openSUSE" /etc/os-release | ||
204 | if [ "$?" -eq 0 ]; | ||
205 | then | ||
206 | echo "TESTING: overlayfs" | ||
207 | ./fs_overlay.exp | ||
208 | fi | ||
209 | |||
210 | grep "Ubuntu" /etc/os-release | ||
211 | if [ "$?" -eq 0 ]; | ||
212 | then | ||
213 | echo "TESTING: overlayfs" | ||
214 | ./fs_overlay.exp | ||
215 | fi | ||
216 | 195 | ||
217 | echo "TESTING: seccomp debug" | 196 | echo "TESTING: seccomp debug" |
218 | ./seccomp-debug.exp | 197 | ./seccomp-debug.exp |