diff options
-rwxr-xr-x | test/environment/environment.sh | 11 | ||||
-rwxr-xr-x | test/environment/ibus.exp | 28 | ||||
-rwxr-xr-x | test/fs/private-bin.exp | 22 |
3 files changed, 61 insertions, 0 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index 5c4d49331..c2a6c435a 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -6,6 +6,7 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | |||
9 | echo "TESTING: DNS (test/environment/dns.exp)" | 10 | echo "TESTING: DNS (test/environment/dns.exp)" |
10 | ./dns.exp | 11 | ./dns.exp |
11 | 12 | ||
@@ -85,3 +86,13 @@ else | |||
85 | echo "TESTING SKIP: strace not found" | 86 | echo "TESTING SKIP: strace not found" |
86 | fi | 87 | fi |
87 | 88 | ||
89 | # to install ibus: | ||
90 | # $ sudo apt-get install ibus-table-array30 | ||
91 | # $ ibus-setup | ||
92 | |||
93 | find ~/.config/ibus/bus | grep unix-0 | ||
94 | if [ "$?" -eq 0 ]; | ||
95 | then | ||
96 | echo "TESTING: ibus (test/environment/ibus.exp)" | ||
97 | ./ibus.exp | ||
98 | fi | ||
diff --git a/test/environment/ibus.exp b/test/environment/ibus.exp new file mode 100755 index 000000000..4344011a6 --- /dev/null +++ b/test/environment/ibus.exp | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | cd /home | ||
5 | spawn $env(SHELL) | ||
6 | match_max 100000 | ||
7 | |||
8 | send -- "firejail\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "Child process initialized" | ||
12 | } | ||
13 | after 100 | ||
14 | |||
15 | send -- "env | grep IBUS\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "IBUS_ADDRESS" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "IBUS_DAEMON_PID" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | |||
27 | puts "\nall done\n" | ||
28 | |||
diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp index fe9468be9..f7181d218 100755 --- a/test/fs/private-bin.exp +++ b/test/fs/private-bin.exp | |||
@@ -65,6 +65,28 @@ expect { | |||
65 | "sh" | 65 | "sh" |
66 | } | 66 | } |
67 | send -- "exit\r" | 67 | send -- "exit\r" |
68 | after 100 | ||
69 | |||
70 | |||
71 | send -- "firejail --private-bin=/etc/shadow\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 8\n";exit} | ||
74 | "invalid filename" | ||
75 | } | ||
76 | after 100 | ||
77 | |||
78 | send -- "firejail --private-bin=\"bla;bla\"\r" | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 9\n";exit} | ||
81 | "is an invalid filename" | ||
82 | } | ||
83 | after 100 | ||
84 | |||
85 | send -- "firejail --private-etc=../bin/ls\r" | ||
86 | expect { | ||
87 | timeout {puts "TESTING ERROR 10\n";exit} | ||
88 | "is an invalid filename" | ||
89 | } | ||
68 | 90 | ||
69 | after 100 | 91 | after 100 |
70 | puts "\nall done\n" | 92 | puts "\nall done\n" |