diff options
author | root <root@debian> | 2015-11-15 12:35:37 -0500 |
---|---|---|
committer | root <root@debian> | 2015-11-15 12:35:37 -0500 |
commit | 2928d900ab261d247163e28c7773e59cba7d3a6f (patch) | |
tree | 0eb04af0cbb6c0b0954b5138c192e0068792952d | |
parent | whitelist enhancements (diff) | |
download | firejail-2928d900ab261d247163e28c7773e59cba7d3a6f.tar.gz firejail-2928d900ab261d247163e28c7773e59cba7d3a6f.tar.zst firejail-2928d900ab261d247163e28c7773e59cba7d3a6f.zip |
server testing
-rwxr-xr-x | test/fs_chroot_asroot.exp | 2 | ||||
-rwxr-xr-x | test/servers5.exp | 56 | ||||
-rwxr-xr-x | test/test-root.sh | 6 |
3 files changed, 63 insertions, 1 deletions
diff --git a/test/fs_chroot_asroot.exp b/test/fs_chroot_asroot.exp index 7e18153e0..6c27bf1db 100755 --- a/test/fs_chroot_asroot.exp +++ b/test/fs_chroot_asroot.exp | |||
@@ -76,7 +76,7 @@ sleep 1 | |||
76 | send -- "ps aux |wc -l; pwd\r" | 76 | send -- "ps aux |wc -l; pwd\r" |
77 | expect { | 77 | expect { |
78 | timeout {puts "TESTING ERROR 5\n";exit} | 78 | timeout {puts "TESTING ERROR 5\n";exit} |
79 | "5" | 79 | "6" |
80 | } | 80 | } |
81 | expect { | 81 | expect { |
82 | timeout {puts "TESTING ERROR 6\n";exit} | 82 | timeout {puts "TESTING ERROR 6\n";exit} |
diff --git a/test/servers5.exp b/test/servers5.exp new file mode 100755 index 000000000..68c986cbb --- /dev/null +++ b/test/servers5.exp | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 5 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "sudo ls; sudo whoami; sudo pwd\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR: you need to root run this test as root\n";exit} | ||
10 | "root" | ||
11 | } | ||
12 | |||
13 | send -- "pkill unbound\r" | ||
14 | sleep 2 | ||
15 | |||
16 | send -- "firejail --name=unbound unbound\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0\n";exit} | ||
19 | "Child process initialized" | ||
20 | } | ||
21 | sleep 2 | ||
22 | |||
23 | spawn $env(SHELL) | ||
24 | send -- "firejail --tree\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "unbound:unbound" | ||
28 | } | ||
29 | sleep 2 | ||
30 | |||
31 | send -- "tail /var/log/syslog\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3\n";exit} | ||
34 | "unbound" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | "info: start of service" | ||
39 | } | ||
40 | sleep 2 | ||
41 | |||
42 | send -- "firejail --join=unbound\r" | ||
43 | sleep 2 | ||
44 | |||
45 | send -- "ls /dev\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 5\n";exit} | ||
48 | "tty0" {puts "TESTING ERROR 6\n";exit} | ||
49 | "ttyS0" {puts "TESTING ERROR 6\n";exit} | ||
50 | "audio" {puts "TESTING ERROR 6\n";exit} | ||
51 | "log" | ||
52 | } | ||
53 | sleep 2 | ||
54 | |||
55 | |||
56 | puts "\nall done\n" | ||
diff --git a/test/test-root.sh b/test/test-root.sh index 94ac3447d..69a594e85 100755 --- a/test/test-root.sh +++ b/test/test-root.sh | |||
@@ -29,6 +29,12 @@ then | |||
29 | ./servers4.exp | 29 | ./servers4.exp |
30 | fi | 30 | fi |
31 | 31 | ||
32 | if [ -f /etc/init.d/unbound ] | ||
33 | then | ||
34 | echo "TESTING: servers unbound, private-dev" | ||
35 | ./servers5.exp | ||
36 | fi | ||
37 | |||
32 | echo "TESTING: /proc/sysrq-trigger reset disabled" | 38 | echo "TESTING: /proc/sysrq-trigger reset disabled" |
33 | ./sysrq-trigger.exp | 39 | ./sysrq-trigger.exp |
34 | 40 | ||