diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-15 13:18:52 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-15 13:18:52 -0500 |
commit | 27637c0fcdf34559b37490f56142e283f1ebf0bb (patch) | |
tree | 7d97be0f26bd92174bf3507bb41bff32d62c45ff /test/servers3.exp | |
parent | server testing (diff) | |
download | firejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.tar.gz firejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.tar.zst firejail-27637c0fcdf34559b37490f56142e283f1ebf0bb.zip |
servers testing
Diffstat (limited to 'test/servers3.exp')
-rwxr-xr-x | test/servers3.exp | 42 |
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 | ||
3 | set timeout 10 | 3 | set timeout 5 |
4 | spawn $env(SHELL) | 4 | spawn $env(SHELL) |
5 | match_max 100000 | 5 | match_max 100000 |
6 | 6 | ||
@@ -10,37 +10,59 @@ expect { | |||
10 | "root" | 10 | "root" |
11 | } | 11 | } |
12 | 12 | ||
13 | send -- "firejail --net=br0 --ip=10.10.20.5 --seccomp\r" | 13 | send -- "pkill apache\r" |
14 | sleep 2 | ||
15 | |||
16 | |||
17 | send -- "firejail --name=apache /etc/init.d/apache2 start\r" | ||
14 | expect { | 18 | expect { |
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 | } |
18 | sleep 2 | 22 | sleep 2 |
19 | 23 | ||
20 | send -- "/etc/init.d/apache2 start\r" | ||
21 | sleep 2 | ||
22 | 24 | ||
23 | send -- "ps aux; pwd\r" | 25 | spawn $env(SHELL) |
26 | send -- "firejail --tree\r" | ||
24 | expect { | 27 | expect { |
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 | } |
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 2\n";exit} | ||
33 | "www-data:/usr/sbin/apache2" | ||
34 | } | ||
35 | sleep 2 | ||
36 | |||
28 | 37 | ||
29 | send -- "rm index.html\r" | 38 | send -- "rm index.html\r" |
30 | sleep 1 | 39 | sleep 1 |
31 | send -- "wget 0\r" | 40 | send -- "wget 0\r" |
32 | expect { | 41 | expect { |
33 | timeout {puts "TESTING ERROR 2\n";exit} | 42 | timeout {puts "TESTING ERROR 3\n";exit} |
34 | "saved" | 43 | "saved" |
35 | } | 44 | } |
36 | send -- "cat index.html\r" | 45 | send -- "cat index.html\r" |
37 | expect { | 46 | expect { |
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 | ||
51 | sleep 1 | ||
52 | send -- "rm index.html\r" | ||
53 | |||
54 | send -- "firejail --join=apache\r" | ||
55 | sleep 2 | ||
42 | 56 | ||
57 | send -- "ls /dev\r" | ||
58 | expect { | ||
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 | } | ||
66 | sleep 2 | ||
43 | 67 | ||
44 | send -- "exit\r" | ||
45 | sleep 1 | ||
46 | puts "\nall done\n" | 68 | puts "\nall done\n" |