aboutsummaryrefslogtreecommitdiffstats
path: root/test/root
diff options
context:
space:
mode:
Diffstat (limited to 'test/root')
-rwxr-xr-xtest/root/apache2.exp68
-rwxr-xr-xtest/root/checkcfg.exp164
-rwxr-xr-xtest/root/firecfg.exp80
-rw-r--r--test/root/firejail.config26
-rwxr-xr-xtest/root/firemon-events.exp74
-rwxr-xr-xtest/root/isc-dhcp.exp51
-rwxr-xr-xtest/root/join.exp56
-rwxr-xr-xtest/root/login_nobody.exp35
-rwxr-xr-xtest/root/nginx.exp68
-rwxr-xr-xtest/root/option_bind_directory.exp24
-rwxr-xr-xtest/root/option_bind_file.exp24
-rwxr-xr-xtest/root/option_tmpfs.exp42
-rwxr-xr-xtest/root/private.exp111
-rwxr-xr-xtest/root/profile_tmpfs.exp42
-rwxr-xr-xtest/root/root.sh127
-rwxr-xr-xtest/root/seccomp-chmod.exp53
-rwxr-xr-xtest/root/seccomp-chown.exp50
-rwxr-xr-xtest/root/seccomp-umount.exp25
-rwxr-xr-xtest/root/snmpd.exp50
-rw-r--r--test/root/tmpfs-bad.profile1
-rw-r--r--test/root/tmpfs.profile1
-rwxr-xr-xtest/root/unbound.exp51
-rwxr-xr-xtest/root/whitelist.exp117
23 files changed, 0 insertions, 1340 deletions
diff --git a/test/root/apache2.exp b/test/root/apache2.exp
deleted file mode 100755
index 369cda40d..000000000
--- a/test/root/apache2.exp
+++ /dev/null
@@ -1,68 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 5
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=apache /etc/init.d/apache2 start\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17
18spawn $env(SHELL)
19send -- "firejail --tree\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "root:apache:firejail --name=apache /etc/init.d/apache2"
23}
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "www-data::/usr/sbin/apache2"
27}
28sleep 2
29
30
31send -- "rm index.html\r"
32sleep 1
33send -- "wget 127.0.0.1\r"
34expect {
35 timeout {puts "TESTING ERROR 3\n";exit}
36 "saved"
37}
38send -- "cat index.html\r"
39expect {
40 timeout {puts "TESTING ERROR 4\n";exit}
41 "DOCTYPE html PUBLIC"
42}
43
44sleep 1
45send -- "rm index.html\r"
46
47send -- "firejail --join=apache\r"
48sleep 2
49
50send -- "ls /dev\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 "tty0" {puts "TESTING ERROR 6\n";exit}
54 "ttyS0" {puts "TESTING ERROR 6\n";exit}
55 "audio" {puts "TESTING ERROR 6\n";exit}
56 "ppp" {puts "TESTING ERROR 6\n";exit}
57 "log"
58}
59sleep 1
60send -- "ls -al /tmp;pwd\r"
61expect {
62 timeout {puts "TESTING ERROR 10\n";exit}
63 "X11-unix" {puts "TESTING ERROR 11\n";exit}
64 "/root"
65}
66sleep 2
67
68puts "\nall done\n"
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
deleted file mode 100755
index d7aea8084..000000000
--- a/test/root/checkcfg.exp
+++ /dev/null
@@ -1,164 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "rm /etc/firejail/firejail.config\r"
12after 100
13
14send -- "firejail\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 "firejail.config not found"
18}
19
20# seccomp
21send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r"
22after 100
23send -- "firejail --noprofile --seccomp\r"
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "seccomp feature is disabled in Firejail configuration file\r"
27}
28
29# whitelist
30send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r"
31after 100
32send -- "firejail --noprofile --whitelist=~/.config\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "whitelist feature is disabled in Firejail configuration file\r"
36}
37
38# network
39send -- "echo \"network no\" > /etc/firejail/firejail.config\r"
40after 100
41send -- "firejail --noprofile --net=eth0\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "networking feature is disabled in Firejail configuration file\r"
45}
46
47# bind
48send -- "echo \"bind no\" > /etc/firejail/firejail.config\r"
49after 100
50send -- "firejail --noprofile --bind=/tmp,/var/tmp\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 "bind feature is disabled in Firejail configuration file\r"
54}
55
56# overlay
57send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r"
58after 100
59send -- "firejail --noprofile --overlay\r"
60expect {
61 timeout {puts "TESTING ERROR 6\n";exit}
62 "overlayfs feature is disabled in Firejail configuration file\r"
63}
64
65# private-home
66send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r"
67after 100
68send -- "firejail --noprofile --private-home=/tmp\r"
69expect {
70 timeout {puts "TESTING ERROR 7\n";exit}
71 "private-home feature is disabled in Firejail configuration file\r"
72}
73
74# chroot
75send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r"
76after 100
77send -- "firejail --noprofile --chroot=/tmp\r"
78expect {
79 timeout {puts "TESTING ERROR 8\n";exit}
80 "chroot feature is disabled in Firejail configuration file\r"
81}
82
83# userns
84send -- "echo \"userns no\" > /etc/firejail/firejail.config\r"
85after 100
86send -- "firejail --noprofile --noroot\r"
87expect {
88 timeout {puts "TESTING ERROR 9\n";exit}
89 "noroot feature is disabled in Firejail configuration file\r"
90}
91sleep 1
92
93# netfilter-default
94send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r"
95after 100
96send -- "firejail --noprofile\r"
97expect {
98 timeout {puts "TESTING ERROR 10\n";exit}
99 "netfilter-default file blablabla not available\r"
100}
101after 100
102
103# strings
104send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r"
105after 100
106send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r"
107after 100
108send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r"
109sleep 1
110send -- "stty -echo\r"
111after 100
112send -- "firejail --noprofile echo done\r"
113expect {
114 timeout {puts "TESTING ERROR 11\n";exit}
115 "done\r"
116}
117sleep 1
118
119after 100
120send -- "echo \"join no\" > /etc/firejail/firejail.config\r"
121after 100
122send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r"
123after 100
124send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r"
125after 100
126send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r"
127after 100
128send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r"
129after 100
130send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r"
131after 100
132send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r"
133after 100
134send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r"
135after 100
136send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r"
137after 100
138send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r"
139after 100
140send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r"
141after 100
142send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r"
143after 100
144send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r"
145after 100
146send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r"
147after 100
148send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r"
149after 100
150send -- "echo \"xephyr-window-title no\" >> /etc/firejail/firejail.config\r"
151after 100
152send -- "echo \"remount-proc-sys no\" >> /etc/firejail/firejail.config\r"
153after 100
154send -- "echo \"disable-mnt no\" >> /etc/firejail/firejail.config\r"
155after 100
156send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r"
157after 100
158send -- "firejail --noprofile\r"
159expect {
160 timeout {puts "TESTING ERROR 12\n";exit}
161 ""
162}
163after 100
164puts "\nall done\n"
diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp
deleted file mode 100755
index d78631c76..000000000
--- a/test/root/firecfg.exp
+++ /dev/null
@@ -1,80 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firecfg --debug\r"
11sleep 1
12
13send -- "firecfg --debug --clean\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "less removed"
17}
18sleep 1
19
20send -- "stty -echo\r"
21after 100
22send -- "file /usr/local/bin/firefox; echo done\r"
23expect {
24 timeout {puts "TESTING ERROR 1\n";exit}
25 "symbolic link to /usr/bin/firejail" {puts "TESTING ERROR 2\n";exit}
26 "done"
27}
28sleep 1
29
30send -- "firecfg --debug\r"
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "less created"
34}
35sleep 1
36
37send -- "file /usr/local/bin/less\r"
38expect {
39 timeout {puts "TESTING ERROR 4\n";exit}
40 "symbolic link to /usr/bin/firejail"
41}
42sleep 1
43
44send -- "firecfg --list\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 "/usr/local/bin/less"
48}
49sleep 1
50
51send -- "firecfg --fix\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 "this option is not supported for root user"
55}
56sleep 1
57
58send -- "firecfg --fix-sound\r"
59expect {
60 timeout {puts "TESTING ERROR 7\n";exit}
61 "PulseAudio configured, please logout and login back again"
62}
63sleep 1
64
65send -- "firecfg --version\r"
66expect {
67 timeout {puts "TESTING ERROR 8\n";exit}
68 "firecfg version"
69}
70sleep 1
71
72send -- "firecfg --blablabla\r"
73expect {
74 timeout {puts "TESTING ERROR 9\n";exit}
75 "invalid command line option"
76}
77sleep 1
78
79
80puts "\nall done\n"
diff --git a/test/root/firejail.config b/test/root/firejail.config
deleted file mode 100644
index 4ad5edd4d..000000000
--- a/test/root/firejail.config
+++ /dev/null
@@ -1,26 +0,0 @@
1
2bind yes
3chroot yes
4chroot-desktop yes
5cache-tmpfs yes
6file-transfer yes
7firejail-prompt no
8follow-symlink-as-user no
9follow-symlink-private-bin no
10force-nonewprivs no
11join yes
12network yes
13overlayfs yes
14private-bin-no-local no
15private-home yes
16quiet-by-default no
17remount-proc-sys yes
18restricted-network no
19# netfilter-default /etc/iptables.iptables.rules
20seccomp yes
21userns yes
22whitelist yes
23x11 yes
24xephyr-screen 800x600
25xephyr-window-title yes
26xephyr-extra-params -grayscale
diff --git a/test/root/firemon-events.exp b/test/root/firemon-events.exp
deleted file mode 100755
index 8ca222733..000000000
--- a/test/root/firemon-events.exp
+++ /dev/null
@@ -1,74 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# start firemon
11set firemon_id $spawn_id
12send -- "firemon\r"
13sleep 1
14
15# start firejail
16spawn $env(SHELL)
17set firejail_id $spawn_id
18send -- "firejail\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23
24# get messages on firemon
25set spawn_id $firemon_id
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "exec"
29}
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "/bin/bash -c /bin/bash"
33}
34expect {
35 timeout {puts "TESTING ERROR 3\n";exit}
36 "exec"
37}
38expect {
39 timeout {puts "TESTING ERROR 4\n";exit}
40 "/bin/bash"
41}
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "fork"
45}
46expect {
47 timeout {puts "TESTING ERROR 6\n";exit}
48 "child"
49}
50expect {
51 timeout {puts "TESTING ERROR 7\n";exit}
52 "/bin/bash"
53}
54after 100
55
56# exit firejail
57set spawn_id $firejail_id
58send -- "exit\r"
59sleep 1
60
61# get messages on firemon
62set spawn_id $firemon_id
63expect {
64 timeout {puts "TESTING ERROR 8\n";exit}
65 "exit"
66}
67
68expect {
69 timeout {puts "TESTING ERROR 9\n";exit}
70 "EXIT SANDBOX"
71}
72
73
74puts "\nall done\n"
diff --git a/test/root/isc-dhcp.exp b/test/root/isc-dhcp.exp
deleted file mode 100755
index dbafdb9d0..000000000
--- a/test/root/isc-dhcp.exp
+++ /dev/null
@@ -1,51 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 5
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=dhcpd /etc/init.d/isc-dhcp-server start\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17spawn $env(SHELL)
18send -- "firejail --tree\r"
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "root:/usr/sbin/dhcpd"
22}
23sleep 2
24
25send -- "tail -n 200 /var/log/syslog\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "Internet Systems Consortium DHCP Server"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Wrote 0 leases to leases file"
33}
34sleep 2
35
36send -- "firejail --join=dhcpd\r"
37sleep 2
38
39send -- "ls /dev\r"
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "tty0" {puts "TESTING ERROR 6\n";exit}
43 "ttyS0" {puts "TESTING ERROR 6\n";exit}
44 "ppp" {puts "TESTING ERROR 6\n";exit}
45 "audio" {puts "TESTING ERROR 6\n";exit}
46 "log"
47}
48sleep 2
49
50
51puts "\nall done\n"
diff --git a/test/root/join.exp b/test/root/join.exp
deleted file mode 100755
index c488a488a..000000000
--- a/test/root/join.exp
+++ /dev/null
@@ -1,56 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "firejail --name=jointesting --cpu=0 --nice=2\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
15}
16sleep 2
17
18spawn $env(SHELL)
19send -- "firejail --join=jointesting\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "Switching to pid"
23}
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
27}
28sleep 1
29send -- "ps aux\r"
30expect {
31 timeout {puts "TESTING ERROR 3\n";exit}
32 "/bin/bash"
33}
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "/bin/bash"
37}
38
39send -- "exit\r"
40sleep 1
41send -- "firejail --join-network=jointesting\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
45}
46send -- "exit\r"
47sleep 1
48send -- "firejail --join-filesystem=jointesting\r"
49expect {
50 timeout {puts "TESTING ERROR 6\n";exit}
51 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
52}
53
54after 100
55
56puts "\nall done\n"
diff --git a/test/root/login_nobody.exp b/test/root/login_nobody.exp
deleted file mode 100755
index 0c54488bd..000000000
--- a/test/root/login_nobody.exp
+++ /dev/null
@@ -1,35 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7cd /home
8spawn $env(SHELL)
9match_max 100000
10
11send -- "su - nobody -s /usr/bin/firejail\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
15}
16after 100
17
18send -- "cat /proc/self/status | grep Seccomp\r"
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "2"
22}
23after 100
24
25send -- "cat /proc/self/status | grep CapBnd\r"
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "0000000000000000"
29}
30after 100
31
32send -- "exit\r"
33sleep 1
34
35puts "\nall done\n"
diff --git a/test/root/nginx.exp b/test/root/nginx.exp
deleted file mode 100755
index cb7367729..000000000
--- a/test/root/nginx.exp
+++ /dev/null
@@ -1,68 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 5
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=nginx /etc/init.d/nginx start\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17
18spawn $env(SHELL)
19send -- "firejail --tree\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "root::nginx: master process /usr/sbin/nginx"
23}
24expect {
25 timeout {puts "TESTING ERROR 2\n";exit}
26 "www-data::nginx: worker process"
27}
28sleep 2
29
30
31send -- "rm index.html\r"
32sleep 1
33send -- "wget 127.0.0.1\r"
34expect {
35 timeout {puts "TESTING ERROR 3\n";exit}
36 "saved"
37}
38send -- "cat index.html\r"
39expect {
40 timeout {puts "TESTING ERROR 4\n";exit}
41 "DOCTYPE html PUBLIC"
42}
43
44sleep 1
45send -- "rm index.html\r"
46
47send -- "firejail --join=nginx\r"
48sleep 2
49
50send -- "ls /dev\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 "tty0" {puts "TESTING ERROR 6\n";exit}
54 "ttyS0" {puts "TESTING ERROR 6\n";exit}
55 "audio" {puts "TESTING ERROR 6\n";exit}
56 "ppp" {puts "TESTING ERROR 6\n";exit}
57 "log"
58}
59sleep 1
60send -- "ls -al /tmp;pwd\r"
61expect {
62 timeout {puts "TESTING ERROR 10\n";exit}
63 "X11-unix" {puts "TESTING ERROR 11\n";exit}
64 "/root"
65}
66sleep 2
67
68puts "\nall done\n"
diff --git a/test/root/option_bind_directory.exp b/test/root/option_bind_directory.exp
deleted file mode 100755
index 83ed6b84d..000000000
--- a/test/root/option_bind_directory.exp
+++ /dev/null
@@ -1,24 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --bind=/tmp/chroot,mntpoint\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17send -- "ls mntpoint;pwd\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "root"
21}
22sleep 1
23
24puts "\n"
diff --git a/test/root/option_bind_file.exp b/test/root/option_bind_file.exp
deleted file mode 100755
index 0807f951a..000000000
--- a/test/root/option_bind_file.exp
+++ /dev/null
@@ -1,24 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --bind=tmpfile,/etc/passwd\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17send -- "cat /etc/passwd;pwd\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "hello"
21}
22sleep 1
23
24puts "\n"
diff --git a/test/root/option_tmpfs.exp b/test/root/option_tmpfs.exp
deleted file mode 100755
index 2d9eea8f5..000000000
--- a/test/root/option_tmpfs.exp
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --tmpfs=/var\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17send -- "ls -l /var;pwd\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "total 0"
21}
22after 100
23send -- "exit\r"
24sleep 1
25
26send -- "firejail --debug-check-filename --tmpfs=\"bla&&bla\"\r"
27expect {
28 timeout {puts "TESTING ERROR 13.1\n";exit}
29 "Checking filename bla&&bla"
30}
31expect {
32 timeout {puts "TESTING ERROR 13.2\n";exit}
33 "Error:"
34}
35expect {
36 timeout {puts "TESTING ERROR 13.3\n";exit}
37 "is an invalid filename"
38}
39after 100
40
41
42puts "\nall done\n"
diff --git a/test/root/private.exp b/test/root/private.exp
deleted file mode 100755
index 8c89e1f31..000000000
--- a/test/root/private.exp
+++ /dev/null
@@ -1,111 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --private\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17send -- "ls -l /home\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "total 0"
21}
22after 100
23
24send -- "ls -l /root\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "total 0"
28}
29after 100
30
31send -- "exit\r"
32sleep 1
33
34
35
36send -- "touch /opt/firejail-test-file\r"
37after 100
38send -- "mkdir /opt/firejail-test-dir\r"
39after 100
40send -- "touch /opt/firejail-test-dir/firejail-test-file\r"
41after 100
42send -- "firejail --private-opt=firejail-test-file,firejail-test-dir --debug\r"
43expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
46}
47sleep 1
48
49send -- "find /opt | wc -l\r"
50expect {
51 timeout {puts "TESTING ERROR 4\n";exit}
52 "4"
53}
54after 100
55send -- "exit\r"
56sleep 1
57send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r"
58expect {
59 timeout {puts "TESTING ERROR 3.1\n";exit}
60 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
61}
62sleep 1
63
64send -- "find /opt | wc -l\r"
65expect {
66 timeout {puts "TESTING ERROR 4.1\n";exit}
67 "4"
68}
69after 100
70send -- "exit\r"
71sleep 1
72
73
74send -- "touch /srv/firejail-test-file\r"
75after 100
76send -- "mkdir /srv/firejail-test-dir\r"
77after 100
78send -- "touch /srv/firejail-test-dir/firejail-test-file\r"
79after 100
80send -- "firejail --private-srv=firejail-test-file,firejail-test-dir --debug\r"
81expect {
82 timeout {puts "TESTING ERROR 5\n";exit}
83 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
84}
85sleep 1
86
87send -- "find /srv | wc -l\r"
88expect {
89 timeout {puts "TESTING ERROR 6\n";exit}
90 "4"
91}
92after 100
93send -- "exit\r"
94sleep 1
95send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r"
96expect {
97 timeout {puts "TESTING ERROR 5.1\n";exit}
98 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
99}
100sleep 1
101
102send -- "find /srv | wc -l\r"
103expect {
104 timeout {puts "TESTING ERROR 6.1\n";exit}
105 "4"
106}
107after 100
108send -- "exit\r"
109sleep 1
110
111puts "\nall done\n"
diff --git a/test/root/profile_tmpfs.exp b/test/root/profile_tmpfs.exp
deleted file mode 100755
index 7331225b3..000000000
--- a/test/root/profile_tmpfs.exp
+++ /dev/null
@@ -1,42 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --profile=tmpfs.profile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17send -- "ls -l /var;pwd\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "total 0"
21}
22after 100
23send -- "exit\r"
24sleep 1
25
26send -- "firejail --debug-check-filename --profile=tmpfs-bad.profile\r"
27expect {
28 timeout {puts "TESTING ERROR 13.1\n";exit}
29 "Checking filename bla&&bla"
30}
31expect {
32 timeout {puts "TESTING ERROR 13.2\n";exit}
33 "Error:"
34}
35expect {
36 timeout {puts "TESTING ERROR 13.3\n";exit}
37 "is an invalid filename"
38}
39after 100
40
41
42puts "\nall done\n"
diff --git a/test/root/root.sh b/test/root/root.sh
deleted file mode 100755
index 84e430c7f..000000000
--- a/test/root/root.sh
+++ /dev/null
@@ -1,127 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6# set a new firejail config file
7#cp firejail.config /etc/firejail/firejail.config
8
9export LC_ALL=C
10
11#********************************
12# firecfg
13#********************************
14if command -v less
15then
16 echo "TESTING: firecfg (test/root/firecfg.exp)"
17 mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store
18 ./firecfg.exp
19 mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications
20else
21 echo "TESTING SKIP: firecfg, less not found"
22fi
23
24#********************************
25# servers
26#********************************
27if [[ -f /etc/init.d/snmpd ]]
28then
29 echo "TESTING: snmpd (test/root/snmpd.exp)"
30 ./snmpd.exp
31else
32 echo "TESTING SKIP: snmpd not found"
33fi
34
35
36if [[ -f /etc/init.d/apache2 ]]
37then
38 echo "TESTING: apache2 (test/root/apache2.exp)"
39 ./apache2.exp
40else
41 echo "TESTING SKIP: apache2 not found"
42fi
43
44if [[ -f /etc/init.d/isc-dhcp-server ]]
45then
46 echo "TESTING: isc dhcp server (test/root/isc-dhscp.exp)"
47 ./isc-dhcp.exp
48else
49 echo "TESTING SKIP: isc dhcp server not found"
50fi
51
52if [[ -f /etc/init.d/unbound ]]
53then
54 echo "TESTING: unbound (test/root/unbound.exp)"
55 ./unbound.exp
56else
57 echo "TESTING SKIP: unbound not found"
58fi
59
60if [[ -f /etc/init.d/nginx ]]
61then
62 echo "TESTING: nginx (test/root/nginx.exp)"
63 ./nginx.exp
64else
65 echo "TESTING SKIP: nginx not found"
66fi
67
68#********************************
69# filesystem
70#********************************
71echo "TESTING: fs private (test/root/private.exp)"
72./private.exp
73
74echo "TESTING: fs whitelist mnt, opt, media (test/root/whitelist-mnt.exp)"
75./whitelist.exp
76
77#********************************
78# utils
79#********************************
80echo "TESTING: join (test/root/join.exp)"
81./join.exp
82
83echo "TESTING: login-nobody (test/root/login_nobody.exp)"
84./login_nobody.exp
85
86#********************************
87# seccomp
88#********************************
89echo "TESTING: seccomp umount (test/root/seccomp-umount.exp)"
90./seccomp-umount.exp
91
92echo "TESTING: seccomp chmod (test/root/seccomp-chmod.exp)"
93./seccomp-chmod.exp
94
95echo "TESTING: seccomp chown (test/root/seccomp-chown.exp)"
96./seccomp-chown.exp
97
98#********************************
99# command line options
100#********************************
101echo "TESTING: firejail configuration (test/root/checkcfg.exp)"
102./checkcfg.exp
103cp ../../etc/firejail.config /etc/firejail/.
104
105echo "TESTING: tmpfs (test/root/option_tmpfs.exp)"
106./option_tmpfs.exp
107
108echo "TESTING: profile tmpfs (test/root/profile_tmpfs)"
109./profile_tmpfs.exp
110
111echo "TESTING: bind directory (test/root/option_bind_directory.exp)"
112./option_bind_directory.exp
113
114echo "TESTING: bind file (test/root/option_bind_file.exp)"
115echo hello > tmpfile
116./option_bind_file.exp
117rm -f tmpfile
118
119#********************************
120# firemon
121#********************************
122echo "TESTING: firemon events (test/root/firemon-events.exp)"
123./firemon-events.exp
124
125
126# restore the default config file
127#cp ../../etc/firejail.config /etc/firejail/firejail.config
diff --git a/test/root/seccomp-chmod.exp b/test/root/seccomp-chmod.exp
deleted file mode 100755
index d26098524..000000000
--- a/test/root/seccomp-chmod.exp
+++ /dev/null
@@ -1,53 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --seccomp=chmod,fchmod,fchmodat --private\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17send -- "stty -echo\r"
18after 100
19send -- "cd ~; echo done\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "done"
23}
24
25send -- "touch testfile; echo done\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "done"
29}
30
31send -- "ls -l testfile; echo done\r"
32expect {
33 timeout {puts "TESTING ERROR 3\n";exit}
34 "testfile"
35}
36expect {
37 timeout {puts "TESTING ERROR 4\n";exit}
38 "done"
39}
40
41send -- "chmod +x testfile; echo done\r"
42expect {
43 timeout {puts "TESTING ERROR 5\n";exit}
44 "Bad system call"
45}
46expect {
47 timeout {puts "TESTING ERROR 6\n";exit}
48 "done"
49}
50
51send -- "exit\r"
52after 100
53puts "\nall done\n"
diff --git a/test/root/seccomp-chown.exp b/test/root/seccomp-chown.exp
deleted file mode 100755
index e17bbc4bb..000000000
--- a/test/root/seccomp-chown.exp
+++ /dev/null
@@ -1,50 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --seccomp=chown,fchown,fchownat,lchown --private\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17send -- "stty -echo\r"
18after 100
19send -- "touch testfile; echo done\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "done"
23}
24after 100
25
26send -- "ls -l testfile; echo done\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "testfile"
30}
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "done"
34}
35after 100
36
37send -- "chown netblue:netblue testfile; echo done\r"
38expect {
39 timeout {puts "TESTING ERROR 2\n";exit}
40 "Bad system call"
41}
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "done"
45}
46
47
48send -- "exit\r"
49after 100
50puts "\nall done\n"
diff --git a/test/root/seccomp-umount.exp b/test/root/seccomp-umount.exp
deleted file mode 100755
index 70a39925d..000000000
--- a/test/root/seccomp-umount.exp
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --seccomp --noprofile\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17send -- "umount /proc\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "Bad system call"
21}
22
23send -- "exit\r"
24after 100
25puts "\n"
diff --git a/test/root/snmpd.exp b/test/root/snmpd.exp
deleted file mode 100755
index 63f488342..000000000
--- a/test/root/snmpd.exp
+++ /dev/null
@@ -1,50 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 5
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=snmpd /etc/init.d/snmpd start\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17spawn $env(SHELL)
18send -- "firejail --tree\r"
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "snmp:/usr/sbin/snmpd"
22}
23sleep 2
24
25send -- "tail /var/log/syslog\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "snmpd"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "NET-SNMP version"
33}
34
35send -- "firejail --join=snmpd\r"
36sleep 2
37
38send -- "ls /dev\r"
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 "tty0" {puts "TESTING ERROR 6\n";exit}
42 "ttyS0" {puts "TESTING ERROR 6\n";exit}
43 "audio" {puts "TESTING ERROR 6\n";exit}
44 "ppp" {puts "TESTING ERROR 6\n";exit}
45 "log"
46}
47sleep 2
48
49sleep 2
50puts "\nall done\n"
diff --git a/test/root/tmpfs-bad.profile b/test/root/tmpfs-bad.profile
deleted file mode 100644
index 7264e18ff..000000000
--- a/test/root/tmpfs-bad.profile
+++ /dev/null
@@ -1 +0,0 @@
1tmpfs bla&&bla
diff --git a/test/root/tmpfs.profile b/test/root/tmpfs.profile
deleted file mode 100644
index 55a6f7ebc..000000000
--- a/test/root/tmpfs.profile
+++ /dev/null
@@ -1 +0,0 @@
1tmpfs /var
diff --git a/test/root/unbound.exp b/test/root/unbound.exp
deleted file mode 100755
index d84c07452..000000000
--- a/test/root/unbound.exp
+++ /dev/null
@@ -1,51 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 5
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=unbound unbound\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17spawn $env(SHELL)
18send -- "firejail --tree\r"
19expect {
20 timeout {puts "TESTING ERROR 2\n";exit}
21 "unbound:unbound"
22}
23sleep 2
24
25send -- "tail /var/log/syslog\r"
26expect {
27 timeout {puts "TESTING ERROR 3\n";exit}
28 "unbound"
29}
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "info: start of service"
33}
34sleep 2
35
36send -- "firejail --join=unbound\r"
37sleep 2
38
39send -- "ls /dev\r"
40expect {
41 timeout {puts "TESTING ERROR 5\n";exit}
42 "tty0" {puts "TESTING ERROR 6\n";exit}
43 "ttyS0" {puts "TESTING ERROR 6\n";exit}
44 "audio" {puts "TESTING ERROR 6\n";exit}
45 "ppp" {puts "TESTING ERROR 6\n";exit}
46 "log"
47}
48sleep 2
49
50
51puts "\nall done\n"
diff --git a/test/root/whitelist.exp b/test/root/whitelist.exp
deleted file mode 100755
index 063864e13..000000000
--- a/test/root/whitelist.exp
+++ /dev/null
@@ -1,117 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch /mnt/firejail-test-file\r"
11after 100
12send -- "mkdir /mnt/firejail-test-dir\r"
13after 100
14send -- "touch /mnt/firejail-test-dir/firejail-test-file\r"
15after 100
16send -- "firejail --whitelist=/mnt/firejail-test-file --whitelist=/mnt/firejail-test-dir --debug\r"
17expect {
18 timeout {puts "TESTING ERROR 0\n";exit}
19 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
20}
21sleep 1
22
23send -- "find /mnt | wc -l\r"
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "4"
27}
28after 100
29send -- "exit\r"
30sleep 1
31
32
33send -- "touch /opt/firejail-test-file\r"
34after 100
35send -- "mkdir /opt/firejail-test-dir\r"
36after 100
37send -- "touch /opt/firejail-test-dir/firejail-test-file\r"
38after 100
39send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r"
40expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
43}
44sleep 1
45
46send -- "find /opt | wc -l\r"
47expect {
48 timeout {puts "TESTING ERROR 3\n";exit}
49 "4"
50}
51after 100
52send -- "exit\r"
53sleep 1
54
55send -- "touch /media/firejail-test-file\r"
56after 100
57send -- "mkdir /media/firejail-test-dir\r"
58after 100
59send -- "touch /media/firejail-test-dir/firejail-test-file\r"
60after 100
61send -- "firejail --whitelist=/media/firejail-test-file --whitelist=/media/firejail-test-dir --debug\r"
62expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65}
66sleep 1
67
68send -- "find /media | wc -l\r"
69expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 "4"
72}
73after 100
74send -- "exit\r"
75sleep 1
76
77
78send -- "firejail --whitelist=/var/run --whitelist=/var/lock --debug\r"
79expect {
80 timeout {puts "TESTING ERROR 6\n";exit}
81 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
82}
83sleep 1
84
85send -- "find /var | wc -l\r"
86expect {
87 timeout {puts "TESTING ERROR 7\n";exit}
88 ""
89}
90after 100
91send -- "exit\r"
92sleep 1
93
94send -- "touch /srv/firejail-test-file\r"
95after 100
96send -- "mkdir /srv/firejail-test-dir\r"
97after 100
98send -- "touch /srv/firejail-test-dir/firejail-test-file\r"
99after 100
100send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r"
101expect {
102 timeout {puts "TESTING ERROR 8\n";exit}
103 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
104}
105sleep 1
106
107send -- "find /srv | wc -l\r"
108expect {
109 timeout {puts "TESTING ERROR 9\n";exit}
110 "4"
111}
112after 100
113send -- "exit\r"
114
115
116after 100
117puts "\nall done\n"