aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-24 11:11:04 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-24 11:11:04 -0500
commit12317dbbf67c1adcaf0d4fec267896d5951d8418 (patch)
tree6c93a0ad98ebeaffca02fc22b79e9b4ec61b01ec /test/features
parentfixes (diff)
downloadfirejail-12317dbbf67c1adcaf0d4fec267896d5951d8418.tar.gz
firejail-12317dbbf67c1adcaf0d4fec267896d5951d8418.tar.zst
firejail-12317dbbf67c1adcaf0d4fec267896d5951d8418.zip
feature test
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/2.1.exp18
-rwxr-xr-xtest/features/2.6.exp68
-rw-r--r--test/features/features.txt2
3 files changed, 88 insertions, 0 deletions
diff --git a/test/features/2.1.exp b/test/features/2.1.exp
index 6b2b3f7f5..a2ae321ce 100755
--- a/test/features/2.1.exp
+++ b/test/features/2.1.exp
@@ -23,6 +23,12 @@ expect {
23 "bingo" 23 "bingo"
24} 24}
25after 100 25after 100
26send -- "cat /etc/hostname\r"
27expect {
28 timeout {puts "TESTING ERROR 1.0\n";exit}
29 "bingo"
30}
31after 100
26send -- "getent hosts bingo\r" 32send -- "getent hosts bingo\r"
27expect { 33expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit} 34 timeout {puts "TESTING ERROR 1.1\n";exit}
@@ -53,6 +59,12 @@ expect {
53 "bingo" 59 "bingo"
54} 60}
55after 100 61after 100
62send -- "cat /etc/hostname\r"
63expect {
64 timeout {puts "TESTING ERROR 3.0\n";exit}
65 "bingo"
66}
67after 100
56send -- "getent hosts bingo\r" 68send -- "getent hosts bingo\r"
57expect { 69expect {
58 timeout {puts "TESTING ERROR 3.1\n";exit} 70 timeout {puts "TESTING ERROR 3.1\n";exit}
@@ -82,6 +94,12 @@ expect {
82 "bingo" 94 "bingo"
83} 95}
84after 100 96after 100
97send -- "cat /etc/hostname\r"
98expect {
99 timeout {puts "TESTING ERROR 5.0\n";exit}
100 "bingo"
101}
102after 100
85send -- "getent hosts bingo\r" 103send -- "getent hosts bingo\r"
86expect { 104expect {
87 timeout {puts "TESTING ERROR 5.1\n";exit} 105 timeout {puts "TESTING ERROR 5.1\n";exit}
diff --git a/test/features/2.6.exp b/test/features/2.6.exp
new file mode 100755
index 000000000..dc2381393
--- /dev/null
+++ b/test/features/2.6.exp
@@ -0,0 +1,68 @@
1#!/usr/bin/expect -f
2#
3# default gateway
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10#
11# N
12#
13send -- "firejail --noprofile --net=eth0 --defaultgw=192.168.1.10\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "netstat -rn\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "0.0.0.0 192.168.1.10"
24}
25after 100
26send -- "exit\r"
27sleep 1
28
29#
30# O
31#
32send -- "firejail --noprofile --overlay --net=eth0 --defaultgw=192.168.1.10\r"
33expect {
34 timeout {puts "TESTING ERROR 2\n";exit}
35 "Child process initialized"
36}
37sleep 1
38
39send -- "netstat -rn\r"
40expect {
41 timeout {puts "TESTING ERROR 3\n";exit}
42 "0.0.0.0 192.168.1.10"
43}
44after 100
45send -- "exit\r"
46sleep 1
47
48#
49# C
50#
51send -- "firejail --noprofile --chroot=/tmp/chroot --net=eth0 --defaultgw=192.168.1.10\r"
52expect {
53 timeout {puts "TESTING ERROR 4\n";exit}
54 "Child process initialized"
55}
56sleep 1
57
58send -- "netstat -rn\r"
59expect {
60 timeout {puts "TESTING ERROR 5\n";exit}
61 "0.0.0.0 192.168.1.10"
62}
63after 100
64send -- "exit\r"
65sleep 1
66
67
68puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
index 9ac7b944e..95e8cc5a0 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -60,6 +60,7 @@ C - chroot filesystem
60 - test --ip: N, O, C 60 - test --ip: N, O, C
61 61
622.5 interface 622.5 interface
63 - N, O, C
63 64
642.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) 652.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn)
65 - N, O, C 66 - N, O, C
@@ -68,4 +69,5 @@ C - chroot filesystem
68 69
693. Filesystem features (use --noprofile) 703. Filesystem features (use --noprofile)
70 71
723.1 tmpfs
71 \ No newline at end of file 73 \ No newline at end of file