aboutsummaryrefslogtreecommitdiffstats
path: root/test/servers.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/servers.exp')
-rwxr-xr-xtest/servers.exp40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/servers.exp b/test/servers.exp
new file mode 100755
index 000000000..a36814a69
--- /dev/null
+++ b/test/servers.exp
@@ -0,0 +1,40 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "sudo ls; sudo whoami; sudo pwd\r"
8expect {
9 timeout {puts "TESTING ERROR: you need to root run this test as root\n";exit}
10 "root"
11}
12
13send -- "firejail --net=br0 --ip=10.10.20.5 --seccomp\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 2
19
20
21send -- "/etc/init.d/rsyslog start;sleep 1;/etc/init.d/ssh start;sleep 1;/etc/init.d/nginx start\r"
22sleep 3
23
24send -- "ps aux; pwd\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "rsyslogd"
28}
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 "sshd"
32}
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "nginx"
36}
37
38send -- "exit\r"
39sleep 1
40puts "\n"