aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/netfilter-template.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/netfilter-template.exp')
-rwxr-xr-xtest/network/netfilter-template.exp44
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --net=br1 --ip=10.10.30.10 --name=test1 --netfilter=/etc/firejail/tcpserver.net,5555 ./tcpserver 5555\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "telnet 10.10.30.10 5555\r"
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "Connected to 10.10.30.10"
22}
23sleep 1
24
25send "sdfklsjadfl;ksadjfl;sdkfj\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "response"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Connection closed"
33}
34sleep 1
35
36send -- "telnet 10.10.30.10 5556\r"
37expect {
38 timeout {puts "OK\n"}
39 "Connected to 10.10.30.10" {puts "TESTING ERROR 6\n";exit}
40 "dikasdfjasdjf"
41}
42
43after 100
44puts "all done\n"