diff options
author | netblue30 <netblue30@yahoo.com> | 2016-09-15 09:59:11 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-09-15 09:59:11 -0400 |
commit | fc116c063938d5e141d5fbc38e8013d9832ef315 (patch) | |
tree | 382b401cc0a9efeda1509a88bd430cd68b741346 /test/root/isc-dhcp.exp | |
parent | fixed /etc/login.def reading on Mageia systems (diff) | |
download | firejail-fc116c063938d5e141d5fbc38e8013d9832ef315.tar.gz firejail-fc116c063938d5e141d5fbc38e8013d9832ef315.tar.zst firejail-fc116c063938d5e141d5fbc38e8013d9832ef315.zip |
testing
Diffstat (limited to 'test/root/isc-dhcp.exp')
-rwxr-xr-x | test/root/isc-dhcp.exp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/root/isc-dhcp.exp b/test/root/isc-dhcp.exp new file mode 100755 index 000000000..86500707a --- /dev/null +++ b/test/root/isc-dhcp.exp | |||
@@ -0,0 +1,58 @@ | |||
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 dhcpd\r" | ||
14 | sleep 2 | ||
15 | |||
16 | send -- "firejail --name=dhcpd /etc/init.d/isc-dhcp-server start\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 | "root:/usr/sbin/dhcpd" | ||
28 | } | ||
29 | sleep 2 | ||
30 | |||
31 | send -- "tail -n 200 /var/log/syslog\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3\n";exit} | ||
34 | "Internet Systems Consortium DHCP Server" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | "Wrote 0 leases to leases file" | ||
39 | } | ||
40 | sleep 2 | ||
41 | |||
42 | send -- "firejail --join=dhcpd\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 | "ppp" {puts "TESTING ERROR 6\n";exit} | ||
51 | "audio" {puts "TESTING ERROR 6\n";exit} | ||
52 | "log" | ||
53 | } | ||
54 | sleep 2 | ||
55 | |||
56 | |||
57 | puts "\nall done\n" | ||
58 | |||