aboutsummaryrefslogtreecommitdiffstats
path: root/test/environment
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2019-10-31 17:37:36 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2019-10-31 17:37:36 -0400
commit11418a46c1c1c51a1270bb585bf8152f9298bc74 (patch)
tree17b60e42e62ecb6d4096f9bfbaaa0543defd7326 /test/environment
parenttesting (diff)
downloadfirejail-11418a46c1c1c51a1270bb585bf8152f9298bc74.tar.gz
firejail-11418a46c1c1c51a1270bb585bf8152f9298bc74.tar.zst
firejail-11418a46c1c1c51a1270bb585bf8152f9298bc74.zip
dns fixes
Diffstat (limited to 'test/environment')
-rwxr-xr-xtest/environment/dns.exp74
1 files changed, 60 insertions, 14 deletions
diff --git a/test/environment/dns.exp b/test/environment/dns.exp
index 6ddc0ccea..d1f3f650f 100755
--- a/test/environment/dns.exp
+++ b/test/environment/dns.exp
@@ -1,31 +1,77 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2 2
3set timeout 30 3set timeout 10
4spawn $env(SHELL) 4spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
7send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2 --dns=1.2.3.4 sleep 1\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Warning: up to 4 DNS servers can be specified, 1.2.3.4 ignored"
11}
12expect {
13 timeout {puts "TESTING ERROR 1.1\n";exit}
14 "DNS server 8.8.4.4"
15}
16expect {
17 timeout {puts "TESTING ERROR 1.2\n";exit}
18 "DNS server 8.8.8.8"
19}
20expect {
21 timeout {puts "TESTING ERROR 1.3\n";exit}
22 "DNS server 4.2.2.1"
23}
24expect {
25 timeout {puts "TESTING ERROR 1.4\n";exit}
26 "DNS server ::2"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.5\n";exit}
30 "Child process initialized"
31}
32expect {
33 timeout {puts "TESTING ERROR 1.6\n";exit}
34 "Parent is shutting down, bye..."
35}
36after 100
37
38
39send -- "firejail --quiet --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2 --dns=1.2.3.4 cat /etc/passwd\r"
40expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "Warning: up to 4 DNS servers can be specified, 1.2.3.4 ignored" {puts "TESTING ERROR 2.1\n";exit}
43 "DNS server 8.8.4.4" {puts "TESTING ERROR 2.2\n";exit}
44 "DNS server 8.8.8.8" {puts "TESTING ERROR 2.3\n";exit}
45 "DNS server 4.2.2.1" {puts "TESTING ERROR 2.4\n";exit}
46 "DNS server ::2" {puts "TESTING ERROR 2.5\n";exit}
47 "Child process initialized" {puts "TESTING ERROR 2.6\n";exit}
48 "Parent is shutting down, bye..." {puts "TESTING ERROR 2.7\n";exit}
49 "root"
50}
51after 100
52
7send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2\r" 53send -- "firejail --dns=8.8.4.4 --dns=8.8.8.8 --dns=4.2.2.1 --dns=::2\r"
8expect { 54expect {
9 timeout {puts "TESTING ERROR 2.1\n";exit} 55 timeout {puts "TESTING ERROR 3\n";exit}
10 "Child process initialized" 56 "Child process initialized"
11} 57}
12sleep 1 58sleep 1
13 59
14send -- "cat /etc/resolv.conf\r" 60send -- "cat /etc/resolv.conf\r"
15expect { 61expect {
16 timeout {puts "TESTING ERROR 2.2\n";exit} 62 timeout {puts "TESTING ERROR 4.1\n";exit}
17 "nameserver 8.8.4.4" 63 "nameserver 8.8.4.4"
18} 64}
19expect { 65expect {
20 timeout {puts "TESTING ERROR 2.3\n";exit} 66 timeout {puts "TESTING ERROR 4.2\n";exit}
21 "nameserver 8.8.8.8" 67 "nameserver 8.8.8.8"
22} 68}
23expect { 69expect {
24 timeout {puts "TESTING ERROR 2.4\n";exit} 70 timeout {puts "TESTING ERROR 4.3\n";exit}
25 "nameserver 4.2.2.1" 71 "nameserver 4.2.2.1"
26} 72}
27expect { 73expect {
28 timeout {puts "TESTING ERROR 2.5\n";exit} 74 timeout {puts "TESTING ERROR 4.4\n";exit}
29 "nameserver ::2" 75 "nameserver ::2"
30} 76}
31after 100 77after 100
@@ -35,27 +81,27 @@ sleep 1
35 81
36send -- "firejail --profile=dns.profile\r" 82send -- "firejail --profile=dns.profile\r"
37expect { 83expect {
38 timeout {puts "TESTING ERROR 12.1\n";exit} 84 timeout {puts "TESTING ERROR 5.1\n";exit}
39 "Child process initialized" 85 "Child process initialized"
40} 86}
41sleep 1 87sleep 1
42 88
43send -- "cat /etc/resolv.conf\r" 89send -- "cat /etc/resolv.conf\r"
44expect { 90expect {
45 timeout {puts "TESTING ERROR 12.2\n";exit} 91 timeout {puts "TESTING ERROR 5.2\n";exit}
46 "nameserver 8.8.4.4" 92 "nameserver 8.8.4.4"
47} 93}
48expect { 94expect {
49 timeout {puts "TESTING ERROR 12.3\n";exit} 95 timeout {puts "TESTING ERROR 5.3\n";exit}
50 "nameserver 8.8.8.8" 96 "nameserver 8.8.8.8"
51} 97}
52expect { 98expect {
53 timeout {puts "TESTING ERROR 12.4\n";exit} 99 timeout {puts "TESTING ERROR 5.4\n";exit}
54 "nameserver 4.2.2.1" 100 "nameserver 4.2.2.1"
55} 101}
56after 100 102after 100
57expect { 103expect {
58 timeout {puts "TESTING ERROR 12.5\n";exit} 104 timeout {puts "TESTING ERROR 5.5\n";exit}
59 "nameserver ::2" 105 "nameserver ::2"
60} 106}
61send -- "exit\r" 107send -- "exit\r"
@@ -63,15 +109,15 @@ sleep 1
63 109
64send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r" 110send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r"
65expect { 111expect {
66 timeout {puts "TESTING ERROR 1.2\n";exit} 112 timeout {puts "TESTING ERROR 6.1\n";exit}
67 "connect" 113 "connect"
68} 114}
69expect { 115expect {
70 timeout {puts "TESTING ERROR 1.2\n";exit} 116 timeout {puts "TESTING ERROR 6.2\n";exit}
71 "208.67.222.222" 117 "208.67.222.222"
72} 118}
73expect { 119expect {
74 timeout {puts "TESTING ERROR 1.2\n";exit} 120 timeout {puts "TESTING ERROR 6.3\n";exit}
75 "53" 121 "53"
76} 122}
77after 100 123after 100