diff options
Diffstat (limited to 'test/environment/dns.exp')
-rwxr-xr-x | test/environment/dns.exp | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/test/environment/dns.exp b/test/environment/dns.exp new file mode 100755 index 000000000..0d12a82f2 --- /dev/null +++ b/test/environment/dns.exp | |||
@@ -0,0 +1,76 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 30 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "cat /etc/resolv.conf\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
17 | "nameserver 8.8.4.4" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
21 | "nameserver 8.8.8.8" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
25 | "nameserver 4.2.2.1" | ||
26 | } | ||
27 | after 100 | ||
28 | send -- "exit\r" | ||
29 | sleep 1 | ||
30 | |||
31 | |||
32 | send -- "firejail --profile=dns.profile\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 12.1\n";exit} | ||
35 | "Child process initialized" | ||
36 | } | ||
37 | sleep 1 | ||
38 | |||
39 | send -- "cat /etc/resolv.conf\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 12.2\n";exit} | ||
42 | "nameserver 8.8.4.4" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 12.3\n";exit} | ||
46 | "nameserver 8.8.8.8" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 12.4\n";exit} | ||
50 | "nameserver 4.2.2.1" | ||
51 | } | ||
52 | after 100 | ||
53 | send -- "exit\r" | ||
54 | sleep 1 | ||
55 | |||
56 | send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
59 | "connect" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
63 | "208.67.222.222" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
67 | "53" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | send -- "rm index.html\r" | ||
72 | after 100 | ||
73 | send -- "exit\r" | ||
74 | sleep 1 | ||
75 | |||
76 | puts "\nall done\n" | ||