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