From 27637c0fcdf34559b37490f56142e283f1ebf0bb Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 15 Nov 2015 13:18:52 -0500 Subject: servers testing --- test/servers3.exp | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'test/servers3.exp') diff --git a/test/servers3.exp b/test/servers3.exp index da44a28ee..20a20a88d 100755 --- a/test/servers3.exp +++ b/test/servers3.exp @@ -1,6 +1,6 @@ #!/usr/bin/expect -f -set timeout 10 +set timeout 5 spawn $env(SHELL) match_max 100000 @@ -10,37 +10,59 @@ expect { "root" } -send -- "firejail --net=br0 --ip=10.10.20.5 --seccomp\r" +send -- "pkill apache\r" +sleep 2 + + +send -- "firejail --name=apache /etc/init.d/apache2 start\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" } sleep 2 -send -- "/etc/init.d/apache2 start\r" -sleep 2 -send -- "ps aux; pwd\r" +spawn $env(SHELL) +send -- "firejail --tree\r" expect { timeout {puts "TESTING ERROR 1\n";exit} - "apache" + "root:/usr/sbin/apache2" } +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "www-data:/usr/sbin/apache2" +} +sleep 2 + send -- "rm index.html\r" sleep 1 send -- "wget 0\r" expect { - timeout {puts "TESTING ERROR 2\n";exit} + timeout {puts "TESTING ERROR 3\n";exit} "saved" } send -- "cat index.html\r" expect { - timeout {puts "TESTING ERROR 3\n";exit} + timeout {puts "TESTING ERROR 4\n";exit} "This is the default web page for this server" } +sleep 1 +send -- "rm index.html\r" + +send -- "firejail --join=apache\r" +sleep 2 +send -- "ls /dev\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "tty0" {puts "TESTING ERROR 6\n";exit} + "ttyS0" {puts "TESTING ERROR 6\n";exit} + "audio" {puts "TESTING ERROR 6\n";exit} + "ppp" {puts "TESTING ERROR 6\n";exit} + "log" +} +sleep 2 -send -- "exit\r" -sleep 1 puts "\nall done\n" -- cgit v1.2.3-54-g00ecf