From 27637c0fcdf34559b37490f56142e283f1ebf0bb Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 15 Nov 2015 13:18:52 -0500 Subject: servers testing --- test/servers4.exp | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'test/servers4.exp') diff --git a/test/servers4.exp b/test/servers4.exp index 9feeecf61..86500707a 100755 --- a/test/servers4.exp +++ b/test/servers4.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f -set timeout 10 +set timeout 5 spawn $env(SHELL) match_max 100000 @@ -10,23 +10,49 @@ expect { "root" } -send -- "firejail --net=br0 --ip=10.10.20.5 --seccomp\r" +send -- "pkill dhcpd\r" +sleep 2 + +send -- "firejail --name=dhcpd /etc/init.d/isc-dhcp-server start\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" } sleep 2 -send -- "/etc/init.d/isc-dhcp-server start\r" -sleep 5 +spawn $env(SHELL) +send -- "firejail --tree\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "root:/usr/sbin/dhcpd" +} +sleep 2 + +send -- "tail -n 200 /var/log/syslog\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Internet Systems Consortium DHCP Server" +} +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Wrote 0 leases to leases file" +} +sleep 2 +send -- "firejail --join=dhcpd\r" +sleep 2 -send -- "ps aux; pwd\r" +send -- "ls /dev\r" expect { - timeout {puts "TESTING ERROR 1\n";exit} - "dhcpd" + timeout {puts "TESTING ERROR 5\n";exit} + "tty0" {puts "TESTING ERROR 6\n";exit} + "ttyS0" {puts "TESTING ERROR 6\n";exit} + "ppp" {puts "TESTING ERROR 6\n";exit} + "audio" {puts "TESTING ERROR 6\n";exit} + "log" } +sleep 2 + + +puts "\nall done\n" -send -- "exit\r" -sleep 1 -puts "\n" -- cgit v1.2.3-54-g00ecf