diff options
-rw-r--r-- | Makefile.in | 4 | ||||
-rwxr-xr-x | test/network/4bridges_arp.exp | 3 | ||||
-rwxr-xr-x | test/network/4bridges_ip.exp | 3 | ||||
-rw-r--r-- | test/network/README | 15 | ||||
-rwxr-xr-x | test/network/bandwidth.exp | 7 | ||||
-rwxr-xr-x | test/network/configure | 3 | ||||
-rwxr-xr-x | test/network/hostname.exp | 9 | ||||
-rwxr-xr-x | test/network/ip6.exp | 3 | ||||
-rwxr-xr-x | test/network/net_arp.exp | 3 | ||||
-rwxr-xr-x | test/network/net_badip.exp | 3 | ||||
-rwxr-xr-x | test/network/net_defaultgw.exp | 3 | ||||
-rwxr-xr-x | test/network/net_defaultgw2.exp | 3 | ||||
-rwxr-xr-x | test/network/net_defaultgw3.exp | 3 | ||||
-rwxr-xr-x | test/network/net_interface.exp | 3 | ||||
-rwxr-xr-x | test/network/net_ip.exp | 3 | ||||
-rwxr-xr-x | test/network/net_local.exp | 3 | ||||
-rwxr-xr-x | test/network/net_mac.exp | 3 | ||||
-rwxr-xr-x | test/network/net_macvlan.exp | 3 | ||||
-rwxr-xr-x | test/network/net_mtu.exp | 3 | ||||
-rwxr-xr-x | test/network/net_netfilter.exp | 3 | ||||
-rwxr-xr-x | test/network/net_noip.exp | 11 | ||||
-rwxr-xr-x | test/network/net_noip2.exp | 11 | ||||
-rwxr-xr-x | test/network/net_none.exp | 21 | ||||
-rwxr-xr-x | test/network/net_profile.exp | 3 |
24 files changed, 107 insertions, 22 deletions
diff --git a/Makefile.in b/Makefile.in index 8a6e8fa01..3f937b532 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -254,6 +254,7 @@ dist: | |||
254 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/compile test/.; cd .. | 254 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/compile test/.; cd .. |
255 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/dist-compile test/.; cd .. | 255 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/dist-compile test/.; cd .. |
256 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/filters test/.; cd .. | 256 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/filters test/.; cd .. |
257 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/network test/.; cd .. | ||
257 | cd $(NAME)-$(VERSION); rm -fr `find . -name .svn`; rm -fr $(NAME)-$(VERSION); cd .. | 258 | cd $(NAME)-$(VERSION); rm -fr `find . -name .svn`; rm -fr $(NAME)-$(VERSION); cd .. |
258 | tar -cjvf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) | 259 | tar -cjvf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) |
259 | rm -fr $(NAME)-$(VERSION) | 260 | rm -fr $(NAME)-$(VERSION) |
@@ -300,5 +301,8 @@ test-environment: | |||
300 | test-filters: | 301 | test-filters: |
301 | cd test/filters; ./filters.sh | grep TESTING | 302 | cd test/filters; ./filters.sh | grep TESTING |
302 | 303 | ||
304 | test-network: | ||
305 | echo "Please read test/netwok/README file and run the test manually" | ||
306 | |||
303 | test: test-profiles test-utils test-environment test-apps test-apps-x11 | 307 | test: test-profiles test-utils test-environment test-apps test-apps-x11 |
304 | echo "TEST COMPLETE" | 308 | echo "TEST COMPLETE" |
diff --git a/test/network/4bridges_arp.exp b/test/network/4bridges_arp.exp index 6a3e6db2a..f769df43b 100755 --- a/test/network/4bridges_arp.exp +++ b/test/network/4bridges_arp.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/4bridges_ip.exp b/test/network/4bridges_ip.exp index 8068aeebb..db7a61867 100755 --- a/test/network/4bridges_ip.exp +++ b/test/network/4bridges_ip.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/README b/test/network/README new file mode 100644 index 000000000..27e5667a2 --- /dev/null +++ b/test/network/README | |||
@@ -0,0 +1,15 @@ | |||
1 | Warning: this test requires root access to configure a number of bridge, macvlan and | ||
2 | vlan devices. Please take a look at configure file. By the time you are finished testing, | ||
3 | you'll probably have to reboot the computer to get your networking subsytem | ||
4 | back to normal. | ||
5 | |||
6 | Limitations - to be investigated and fixed: | ||
7 | - the test is assuming an eth0 wired interface to be present | ||
8 | - using netstat and ifconfig - this needs to be moved to iproute2 utilities | ||
9 | - configure script inserts an entry in system netfilter configuration | ||
10 | - the test will probably not work on grsecurity settings | ||
11 | - macvlan interfaces don't seem to work correctly under VirtualBox | ||
12 | |||
13 | Run the test: | ||
14 | $ sudo ./configure | ||
15 | $ ./network.sh | grep TESTING | ||
diff --git a/test/network/bandwidth.exp b/test/network/bandwidth.exp index 33b351296..a3dc9b55f 100755 --- a/test/network/bandwidth.exp +++ b/test/network/bandwidth.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
@@ -51,11 +54,11 @@ expect { | |||
51 | } | 54 | } |
52 | sleep 1 | 55 | sleep 1 |
53 | 56 | ||
54 | send -- "firejail --bandwidth=test status; pwd\r" | 57 | send -- "firejail --bandwidth=test status; echo done\r" |
55 | expect { | 58 | expect { |
56 | timeout {puts "TESTING ERROR 8\n";exit} | 59 | timeout {puts "TESTING ERROR 8\n";exit} |
57 | "rate 80Kbit burst 10Kb" {puts "TESTING ERROR 9\n";exit} | 60 | "rate 80Kbit burst 10Kb" {puts "TESTING ERROR 9\n";exit} |
58 | "home" {puts "ok\n"} | 61 | "done" |
59 | } | 62 | } |
60 | sleep 1 | 63 | sleep 1 |
61 | 64 | ||
diff --git a/test/network/configure b/test/network/configure index 788c5a9a0..35d938340 100755 --- a/test/network/configure +++ b/test/network/configure | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | brctl addbr br0 | 6 | brctl addbr br0 |
4 | ifconfig br0 10.10.20.1/29 up | 7 | ifconfig br0 10.10.20.1/29 up |
diff --git a/test/network/hostname.exp b/test/network/hostname.exp index 4e5c7e073..53f24f7b1 100755 --- a/test/network/hostname.exp +++ b/test/network/hostname.exp | |||
@@ -1,24 +1,27 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
5 | match_max 100000 | 8 | match_max 100000 |
6 | 9 | ||
7 | send -- "firejail --hostname=baluba --noprofile\r" | 10 | send -- "firejail --hostname=bingo --noprofile\r" |
8 | expect { | 11 | expect { |
9 | timeout {puts "TESTING ERROR 1\n";exit} | 12 | timeout {puts "TESTING ERROR 1\n";exit} |
10 | "Child process initialized" | 13 | "Child process initialized" |
11 | } | 14 | } |
12 | sleep 1 | 15 | sleep 1 |
13 | 16 | ||
14 | send -- "ping -c 3 baluba;pwd\r" | 17 | send -- "ping -c 3 bingo; echo done\r" |
15 | expect { | 18 | expect { |
16 | timeout {puts "TESTING ERROR 2\n";exit} | 19 | timeout {puts "TESTING ERROR 2\n";exit} |
17 | "3 packets transmitted, 3 received" | 20 | "3 packets transmitted, 3 received" |
18 | } | 21 | } |
19 | expect { | 22 | expect { |
20 | timeout {puts "TESTING ERROR 3\n";exit} | 23 | timeout {puts "TESTING ERROR 3\n";exit} |
21 | "home" | 24 | "done" |
22 | } | 25 | } |
23 | sleep 1 | 26 | sleep 1 |
24 | 27 | ||
diff --git a/test/network/ip6.exp b/test/network/ip6.exp index fba47d095..2cd756a1d 100755 --- a/test/network/ip6.exp +++ b/test/network/ip6.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_arp.exp b/test/network/net_arp.exp index 9e07744f3..f27f85814 100755 --- a/test/network/net_arp.exp +++ b/test/network/net_arp.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_badip.exp b/test/network/net_badip.exp index 71b69e104..8003252d6 100755 --- a/test/network/net_badip.exp +++ b/test/network/net_badip.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_defaultgw.exp b/test/network/net_defaultgw.exp index 840f2ccac..5534b7706 100755 --- a/test/network/net_defaultgw.exp +++ b/test/network/net_defaultgw.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_defaultgw2.exp b/test/network/net_defaultgw2.exp index db14e17cb..86f204e8c 100755 --- a/test/network/net_defaultgw2.exp +++ b/test/network/net_defaultgw2.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_defaultgw3.exp b/test/network/net_defaultgw3.exp index 64da9dfca..30150938f 100755 --- a/test/network/net_defaultgw3.exp +++ b/test/network/net_defaultgw3.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_interface.exp b/test/network/net_interface.exp index 4b55187ff..2e6619938 100755 --- a/test/network/net_interface.exp +++ b/test/network/net_interface.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_ip.exp b/test/network/net_ip.exp index f5d487ecc..0eff212dd 100755 --- a/test/network/net_ip.exp +++ b/test/network/net_ip.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_local.exp b/test/network/net_local.exp index 642213658..60ab2af05 100755 --- a/test/network/net_local.exp +++ b/test/network/net_local.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_mac.exp b/test/network/net_mac.exp index 076634730..5c48be9fd 100755 --- a/test/network/net_mac.exp +++ b/test/network/net_mac.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_macvlan.exp b/test/network/net_macvlan.exp index 20d022de9..ca503c26a 100755 --- a/test/network/net_macvlan.exp +++ b/test/network/net_macvlan.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_mtu.exp b/test/network/net_mtu.exp index 7943b2866..21b9aa5cb 100755 --- a/test/network/net_mtu.exp +++ b/test/network/net_mtu.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_netfilter.exp b/test/network/net_netfilter.exp index 989fcc407..f011f3746 100755 --- a/test/network/net_netfilter.exp +++ b/test/network/net_netfilter.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/network/net_noip.exp b/test/network/net_noip.exp index 8d28adb39..3fb53d860 100755 --- a/test/network/net_noip.exp +++ b/test/network/net_noip.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
@@ -16,24 +19,24 @@ send -- "bash\r" | |||
16 | sleep 1 | 19 | sleep 1 |
17 | 20 | ||
18 | # no default gateway configured | 21 | # no default gateway configured |
19 | send -- "netstat -rn;pwd\r" | 22 | send -- "netstat -rn;echo done\r" |
20 | expect { | 23 | expect { |
21 | timeout {puts "TESTING ERROR 2\n";exit} | 24 | timeout {puts "TESTING ERROR 2\n";exit} |
22 | "0.0.0.0" {puts "TESTING ERROR 3\n";exit} | 25 | "0.0.0.0" {puts "TESTING ERROR 3\n";exit} |
23 | "eth0" {puts "TESTING ERROR 4\n";exit} | 26 | "eth0" {puts "TESTING ERROR 4\n";exit} |
24 | "home" | 27 | "done" |
25 | } | 28 | } |
26 | sleep 1 | 29 | sleep 1 |
27 | 30 | ||
28 | # eth0 configured | 31 | # eth0 configured |
29 | send -- "/sbin/ifconfig;pwd\r" | 32 | send -- "/sbin/ifconfig;echo done\r" |
30 | expect { | 33 | expect { |
31 | timeout {puts "TESTING ERROR 5\n";exit} | 34 | timeout {puts "TESTING ERROR 5\n";exit} |
32 | "eth0" | 35 | "eth0" |
33 | } | 36 | } |
34 | expect { | 37 | expect { |
35 | timeout {puts "TESTING ERROR 6\n";exit} | 38 | timeout {puts "TESTING ERROR 6\n";exit} |
36 | "home" | 39 | "done" |
37 | } | 40 | } |
38 | after 100 | 41 | after 100 |
39 | 42 | ||
diff --git a/test/network/net_noip2.exp b/test/network/net_noip2.exp index 58f90422b..cf86d7f6b 100755 --- a/test/network/net_noip2.exp +++ b/test/network/net_noip2.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
@@ -16,24 +19,24 @@ send -- "bash\r" | |||
16 | sleep 1 | 19 | sleep 1 |
17 | 20 | ||
18 | # no default gateway configured | 21 | # no default gateway configured |
19 | send -- "netstat -rn;pwd\r" | 22 | send -- "netstat -rn;echo done\r" |
20 | expect { | 23 | expect { |
21 | timeout {puts "TESTING ERROR 2\n";exit} | 24 | timeout {puts "TESTING ERROR 2\n";exit} |
22 | "0.0.0.0" {puts "TESTING ERROR 3\n";exit} | 25 | "0.0.0.0" {puts "TESTING ERROR 3\n";exit} |
23 | "eth0" {puts "TESTING ERROR 4\n";exit} | 26 | "eth0" {puts "TESTING ERROR 4\n";exit} |
24 | "home" | 27 | "done" |
25 | } | 28 | } |
26 | sleep 1 | 29 | sleep 1 |
27 | 30 | ||
28 | # eth0 configured | 31 | # eth0 configured |
29 | send -- "/sbin/ifconfig;pwd\r" | 32 | send -- "/sbin/ifconfig;echo done\r" |
30 | expect { | 33 | expect { |
31 | timeout {puts "TESTING ERROR 5\n";exit} | 34 | timeout {puts "TESTING ERROR 5\n";exit} |
32 | "eth0" | 35 | "eth0" |
33 | } | 36 | } |
34 | expect { | 37 | expect { |
35 | timeout {puts "TESTING ERROR 6\n";exit} | 38 | timeout {puts "TESTING ERROR 6\n";exit} |
36 | "home" | 39 | "done" |
37 | } | 40 | } |
38 | after 100 | 41 | after 100 |
39 | 42 | ||
diff --git a/test/network/net_none.exp b/test/network/net_none.exp index 54b6cb946..1c1577d76 100755 --- a/test/network/net_none.exp +++ b/test/network/net_none.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
@@ -16,20 +19,20 @@ sleep 1 | |||
16 | # test default gw | 19 | # test default gw |
17 | send -- "bash\r" | 20 | send -- "bash\r" |
18 | sleep 1 | 21 | sleep 1 |
19 | send -- "netstat -rn; pwd\r" | 22 | send -- "netstat -rn; echo done\r" |
20 | expect { | 23 | expect { |
21 | timeout {puts "TESTING ERROR 1\n";exit} | 24 | timeout {puts "TESTING ERROR 1\n";exit} |
22 | "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit} | 25 | "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit} |
23 | "home" | 26 | "done" |
24 | } | 27 | } |
25 | sleep 1 | 28 | sleep 1 |
26 | 29 | ||
27 | # check again devices | 30 | # check again devices |
28 | send -- "cat /proc/1/net/dev;pwd\r" | 31 | send -- "cat /proc/1/net/dev;echo done\r" |
29 | expect { | 32 | expect { |
30 | timeout {puts "TESTING ERROR 2\n";exit} | 33 | timeout {puts "TESTING ERROR 2\n";exit} |
31 | "eth0" {puts "TESTING ERROR 2.1\n";exit} | 34 | "eth0" {puts "TESTING ERROR 2.1\n";exit} |
32 | "home" | 35 | "done" |
33 | } | 36 | } |
34 | send -- "exit\r" | 37 | send -- "exit\r" |
35 | sleep 1 | 38 | sleep 1 |
@@ -48,21 +51,21 @@ sleep 1 | |||
48 | # test default gw | 51 | # test default gw |
49 | send -- "bash\r" | 52 | send -- "bash\r" |
50 | sleep 1 | 53 | sleep 1 |
51 | send -- "netstat -rn; pwd\r" | 54 | send -- "netstat -rn; echo done\r" |
52 | expect { | 55 | expect { |
53 | timeout {puts "TESTING ERROR 4\n";exit} | 56 | timeout {puts "TESTING ERROR 4\n";exit} |
54 | "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} | 57 | "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} |
55 | "home" | 58 | "done" |
56 | } | 59 | } |
57 | sleep 1 | 60 | sleep 1 |
58 | 61 | ||
59 | # check again devices | 62 | # check again devices |
60 | send -- "cat /proc/1/net/dev;pwd\r" | 63 | send -- "cat /proc/1/net/dev;echo done\r" |
61 | expect { | 64 | expect { |
62 | timeout {puts "TESTING ERROR 5\n";exit} | 65 | timeout {puts "TESTING ERROR 5\n";exit} |
63 | "eth0" {puts "TESTING ERROR 5.1\n";exit} | 66 | "eth0" {puts "TESTING ERROR 5.1\n";exit} |
64 | "home" | 67 | "done" |
65 | } | 68 | } |
66 | sleep 1 | 69 | sleep 1 |
67 | 70 | ||
68 | puts "\n" | 71 | puts "\nall done\n" |
diff --git a/test/network/net_profile.exp b/test/network/net_profile.exp index 37043c906..7e88193cc 100755 --- a/test/network/net_profile.exp +++ b/test/network/net_profile.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |