aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/ip6.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/ip6.exp')
-rwxr-xr-xtest/network/ip6.exp89
1 files changed, 89 insertions, 0 deletions
diff --git a/test/network/ip6.exp b/test/network/ip6.exp
new file mode 100755
index 000000000..1db16c28a
--- /dev/null
+++ b/test/network/ip6.exp
@@ -0,0 +1,89 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug --noprofile --net=br0 --ip6=2001:0db8:0:f101::1/64 --netfilter6=ipv6.net\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Installing network filter"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "DROP"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "unable to initialize table 'filter'" {puts "\nTESTING SKIP 2: no IPv6 support\n"; exit}
22 "2001:db8:1f0a:3ec::2"
23}
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "Child process initialized"
27}
28sleep 2
29
30send -- "/sbin/ifconfig\r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "inet6"
34}
35expect {
36 timeout {puts "TESTING ERROR 5\n";exit}
37 "2001:db8:0:f101::1"
38}
39expect {
40 timeout {puts "TESTING ERROR 6\n";exit}
41 "Scope:Global" { puts "Debian\n"}
42 "scopeid 0x0<global>" { puts "Arch\n"}
43}
44
45send -- "exit\r"
46sleep 2
47
48
49send -- "firejail --debug --profile=ip6.profile\r"
50expect {
51 timeout {puts "TESTING ERROR 10\n";exit}
52 "Installing network filter"
53}
54expect {
55 timeout {puts "TESTING ERROR 11\n";exit}
56 "DROP"
57}
58expect {
59 timeout {puts "TESTING ERROR 12\n";exit}
60 "unable to initialize table 'filter'" {puts "\nTESTING SKIP 2: no IPv6 support\n"; exit}
61 "2001:db8:1f0a:3ec::2"
62}
63expect {
64 timeout {puts "TESTING ERROR 13\n";exit}
65 "Child process initialized"
66}
67sleep 2
68
69send -- "/sbin/ifconfig\r"
70expect {
71 timeout {puts "TESTING ERROR 14\n";exit}
72 "inet6"
73}
74expect {
75 timeout {puts "TESTING ERROR 15\n";exit}
76 "2001:db8:0:f101::1"
77}
78expect {
79 timeout {puts "TESTING ERROR 16\n";exit}
80 "Scope:Global" { puts "Debian\n"}
81 "scopeid 0x0<global>" { puts "Arch\n"}
82}
83
84send -- "exit\r"
85
86after 100
87
88puts "\nall done\n"
89