diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile.in | 11 | ||||
-rwxr-xr-x | gcov-test-init.sh | 11 | ||||
-rw-r--r-- | src/ftee/main.c | 4 | ||||
-rwxr-xr-x | test/network/4bridges_arp.exp | 16 | ||||
-rwxr-xr-x | test/network/4bridges_ip.exp | 16 | ||||
-rw-r--r-- | test/network/README | 1 | ||||
-rwxr-xr-x | test/network/bandwidth.exp | 2 | ||||
-rwxr-xr-x | test/network/firemon-arp.exp (renamed from test/firemon-arp.exp) | 26 | ||||
-rwxr-xr-x | test/network/firemon-route.exp (renamed from test/firemon-route.exp) | 30 | ||||
-rwxr-xr-x | test/network/interface.exp | 2 | ||||
-rwxr-xr-x | test/network/net_ip.exp | 4 | ||||
-rwxr-xr-x | test/network/net_local.exp | 4 | ||||
-rwxr-xr-x | test/network/net_netfilter.exp | 6 | ||||
-rwxr-xr-x | test/network/net_profile.exp | 2 | ||||
-rwxr-xr-x | test/network/net_veth.exp | 130 | ||||
-rwxr-xr-x | test/network/network.sh | 11 |
17 files changed, 235 insertions, 43 deletions
diff --git a/.gitignore b/.gitignore index db523da59..459119b14 100644 --- a/.gitignore +++ b/.gitignore | |||
@@ -3,6 +3,8 @@ | |||
3 | *~ | 3 | *~ |
4 | *.swp | 4 | *.swp |
5 | *.rpm | 5 | *.rpm |
6 | *.gcda | ||
7 | *.gcno | ||
6 | Makefile | 8 | Makefile |
7 | config.log | 9 | config.log |
8 | config.status | 10 | config.status |
diff --git a/Makefile.in b/Makefile.in index d93eee502..41885ddcf 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -39,7 +39,7 @@ clean: | |||
39 | for dir in $(APPS) $(MYLIBS); do \ | 39 | for dir in $(APPS) $(MYLIBS); do \ |
40 | $(MAKE) -C $$dir clean; \ | 40 | $(MAKE) -C $$dir clean; \ |
41 | done | 41 | done |
42 | rm -fr gcov-file gcov-dir | 42 | rm -fr gcov-file gcov-dir gcov-test-initialized |
43 | rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm | 43 | rm -f $(MANPAGES) $(MANPAGES:%=%.gz) firejail*.rpm |
44 | rm -f test/utils/index.html* | 44 | rm -f test/utils/index.html* |
45 | rm -f test/utils/wget-log | 45 | rm -f test/utils/wget-log |
@@ -146,7 +146,7 @@ uninstall: | |||
146 | rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg | 146 | rm -f $(DESTDIR)/$(datarootdir)/bash-completion/completions/firecfg |
147 | 147 | ||
148 | DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" | 148 | DISTFILES = "src etc platform configure configure.ac Makefile.in install.sh mkman.sh mketc.sh mkdeb.sh mkuid.sh COPYING README RELNOTES" |
149 | DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/environment test/profiles test/utils test/compile test/filters test/network test/fs test/sysutils" | 149 | DISTFILES_TEST = "test/apps test/apps-x11 test/apps-x11-xorg test/root test/environment test/profiles test/utils test/compile test/filters test/network test/arguments test/fs test/sysutils" |
150 | 150 | ||
151 | dist: | 151 | dist: |
152 | mv config.status config.status.old | 152 | mv config.status config.status.old |
@@ -219,7 +219,7 @@ test-arguments: | |||
219 | cd test/arguments; ./arguments.sh | grep TESTING | 219 | cd test/arguments; ./arguments.sh | grep TESTING |
220 | 220 | ||
221 | test-network: | 221 | test-network: |
222 | echo "Please read test/network/README file and run the test manually" | 222 | cd test/network; ./network.sh | grep TESTING |
223 | 223 | ||
224 | test-fs: | 224 | test-fs: |
225 | cd test/fs; ./fs.sh | grep TESTING | 225 | cd test/fs; ./fs.sh | grep TESTING |
@@ -227,7 +227,10 @@ test-fs: | |||
227 | test: test-profiles test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments | 227 | test: test-profiles test-fs test-utils test-environment test-apps test-apps-x11 test-apps-x11-xorg test-filters test-arguments |
228 | echo "TEST COMPLETE" | 228 | echo "TEST COMPLETE" |
229 | 229 | ||
230 | gcov:; | 230 | gcov-test-initialized: |
231 | ./gcov-test-init.sh | ||
232 | |||
233 | gcov: gcov-test-initialized | ||
231 | lcov --capture -d src/firejail -d src/firemon -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg --output-file gcov-file | 234 | lcov --capture -d src/firejail -d src/firemon -d src/fseccomp -d src/fnet -d src/ftee -d src/lib -d src/firecfg --output-file gcov-file |
232 | rm -fr gcov-dir | 235 | rm -fr gcov-dir |
233 | genhtml gcov-file --output-directory gcov-dir | 236 | genhtml gcov-file --output-directory gcov-dir |
diff --git a/gcov-test-init.sh b/gcov-test-init.sh new file mode 100755 index 000000000..e98d9fa79 --- /dev/null +++ b/gcov-test-init.sh | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | USER=`whoami` | ||
4 | firejail --help | ||
5 | firemon --help | ||
6 | /usr/lib/firejail/fnet --help | ||
7 | /usr/lib/firejail/fseccomp --help | ||
8 | /usr/lib/firejail/ftee --help | ||
9 | firecfg --help | ||
10 | sudo chown $USER:$USER `find .` | ||
11 | touch gcov-test-initialized | ||
diff --git a/src/ftee/main.c b/src/ftee/main.c index 8daea8487..e6aa5f567 100644 --- a/src/ftee/main.c +++ b/src/ftee/main.c | |||
@@ -193,6 +193,10 @@ int main(int argc, char **argv) { | |||
193 | usage(); | 193 | usage(); |
194 | exit(1); | 194 | exit(1); |
195 | } | 195 | } |
196 | if (strcmp(argv[1], "--help") == 0) { | ||
197 | usage(); | ||
198 | return 0; | ||
199 | } | ||
196 | char *fname = argv[1]; | 200 | char *fname = argv[1]; |
197 | 201 | ||
198 | 202 | ||
diff --git a/test/network/4bridges_arp.exp b/test/network/4bridges_arp.exp index 4ffa715cc..6383aad5e 100755 --- a/test/network/4bridges_arp.exp +++ b/test/network/4bridges_arp.exp | |||
@@ -29,9 +29,9 @@ expect { | |||
29 | timeout {puts "TESTING ERROR 0.4\n";exit} | 29 | timeout {puts "TESTING ERROR 0.4\n";exit} |
30 | "Child process initialized" | 30 | "Child process initialized" |
31 | } | 31 | } |
32 | sleep 2 | 32 | sleep 1 |
33 | send -- "exit\r" | 33 | send -- "exit\r" |
34 | sleep 2 | 34 | sleep 1 |
35 | 35 | ||
36 | # check eth1 | 36 | # check eth1 |
37 | send -- "firejail --net=br0 --net=br1 --net=br2 --net=br3\r" | 37 | send -- "firejail --net=br0 --net=br1 --net=br2 --net=br3\r" |
@@ -55,9 +55,9 @@ expect { | |||
55 | timeout {puts "TESTING ERROR 1.4\n";exit} | 55 | timeout {puts "TESTING ERROR 1.4\n";exit} |
56 | "Child process initialized" | 56 | "Child process initialized" |
57 | } | 57 | } |
58 | sleep 2 | 58 | sleep 1 |
59 | send -- "exit\r" | 59 | send -- "exit\r" |
60 | sleep 2 | 60 | sleep 1 |
61 | 61 | ||
62 | 62 | ||
63 | # check eth2 | 63 | # check eth2 |
@@ -82,9 +82,9 @@ expect { | |||
82 | timeout {puts "TESTING ERROR 2.4\n";exit} | 82 | timeout {puts "TESTING ERROR 2.4\n";exit} |
83 | "Child process initialized" | 83 | "Child process initialized" |
84 | } | 84 | } |
85 | sleep 2 | 85 | sleep 1 |
86 | send -- "exit\r" | 86 | send -- "exit\r" |
87 | sleep 2 | 87 | sleep 1 |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
@@ -110,9 +110,9 @@ expect { | |||
110 | timeout {puts "TESTING ERROR 4\n";exit} | 110 | timeout {puts "TESTING ERROR 4\n";exit} |
111 | "Child process initialized" | 111 | "Child process initialized" |
112 | } | 112 | } |
113 | sleep 2 | 113 | sleep 1 |
114 | send -- "exit\r" | 114 | send -- "exit\r" |
115 | sleep 2 | 115 | sleep 1 |
116 | 116 | ||
117 | 117 | ||
118 | 118 | ||
diff --git a/test/network/4bridges_ip.exp b/test/network/4bridges_ip.exp index 3cfd71be0..e762ac285 100755 --- a/test/network/4bridges_ip.exp +++ b/test/network/4bridges_ip.exp | |||
@@ -29,9 +29,9 @@ expect { | |||
29 | timeout {puts "TESTING ERROR 0.4\n";exit} | 29 | timeout {puts "TESTING ERROR 0.4\n";exit} |
30 | "Child process initialized" | 30 | "Child process initialized" |
31 | } | 31 | } |
32 | sleep 2 | 32 | sleep 1 |
33 | send -- "exit\r" | 33 | send -- "exit\r" |
34 | sleep 2 | 34 | sleep 1 |
35 | 35 | ||
36 | # check eth1 | 36 | # check eth1 |
37 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" | 37 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" |
@@ -55,9 +55,9 @@ expect { | |||
55 | timeout {puts "TESTING ERROR 1.4\n";exit} | 55 | timeout {puts "TESTING ERROR 1.4\n";exit} |
56 | "Child process initialized" | 56 | "Child process initialized" |
57 | } | 57 | } |
58 | sleep 2 | 58 | sleep 1 |
59 | send -- "exit\r" | 59 | send -- "exit\r" |
60 | sleep 2 | 60 | sleep 1 |
61 | 61 | ||
62 | 62 | ||
63 | # check eth2 | 63 | # check eth2 |
@@ -82,9 +82,9 @@ expect { | |||
82 | timeout {puts "TESTING ERROR 2.4\n";exit} | 82 | timeout {puts "TESTING ERROR 2.4\n";exit} |
83 | "Child process initialized" | 83 | "Child process initialized" |
84 | } | 84 | } |
85 | sleep 2 | 85 | sleep 1 |
86 | send -- "exit\r" | 86 | send -- "exit\r" |
87 | sleep 2 | 87 | sleep 1 |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
@@ -110,9 +110,9 @@ expect { | |||
110 | timeout {puts "TESTING ERROR 4\n";exit} | 110 | timeout {puts "TESTING ERROR 4\n";exit} |
111 | "Child process initialized" | 111 | "Child process initialized" |
112 | } | 112 | } |
113 | sleep 2 | 113 | sleep 1 |
114 | send -- "exit\r" | 114 | send -- "exit\r" |
115 | sleep 2 | 115 | sleep 1 |
116 | 116 | ||
117 | 117 | ||
118 | 118 | ||
diff --git a/test/network/README b/test/network/README index a715d8edf..4404c53b0 100644 --- a/test/network/README +++ b/test/network/README | |||
@@ -11,5 +11,4 @@ Limitations - to be investigated and fixed: | |||
11 | - macvlan interfaces don't seem to work correctly under VirtualBox | 11 | - macvlan interfaces don't seem to work correctly under VirtualBox |
12 | 12 | ||
13 | Run the test: | 13 | Run the test: |
14 | $ sudo ./configure | ||
15 | $ ./network.sh | grep TESTING | 14 | $ ./network.sh | grep TESTING |
diff --git a/test/network/bandwidth.exp b/test/network/bandwidth.exp index 8f3a706a8..8a2e46e04 100755 --- a/test/network/bandwidth.exp +++ b/test/network/bandwidth.exp | |||
@@ -12,7 +12,7 @@ expect { | |||
12 | timeout {puts "TESTING ERROR 0\n";exit} | 12 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "Child process initialized" | 13 | "Child process initialized" |
14 | } | 14 | } |
15 | sleep 2 | 15 | sleep 1 |
16 | 16 | ||
17 | spawn $env(SHELL) | 17 | spawn $env(SHELL) |
18 | send -- "firejail --bandwidth=test status\r" | 18 | send -- "firejail --bandwidth=test status\r" |
diff --git a/test/firemon-arp.exp b/test/network/firemon-arp.exp index 3fc8c2aee..0a543c3b4 100755 --- a/test/firemon-arp.exp +++ b/test/network/firemon-arp.exp | |||
@@ -11,7 +11,7 @@ expect { | |||
11 | } | 11 | } |
12 | sleep 1 | 12 | sleep 1 |
13 | 13 | ||
14 | send -- "firejail\r" | 14 | send -- "firejail --name=test1\r" |
15 | expect { | 15 | expect { |
16 | timeout {puts "TESTING ERROR 1\n";exit} | 16 | timeout {puts "TESTING ERROR 1\n";exit} |
17 | "Child process initialized" | 17 | "Child process initialized" |
@@ -19,16 +19,32 @@ expect { | |||
19 | sleep 1 | 19 | sleep 1 |
20 | 20 | ||
21 | spawn $env(SHELL) | 21 | spawn $env(SHELL) |
22 | send -- "firemon --arp\r" | 22 | send -- "firejail --name=test2\r" |
23 | expect { | 23 | expect { |
24 | timeout {puts "TESTING ERROR 2\n";exit} | 24 | timeout {puts "TESTING ERROR 2\n";exit} |
25 | "Child process initialized" | ||
26 | } | ||
27 | sleep 1 | ||
28 | |||
29 | spawn $env(SHELL) | ||
30 | send -- "firemon --arp\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "name=test1" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "192.168.1.1 dev eth0 lladdr" {puts "Debian testing\n";} | 37 | "192.168.1.1 dev eth0 lladdr" {puts "Debian testing\n";} |
26 | "192.168.1.1 dev enp0s3 lladdr" {puts "Centos 7 testing\n";} | 38 | "192.168.1.1 dev enp0s3 lladdr" {puts "Centos 7 testing\n";} |
27 | } | 39 | } |
28 | expect { | 40 | expect { |
29 | timeout {puts "TESTING ERROR 3\n";exit} | 41 | timeout {puts "TESTING ERROR 5\n";exit} |
30 | "REACHABLE" | 42 | "REACHABLE" |
31 | } | 43 | } |
32 | sleep 1 | 44 | expect { |
45 | timeout {puts "TESTING ERROR 6\n";exit} | ||
46 | "name=test2" | ||
47 | } | ||
48 | after 100 | ||
33 | 49 | ||
34 | puts "\n" | 50 | puts "\nall done\n"" |
diff --git a/test/firemon-route.exp b/test/network/firemon-route.exp index a48116675..19a705778 100755 --- a/test/firemon-route.exp +++ b/test/network/firemon-route.exp | |||
@@ -4,7 +4,7 @@ set timeout 10 | |||
4 | spawn $env(SHELL) | 4 | spawn $env(SHELL) |
5 | match_max 100000 | 5 | match_max 100000 |
6 | 6 | ||
7 | send -- "firejail\r" | 7 | send -- "firejail --name=test1\r" |
8 | expect { | 8 | expect { |
9 | timeout {puts "TESTING ERROR 0\n";exit} | 9 | timeout {puts "TESTING ERROR 0\n";exit} |
10 | "Child process initialized" | 10 | "Child process initialized" |
@@ -12,22 +12,38 @@ expect { | |||
12 | sleep 1 | 12 | sleep 1 |
13 | 13 | ||
14 | spawn $env(SHELL) | 14 | spawn $env(SHELL) |
15 | send -- "firemon --route\r" | 15 | send -- "firejail --name=test2\r" |
16 | expect { | 16 | expect { |
17 | timeout {puts "TESTING ERROR 1\n";exit} | 17 | timeout {puts "TESTING ERROR 1\n";exit} |
18 | "Child process initialized" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | spawn $env(SHELL) | ||
23 | send -- "firemon --route\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "name=test1" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 3\n";exit} | ||
18 | "0.0.0.0/0 via 192.168.1.1, dev eth0, metric 0" {puts "Debian testing\n";} | 30 | "0.0.0.0/0 via 192.168.1.1, dev eth0, metric 0" {puts "Debian testing\n";} |
19 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 1024" {puts "Centos 7 testing\n";} | 31 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 1024" {puts "Centos 7 testing\n";} |
20 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 0" {puts "OpenSUSE testing\n";} | 32 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 0" {puts "OpenSUSE testing\n";} |
21 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 100" {puts "Arch testing\n";} | 33 | "0.0.0.0/0 via 192.168.1.1, dev enp0s3, metric 100" {puts "Arch testing\n";} |
22 | } | 34 | } |
23 | expect { | 35 | expect { |
24 | timeout {puts "TESTING ERROR 2\n";exit} | 36 | timeout {puts "TESTING ERROR 4\n";exit} |
25 | "10.10.30.0/24, dev br1, scope link src 10.10.30.1" | 37 | "10.10.30.0/24, dev br1, scope link src 10.10.30.1" |
26 | } | 38 | } |
27 | expect { | 39 | expect { |
28 | timeout {puts "TESTING ERROR 3\n";exit} | 40 | timeout {puts "TESTING ERROR 5\n";exit} |
29 | "10.10.50.0/24, dev br3, scope link src 10.10.50.1" | 41 | "10.10.50.0/24, dev br3, scope link src 10.10.50.1" |
30 | } | 42 | } |
31 | sleep 1 | 43 | expect { |
44 | timeout {puts "TESTING ERROR 6\n";exit} | ||
45 | "name=test2" | ||
46 | } | ||
47 | after 100 | ||
32 | 48 | ||
33 | puts "\n" | 49 | puts "\nalldone\n" |
diff --git a/test/network/interface.exp b/test/network/interface.exp index b15563eec..bd8777c33 100755 --- a/test/network/interface.exp +++ b/test/network/interface.exp | |||
@@ -14,7 +14,7 @@ set chroot [lindex $argv 1] | |||
14 | # | 14 | # |
15 | # todo: seems to be unable to find interface eth0.7 | 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" | 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" | 17 | send -- "firejail --noprofile --interface=eth0.5 --interface=eth0.6\r" |
18 | expect { | 18 | expect { |
19 | timeout {puts "TESTING ERROR 0\n";exit} | 19 | timeout {puts "TESTING ERROR 0\n";exit} |
20 | "Child process initialized" | 20 | "Child process initialized" |
diff --git a/test/network/net_ip.exp b/test/network/net_ip.exp index 32103050d..0fa84243a 100755 --- a/test/network/net_ip.exp +++ b/test/network/net_ip.exp | |||
@@ -29,9 +29,9 @@ expect { | |||
29 | timeout {puts "TESTING ERROR 4\n";exit} | 29 | timeout {puts "TESTING ERROR 4\n";exit} |
30 | "Child process initialized" | 30 | "Child process initialized" |
31 | } | 31 | } |
32 | sleep 2 | 32 | sleep 1 |
33 | send -- "exit\r" | 33 | send -- "exit\r" |
34 | sleep 2 | 34 | sleep 1 |
35 | 35 | ||
36 | # check loopback | 36 | # check loopback |
37 | send -- "firejail --net=br0 --ip=10.10.20.5 --protocol=unix,inet,netlink\r" | 37 | send -- "firejail --net=br0 --ip=10.10.20.5 --protocol=unix,inet,netlink\r" |
diff --git a/test/network/net_local.exp b/test/network/net_local.exp index b72b9adaf..d58135785 100755 --- a/test/network/net_local.exp +++ b/test/network/net_local.exp | |||
@@ -17,9 +17,9 @@ expect { | |||
17 | timeout {puts "TESTING ERROR 4\n";exit} | 17 | timeout {puts "TESTING ERROR 4\n";exit} |
18 | "Child process initialized" | 18 | "Child process initialized" |
19 | } | 19 | } |
20 | sleep 2 | 20 | sleep 1 |
21 | send -- "exit\r" | 21 | send -- "exit\r" |
22 | sleep 2 | 22 | sleep 1 |
23 | 23 | ||
24 | # check loopback | 24 | # check loopback |
25 | send -- "firejail --noprofile\r" | 25 | send -- "firejail --noprofile\r" |
diff --git a/test/network/net_netfilter.exp b/test/network/net_netfilter.exp index f011f3746..737485d07 100755 --- a/test/network/net_netfilter.exp +++ b/test/network/net_netfilter.exp | |||
@@ -29,7 +29,7 @@ expect { | |||
29 | timeout {puts "TESTING ERROR 4\n";exit} | 29 | timeout {puts "TESTING ERROR 4\n";exit} |
30 | "Child process initialized" | 30 | "Child process initialized" |
31 | } | 31 | } |
32 | sleep 2 | 32 | sleep 1 |
33 | send -- "exit\r" | 33 | send -- "exit\r" |
34 | sleep 1 | 34 | sleep 1 |
35 | 35 | ||
@@ -43,7 +43,7 @@ expect { | |||
43 | "ACCEPT icmp -- any any anywhere" {puts "TESTING ERROR 5.1\n";exit} | 43 | "ACCEPT icmp -- any any anywhere" {puts "TESTING ERROR 5.1\n";exit} |
44 | "Child process initialized" | 44 | "Child process initialized" |
45 | } | 45 | } |
46 | sleep 2 | 46 | sleep 1 |
47 | send -- "exit\r" | 47 | send -- "exit\r" |
48 | sleep 1 | 48 | sleep 1 |
49 | 49 | ||
@@ -57,7 +57,7 @@ expect { | |||
57 | timeout {puts "TESTING ERROR 6.1\n";exit} | 57 | timeout {puts "TESTING ERROR 6.1\n";exit} |
58 | "Child process initialized" | 58 | "Child process initialized" |
59 | } | 59 | } |
60 | sleep 2 | 60 | sleep 1 |
61 | send -- "ping -c 1 -w 3 10.10.20.1\r" | 61 | send -- "ping -c 1 -w 3 10.10.20.1\r" |
62 | expect { | 62 | expect { |
63 | timeout {puts "TESTING ERROR 6.2\n";exit} | 63 | timeout {puts "TESTING ERROR 6.2\n";exit} |
diff --git a/test/network/net_profile.exp b/test/network/net_profile.exp index dee0b2793..29008d811 100755 --- a/test/network/net_profile.exp +++ b/test/network/net_profile.exp | |||
@@ -33,7 +33,7 @@ expect { | |||
33 | timeout {puts "TESTING ERROR 0.4\n";exit} | 33 | timeout {puts "TESTING ERROR 0.4\n";exit} |
34 | "Child process initialized" | 34 | "Child process initialized" |
35 | } | 35 | } |
36 | sleep 2 | 36 | sleep 1 |
37 | 37 | ||
38 | send -- "ip route show\r" | 38 | send -- "ip route show\r" |
39 | expect { | 39 | expect { |
diff --git a/test/network/net_veth.exp b/test/network/net_veth.exp new file mode 100755 index 000000000..89dedcb24 --- /dev/null +++ b/test/network/net_veth.exp | |||
@@ -0,0 +1,130 @@ | |||
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 | send -- "firejail --net=eth0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "lo" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 2\n";exit} | ||
17 | "127.0.0.1" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | "255.0.0.0" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "UP" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 5\n";exit} | ||
29 | "eth0-" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 6\n";exit} | ||
33 | "255.255.255.0" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 7\n";exit} | ||
37 | "UP" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 8\n";exit} | ||
41 | "Default gateway" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 9\n";exit} | ||
45 | "Child process initialized" | ||
46 | } | ||
47 | sleep 1 | ||
48 | send -- "exit\r" | ||
49 | sleep 1 | ||
50 | |||
51 | send -- "firejail --net=eth0 --net=eth0 --net=eth0 --net=eth0\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 11\n";exit} | ||
54 | "lo" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 12\n";exit} | ||
58 | "127.0.0.1" | ||
59 | } | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 13\n";exit} | ||
62 | "255.0.0.0" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 14\n";exit} | ||
66 | "UP" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 15\n";exit} | ||
70 | "eth0-" | ||
71 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 16\n";exit} | ||
74 | "255.255.255.0" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 17\n";exit} | ||
78 | "UP" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 18\n";exit} | ||
82 | "eth1-" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 19\n";exit} | ||
86 | "255.255.255.0" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 20\n";exit} | ||
90 | "UP" | ||
91 | } | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 5\n";exit} | ||
94 | "eth2-" | ||
95 | } | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 21\n";exit} | ||
98 | "255.255.255.0" | ||
99 | } | ||
100 | expect { | ||
101 | timeout {puts "TESTING ERROR 22\n";exit} | ||
102 | "UP" | ||
103 | } | ||
104 | expect { | ||
105 | timeout {puts "TESTING ERROR 23\n";exit} | ||
106 | "eth3-" | ||
107 | } | ||
108 | expect { | ||
109 | timeout {puts "TESTING ERROR 24\n";exit} | ||
110 | "255.255.255.0" | ||
111 | } | ||
112 | expect { | ||
113 | timeout {puts "TESTING ERROR 25\n";exit} | ||
114 | "UP" | ||
115 | } | ||
116 | expect { | ||
117 | timeout {puts "TESTING ERROR 26\n";exit} | ||
118 | "Default gateway" | ||
119 | } | ||
120 | expect { | ||
121 | timeout {puts "TESTING ERROR 27\n";exit} | ||
122 | "Child process initialized" | ||
123 | } | ||
124 | sleep 1 | ||
125 | send -- "exit\r" | ||
126 | |||
127 | after 100 | ||
128 | |||
129 | puts "\n" | ||
130 | |||
diff --git a/test/network/network.sh b/test/network/network.sh index e0087411d..28f707952 100755 --- a/test/network/network.sh +++ b/test/network/network.sh | |||
@@ -6,6 +6,14 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | sudo ./configure | ||
10 | |||
11 | echo "TESTING: firemon arp (firemon-arp.exp)" | ||
12 | ./firemon-arp.exp | ||
13 | |||
14 | echo "TESTING: firemon route (firemon-route.exp)" | ||
15 | ./firemon-route.exp | ||
16 | |||
9 | echo "TESTING: network profile (net_profile.exp)" | 17 | echo "TESTING: network profile (net_profile.exp)" |
10 | ./net_profile.exp | 18 | ./net_profile.exp |
11 | 19 | ||
@@ -58,6 +66,9 @@ echo "TESTING: scan (net_scan.exp)" | |||
58 | echo "TESTING: interface (interface.exp)" | 66 | echo "TESTING: interface (interface.exp)" |
59 | ./interface.exp | 67 | ./interface.exp |
60 | 68 | ||
69 | echo "TESTING: veth (net_veth.exp)" | ||
70 | ./net_veth.exp | ||
71 | |||
61 | echo "TESTING: netfilter (net_netfilter.exp)" | 72 | echo "TESTING: netfilter (net_netfilter.exp)" |
62 | ./net_netfilter.exp | 73 | ./net_netfilter.exp |
63 | 74 | ||