aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-04-29 10:02:47 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-04-29 10:02:47 -0400
commit13af4d76ee0e86b6a74cda3365f41b83b1651a95 (patch)
treec0dbe37514f3ddb637738895202a0ff5b7d04faf /test
parentwhitelist haderning - based on an idea from smitsohu (diff)
downloadfirejail-13af4d76ee0e86b6a74cda3365f41b83b1651a95.tar.gz
firejail-13af4d76ee0e86b6a74cda3365f41b83b1651a95.tar.zst
firejail-13af4d76ee0e86b6a74cda3365f41b83b1651a95.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/arguments/arguments.sh3
-rwxr-xr-xtest/filters/filters.sh4
-rwxr-xr-xtest/fs/invalid_filename.exp79
3 files changed, 16 insertions, 70 deletions
diff --git a/test/arguments/arguments.sh b/test/arguments/arguments.sh
index 9500b5975..d9f2d4697 100755
--- a/test/arguments/arguments.sh
+++ b/test/arguments/arguments.sh
@@ -3,9 +3,8 @@
3if [ -f /etc/debian_version ]; then 3if [ -f /etc/debian_version ]; then
4 libdir=$(dirname "$(dpkg -L firejail | grep faudit)") 4 libdir=$(dirname "$(dpkg -L firejail | grep faudit)")
5 export PATH="$PATH:$libdir" 5 export PATH="$PATH:$libdir"
6else
7 export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
8fi 6fi
7export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
9 8
10echo "TESTING: 1. regular bash session" 9echo "TESTING: 1. regular bash session"
11./bashrun.exp 10./bashrun.exp
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index ff197aa54..d0a34ccc5 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -9,9 +9,9 @@ export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
9if [ -f /etc/debian_version ]; then 9if [ -f /etc/debian_version ]; then
10 libdir=$(dirname "$(dpkg -L firejail | grep fseccomp)") 10 libdir=$(dirname "$(dpkg -L firejail | grep fseccomp)")
11 export PATH="$PATH:$libdir" 11 export PATH="$PATH:$libdir"
12else
13 export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
14fi 12fi
13export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
14
15 15
16if [ "$(uname -m)" = "x86_64" ]; then 16if [ "$(uname -m)" = "x86_64" ]; then
17 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" 17 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)"
diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp
index e16798ab8..84abe74cd 100755
--- a/test/fs/invalid_filename.exp
+++ b/test/fs/invalid_filename.exp
@@ -7,11 +7,7 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r" 10send -- "firejail --noprofile --blacklist=\"bla&&bla\"\r"
11expect {
12 timeout {puts "TESTING ERROR 1.1\n";exit}
13 "Checking filename bla&&bla"
14}
15expect { 11expect {
16 timeout {puts "TESTING ERROR 1.2\n";exit} 12 timeout {puts "TESTING ERROR 1.2\n";exit}
17 "Error:" 13 "Error:"
@@ -22,11 +18,7 @@ expect {
22} 18}
23after 100 19after 100
24 20
25send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r" 21send -- "firejail --noprofile --cgroup=\"bla&&bla\"\r"
26expect {
27 timeout {puts "TESTING ERROR 2.1\n";exit}
28 "Checking filename bla&&bla"
29}
30expect { 22expect {
31 timeout {puts "TESTING ERROR 2.2\n";exit} 23 timeout {puts "TESTING ERROR 2.2\n";exit}
32 "Error:" 24 "Error:"
@@ -37,12 +29,7 @@ expect {
37} 29}
38after 100 30after 100
39 31
40send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r" 32send -- "firejail --noprofile --chroot=\"bla&&bla\"\r"
41expect {
42 timeout {puts "TESTING ERROR 3.1\n";exit}
43 "Checking filename bla&&bla" {puts "normal system\n"}
44 "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit}
45}
46expect { 33expect {
47 timeout {puts "TESTING ERROR 3.2\n";exit} 34 timeout {puts "TESTING ERROR 3.2\n";exit}
48 "Error:" 35 "Error:"
@@ -53,11 +40,7 @@ expect {
53} 40}
54after 100 41after 100
55 42
56send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r" 43send -- "firejail --noprofile --netfilter=\"bla&&bla\"\r"
57expect {
58 timeout {puts "TESTING ERROR 4.1\n";exit}
59 "Checking filename bla&&bla"
60}
61expect { 44expect {
62 timeout {puts "TESTING ERROR 4.2\n";exit} 45 timeout {puts "TESTING ERROR 4.2\n";exit}
63 "Error:" 46 "Error:"
@@ -68,22 +51,14 @@ expect {
68} 51}
69after 100 52after 100
70 53
71send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r" 54send -- "firejail --noprofile --output=\"bla&&bla\"\r"
72expect {
73 timeout {puts "TESTING ERROR 5.2\n";exit}
74 "Error:"
75}
76expect { 55expect {
77 timeout {puts "TESTING ERROR 5.3\n";exit} 56 timeout {puts "TESTING ERROR 5.3\n";exit}
78 "is an invalid filename" 57 "is an invalid filename"
79} 58}
80after 100 59after 100
81 60
82send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r" 61send -- "firejail --noprofile --private=\"bla&&bla\"\r"
83expect {
84 timeout {puts "TESTING ERROR 6.1\n";exit}
85 "Checking filename bla&&bla"
86}
87expect { 62expect {
88 timeout {puts "TESTING ERROR 6.2\n";exit} 63 timeout {puts "TESTING ERROR 6.2\n";exit}
89 "Error:" 64 "Error:"
@@ -94,11 +69,7 @@ expect {
94} 69}
95after 100 70after 100
96 71
97send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r" 72send -- "firejail --noprofile --private-bin=\"bla&&bla\"\r"
98expect {
99 timeout {puts "TESTING ERROR 7.1\n";exit}
100 "Checking filename bla&&bla"
101}
102expect { 73expect {
103 timeout {puts "TESTING ERROR 7.2\n";exit} 74 timeout {puts "TESTING ERROR 7.2\n";exit}
104 "Error:" 75 "Error:"
@@ -109,11 +80,7 @@ expect {
109} 80}
110after 100 81after 100
111 82
112send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r" 83send -- "firejail --noprofile --private-home=\"bla&&bla\"\r"
113expect {
114 timeout {puts "TESTING ERROR 8.1\n";exit}
115 "Checking filename bla&&bla"
116}
117expect { 84expect {
118 timeout {puts "TESTING ERROR 8.2\n";exit} 85 timeout {puts "TESTING ERROR 8.2\n";exit}
119 "Error:" 86 "Error:"
@@ -124,11 +91,7 @@ expect {
124} 91}
125after 100 92after 100
126 93
127send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" 94send -- "firejail --noprofile --private-etc=\"bla&&bla\"\r"
128expect {
129 timeout {puts "TESTING ERROR 9.1\n";exit}
130 "Checking filename bla&&bla"
131}
132expect { 95expect {
133 timeout {puts "TESTING ERROR 9.2\n";exit} 96 timeout {puts "TESTING ERROR 9.2\n";exit}
134 "Error:" 97 "Error:"
@@ -139,11 +102,7 @@ expect {
139} 102}
140after 100 103after 100
141 104
142send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r" 105send -- "firejail --profile=\"bla&&bla\"\r"
143expect {
144 timeout {puts "TESTING ERROR 10.1\n";exit}
145 "Checking filename bla&&bla"
146}
147expect { 106expect {
148 timeout {puts "TESTING ERROR 10.2\n";exit} 107 timeout {puts "TESTING ERROR 10.2\n";exit}
149 "Error:" 108 "Error:"
@@ -154,11 +113,7 @@ expect {
154} 113}
155after 100 114after 100
156 115
157send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r" 116send -- "firejail --read-only=\"bla&&bla\"\r"
158expect {
159 timeout {puts "TESTING ERROR 11.1\n";exit}
160 "Checking filename bla&&bla"
161}
162expect { 117expect {
163 timeout {puts "TESTING ERROR 11.2\n";exit} 118 timeout {puts "TESTING ERROR 11.2\n";exit}
164 "Error:" 119 "Error:"
@@ -169,11 +124,7 @@ expect {
169} 124}
170after 100 125after 100
171 126
172send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r" 127send -- "firejail --shell=\"bla&&bla\"\r"
173expect {
174 timeout {puts "TESTING ERROR 12.1\n";exit}
175 "Checking filename bla&&bla"
176}
177expect { 128expect {
178 timeout {puts "TESTING ERROR 12.2\n";exit} 129 timeout {puts "TESTING ERROR 12.2\n";exit}
179 "Error:" 130 "Error:"
@@ -185,11 +136,7 @@ expect {
185after 100 136after 100
186 137
187 138
188send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r" 139send -- "firejail --whitelist=\"bla&&bla\"\r"
189expect {
190 timeout {puts "TESTING ERROR 14.1\n";exit}
191 "Checking filename bla&&bla"
192}
193expect { 140expect {
194 timeout {puts "TESTING ERROR 14.2\n";exit} 141 timeout {puts "TESTING ERROR 14.2\n";exit}
195 "Error:" 142 "Error:"