diff options
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/build.exp | 56 | ||||
-rwxr-xr-x | test/utils/utils.sh | 5 |
2 files changed, 24 insertions, 37 deletions
diff --git a/test/utils/build.exp b/test/utils/build.exp index ae46ffa6e..ac4f30326 100755 --- a/test/utils/build.exp +++ b/test/utils/build.exp | |||
@@ -7,22 +7,21 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "echo testing > ~/firejail-test-file-7699\r" | ||
11 | after 100 | ||
12 | |||
10 | send -- "firejail --build cat ~/firejail-test-file-7699\r" | 13 | send -- "firejail --build cat ~/firejail-test-file-7699\r" |
11 | expect { | 14 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 15 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "whitelist ~/firejail-test-file-7699" | 16 | "whitelist $\{HOME\}/firejail-test-file-7699" |
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
17 | "include /etc/firejail/whitelist-common.inc" | ||
18 | } | 17 | } |
19 | expect { | 18 | expect { |
20 | timeout {puts "TESTING ERROR 1\n";exit} | 19 | timeout {puts "TESTING ERROR 1\n";exit} |
21 | "private-tmp" | 20 | "include whitelist-common.inc" |
22 | } | 21 | } |
23 | expect { | 22 | expect { |
24 | timeout {puts "TESTING ERROR 2\n";exit} | 23 | timeout {puts "TESTING ERROR 2\n";exit} |
25 | "private-dev" | 24 | "blacklist /usr/share" |
26 | } | 25 | } |
27 | expect { | 26 | expect { |
28 | timeout {puts "TESTING ERROR 3\n";exit} | 27 | timeout {puts "TESTING ERROR 3\n";exit} |
@@ -34,26 +33,40 @@ expect { | |||
34 | } | 33 | } |
35 | expect { | 34 | expect { |
36 | timeout {puts "TESTING ERROR 5\n";exit} | 35 | timeout {puts "TESTING ERROR 5\n";exit} |
37 | "caps.drop all" | 36 | "private-dev" |
38 | } | 37 | } |
39 | expect { | 38 | expect { |
40 | timeout {puts "TESTING ERROR 6\n";exit} | 39 | timeout {puts "TESTING ERROR 6\n";exit} |
41 | "nonewprivs" | 40 | "private-etc" |
42 | } | 41 | } |
43 | expect { | 42 | expect { |
44 | timeout {puts "TESTING ERROR 7\n";exit} | 43 | timeout {puts "TESTING ERROR 7\n";exit} |
45 | "seccomp" | 44 | "private-tmp" |
46 | } | 45 | } |
47 | expect { | 46 | expect { |
48 | timeout {puts "TESTING ERROR 8\n";exit} | 47 | timeout {puts "TESTING ERROR 8\n";exit} |
49 | "net none" | 48 | "caps.drop all" |
50 | } | 49 | } |
51 | expect { | 50 | expect { |
52 | timeout {puts "TESTING ERROR 9\n";exit} | 51 | timeout {puts "TESTING ERROR 9\n";exit} |
52 | "nonewprivs" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 10\n";exit} | ||
56 | "seccomp" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 11\n";exit} | ||
60 | "net none" | ||
61 | } | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 12\n";exit} | ||
53 | "shell none" | 64 | "shell none" |
54 | } | 65 | } |
55 | after 100 | 66 | after 100 |
56 | 67 | ||
68 | |||
69 | |||
57 | send -- "firejail --build cat /etc/passwd\r" | 70 | send -- "firejail --build cat /etc/passwd\r" |
58 | expect { | 71 | expect { |
59 | timeout {puts "TESTING ERROR 10\n";exit} | 72 | timeout {puts "TESTING ERROR 10\n";exit} |
@@ -72,21 +85,6 @@ expect { | |||
72 | } | 85 | } |
73 | after 100 | 86 | after 100 |
74 | 87 | ||
75 | |||
76 | #send -- "firejail --build cat /var/tmp/firejail-test-file-7699\r" | ||
77 | #expect { | ||
78 | # timeout {puts "TESTING ERROR 11\n";exit} | ||
79 | # "whitelist /var/tmp/firejail-test-file-7699" | ||
80 | #} | ||
81 | #after 100 | ||
82 | |||
83 | #send -- "firejail --build man firejail\r" | ||
84 | #expect { | ||
85 | # timeout {puts "TESTING ERROR 12\n";exit} | ||
86 | # "whitelist /usr/share/man" | ||
87 | #} | ||
88 | #after 100 | ||
89 | |||
90 | send -- "firejail --build wget --output-document=~ debian.org\r" | 88 | send -- "firejail --build wget --output-document=~ debian.org\r" |
91 | expect { | 89 | expect { |
92 | timeout {puts "TESTING ERROR 13\n";exit} | 90 | timeout {puts "TESTING ERROR 13\n";exit} |
@@ -98,10 +96,4 @@ expect { | |||
98 | } | 96 | } |
99 | after 100 | 97 | after 100 |
100 | 98 | ||
101 | |||
102 | send -- "firejail --build cat /tmp/firejail-test-file-7699\r" | ||
103 | #todo - bug: it comes back with private-tmp | ||
104 | sleep 1 | ||
105 | |||
106 | |||
107 | puts "all done\n" | 99 | puts "all done\n" |
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 82ccc82bb..48a8051fa 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -13,14 +13,9 @@ if [ -f /etc/debian_version ]; then | |||
13 | fi | 13 | fi |
14 | export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" | 14 | export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" |
15 | 15 | ||
16 | echo "testing" > ~/firejail-test-file-7699 | ||
17 | echo "testing" > /tmp/firejail-test-file-7699 | ||
18 | echo "testing" > /var/tmp/firejail-test-file-7699 | ||
19 | echo "TESTING: build (test/utils/build.exp)" | 16 | echo "TESTING: build (test/utils/build.exp)" |
20 | ./build.exp | 17 | ./build.exp |
21 | rm -f ~/firejail-test-file-7699 | 18 | rm -f ~/firejail-test-file-7699 |
22 | rm -f /tmp/firejail-test-file-7699 | ||
23 | rm -f /var/tmp/firejail-test-file-7699 | ||
24 | rm -f firejail-test-file-4388 | 19 | rm -f firejail-test-file-4388 |
25 | 20 | ||
26 | if [ $(readlink /proc/self) -lt 100 ]; then | 21 | if [ $(readlink /proc/self) -lt 100 ]; then |