summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 09:10:55 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 09:10:55 -0500
commit09e3fdc601c6db7a3d14ce1ec107abf91ef39ed9 (patch)
tree4fdc051676edbb4e48327fa5e4b260cf6d402fe6
parent0.9.38 testing (diff)
downloadfirejail-09e3fdc601c6db7a3d14ce1ec107abf91ef39ed9.tar.gz
firejail-09e3fdc601c6db7a3d14ce1ec107abf91ef39ed9.tar.zst
firejail-09e3fdc601c6db7a3d14ce1ec107abf91ef39ed9.zip
0.9.38 testing
-rwxr-xr-xtest/features/3.1.exp2
-rwxr-xr-xtest/features/3.5.exp77
-rwxr-xr-xtest/features/3.6.exp77
-rw-r--r--test/features/features.txt36
-rwxr-xr-xtest/features/test.sh6
5 files changed, 167 insertions, 31 deletions
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
index 52a929651..a66fbdae1 100755
--- a/test/features/3.1.exp
+++ b/test/features/3.1.exp
@@ -1,6 +1,6 @@
1#!/usr/bin/expect -f 1#!/usr/bin/expect -f
2# 2#
3# tmpfs 3# private
4# 4#
5 5
6set timeout 10 6set timeout 10
diff --git a/test/features/3.5.exp b/test/features/3.5.exp
new file mode 100755
index 000000000..d190ef36f
--- /dev/null
+++ b/test/features/3.5.exp
@@ -0,0 +1,77 @@
1#!/usr/bin/expect -f
2#
3# private-dev
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-dev\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22send -- "ls -al /dev | wc -l\r"
23expect {
24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "14"
26}
27
28after 100
29send -- "exit\r"
30sleep 1
31
32#
33# O
34#
35if { $overlay == "overlay" } {
36 send -- "firejail --noprofile --overlay --private-dev\r"
37 expect {
38 timeout {puts "TESTING ERROR 2\n";exit}
39 "Child process initialized"
40 }
41 sleep 1
42
43 send -- "ls -al /dev | wc -l\r"
44 expect {
45 timeout {puts "TESTING ERROR 3.1\n";exit}
46 "13"
47 }
48
49 after 100
50 send -- "exit\r"
51 sleep 1
52}
53
54#
55# C
56#
57if { $chroot == "chroot" } {
58 send -- "firejail --noprofile --chroot=/tmp/chroot --private-dev\r"
59 expect {
60 timeout {puts "TESTING ERROR 4\n";exit}
61 "Child process initialized"
62 }
63 sleep 1
64
65 send -- "ls -al /dev | wc -l\r"
66 expect {
67 timeout {puts "TESTING ERROR 5.1\n";exit}
68 "13"
69 }
70
71 after 100
72 send -- "exit\r"
73 sleep 1
74}
75
76
77puts "\nall done\n"
diff --git a/test/features/3.6.exp b/test/features/3.6.exp
new file mode 100755
index 000000000..6117485da
--- /dev/null
+++ b/test/features/3.6.exp
@@ -0,0 +1,77 @@
1#!/usr/bin/expect -f
2#
3# private-etc
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-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22send -- "ls -al /etc | wc -l\r"
23expect {
24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "10"
26}
27
28after 100
29send -- "exit\r"
30sleep 1
31
32#
33# O
34#
35if { $overlay == "overlay" } {
36 send -- "firejail --noprofile --overlay --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
37 expect {
38 timeout {puts "TESTING ERROR 2\n";exit}
39 "Child process initialized"
40 }
41 sleep 1
42
43 send -- "ls -al /etc | wc -l\r"
44 expect {
45 timeout {puts "TESTING ERROR 3.1\n";exit}
46 "10"
47 }
48
49 after 100
50 send -- "exit\r"
51 sleep 1
52}
53
54#
55# C
56#
57if { $chroot == "chroot" } {
58 send -- "firejail --noprofile --chroot=/tmp/chroot --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
59 expect {
60 timeout {puts "TESTING ERROR 4\n";exit}
61 "Child process initialized"
62 }
63 sleep 1
64
65 send -- "ls -al /etc | wc -l\r"
66 expect {
67 timeout {puts "TESTING ERROR 5.1\n";exit}
68 "10"
69 }
70
71 after 100
72 send -- "exit\r"
73 sleep 1
74}
75
76
77puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
index 1dedff357..0c41090aa 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -9,11 +9,7 @@ C - chroot filesystem
91. Default features (tesing with --noprofile) 91. Default features (tesing with --noprofile)
10 10
111.1 disable /boot 111.1 disable /boot
12 - N, O, C
13
141.2 new /proc 121.2 new /proc
15 - N, O, C
16
171.3 new /sys 131.3 new /sys
18 - N, O fails remount, C fails remount 14 - N, O fails remount, C fails remount
19 15
@@ -23,49 +19,23 @@ C - chroot filesystem
23 - /etc/group: N, O, C to test 19 - /etc/group: N, O, C to test
24 20
251.5 PID namespace 211.5 PID namespace
26 - N, O, C
27
281.6 new /var/log 221.6 new /var/log
29 - N, O, C
30
311.7 new /var/tmp 231.7 new /var/tmp
32 -N, O, C
33
341.8 disable /etc/firejail and ~/.config/firejail 241.8 disable /etc/firejail and ~/.config/firejail
35 -N, O, C
36
371.9 mount namespace 251.9 mount namespace
38
391.10 disable /selinux 261.10 disable /selinux
40 - N, O, C
41
42
43 27
442. Networking features 282. Networking features
45 29
462.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname) 302.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname)
47 - N, O, C
48 - ping disabled for C by default seccomp filter, use "getent hosts bingo" 31 - ping disabled for C by default seccomp filter, use "getent hosts bingo"
49 32
502.2 DNS (use --dns=4.2.2.1, use "dig google.com") 332.2 DNS (use --dns=4.2.2.1, use "dig google.com")
51 - N, O, C
52
532.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com) 342.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com)
54 - N, O, C
55 - test --ip: N, O, C
56
572.4 bridge (use --net=br0 and --noprofile; run ifconfig, netstat -rn, ping default gw) 352.4 bridge (use --net=br0 and --noprofile; run ifconfig, netstat -rn, ping default gw)
58 - N, O, C
59 - ping disabled for C by default seccomp filter - transfer test not implemented for C 36 - ping disabled for C by default seccomp filter - transfer test not implemented for C
60 - test --ip: N, O, C
61
622.5 interface 372.5 interface
63 - N, O, C
64
652.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) 382.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn)
66 - N, O, C
67
68
69 39
703. Filesystem features (use --noprofile) 403. Filesystem features (use --noprofile)
71 41
@@ -73,3 +43,9 @@ C - chroot filesystem
733.2 read-only 433.2 read-only
743.3 blacklist 443.3 blacklist
753.4 whitelist home 453.4 whitelist home
463.5 private-dev
47 - O, C - somehow /dev/log is missing
483.6 private-etc
49 - O not working
50
51 \ No newline at end of file
diff --git a/test/features/test.sh b/test/features/test.sh
index 56b6289b4..a162fc9ca 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -95,3 +95,9 @@ echo "TESTING: 3.3 blacklist"
95echo "TESTING: 3.4 whitelist" 95echo "TESTING: 3.4 whitelist"
96./3.4.exp $OVERLAY $CHROOT 96./3.4.exp $OVERLAY $CHROOT
97 97
98echo "TESTING: 3.5 private-dev"
99./3.5.exp $OVERLAY $CHROOT
100
101echo "TESTING: 3.6 private-etc"
102./3.6.exp notworking-todo $CHROOT
103