aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_none.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-03-02 08:19:41 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-03-02 08:19:41 -0500
commit91235785e06ac890514fd51fa44aa14e7c2e108e (patch)
tree5834f92126a508af41f65a0bf4fba96e46ccbd17 /test/network/net_none.exp
parentappimage testing (diff)
downloadfirejail-91235785e06ac890514fd51fa44aa14e7c2e108e.tar.gz
firejail-91235785e06ac890514fd51fa44aa14e7c2e108e.tar.zst
firejail-91235785e06ac890514fd51fa44aa14e7c2e108e.zip
network testing
Diffstat (limited to 'test/network/net_none.exp')
-rwxr-xr-xtest/network/net_none.exp52
1 files changed, 10 insertions, 42 deletions
diff --git a/test/network/net_none.exp b/test/network/net_none.exp
index aa071862e..6932c7e8a 100755
--- a/test/network/net_none.exp
+++ b/test/network/net_none.exp
@@ -11,63 +11,31 @@ match_max 100000
11send -- "firejail --net=none\r" 11send -- "firejail --net=none\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "eth0" {puts "TESTING ERROR 0.1\n";exit}
15 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
16} 15}
17sleep 1 16after 500
18 17
19# test default gw 18send -- "cat /proc/1/net/dev | wc -l\r"
20send -- "bash\r"
21sleep 1
22send -- "stty -echo\r"
23after 100
24
25send -- "netstat -rn; echo done\r"
26expect { 19expect {
27 timeout {puts "TESTING ERROR 1\n";exit} 20 timeout {puts "TESTING ERROR 1\n";exit}
28 "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit} 21 "3"
29 "done"
30} 22}
31sleep 1
32
33# check again devices
34send -- "cat /proc/1/net/dev;echo done\r"
35expect {
36 timeout {puts "TESTING ERROR 2\n";exit}
37 "eth0" {puts "TESTING ERROR 2.1\n";exit}
38 "done"
39}
40send -- "exit\r"
41sleep 1
42send -- "exit\r" 23send -- "exit\r"
43sleep 1 24after 500
25
44 26
45# profile 27# profile
46send -- "firejail --profile=net_none.profile\r" 28send -- "firejail --profile=net_none.profile\r"
47expect { 29expect {
48 timeout {puts "TESTING ERROR 3\n";exit} 30 timeout {puts "TESTING ERROR 2\n";exit}
49 "eth0" {puts "TESTING ERROR 3.1\n";exit}
50 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 31 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
51} 32}
52sleep 1 33after 500
53 34
54# test default gw 35send -- "cat /proc/1/net/dev | wc -l\r"
55send -- "bash\r"
56sleep 1
57send -- "netstat -rn; echo done\r"
58expect { 36expect {
59 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 3\n";exit}
60 "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} 38 "3"
61 "done"
62}
63sleep 1
64
65# check again devices
66send -- "cat /proc/1/net/dev;echo done\r"
67expect {
68 timeout {puts "TESTING ERROR 5\n";exit}
69 "eth0" {puts "TESTING ERROR 5.1\n";exit}
70 "done"
71} 39}
72send -- "exit\r" 40send -- "exit\r"
73after 100 41after 100