aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-03-06 16:09:33 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-03-06 16:09:33 -0500
commitc79beb5a151e28e1185e380638073d259f0da24b (patch)
treeae221f117231853166c70bd9af7190eb47ce9d56 /test
parentci: remove extra space on codespell job (diff)
downloadfirejail-c79beb5a151e28e1185e380638073d259f0da24b.tar.gz
firejail-c79beb5a151e28e1185e380638073d259f0da24b.tar.zst
firejail-c79beb5a151e28e1185e380638073d259f0da24b.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/network/ip6.exp48
-rw-r--r--test/network/ip6.profile3
-rwxr-xr-xtest/network/net-print.exp34
-rwxr-xr-xtest/network/network.sh6
4 files changed, 91 insertions, 0 deletions
diff --git a/test/network/ip6.exp b/test/network/ip6.exp
new file mode 100755
index 000000000..e2e83fe0e
--- /dev/null
+++ b/test/network/ip6.exp
@@ -0,0 +1,48 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2022 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --noprofile --net=br0 --ip6=2001:0db8:0:f101::1/64 ip addr show\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "eth0"
18}
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "inet6"
22}
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 "2001:db8:0:f101::1/64"
26}
27sleep 1
28
29send -- "firejail --profile=ip6.profile ip addr show\r"
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
33}
34expect {
35 timeout {puts "TESTING ERROR 5\n";exit}
36 "eth0"
37}
38expect {
39 timeout {puts "TESTING ERROR 6\n";exit}
40 "inet6"
41}
42expect {
43 timeout {puts "TESTING ERROR 7\n";exit}
44 "2001:db8:0:f101::1/64"
45}
46after 500
47puts "\nall done\n"
48exit
diff --git a/test/network/ip6.profile b/test/network/ip6.profile
new file mode 100644
index 000000000..d4611ec41
--- /dev/null
+++ b/test/network/ip6.profile
@@ -0,0 +1,3 @@
1net br0
2ip6 2001:0db8:0:f101::1/64
3#netfilter6 ipv6.net
diff --git a/test/network/net-print.exp b/test/network/net-print.exp
new file mode 100755
index 000000000..691114cf4
--- /dev/null
+++ b/test/network/net-print.exp
@@ -0,0 +1,34 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test --net=br0 --ip=10.10.20.9\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "firejail --net.print=test\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "lo"
22}
23expect {
24 timeout {puts "TESTING ERROR 2\n";exit}
25 "eth0"
26}
27expect {
28 timeout {puts "TESTING ERROR 3\n";exit}
29 "10.10.20.9"
30}
31
32after 500
33
34puts "\nall done\n"
diff --git a/test/network/network.sh b/test/network/network.sh
index 319927493..877f16156 100755
--- a/test/network/network.sh
+++ b/test/network/network.sh
@@ -27,8 +27,14 @@ echo "TESTING: network scan (net_scan.exp)"
27echo "TESTING: netfilter (net_netfilter.exp)" 27echo "TESTING: netfilter (net_netfilter.exp)"
28./net_netfilter.exp 28./net_netfilter.exp
29 29
30echo "TESTING: print network (net-print.exp)"
31./net-print.exp
32
30echo "TESTING: print dns (dns-print.exp)" 33echo "TESTING: print dns (dns-print.exp)"
31./dns-print.exp 34./dns-print.exp
32 35
36echo "TESTING: ipv6 (ip6.exp)"
37./ip6.exp
38
33sudo ip link set br0 down 39sudo ip link set br0 down
34sudo brctl delbr br0 40sudo brctl delbr br0