diff options
author | netblue30 <netblue30@yahoo.com> | 2017-03-05 11:52:56 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-03-05 11:52:56 -0500 |
commit | 578a83fcd07da8b9afb3b3a4f26eefe0df19c98d (patch) | |
tree | dfc775b9436a7ea0df34e90554f733f02b25d3b1 /test | |
parent | added Geeqie profile (diff) | |
download | firejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.tar.gz firejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.tar.zst firejail-578a83fcd07da8b9afb3b3a4f26eefe0df19c98d.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/root/checkcfg.exp | 106 | ||||
-rwxr-xr-x | test/root/root.sh | 3 |
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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --noprofile --overlay\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 2 | ||
17 | |||
18 | send -- "rm /etc/firejail/firejail.config\r" | ||
19 | after 100 | ||
20 | |||
21 | send -- "firejail\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 1\n";exit} | ||
24 | "firejail.config not found" | ||
25 | } | ||
26 | |||
27 | # seccomp | ||
28 | send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r" | ||
29 | after 100 | ||
30 | send -- "firejail --noprofile --seccomp --force\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 2\n";exit} | ||
33 | "seccomp feature is disabled in Firejail configuration file\r" | ||
34 | } | ||
35 | send -- "exit\r" | ||
36 | after 100 | ||
37 | |||
38 | # whitelist | ||
39 | send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r" | ||
40 | after 100 | ||
41 | send -- "firejail --noprofile --whitelist=~/.config --force\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "whitelist feature is disabled in Firejail configuration file\r" | ||
45 | } | ||
46 | |||
47 | # network | ||
48 | send -- "echo \"network no\" > /etc/firejail/firejail.config\r" | ||
49 | after 100 | ||
50 | send -- "firejail --noprofile --net=eth0 --force\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 4\n";exit} | ||
53 | "networking feature is disabled in Firejail configuration file\r" | ||
54 | } | ||
55 | |||
56 | # bind | ||
57 | send -- "echo \"bind no\" > /etc/firejail/firejail.config\r" | ||
58 | after 100 | ||
59 | send -- "firejail --noprofile --bind=/tmp,/var/tmp --force\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 5\n";exit} | ||
62 | "bind feature is disabled in Firejail configuration file\r" | ||
63 | } | ||
64 | |||
65 | # overlay | ||
66 | send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r" | ||
67 | after 100 | ||
68 | send -- "firejail --noprofile --overlay --force\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6\n";exit} | ||
71 | "overlayfs feature is disabled in Firejail configuration file\r" | ||
72 | } | ||
73 | |||
74 | # private-home | ||
75 | send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r" | ||
76 | after 100 | ||
77 | send -- "firejail --noprofile --private-home=/tmp --force\r" | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 7\n";exit} | ||
80 | "private-home feature is disabled in Firejail configuration file\r" | ||
81 | } | ||
82 | |||
83 | # chroot | ||
84 | send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r" | ||
85 | after 100 | ||
86 | send -- "firejail --noprofile --chroot=/tmp --force\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 8\n";exit} | ||
89 | "chroot feature is disabled in Firejail configuration file\r" | ||
90 | } | ||
91 | |||
92 | # userns | ||
93 | send -- "echo \"userns no\" > /etc/firejail/firejail.config\r" | ||
94 | after 100 | ||
95 | send -- "firejail --noprofile --noroot --force\r" | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 9\n";exit} | ||
98 | "noroot feature is disabled in Firejail configuration file\r" | ||
99 | } | ||
100 | |||
101 | send -- "exit\r" | ||
102 | after 100 | ||
103 | |||
104 | |||
105 | after 100 | ||
106 | puts "\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 | #******************************** |
83 | echo "TESTING: firejail configuration (test/root/checkcfg.exp)" | ||
84 | ./checkcfg.exp | ||
85 | |||
83 | echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" | 86 | echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" |
84 | ./option_tmpfs.exp | 87 | ./option_tmpfs.exp |
85 | 88 | ||