diff options
Diffstat (limited to 'test/servers5.exp')
-rwxr-xr-x | test/servers5.exp | 56 |
1 files changed, 56 insertions, 0 deletions
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" | ||