diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-09 09:43:31 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-09 09:43:31 -0500 |
commit | e44f60a25011e388ae9f33ce8d16b9d8cb143502 (patch) | |
tree | 2a13bc2f751db72c75f1cd96f88d932c4b5c4a90 /test | |
parent | testing (diff) | |
download | firejail-e44f60a25011e388ae9f33ce8d16b9d8cb143502.tar.gz firejail-e44f60a25011e388ae9f33ce8d16b9d8cb143502.tar.zst firejail-e44f60a25011e388ae9f33ce8d16b9d8cb143502.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/network/interface.exp | 66 | ||||
-rwxr-xr-x | test/network/net_scan.exp | 75 | ||||
-rwxr-xr-x | test/network/network.sh | 6 |
3 files changed, 147 insertions, 0 deletions
diff --git a/test/network/interface.exp b/test/network/interface.exp new file mode 100755 index 000000000..b15563eec --- /dev/null +++ b/test/network/interface.exp | |||
@@ -0,0 +1,66 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # interface | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | set overlay [lindex $argv 0] | ||
10 | set chroot [lindex $argv 1] | ||
11 | |||
12 | # | ||
13 | # N | ||
14 | # | ||
15 | # todo: seems to be unable to find interface eth0.7 | ||
16 | #send -- "firejail --noprofile --interface=eth0.5 --interface=eth0.6 --interface=eth0.7\r" | ||
17 | send -- "firejail --noprofile --interface=eth0.7 --interface=eth0.6\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 0\n";exit} | ||
20 | "Child process initialized" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | send -- "/sbin/ifconfig\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "eth0.5" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 2n";exit} | ||
31 | "Link" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "10.10.205.10" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
40 | } | ||
41 | after 100 | ||
42 | |||
43 | send -- "/sbin/ifconfig\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 5\n";exit} | ||
46 | "eth0.6" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 6\n";exit} | ||
50 | "Link" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 7\n";exit} | ||
54 | "10.10.206.10" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 8\n";exit} | ||
58 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
59 | } | ||
60 | after 100 | ||
61 | |||
62 | send -- "exit\r" | ||
63 | sleep 1 | ||
64 | |||
65 | |||
66 | puts "\nall done\n" | ||
diff --git a/test/network/net_scan.exp b/test/network/net_scan.exp new file mode 100755 index 000000000..5afbbeea6 --- /dev/null +++ b/test/network/net_scan.exp | |||
@@ -0,0 +1,75 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | send -- "firejail --net=br1 --ip=10.10.30.50\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "eth0" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 1\n";exit} | ||
18 | "10.10.30.50" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "255.255.255.0" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3\n";exit} | ||
26 | "Child process initialized" | ||
27 | } | ||
28 | sleep 1 | ||
29 | |||
30 | spawn $env(SHELL) | ||
31 | send -- "firejail --net=br1 --ip=10.10.30.51\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 4\n";exit} | ||
34 | "eth0" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 5\n";exit} | ||
38 | "10.10.30.51" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 6\n";exit} | ||
42 | "255.255.255.0" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 7\n";exit} | ||
46 | "Child process initialized" | ||
47 | } | ||
48 | sleep 1 | ||
49 | |||
50 | spawn $env(SHELL) | ||
51 | send -- "firejail --net=br1 --scan\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 8\n";exit} | ||
54 | "eth0" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 9\n";exit} | ||
58 | "10.10.30.50" | ||
59 | } | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 10\n";exit} | ||
62 | "10.10.30.51" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 11\n";exit} | ||
66 | "Child process initialized" | ||
67 | } | ||
68 | sleep 1 | ||
69 | |||
70 | |||
71 | |||
72 | after 100 | ||
73 | |||
74 | puts "\nall done\n" | ||
75 | |||
diff --git a/test/network/network.sh b/test/network/network.sh index 7b6d66e34..e0087411d 100755 --- a/test/network/network.sh +++ b/test/network/network.sh | |||
@@ -52,6 +52,12 @@ echo "TESTING: network default gateway test 2 (net_defaultgw2.exp)" | |||
52 | echo "TESTING: network default gateway test 3 (net_defaultgw3.exp)" | 52 | echo "TESTING: network default gateway test 3 (net_defaultgw3.exp)" |
53 | ./net_defaultgw3.exp | 53 | ./net_defaultgw3.exp |
54 | 54 | ||
55 | echo "TESTING: scan (net_scan.exp)" | ||
56 | ./net_scan.exp | ||
57 | |||
58 | echo "TESTING: interface (interface.exp)" | ||
59 | ./interface.exp | ||
60 | |||
55 | echo "TESTING: netfilter (net_netfilter.exp)" | 61 | echo "TESTING: netfilter (net_netfilter.exp)" |
56 | ./net_netfilter.exp | 62 | ./net_netfilter.exp |
57 | 63 | ||