diff options
Diffstat (limited to 'test/servers2.exp')
-rwxr-xr-x | test/servers2.exp | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/test/servers2.exp b/test/servers2.exp index 28bcae207..90e34470f 100755 --- a/test/servers2.exp +++ b/test/servers2.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,22 +10,48 @@ expect { | |||
10 | "root" | 10 | "root" |
11 | } | 11 | } |
12 | 12 | ||
13 | send -- "firejail --net=br0 --ip=10.10.20.5--seccomp\r" | 13 | send -- "pkill snmpd\r" |
14 | sleep 2 | ||
15 | |||
16 | |||
17 | send -- "firejail --name=snmpd /etc/init.d/snmpd 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/snmpd start" | 24 | spawn $env(SHELL) |
25 | send -- "firejail --tree\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "snmp:/usr/sbin/snmpd" | ||
29 | } | ||
21 | sleep 2 | 30 | sleep 2 |
22 | 31 | ||
23 | send -- "ps aux; pwd\r" | 32 | send -- "tail /var/log/syslog\r" |
24 | expect { | 33 | expect { |
25 | timeout {puts "TESTING ERROR 1\n";exit} | 34 | timeout {puts "TESTING ERROR 3\n";exit} |
26 | "snmpd" | 35 | "snmpd" |
27 | } | 36 | } |
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | "NET-SNMP version" | ||
40 | } | ||
28 | 41 | ||
29 | send -- "exit\r" | 42 | send -- "firejail --join=snmpd\r" |
30 | sleep 1 | 43 | sleep 2 |
31 | puts "\n" | 44 | |
45 | send -- "ls /dev\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 5\n";exit} | ||
48 | "tty0" {puts "TESTING ERROR 6\n";exit} | ||
49 | "ttyS0" {puts "TESTING ERROR 6\n";exit} | ||
50 | "audio" {puts "TESTING ERROR 6\n";exit} | ||
51 | "ppp" {puts "TESTING ERROR 6\n";exit} | ||
52 | "log" | ||
53 | } | ||
54 | sleep 2 | ||
55 | |||
56 | sleep 2 | ||
57 | puts "\nall done\n" | ||