diff options
author | netblue30 <netblue30@yahoo.com> | 2017-11-18 08:39:02 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-11-18 08:39:02 -0500 |
commit | ead4ec3089b97eda1b438da248caf76f169345ad (patch) | |
tree | 31bc22bcba4e6530b5f0daba3f332702efa7a4b9 /test/fnetfilter/template.exp | |
parent | Consistent home directory nomenclature (diff) | |
download | firejail-ead4ec3089b97eda1b438da248caf76f169345ad.tar.gz firejail-ead4ec3089b97eda1b438da248caf76f169345ad.tar.zst firejail-ead4ec3089b97eda1b438da248caf76f169345ad.zip |
netfilter template support
Diffstat (limited to 'test/fnetfilter/template.exp')
-rwxr-xr-x | test/fnetfilter/template.exp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/test/fnetfilter/template.exp b/test/fnetfilter/template.exp new file mode 100755 index 000000000..eb57313bd --- /dev/null +++ b/test/fnetfilter/template.exp | |||
@@ -0,0 +1,82 @@ | |||
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 -- "rm outfile\r" | ||
11 | after 100 | ||
12 | |||
13 | send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request,3478,3479 outfile\r" | ||
14 | after 100 | ||
15 | |||
16 | send -- "cat outfile\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | "*filter" | ||
20 | } | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 2\n";exit} | ||
23 | "INPUT -m state --state RELATED,ESTABLISHED" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 3\n";exit} | ||
27 | "icmp-type echo-reply" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 4\n";exit} | ||
31 | "icmp-type destination-unreachable" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 5\n";exit} | ||
35 | "icmp-type time-exceeded" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 6\n";exit} | ||
39 | "icmp-type echo-request" | ||
40 | } | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 7\n";exit} | ||
43 | "dport 3478" | ||
44 | } | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 8\n";exit} | ||
47 | "dport 3479" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 8\n";exit} | ||
51 | "dport 3478" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 10\n";exit} | ||
55 | "dport 3479" | ||
56 | } | ||
57 | after 100 | ||
58 | |||
59 | send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request outfile\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 11\n";exit} | ||
62 | "ARG5 on line 14 was not defined" | ||
63 | } | ||
64 | after 100 | ||
65 | |||
66 | send -- "fnetfilter test2.net,icmp-type,destination-unreachable,time-exceeded,echo-request\r" | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 12\n";exit} | ||
69 | "invalid destination file in netfilter command" | ||
70 | } | ||
71 | after 100 | ||
72 | |||
73 | send -- "fnetfilter test3.net,44 outfile\r" | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 13\n";exit} | ||
76 | "invalid template argument on line 1" | ||
77 | } | ||
78 | after 100 | ||
79 | send -- "rm outfile\r" | ||
80 | after 100 | ||
81 | |||
82 | puts "\nall done\n" | ||