summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar root <root@debian>2015-11-15 12:35:37 -0500
committerLibravatar root <root@debian>2015-11-15 12:35:37 -0500
commit2928d900ab261d247163e28c7773e59cba7d3a6f (patch)
tree0eb04af0cbb6c0b0954b5138c192e0068792952d /test
parentwhitelist enhancements (diff)
downloadfirejail-2928d900ab261d247163e28c7773e59cba7d3a6f.tar.gz
firejail-2928d900ab261d247163e28c7773e59cba7d3a6f.tar.zst
firejail-2928d900ab261d247163e28c7773e59cba7d3a6f.zip
server testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/fs_chroot_asroot.exp2
-rwxr-xr-xtest/servers5.exp56
-rwxr-xr-xtest/test-root.sh6
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
76send -- "ps aux |wc -l; pwd\r" 76send -- "ps aux |wc -l; pwd\r"
77expect { 77expect {
78 timeout {puts "TESTING ERROR 5\n";exit} 78 timeout {puts "TESTING ERROR 5\n";exit}
79 "5" 79 "6"
80} 80}
81expect { 81expect {
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
3set timeout 5
4spawn $env(SHELL)
5match_max 100000
6
7send -- "sudo ls; sudo whoami; sudo pwd\r"
8expect {
9 timeout {puts "TESTING ERROR: you need to root run this test as root\n";exit}
10 "root"
11}
12
13send -- "pkill unbound\r"
14sleep 2
15
16send -- "firejail --name=unbound unbound\r"
17expect {
18 timeout {puts "TESTING ERROR 0\n";exit}
19 "Child process initialized"
20}
21sleep 2
22
23spawn $env(SHELL)
24send -- "firejail --tree\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "unbound:unbound"
28}
29sleep 2
30
31send -- "tail /var/log/syslog\r"
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "unbound"
35}
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 "info: start of service"
39}
40sleep 2
41
42send -- "firejail --join=unbound\r"
43sleep 2
44
45send -- "ls /dev\r"
46expect {
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}
53sleep 2
54
55
56puts "\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
30fi 30fi
31 31
32if [ -f /etc/init.d/unbound ]
33then
34 echo "TESTING: servers unbound, private-dev"
35 ./servers5.exp
36fi
37
32echo "TESTING: /proc/sysrq-trigger reset disabled" 38echo "TESTING: /proc/sysrq-trigger reset disabled"
33./sysrq-trigger.exp 39./sysrq-trigger.exp
34 40