aboutsummaryrefslogtreecommitdiffstats
path: root/test/root/nginx.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/root/nginx.exp')
-rwxr-xr-xtest/root/nginx.exp65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/root/nginx.exp b/test/root/nginx.exp
new file mode 100755
index 000000000..82ebe0ee7
--- /dev/null
+++ b/test/root/nginx.exp
@@ -0,0 +1,65 @@
1#!/usr/bin/expect -f
2
3set timeout 5
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=nginx /etc/init.d/nginx start\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 2
13
14
15spawn $env(SHELL)
16send -- "firejail --tree\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 "root:nginx"
20}
21expect {
22 timeout {puts "TESTING ERROR 2\n";exit}
23 "www-data:nginx"
24}
25sleep 2
26
27
28send -- "rm index.html\r"
29sleep 1
30send -- "wget 0\r"
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "saved"
34}
35send -- "cat index.html\r"
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 "DOCTYPE html PUBLIC"
39}
40
41sleep 1
42send -- "rm index.html\r"
43
44send -- "firejail --join=nginx\r"
45sleep 2
46
47send -- "ls /dev\r"
48expect {
49 timeout {puts "TESTING ERROR 5\n";exit}
50 "tty0" {puts "TESTING ERROR 6\n";exit}
51 "ttyS0" {puts "TESTING ERROR 6\n";exit}
52 "audio" {puts "TESTING ERROR 6\n";exit}
53 "ppp" {puts "TESTING ERROR 6\n";exit}
54 "log"
55}
56sleep 1
57send -- "ls -al /tmp;pwd\r"
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "X11-unix" {puts "TESTING ERROR 11\n";exit}
61 "/root"
62}
63sleep 2
64
65puts "\nall done\n"