diff options
author | netblue30 <netblue30@protonmail.com> | 2023-03-02 08:19:41 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-03-02 08:19:41 -0500 |
commit | 91235785e06ac890514fd51fa44aa14e7c2e108e (patch) | |
tree | 5834f92126a508af41f65a0bf4fba96e46ccbd17 /test/network/net_none.exp | |
parent | appimage testing (diff) | |
download | firejail-91235785e06ac890514fd51fa44aa14e7c2e108e.tar.gz firejail-91235785e06ac890514fd51fa44aa14e7c2e108e.tar.zst firejail-91235785e06ac890514fd51fa44aa14e7c2e108e.zip |
network testing
Diffstat (limited to 'test/network/net_none.exp')
-rwxr-xr-x | test/network/net_none.exp | 52 |
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 | |||
11 | send -- "firejail --net=none\r" | 11 | send -- "firejail --net=none\r" |
12 | expect { | 12 | expect { |
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 | } |
17 | sleep 1 | 16 | after 500 |
18 | 17 | ||
19 | # test default gw | 18 | send -- "cat /proc/1/net/dev | wc -l\r" |
20 | send -- "bash\r" | ||
21 | sleep 1 | ||
22 | send -- "stty -echo\r" | ||
23 | after 100 | ||
24 | |||
25 | send -- "netstat -rn; echo done\r" | ||
26 | expect { | 19 | expect { |
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 | } |
31 | sleep 1 | ||
32 | |||
33 | # check again devices | ||
34 | send -- "cat /proc/1/net/dev;echo done\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 2\n";exit} | ||
37 | "eth0" {puts "TESTING ERROR 2.1\n";exit} | ||
38 | "done" | ||
39 | } | ||
40 | send -- "exit\r" | ||
41 | sleep 1 | ||
42 | send -- "exit\r" | 23 | send -- "exit\r" |
43 | sleep 1 | 24 | after 500 |
25 | |||
44 | 26 | ||
45 | # profile | 27 | # profile |
46 | send -- "firejail --profile=net_none.profile\r" | 28 | send -- "firejail --profile=net_none.profile\r" |
47 | expect { | 29 | expect { |
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 | } |
52 | sleep 1 | 33 | after 500 |
53 | 34 | ||
54 | # test default gw | 35 | send -- "cat /proc/1/net/dev | wc -l\r" |
55 | send -- "bash\r" | ||
56 | sleep 1 | ||
57 | send -- "netstat -rn; echo done\r" | ||
58 | expect { | 36 | expect { |
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 | } | ||
63 | sleep 1 | ||
64 | |||
65 | # check again devices | ||
66 | send -- "cat /proc/1/net/dev;echo done\r" | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 5\n";exit} | ||
69 | "eth0" {puts "TESTING ERROR 5.1\n";exit} | ||
70 | "done" | ||
71 | } | 39 | } |
72 | send -- "exit\r" | 40 | send -- "exit\r" |
73 | after 100 | 41 | after 100 |