diff options
author | netblue30 <netblue30@yahoo.com> | 2015-10-20 11:01:40 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-10-20 11:01:40 -0400 |
commit | 45060ec40f0e9790d5e6a503486867951df71300 (patch) | |
tree | 1811814d5fbd5f4806c0a8d527806fffc137f5e5 /test/invalid_filename.exp | |
parent | fixed join/shutdown problem, moving browsers and mail clients to a --shell=no... (diff) | |
download | firejail-45060ec40f0e9790d5e6a503486867951df71300.tar.gz firejail-45060ec40f0e9790d5e6a503486867951df71300.tar.zst firejail-45060ec40f0e9790d5e6a503486867951df71300.zip |
testing and fixes
Diffstat (limited to 'test/invalid_filename.exp')
-rwxr-xr-x | test/invalid_filename.exp | 236 |
1 files changed, 236 insertions, 0 deletions
diff --git a/test/invalid_filename.exp b/test/invalid_filename.exp new file mode 100755 index 000000000..ca35262f8 --- /dev/null +++ b/test/invalid_filename.exp | |||
@@ -0,0 +1,236 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | #invalid_filename checks: | ||
4 | # | ||
5 | #--bind (two files) - profile.c - Note: The test is not implemented here, need to be root to test it | ||
6 | #--blacklist - profile.c | ||
7 | #--cgroup - cgroup.c | ||
8 | #--chroot - main.c | ||
9 | #--netfilter - netfilter.c | ||
10 | #--output - output.c | ||
11 | #--private - fs_home.c | ||
12 | #--privte-bin (list) - fs_bin.c | ||
13 | #--private-keep/--private-home (list) - fs_home.c | ||
14 | #--private-etc (list) - fs_etc.c | ||
15 | #--profile - main.c | ||
16 | #--read_only - profile.c | ||
17 | #--shell - main.c | ||
18 | #--tmpfs - profile.c | ||
19 | #--white-list | ||
20 | |||
21 | |||
22 | set timeout 10 | ||
23 | spawn $env(SHELL) | ||
24 | match_max 100000 | ||
25 | |||
26 | send -- "firejail --debug --noprofile --blacklist=\"bla&&bla\"\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
29 | "Checking filename bla&&bla" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
33 | "Error:" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
37 | "is an invalid filename" | ||
38 | } | ||
39 | after 100 | ||
40 | |||
41 | send -- "firejail --debug --noprofile --cgroup=\"bla&&bla\"\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
44 | "Checking filename bla&&bla" | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
48 | "Error:" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
52 | "is an invalid filename" | ||
53 | } | ||
54 | after 100 | ||
55 | |||
56 | send -- "firejail --debug --noprofile --chroot=\"bla&&bla\"\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
59 | "Checking filename bla&&bla" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
63 | "Error:" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
67 | "is an invalid filename" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | send -- "firejail --debug --noprofile --netfilter=\"bla&&bla\"\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
74 | "Checking filename bla&&bla" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 4.2\n";exit} | ||
78 | "Error:" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 4.3\n";exit} | ||
82 | "is an invalid filename" | ||
83 | } | ||
84 | after 100 | ||
85 | |||
86 | send -- "firejail --debug --noprofile --output=\"bla&&bla\"\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
89 | "Error:" | ||
90 | } | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
93 | "is an invalid filename" | ||
94 | } | ||
95 | after 100 | ||
96 | |||
97 | send -- "firejail --debug --noprofile --private=\"bla&&bla\"\r" | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
100 | "Checking filename bla&&bla" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
104 | "Error:" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
108 | "is an invalid filename" | ||
109 | } | ||
110 | after 100 | ||
111 | |||
112 | send -- "firejail --debug --noprofile --private-bin=\"bla&&bla\"\r" | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 7.1\n";exit} | ||
115 | "Checking filename bla&&bla" | ||
116 | } | ||
117 | expect { | ||
118 | timeout {puts "TESTING ERROR 7.2\n";exit} | ||
119 | "Error:" | ||
120 | } | ||
121 | expect { | ||
122 | timeout {puts "TESTING ERROR 7.3\n";exit} | ||
123 | "is an invalid filename" | ||
124 | } | ||
125 | after 100 | ||
126 | |||
127 | send -- "firejail --debug --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 --noprofile --private-etc=\"bla&&bla\"\r" | ||
144 | expect { | ||
145 | timeout {puts "TESTING ERROR 9.1\n";exit} | ||
146 | "Checking filename bla&&bla" | ||
147 | } | ||
148 | expect { | ||
149 | timeout {puts "TESTING ERROR 9.2\n";exit} | ||
150 | "Error:" | ||
151 | } | ||
152 | expect { | ||
153 | timeout {puts "TESTING ERROR 9.3\n";exit} | ||
154 | "is an invalid filename" | ||
155 | } | ||
156 | after 100 | ||
157 | |||
158 | send -- "firejail --debug --profile=\"bla&&bla\"\r" | ||
159 | expect { | ||
160 | timeout {puts "TESTING ERROR 10.1\n";exit} | ||
161 | "Checking filename bla&&bla" | ||
162 | } | ||
163 | expect { | ||
164 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
165 | "Error:" | ||
166 | } | ||
167 | expect { | ||
168 | timeout {puts "TESTING ERROR 10.3\n";exit} | ||
169 | "is an invalid filename" | ||
170 | } | ||
171 | after 100 | ||
172 | |||
173 | send -- "firejail --debug --read-only=\"bla&&bla\"\r" | ||
174 | expect { | ||
175 | timeout {puts "TESTING ERROR 11.1\n";exit} | ||
176 | "Checking filename bla&&bla" | ||
177 | } | ||
178 | expect { | ||
179 | timeout {puts "TESTING ERROR 11.2\n";exit} | ||
180 | "Error:" | ||
181 | } | ||
182 | expect { | ||
183 | timeout {puts "TESTING ERROR 11.3\n";exit} | ||
184 | "is an invalid filename" | ||
185 | } | ||
186 | after 100 | ||
187 | |||
188 | send -- "firejail --debug --shell=\"bla&&bla\"\r" | ||
189 | expect { | ||
190 | timeout {puts "TESTING ERROR 12.1\n";exit} | ||
191 | "Checking filename bla&&bla" | ||
192 | } | ||
193 | expect { | ||
194 | timeout {puts "TESTING ERROR 12.2\n";exit} | ||
195 | "Error:" | ||
196 | } | ||
197 | expect { | ||
198 | timeout {puts "TESTING ERROR 12.3\n";exit} | ||
199 | "is an invalid filename" | ||
200 | } | ||
201 | after 100 | ||
202 | |||
203 | send -- "firejail --debug --tmpfs=\"bla&&bla\"\r" | ||
204 | expect { | ||
205 | timeout {puts "TESTING ERROR 13.1\n";exit} | ||
206 | "Checking filename bla&&bla" | ||
207 | } | ||
208 | expect { | ||
209 | timeout {puts "TESTING ERROR 13.2\n";exit} | ||
210 | "Error:" | ||
211 | } | ||
212 | expect { | ||
213 | timeout {puts "TESTING ERROR 13.3\n";exit} | ||
214 | "is an invalid filename" | ||
215 | } | ||
216 | after 100 | ||
217 | |||
218 | send -- "firejail --debug --whitelist=\"bla&&bla\"\r" | ||
219 | expect { | ||
220 | timeout {puts "TESTING ERROR 14.1\n";exit} | ||
221 | "Checking filename bla&&bla" | ||
222 | } | ||
223 | expect { | ||
224 | timeout {puts "TESTING ERROR 14.2\n";exit} | ||
225 | "Error:" | ||
226 | } | ||
227 | expect { | ||
228 | timeout {puts "TESTING ERROR 14.3\n";exit} | ||
229 | "is an invalid filename" | ||
230 | } | ||
231 | after 100 | ||
232 | |||
233 | |||
234 | |||
235 | puts "\nall done\n" | ||
236 | |||