aboutsummaryrefslogtreecommitdiffstats
path: root/test/servers3.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-15 13:18:52 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-15 13:18:52 -0500
commit27637c0fcdf34559b37490f56142e283f1ebf0bb (patch)
tree7d97be0f26bd92174bf3507bb41bff32d62c45ff /test/servers3.exp
parentserver testing (diff)
downloadfirejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.tar.gz
firejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.tar.zst
firejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.zip
servers testing
Diffstat (limited to 'test/servers3.exp')
-rwxr-xr-xtest/servers3.exp42
1 files changed, 32 insertions, 10 deletions
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 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2 2
3set timeout 10 3set timeout 5
4spawn $env(SHELL) 4spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
@@ -10,37 +10,59 @@ expect {
10 "root" 10 "root"
11} 11}
12 12
13send -- "firejail --net=br0 --ip=10.10.20.5 --seccomp\r" 13send -- "pkill apache\r"
14sleep 2
15
16
17send -- "firejail --name=apache /etc/init.d/apache2 start\r"
14expect { 18expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 19 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized" 20 "Child process initialized"
17} 21}
18sleep 2 22sleep 2
19 23
20send -- "/etc/init.d/apache2 start\r"
21sleep 2
22 24
23send -- "ps aux; pwd\r" 25spawn $env(SHELL)
26send -- "firejail --tree\r"
24expect { 27expect {
25 timeout {puts "TESTING ERROR 1\n";exit} 28 timeout {puts "TESTING ERROR 1\n";exit}
26 "apache" 29 "root:/usr/sbin/apache2"
27} 30}
31expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 "www-data:/usr/sbin/apache2"
34}
35sleep 2
36
28 37
29send -- "rm index.html\r" 38send -- "rm index.html\r"
30sleep 1 39sleep 1
31send -- "wget 0\r" 40send -- "wget 0\r"
32expect { 41expect {
33 timeout {puts "TESTING ERROR 2\n";exit} 42 timeout {puts "TESTING ERROR 3\n";exit}
34 "saved" 43 "saved"
35} 44}
36send -- "cat index.html\r" 45send -- "cat index.html\r"
37expect { 46expect {
38 timeout {puts "TESTING ERROR 3\n";exit} 47 timeout {puts "TESTING ERROR 4\n";exit}
39 "This is the default web page for this server" 48 "This is the default web page for this server"
40} 49}
41 50
51sleep 1
52send -- "rm index.html\r"
53
54send -- "firejail --join=apache\r"
55sleep 2
42 56
57send -- "ls /dev\r"
58expect {
59 timeout {puts "TESTING ERROR 5\n";exit}
60 "tty0" {puts "TESTING ERROR 6\n";exit}
61 "ttyS0" {puts "TESTING ERROR 6\n";exit}
62 "audio" {puts "TESTING ERROR 6\n";exit}
63 "ppp" {puts "TESTING ERROR 6\n";exit}
64 "log"
65}
66sleep 2
43 67
44send -- "exit\r"
45sleep 1
46puts "\nall done\n" 68puts "\nall done\n"