aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-24 11:47:38 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-24 11:47:38 -0500
commit0df2fd2efce584ff9430cb2e523136b75df92c20 (patch)
tree5e7e8fadd1be89f31c299a77d7cbf0f63ebc755d /test/features
parentfeature testing (diff)
downloadfirejail-0df2fd2efce584ff9430cb2e523136b75df92c20.tar.gz
firejail-0df2fd2efce584ff9430cb2e523136b75df92c20.tar.zst
firejail-0df2fd2efce584ff9430cb2e523136b75df92c20.zip
feature testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/2.3.exp10
-rwxr-xr-xtest/features/3.2.exp2
-rwxr-xr-xtest/features/3.3.exp69
-rwxr-xr-xtest/features/3.4.exp69
-rw-r--r--test/features/features.txt3
-rwxr-xr-xtest/features/test.sh16
6 files changed, 162 insertions, 7 deletions
diff --git a/test/features/2.3.exp b/test/features/2.3.exp
index a70005781..c519c72ad 100755
--- a/test/features/2.3.exp
+++ b/test/features/2.3.exp
@@ -56,7 +56,7 @@ expect {
56after 100 56after 100
57 57
58send -- "exit\r" 58send -- "exit\r"
59sleep 1 59sleep 3
60 60
61send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244\r" 61send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244\r"
62expect { 62expect {
@@ -104,7 +104,7 @@ expect {
104after 100 104after 100
105 105
106send -- "exit\r" 106send -- "exit\r"
107sleep 1 107sleep 3
108 108
109# 109#
110# O 110# O
@@ -155,7 +155,7 @@ expect {
155after 100 155after 100
156 156
157send -- "exit\r" 157send -- "exit\r"
158sleep 1 158sleep 3
159 159
160send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay\r" 160send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay\r"
161expect { 161expect {
@@ -203,7 +203,7 @@ expect {
203after 100 203after 100
204 204
205send -- "exit\r" 205send -- "exit\r"
206sleep 1 206sleep 3
207 207
208 208
209# 209#
@@ -255,7 +255,7 @@ expect {
255after 100 255after 100
256 256
257send -- "exit\r" 257send -- "exit\r"
258sleep 1 258sleep 3
259 259
260send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot\r" 260send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot\r"
261expect { 261expect {
diff --git a/test/features/3.2.exp b/test/features/3.2.exp
index f6ed01310..44d9b73f3 100755
--- a/test/features/3.2.exp
+++ b/test/features/3.2.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# 2#
3# disable /boot 3# read-only
4# 4#
5 5
6set timeout 10 6set timeout 10
diff --git a/test/features/3.3.exp b/test/features/3.3.exp
new file mode 100755
index 000000000..432a135d7
--- /dev/null
+++ b/test/features/3.3.exp
@@ -0,0 +1,69 @@
1#!/usr/bin/expect -f
2#
3# blacklist
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10#
11# N
12#
13send -- "firejail --noprofile --blacklist=/home/netblue/.config\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "cd ~/.config\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "Permission denied"
24}
25after 100
26send -- "exit\r"
27sleep 1
28
29
30#
31# O
32#
33send -- "firejail --noprofile --overlay --blacklist=/home/netblue/.config\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 "Child process initialized"
37}
38sleep 1
39
40send -- "cd ~/.config\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "Permission denied"
44}
45after 100
46send -- "exit\r"
47sleep 1
48
49#
50# C
51#
52send -- "firejail --noprofile --chroot=/tmp/chroot --blacklist=/home/netblue/.config\r"
53expect {
54 timeout {puts "TESTING ERROR 4\n";exit}
55 "Child process initialized"
56}
57sleep 1
58
59send -- "cd ~/.config\r"
60expect {
61 timeout {puts "TESTING ERROR 5\n";exit}
62 "Permission denied"
63}
64after 100
65send -- "exit\r"
66sleep 1
67
68
69puts "\nall done\n"
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
new file mode 100755
index 000000000..bc6e10733
--- /dev/null
+++ b/test/features/3.4.exp
@@ -0,0 +1,69 @@
1#!/usr/bin/expect -f
2#
3# whitelist
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10#
11# N
12#
13send -- "firejail --noprofile --whitelist=/home/netblue/.config\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized"
17}
18sleep 1
19
20send -- "ls -al ~/. | wc -l\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "6"
24}
25after 100
26send -- "exit\r"
27sleep 1
28
29
30#
31# O
32#
33send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 "Child process initialized"
37}
38sleep 1
39
40send -- "ls -al ~/. | wc -l\r"
41expect {
42 timeout {puts "TESTING ERROR 1\n";exit}
43 "6"
44}
45after 100
46send -- "exit\r"
47sleep 1
48
49#
50# C
51#
52send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r"
53expect {
54 timeout {puts "TESTING ERROR 4\n";exit}
55 "Child process initialized"
56}
57sleep 1
58
59send -- "ls -al ~/. | wc -l\r"
60expect {
61 timeout {puts "TESTING ERROR 1\n";exit}
62 "6"
63}
64after 100
65send -- "exit\r"
66sleep 1
67
68
69puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
index 492843adc..d372d2f7a 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -71,4 +71,5 @@ C - chroot filesystem
71 71
723.1 tmpfs 723.1 tmpfs
733.2 read-only 733.2 read-only
74 \ No newline at end of file 743.3 blacklist
753.4 whitelist
diff --git a/test/features/test.sh b/test/features/test.sh
index 8047bbd0c..e49dfc3f0 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -44,3 +44,19 @@ echo "TESTING: 2.4 bridge"
44 44
45echo "TESTING: 2.5 interface" 45echo "TESTING: 2.5 interface"
46./2.5.exp 46./2.5.exp
47
48echo "TESTING: 2.6 Default gateway"
49./2.6.exp
50
51echo "TESTING: 3.1 tmpfs"
52./3.1.exp
53
54echo "TESTING: 3.2 read-only"
55./3.2.exp
56
57echo "TESTING: 3.3 blacklist"
58./3.3.exp
59
60echo "TESTING: 3.4 whitelist"
61./3.4.exp
62