diff options
Diffstat (limited to 'test/network/netfilter-template.exp')
-rwxr-xr-x | test/network/netfilter-template.exp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/network/netfilter-template.exp b/test/network/netfilter-template.exp new file mode 100755 index 000000000..637b32468 --- /dev/null +++ b/test/network/netfilter-template.exp | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --net=br1 --ip=10.10.30.10 --name=test1 --netfilter=/etc/firejail/tcpserver.net,5555 ./tcpserver 5555\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "telnet 10.10.30.10 5555\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "Connected to 10.10.30.10" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send "sdfklsjadfl;ksadjfl;sdkfj\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "response" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "Connection closed" | ||
33 | } | ||
34 | sleep 1 | ||
35 | |||
36 | send -- "telnet 10.10.30.10 5556\r" | ||
37 | expect { | ||
38 | timeout {puts "OK\n"} | ||
39 | "Connected to 10.10.30.10" {puts "TESTING ERROR 6\n";exit} | ||
40 | "dikasdfjasdjf" | ||
41 | } | ||
42 | |||
43 | after 100 | ||
44 | puts "all done\n" | ||