aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-12-07 21:14:23 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-12-07 21:14:23 -0500
commitc6ea2db9110feb68fe181188384c31254cdec945 (patch)
treea9a942e7ce10ff3d0bde168fcceb51c38f7f3b4b
parentfixes (diff)
downloadfirejail-c6ea2db9110feb68fe181188384c31254cdec945.tar.gz
firejail-c6ea2db9110feb68fe181188384c31254cdec945.tar.zst
firejail-c6ea2db9110feb68fe181188384c31254cdec945.zip
testing
-rwxr-xr-xtest/network/dns-print.exp31
-rwxr-xr-xtest/network/net_macvlan2.exp43
-rwxr-xr-xtest/network/network.sh9
-rwxr-xr-xtest/stress/net_macvlan.exp (renamed from test/network/net_macvlan.exp)2
-rwxr-xr-xtest/stress/stress.sh11
5 files changed, 95 insertions, 1 deletions
diff --git a/test/network/dns-print.exp b/test/network/dns-print.exp
new file mode 100755
index 000000000..9cdc14a6d
--- /dev/null
+++ b/test/network/dns-print.exp
@@ -0,0 +1,31 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=test-dns --net=eth0 --dns=1.2.3.4 --dns=2.3.4.5 --dns=3.4.5.6\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14spawn $env(SHELL)
15send -- "firejail --dns.print=test-dns\r"
16expect {
17 timeout {puts "TESTING ERROR 2\n";exit}
18 "nameserver 1.2.3.4"
19}
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "nameserver 2.3.4.5"
23}
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "nameserver 3.4.5.6"
27}
28
29after 100
30
31puts "\nall done\n"
diff --git a/test/network/net_macvlan2.exp b/test/network/net_macvlan2.exp
new file mode 100755
index 000000000..7f21fc083
--- /dev/null
+++ b/test/network/net_macvlan2.exp
@@ -0,0 +1,43 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --net=eth0 --net=eth0 --net=eth0 --net=eth0\r"
11expect {
12 timeout {puts "TESTING ERROR 0.1\n";exit}
13 "eth0-"
14}
15expect {
16 timeout {puts "TESTING ERROR 0.2\n";exit}
17 "eth1-"
18}
19expect {
20 timeout {puts "TESTING ERROR 0.3\n";exit}
21 "eth2-"
22}
23expect {
24 timeout {puts "TESTING ERROR 0.4\n";exit}
25 "eth3-"
26}
27expect {
28 timeout {puts "TESTING ERROR 0.5\n";exit}
29 "Default gateway 192.168.1.1"
30}
31expect {
32 timeout {puts "TESTING ERROR 0.6\n";exit}
33 "Child process initialized"
34}
35after 100
36send -- "exit\r"
37sleep 1
38
39
40after 100
41
42puts "\nall done\n"
43
diff --git a/test/network/network.sh b/test/network/network.sh
index bea5dfb26..94df9935e 100755
--- a/test/network/network.sh
+++ b/test/network/network.sh
@@ -11,6 +11,9 @@ sudo ./configure
11echo "TESTING: firemon interface (firemon-interfaces.exp)" 11echo "TESTING: firemon interface (firemon-interfaces.exp)"
12sudo ./firemon-interfaces.exp 12sudo ./firemon-interfaces.exp
13 13
14echo "TESTING: print dns (dns-print.exp)"
15./dns-print.exp
16
14echo "TESTING: firemon arp (firemon-arp.exp)" 17echo "TESTING: firemon arp (firemon-arp.exp)"
15./firemon-arp.exp 18./firemon-arp.exp
16 19
@@ -69,6 +72,9 @@ echo "TESTING: network default gateway test 3 (net_defaultgw3.exp)"
69echo "TESTING: scan (net_scan.exp)" 72echo "TESTING: scan (net_scan.exp)"
70./net_scan.exp 73./net_scan.exp
71 74
75echo "TESTING: mtu (mtu.exp)"
76./mtu.exp
77
72echo "TESTING: interface (interface.exp)" 78echo "TESTING: interface (interface.exp)"
73./interface.exp 79./interface.exp
74 80
@@ -84,6 +90,9 @@ echo "TESTING: iprange (iprange.exp)"
84echo "TESTING: veth-name (veth-name.exp)" 90echo "TESTING: veth-name (veth-name.exp)"
85./veth-name.exp 91./veth-name.exp
86 92
93echo "TESTING: macvlan2 (net_macvlan2.exp)"
94./net_macvlan2.exp
95
87echo "TESTING: 4 bridges ARP (4bridges_arp.exp)" 96echo "TESTING: 4 bridges ARP (4bridges_arp.exp)"
88./4bridges_arp.exp 97./4bridges_arp.exp
89 98
diff --git a/test/network/net_macvlan.exp b/test/stress/net_macvlan.exp
index f457ea98f..6ea4a6adf 100755
--- a/test/network/net_macvlan.exp
+++ b/test/stress/net_macvlan.exp
@@ -12,7 +12,7 @@ spawn $env(SHELL)
12send -- "firejail --net=eth0 --ip=192.168.1.60\r" 12send -- "firejail --net=eth0 --ip=192.168.1.60\r"
13expect { 13expect {
14 timeout {puts "TESTING ERROR 1.1\n";puts "Please open a sandbox on 192.168.1.60\n";exit} 14 timeout {puts "TESTING ERROR 1.1\n";puts "Please open a sandbox on 192.168.1.60\n";exit}
15 "the address 192.168.1.60 is already in use" 15 "192.168.1.60 is interface eth0 address"
16} 16}
17 17
18 18
diff --git a/test/stress/stress.sh b/test/stress/stress.sh
new file mode 100755
index 000000000..35c846071
--- /dev/null
+++ b/test/stress/stress.sh
@@ -0,0 +1,11 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8
9echo "TESTING: macvlan (net_macvlan.exp)"
10./net_macvlan.exp
11