aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-29 10:04:43 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-29 10:04:43 -0500
commitd3b6581db7fcd0fb0897ada9910140f0e43f4ed1 (patch)
tree1c4409a84665834736370f89dcf915a12f173ef5 /test/fs
parentMerge pull request #945 from Fred-Barclay/cryptocat (diff)
downloadfirejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.gz
firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.zst
firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.zip
testing and cleanup
Diffstat (limited to 'test/fs')
-rwxr-xr-xtest/fs/fs.sh3
-rwxr-xr-xtest/fs/whitelist-dev.exp47
-rwxr-xr-xtest/fs/whitelist.exp26
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)"
88echo "TESTING: whitelist (test/fs/whitelist.exp)" 88echo "TESTING: whitelist (test/fs/whitelist.exp)"
89./whitelist.exp 89./whitelist.exp
90 90
91echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)"
92./whitelist-dev.exp
93
91echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" 94echo "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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --whitelist=/dev/null --debug\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls -l /dev | find /dev | wc -l\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "2"
21}
22after 100
23send -- "exit\r"
24sleep 1
25
26send -- "firejail --whitelist=/var/tmp --debug\r"
27expect {
28 timeout {puts "TESTING ERROR 0\n";exit}
29 "Child process initialized"
30}
31sleep 1
32
33send -- "ls -l /dev | find /dev | wc -l\r"
34expect {
35 timeout {puts "TESTING ERROR 1\n";exit}
36 "2"
37}
38after 100
39send -- "exit\r"
40sleep 1
41
42
43
44
45after 100
46puts "\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
36send -- "ln -s ~/fjtest-dir ~/fjtest-dir-lnk\r" 36send -- "ln -s ~/fjtest-dir ~/fjtest-dir-lnk\r"
37after 200 37after 200
38 38
39send -- "firejail --whitelist=~/fjtest-file --whitelist=~/fjtest-dir\r" 39send -- "firejail --whitelist=~/fjtest-file --whitelist=~/fjtest-dir --debug\r"
40expect { 40expect {
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
52send -- "cat fjtest-file\r" 52send -- "cat ~/fjtest-file\r"
53expect { 53expect {
54 timeout {puts "TESTING ERROR 2\n";exit} 54 timeout {puts "TESTING ERROR 2\n";exit}
55 "123" 55 "123"
56} 56}
57 57
58send -- "cat fjtest-dir/fjtest-file\r" 58send -- "cat ~/fjtest-dir/fjtest-file\r"
59expect { 59expect {
60 timeout {puts "TESTING ERROR 3\n";exit} 60 timeout {puts "TESTING ERROR 3\n";exit}
61 "123" 61 "123"
62} 62}
63 63
64send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" 64send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r"
65expect { 65expect {
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
89send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" 89send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r"
90expect { 90expect {
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
114send -- "cat fjtest-file\r" 114send -- "cat ~/fjtest-file\r"
115expect { 115expect {
116 timeout {puts "TESTING ERROR 22\n";exit} 116 timeout {puts "TESTING ERROR 22\n";exit}
117 "123" 117 "123"
118} 118}
119 119
120send -- "cat fjtest-dir/fjtest-file\r" 120send -- "cat ~/fjtest-dir/fjtest-file\r"
121expect { 121expect {
122 timeout {puts "TESTING ERROR 23\n";exit} 122 timeout {puts "TESTING ERROR 23\n";exit}
123 "123" 123 "123"
124} 124}
125 125
126send -- "cat fjtest-dir/fjtest-dir/fjtest-file\r" 126send -- "cat ~/fjtest-dir/fjtest-dir/fjtest-file\r"
127expect { 127expect {
128 timeout {puts "TESTING ERROR 24\n";exit} 128 timeout {puts "TESTING ERROR 24\n";exit}
129 "123" 129 "123"
130} 130}
131 131
132send -- "cat fjtest-file-lnk\r" 132send -- "cat ~/fjtest-file-lnk\r"
133expect { 133expect {
134 timeout {puts "TESTING ERROR 25\n";exit} 134 timeout {puts "TESTING ERROR 25\n";exit}
135 "123" 135 "123"
136} 136}
137 137
138send -- "cat fjtest-dir-lnk/fjtest-file\r" 138send -- "cat ~/fjtest-dir-lnk/fjtest-file\r"
139expect { 139expect {
140 timeout {puts "TESTING ERROR 26\n";exit} 140 timeout {puts "TESTING ERROR 26\n";exit}
141 "123" 141 "123"
142} 142}
143 143
144send -- "cat fjtest-dir-lnk/fjtest-dir/fjtest-file\r" 144send -- "cat ~/fjtest-dir-lnk/fjtest-dir/fjtest-file\r"
145expect { 145expect {
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
196send -- "cat fjtest-file-lnk\r" 196send -- "cat ~/fjtest-file-lnk\r"
197expect { 197expect {
198 timeout {puts "TESTING ERROR 42\n";exit} 198 timeout {puts "TESTING ERROR 42\n";exit}
199 "123" 199 "123"
200} 200}
201 201
202send -- "cat fjtest-dir-lnk/fjtest-file\r" 202send -- "cat ~/fjtest-dir-lnk/fjtest-file\r"
203expect { 203expect {
204 timeout {puts "TESTING ERROR 43\n";exit} 204 timeout {puts "TESTING ERROR 43\n";exit}
205 "123" 205 "123"