aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 09:34:58 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 09:34:58 -0500
commit6d1e93c2aea17fa209779e768a57450b06dcfa14 (patch)
tree0456d1493c8ea1e82ce05b239a62855f230f56dd /test/features
parent0.9.38 testing (diff)
downloadfirejail-6d1e93c2aea17fa209779e768a57450b06dcfa14.tar.gz
firejail-6d1e93c2aea17fa209779e768a57450b06dcfa14.tar.zst
firejail-6d1e93c2aea17fa209779e768a57450b06dcfa14.zip
0.9.38 testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/3.7.exp91
-rwxr-xr-xtest/features/3.8.exp79
-rw-r--r--test/features/features.txt7
-rwxr-xr-xtest/features/test.sh7
4 files changed, 182 insertions, 2 deletions
diff --git a/test/features/3.7.exp b/test/features/3.7.exp
new file mode 100755
index 000000000..d8236b851
--- /dev/null
+++ b/test/features/3.7.exp
@@ -0,0 +1,91 @@
1#!/usr/bin/expect -f
2#
3# private-tmp
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "touch /tmp/test1\r"
16sleep 1
17send -- "touch /tmp/test2\r"
18sleep 1
19send -- "firejail --noprofile --private-tmp\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "Child process initialized"
23}
24sleep 1
25
26send -- "ls -al /tmp | wc -l\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "3"
30}
31
32
33after 100
34send -- "exit\r"
35sleep 1
36
37#
38# O
39#
40if { $overlay == "overlay" } {
41 send -- "touch /tmp/test1\r"
42 sleep 1
43 send -- "touch /tmp/test2\r"
44 sleep 1
45 send -- "firejail --noprofile --overlay --private-tmp\r"
46 expect {
47 timeout {puts "TESTING ERROR 2\n";exit}
48 "Child process initialized"
49 }
50 sleep 1
51
52 send -- "ls -al /tmp | wc -l\r"
53 expect {
54 timeout {puts "TESTING ERROR 3.1\n";exit}
55 "3"
56 }
57
58
59 after 100
60 send -- "exit\r"
61 sleep 1
62}
63
64#
65# C
66#
67if { $chroot == "chroot" } {
68 send -- "touch /tmp/test1\r"
69 sleep 1
70 send -- "touch /tmp/test2\r"
71 sleep 1
72 send -- "firejail --noprofile --chroot=/tmp/chroot --private-tmp\r"
73 expect {
74 timeout {puts "TESTING ERROR 4\n";exit}
75 "Child process initialized"
76 }
77 sleep 1
78
79 send -- "ls -al /tmp | wc -l\r"
80 expect {
81 timeout {puts "TESTING ERROR 5.1\n";exit}
82 "3"
83 }
84
85 after 100
86 send -- "exit\r"
87 sleep 1
88}
89
90
91puts "\nall done\n"
diff --git a/test/features/3.8.exp b/test/features/3.8.exp
new file mode 100755
index 000000000..72953d159
--- /dev/null
+++ b/test/features/3.8.exp
@@ -0,0 +1,79 @@
1#!/usr/bin/expect -f
2#
3# private-bin
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "firejail --noprofile --private-bin=bash,cat,cp,ls,wc\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22send -- "ls -l /bin | wc -l\r"
23expect {
24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "6"
26}
27
28
29after 100
30send -- "exit\r"
31sleep 1
32
33#
34# O
35#
36if { $overlay == "overlay" } {
37 send -- "firejail --noprofile --overlay --private-bin=bash,cat,cp,ls,wc\r"
38 expect {
39 timeout {puts "TESTING ERROR 2\n";exit}
40 "Child process initialized"
41 }
42 sleep 1
43
44 send -- "ls -l /bin | wc -l\r"
45 expect {
46 timeout {puts "TESTING ERROR 3.1\n";exit}
47 "6"
48 }
49
50
51 after 100
52 send -- "exit\r"
53 sleep 1
54}
55
56#
57# C
58#
59if { $chroot == "chroot" } {
60 send -- "firejail --noprofile --chroot=/tmp/chroot --private-bin=bash,cat,cp,ls,wc\r"
61 expect {
62 timeout {puts "TESTING ERROR 4\n";exit}
63 "Child process initialized"
64 }
65 sleep 1
66
67 send -- "ls -l /bin | wc -l\r"
68 expect {
69 timeout {puts "TESTING ERROR 5.1\n";exit}
70 "6"
71 }
72
73 after 100
74 send -- "exit\r"
75 sleep 1
76}
77
78
79puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
index 0c41090aa..ac5390bc9 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -46,6 +46,11 @@ C - chroot filesystem
463.5 private-dev 463.5 private-dev
47 - O, C - somehow /dev/log is missing 47 - O, C - somehow /dev/log is missing
483.6 private-etc 483.6 private-etc
49 - O not working 49 - O not working - todo
503.7 private-tmp
513.8 private-bin
52 - O, C not working - todo
53
54
50 55
51 \ No newline at end of file 56 \ No newline at end of file
diff --git a/test/features/test.sh b/test/features/test.sh
index a162fc9ca..4e84f1f9c 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -99,5 +99,10 @@ echo "TESTING: 3.5 private-dev"
99./3.5.exp $OVERLAY $CHROOT 99./3.5.exp $OVERLAY $CHROOT
100 100
101echo "TESTING: 3.6 private-etc" 101echo "TESTING: 3.6 private-etc"
102./3.6.exp notworking-todo $CHROOT 102./3.6.exp notworking $CHROOT
103 103
104echo "TESTING: 3.7 private-tmp"
105./3.7.exp $OVERLAY $CHROOT
106
107echo "TESTING: 3.8 private-bin"
108./3.6.exp notworking notworking