aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-03-05 11:52:56 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2017-03-05 11:52:56 -0500
commit578a83fcd07da8b9afb3b3a4f26eefe0df19c98d (patch)
treedfc775b9436a7ea0df34e90554f733f02b25d3b1 /test
parentadded Geeqie profile (diff)
downloadfirejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.tar.gz
firejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.tar.zst
firejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/root/checkcfg.exp106
-rwxr-xr-xtest/root/root.sh3
2 files changed, 109 insertions, 0 deletions
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
new file mode 100755
index 000000000..e1ec6cf79
--- /dev/null
+++ b/test/root/checkcfg.exp
@@ -0,0 +1,106 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2017 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "firejail --noprofile --overlay\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 2
17
18send -- "rm /etc/firejail/firejail.config\r"
19after 100
20
21send -- "firejail\r"
22expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "firejail.config not found"
25}
26
27# seccomp
28send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r"
29after 100
30send -- "firejail --noprofile --seccomp --force\r"
31expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 "seccomp feature is disabled in Firejail configuration file\r"
34}
35send -- "exit\r"
36after 100
37
38# whitelist
39send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r"
40after 100
41send -- "firejail --noprofile --whitelist=~/.config --force\r"
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "whitelist feature is disabled in Firejail configuration file\r"
45}
46
47# network
48send -- "echo \"network no\" > /etc/firejail/firejail.config\r"
49after 100
50send -- "firejail --noprofile --net=eth0 --force\r"
51expect {
52 timeout {puts "TESTING ERROR 4\n";exit}
53 "networking feature is disabled in Firejail configuration file\r"
54}
55
56# bind
57send -- "echo \"bind no\" > /etc/firejail/firejail.config\r"
58after 100
59send -- "firejail --noprofile --bind=/tmp,/var/tmp --force\r"
60expect {
61 timeout {puts "TESTING ERROR 5\n";exit}
62 "bind feature is disabled in Firejail configuration file\r"
63}
64
65# overlay
66send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r"
67after 100
68send -- "firejail --noprofile --overlay --force\r"
69expect {
70 timeout {puts "TESTING ERROR 6\n";exit}
71 "overlayfs feature is disabled in Firejail configuration file\r"
72}
73
74# private-home
75send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r"
76after 100
77send -- "firejail --noprofile --private-home=/tmp --force\r"
78expect {
79 timeout {puts "TESTING ERROR 7\n";exit}
80 "private-home feature is disabled in Firejail configuration file\r"
81}
82
83# chroot
84send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r"
85after 100
86send -- "firejail --noprofile --chroot=/tmp --force\r"
87expect {
88 timeout {puts "TESTING ERROR 8\n";exit}
89 "chroot feature is disabled in Firejail configuration file\r"
90}
91
92# userns
93send -- "echo \"userns no\" > /etc/firejail/firejail.config\r"
94after 100
95send -- "firejail --noprofile --noroot --force\r"
96expect {
97 timeout {puts "TESTING ERROR 9\n";exit}
98 "noroot feature is disabled in Firejail configuration file\r"
99}
100
101send -- "exit\r"
102after 100
103
104
105after 100
106puts "\nall done\n"
diff --git a/test/root/root.sh b/test/root/root.sh
index 29c618772..e23499d2a 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -80,6 +80,9 @@ echo "TESTING: seccomp chown (test/root/seccomp-chown.exp)"
80#******************************** 80#********************************
81# command line options 81# command line options
82#******************************** 82#********************************
83echo "TESTING: firejail configuration (test/root/checkcfg.exp)"
84./checkcfg.exp
85
83echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" 86echo "TESTING: tmpfs (test/root/option_tmpfs.exp)"
84./option_tmpfs.exp 87./option_tmpfs.exp
85 88