diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-29 10:04:43 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-29 10:04:43 -0500 |
commit | d3b6581db7fcd0fb0897ada9910140f0e43f4ed1 (patch) | |
tree | 1c4409a84665834736370f89dcf915a12f173ef5 /test/fs | |
parent | Merge pull request #945 from Fred-Barclay/cryptocat (diff) | |
download | firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.gz firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.zst firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.zip |
testing and cleanup
Diffstat (limited to 'test/fs')
-rwxr-xr-x | test/fs/fs.sh | 3 | ||||
-rwxr-xr-x | test/fs/whitelist-dev.exp | 47 | ||||
-rwxr-xr-x | test/fs/whitelist.exp | 26 |
3 files changed, 63 insertions, 13 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index d9a425661..611b62b09 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -88,6 +88,9 @@ echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" | |||
88 | echo "TESTING: whitelist (test/fs/whitelist.exp)" | 88 | echo "TESTING: whitelist (test/fs/whitelist.exp)" |
89 | ./whitelist.exp | 89 | ./whitelist.exp |
90 | 90 | ||
91 | echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" | ||
92 | ./whitelist-dev.exp | ||
93 | |||
91 | echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" | 94 | echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" |
92 | ./fscheck-bindnoroot.exp | 95 | ./fscheck-bindnoroot.exp |
93 | 96 | ||
diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp new file mode 100755 index 000000000..a19d5cedf --- /dev/null +++ b/test/fs/whitelist-dev.exp | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --whitelist=/dev/null --debug\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls -l /dev | find /dev | wc -l\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "2" | ||
21 | } | ||
22 | after 100 | ||
23 | send -- "exit\r" | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "firejail --whitelist=/var/tmp --debug\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0\n";exit} | ||
29 | "Child process initialized" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | send -- "ls -l /dev | find /dev | wc -l\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1\n";exit} | ||
36 | "2" | ||
37 | } | ||
38 | after 100 | ||
39 | send -- "exit\r" | ||
40 | sleep 1 | ||
41 | |||
42 | |||
43 | |||
44 | |||
45 | after 100 | ||
46 | puts "\nall done\n" | ||
47 | |||
diff --git a/test/fs/whitelist.exp b/test/fs/whitelist.exp index 9a9a0f353..9b631b884 100755 --- a/test/fs/whitelist.exp +++ b/test/fs/whitelist.exp | |||
@@ -36,7 +36,7 @@ after 200 | |||
36 | send -- "ln -s ~/fjtest-dir ~/fjtest-dir-lnk\r" | 36 | send -- "ln -s ~/fjtest-dir ~/fjtest-dir-lnk\r" |
37 | after 200 | 37 | after 200 |
38 | 38 | ||
39 | send -- "firejail --whitelist=~/fjtest-file --whitelist=~/fjtest-dir\r" | 39 | send -- "firejail --whitelist=~/fjtest-file --whitelist=~/fjtest-dir --debug\r" |
40 | expect { | 40 | expect { |
41 | timeout {puts "TESTING ERROR 0\n";exit} | 41 | timeout {puts "TESTING ERROR 0\n";exit} |
42 | "Child process initialized" | 42 | "Child process initialized" |
@@ -49,19 +49,19 @@ expect { | |||
49 | "2" | 49 | "2" |
50 | } | 50 | } |
51 | 51 | ||
52 | send -- "cat fjtest-file\r" | 52 | send -- "cat ~/fjtest-file\r" |
53 | expect { | 53 | expect { |
54 | timeout {puts "TESTING ERROR 2\n";exit} | 54 | timeout {puts "TESTING ERROR 2\n";exit} |
55 | "123" | 55 | "123" |
56 | } | 56 | } |
57 | 57 | ||
58 | send -- "cat fjtest-dir/fjtest-file\r" | 58 | send -- "cat ~/fjtest-dir/fjtest-file\r" |
59 | expect { | 59 | expect { |
60 | timeout {puts "TESTING ERROR 3\n";exit} | 60 | timeout {puts "TESTING ERROR 3\n";exit} |
61 | "123" | 61 | "123" |
62 | } | 62 | } |
63 | 63 | ||
64 | send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" | 64 | send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r" |
65 | expect { | 65 | expect { |
66 | timeout {puts "TESTING ERROR 4\n";exit} | 66 | timeout {puts "TESTING ERROR 4\n";exit} |
67 | "123" | 67 | "123" |
@@ -86,7 +86,7 @@ expect { | |||
86 | "1" | 86 | "1" |
87 | } | 87 | } |
88 | 88 | ||
89 | send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" | 89 | send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r" |
90 | expect { | 90 | expect { |
91 | timeout {puts "TESTING ERROR 12\n";exit} | 91 | timeout {puts "TESTING ERROR 12\n";exit} |
92 | "123" | 92 | "123" |
@@ -111,37 +111,37 @@ expect { | |||
111 | "4" | 111 | "4" |
112 | } | 112 | } |
113 | 113 | ||
114 | send -- "cat fjtest-file\r" | 114 | send -- "cat ~/fjtest-file\r" |
115 | expect { | 115 | expect { |
116 | timeout {puts "TESTING ERROR 22\n";exit} | 116 | timeout {puts "TESTING ERROR 22\n";exit} |
117 | "123" | 117 | "123" |
118 | } | 118 | } |
119 | 119 | ||
120 | send -- "cat fjtest-dir/fjtest-file\r" | 120 | send -- "cat ~/fjtest-dir/fjtest-file\r" |
121 | expect { | 121 | expect { |
122 | timeout {puts "TESTING ERROR 23\n";exit} | 122 | timeout {puts "TESTING ERROR 23\n";exit} |
123 | "123" | 123 | "123" |
124 | } | 124 | } |
125 | 125 | ||
126 | send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" | 126 | send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r" |
127 | expect { | 127 | expect { |
128 | timeout {puts "TESTING ERROR 24\n";exit} | 128 | timeout {puts "TESTING ERROR 24\n";exit} |
129 | "123" | 129 | "123" |
130 | } | 130 | } |
131 | 131 | ||
132 | send -- "cat fjtest-file-lnk\r" | 132 | send -- "cat ~/fjtest-file-lnk\r" |
133 | expect { | 133 | expect { |
134 | timeout {puts "TESTING ERROR 25\n";exit} | 134 | timeout {puts "TESTING ERROR 25\n";exit} |
135 | "123" | 135 | "123" |
136 | } | 136 | } |
137 | 137 | ||
138 | send -- "cat fjtest-dir-lnk/fjtest-file\r" | 138 | send -- "cat ~/fjtest-dir-lnk/fjtest-file\r" |
139 | expect { | 139 | expect { |
140 | timeout {puts "TESTING ERROR 26\n";exit} | 140 | timeout {puts "TESTING ERROR 26\n";exit} |
141 | "123" | 141 | "123" |
142 | } | 142 | } |
143 | 143 | ||
144 | send -- "cat fjtest-dir-lnk/fjtest-dir/fjtest-file\r" | 144 | send -- "cat ~/fjtest-dir-lnk/fjtest-dir/fjtest-file\r" |
145 | expect { | 145 | expect { |
146 | timeout {puts "TESTING ERROR 27\n";exit} | 146 | timeout {puts "TESTING ERROR 27\n";exit} |
147 | "123" | 147 | "123" |
@@ -193,13 +193,13 @@ expect { | |||
193 | "2" | 193 | "2" |
194 | } | 194 | } |
195 | 195 | ||
196 | send -- "cat fjtest-file-lnk\r" | 196 | send -- "cat ~/fjtest-file-lnk\r" |
197 | expect { | 197 | expect { |
198 | timeout {puts "TESTING ERROR 42\n";exit} | 198 | timeout {puts "TESTING ERROR 42\n";exit} |
199 | "123" | 199 | "123" |
200 | } | 200 | } |
201 | 201 | ||
202 | send -- "cat fjtest-dir-lnk/fjtest-file\r" | 202 | send -- "cat ~/fjtest-dir-lnk/fjtest-file\r" |
203 | expect { | 203 | expect { |
204 | timeout {puts "TESTING ERROR 43\n";exit} | 204 | timeout {puts "TESTING ERROR 43\n";exit} |
205 | "123" | 205 | "123" |