diff options
author | netblue30 <netblue30@yahoo.com> | 2017-09-05 10:56:40 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-09-05 10:56:40 -0400 |
commit | 362d290bacf90a9bb29d6c25ca395117e4da838e (patch) | |
tree | 8522b67cdfa1692cef8f676f72fb0d609fe6514f /test | |
parent | fix caps.keep/dac-overwrite (diff) | |
download | firejail-362d290bacf90a9bb29d6c25ca395117e4da838e.tar.gz firejail-362d290bacf90a9bb29d6c25ca395117e4da838e.tar.zst firejail-362d290bacf90a9bb29d6c25ca395117e4da838e.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/fs/fs.sh | 3 | ||||
-rwxr-xr-x | test/fs/private-lib.exp | 44 | ||||
-rwxr-xr-x | test/utils/seccomp-print.exp | 4 |
3 files changed, 49 insertions, 2 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 9e7ead3c9..e67ccc476 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -28,6 +28,9 @@ echo "TESTING: kmsg access (test/fs/kmsg.exp)" | |||
28 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" | 28 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" |
29 | ./fs_var_tmp.exp | 29 | ./fs_var_tmp.exp |
30 | 30 | ||
31 | echo "TESTING: private-lib (test/fs/private-lib.exp)" | ||
32 | ./private-lib.exp | ||
33 | |||
31 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" | 34 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" |
32 | ./fs_var_lock.exp | 35 | ./fs_var_lock.exp |
33 | 36 | ||
diff --git a/test/fs/private-lib.exp b/test/fs/private-lib.exp new file mode 100755 index 000000000..dd418da0f --- /dev/null +++ b/test/fs/private-lib.exp | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private-lib --private-bin=sh,bash,dash,ps,grep,ls,find,echo \r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | after 100 | ||
16 | |||
17 | send -- "find /bin; echo done\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "rm" {puts "TESTING ERROR 3\n";exit} | ||
21 | "cp" {puts "TESTING ERROR 4\n";exit} | ||
22 | "done" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | send -- "find /lib; echo done\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 5\n";exit} | ||
29 | "modules" {puts "TESTING ERROR 6\n";exit} | ||
30 | "firmware" {puts "TESTING ERROR 7\n";exit} | ||
31 | "libc.so" | ||
32 | } | ||
33 | after 100 | ||
34 | |||
35 | send -- "find /usr/lib; echo done\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 8\n";exit} | ||
38 | "grub" {puts "TESTING ERROR 9\n";exit} | ||
39 | "mozilla" {puts "TESTING ERROR 10\n";exit} | ||
40 | "libdl.so" | ||
41 | } | ||
42 | after 100 | ||
43 | |||
44 | puts "\nall done\n" | ||
diff --git a/test/utils/seccomp-print.exp b/test/utils/seccomp-print.exp index 5a76d7fcc..b3ab5e13c 100755 --- a/test/utils/seccomp-print.exp +++ b/test/utils/seccomp-print.exp | |||
@@ -22,11 +22,11 @@ expect { | |||
22 | } | 22 | } |
23 | expect { | 23 | expect { |
24 | timeout {puts "TESTING ERROR 2\n";exit} | 24 | timeout {puts "TESTING ERROR 2\n";exit} |
25 | "init_module" | 25 | "delete_module" |
26 | } | 26 | } |
27 | expect { | 27 | expect { |
28 | timeout {puts "TESTING ERROR 3\n";exit} | 28 | timeout {puts "TESTING ERROR 3\n";exit} |
29 | "delete_module" | 29 | "init_module" |
30 | } | 30 | } |
31 | expect { | 31 | expect { |
32 | timeout {puts "TESTING ERROR 4\n";exit} | 32 | timeout {puts "TESTING ERROR 4\n";exit} |