diff options
author | 2023-03-09 09:21:35 -0500 | |
---|---|---|
committer | 2023-03-09 09:21:35 -0500 | |
commit | 18765f235857f5c4e11f5e39fcdc13b5c76759fa (patch) | |
tree | 2fa74ff3a2af81c924f1b15acccf38d65b0b4943 /test/network/netfilter-template.exp | |
parent | Merge branch 'master' of ssh://github.com/netblue30/firejail (diff) | |
download | firejail-18765f235857f5c4e11f5e39fcdc13b5c76759fa.tar.gz firejail-18765f235857f5c4e11f5e39fcdc13b5c76759fa.tar.zst firejail-18765f235857f5c4e11f5e39fcdc13b5c76759fa.zip |
testing
Diffstat (limited to 'test/network/netfilter-template.exp')
-rwxr-xr-x | test/network/netfilter-template.exp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/network/netfilter-template.exp b/test/network/netfilter-template.exp new file mode 100755 index 000000000..2dc50cef7 --- /dev/null +++ b/test/network/netfilter-template.exp | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | |||
11 | send -- "firejail --net=br0 --ip=10.10.30.10 --name=test1 --netfilter=/etc/firejail/blablabla\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "invalid network filter file" | ||
15 | } | ||
16 | after 500 | ||
17 | |||
18 | send -- "firejail --net=br0 --ip=10.10.20.10 --name=test1 --netfilter=/etc/firejail/tcpserver.net,5678\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 2 | ||
24 | |||
25 | spawn $env(SHELL) | ||
26 | send -- "firejail --netfilter.print=test1\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "Chain INPUT" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "ACCEPT" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 4\n";exit} | ||
37 | "tcp dpt:5678 state NEW,ESTABLISHED" | ||
38 | } | ||
39 | sleep 1 | ||
40 | |||
41 | puts "\nall done\n" | ||