aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-02-28 09:51:26 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-02-28 09:51:26 -0500
commit27c4d069f322fbeca07c88e0e96208233103a5db (patch)
treefb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test
parentfix cppcheck/scan-build problems (diff)
downloadfirejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz
firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst
firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip
chroot testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/appimage/appimage-args.exp4
-rwxr-xr-xtest/appimage/appimage-v1.exp4
-rwxr-xr-xtest/appimage/appimage-v2.exp4
-rwxr-xr-xtest/chroot/chroot.sh5
-rwxr-xr-xtest/chroot/configure2
-rwxr-xr-xtest/chroot/fs_chroot.exp48
-rwxr-xr-xtest/chroot/fs_chroot_disabled.exp (renamed from test/root/option_bind_directory.exp)13
-rwxr-xr-xtest/chroot/unchroot-as-root.exp2
-rwxr-xr-xtest/features/1.1.exp79
-rwxr-xr-xtest/features/1.10.exp82
-rwxr-xr-xtest/features/1.2.exp143
-rwxr-xr-xtest/features/1.4.exp116
-rwxr-xr-xtest/features/1.5.exp79
-rwxr-xr-xtest/features/1.6.exp79
-rwxr-xr-xtest/features/1.7.exp81
-rwxr-xr-xtest/features/1.8.exp169
-rwxr-xr-xtest/features/2.1.exp127
-rwxr-xr-xtest/features/2.2.exp103
-rwxr-xr-xtest/features/2.3.exp295
-rwxr-xr-xtest/features/2.4.exp239
-rwxr-xr-xtest/features/2.5.exp114
-rwxr-xr-xtest/features/2.6.exp77
-rwxr-xr-xtest/features/3.1.exp167
-rwxr-xr-xtest/features/3.10.exp187
-rwxr-xr-xtest/features/3.11.exp174
-rw-r--r--test/features/3.11.profile2
-rwxr-xr-xtest/features/3.2.exp82
-rwxr-xr-xtest/features/3.3.exp78
-rwxr-xr-xtest/features/3.4.exp208
-rwxr-xr-xtest/features/3.5.exp83
-rwxr-xr-xtest/features/3.6.exp87
-rwxr-xr-xtest/features/3.7.exp95
-rwxr-xr-xtest/features/3.8.exp87
-rwxr-xr-xtest/features/3.9.exp84
-rw-r--r--test/features/features.txt61
-rwxr-xr-xtest/features/test.sh119
-rwxr-xr-xtest/overlay/firefox-x11-xorg.exp89
-rwxr-xr-xtest/overlay/firefox-x11.exp89
-rwxr-xr-xtest/overlay/firefox.exp98
-rwxr-xr-xtest/overlay/fs-named.exp72
-rwxr-xr-xtest/overlay/fs-tmpfs.exp70
-rwxr-xr-xtest/overlay/fs.exp62
-rwxr-xr-xtest/overlay/overlay.sh62
-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_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
-rwxr-xr-xtest/ssh/login.exp52
-rwxr-xr-xtest/ssh/scp.exp66
-rwxr-xr-xtest/ssh/sftp.exp90
-rwxr-xr-xtest/ssh/ssh.sh17
-rwxr-xr-xtest/stress/blacklist.exp59
-rwxr-xr-xtest/stress/env.exp31
-rwxr-xr-xtest/stress/net_macvlan.exp51
-rwxr-xr-xtest/stress/stress.sh42
73 files changed, 43 insertions, 5602 deletions
diff --git a/test/appimage/appimage-args.exp b/test/appimage/appimage-args.exp
index c10007603..e85e8a46a 100755
--- a/test/appimage/appimage-args.exp
+++ b/test/appimage/appimage-args.exp
@@ -8,7 +8,7 @@ spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10set appimage_id $spawn_id 10set appimage_id $spawn_id
11send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r" 11send -- "firejail --name=test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 "execvp argument 2" 14 "execvp argument 2"
@@ -91,7 +91,7 @@ expect {
91after 100 91after 100
92 92
93spawn $env(SHELL) 93spawn $env(SHELL)
94send -- "firejail --shutdown=appimage-test\r" 94send -- "firejail --shutdown=test\r"
95 95
96set spawn_id $appimage_id 96set spawn_id $appimage_id
97expect { 97expect {
diff --git a/test/appimage/appimage-v1.exp b/test/appimage/appimage-v1.exp
index 72dfdea42..bb360cd18 100755
--- a/test/appimage/appimage-v1.exp
+++ b/test/appimage/appimage-v1.exp
@@ -8,7 +8,7 @@ spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set appimage_id $spawn_id 9set appimage_id $spawn_id
10 10
11send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" 11send -- "firejail --name=test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
@@ -79,7 +79,7 @@ expect {
79after 100 79after 100
80 80
81spawn $env(SHELL) 81spawn $env(SHELL)
82send -- "firejail --shutdown=appimage-test\r" 82send -- "firejail --shutdown=test\r"
83 83
84set spawn_id $appimage_id 84set spawn_id $appimage_id
85expect { 85expect {
diff --git a/test/appimage/appimage-v2.exp b/test/appimage/appimage-v2.exp
index 0f865d94b..748ac3d79 100755
--- a/test/appimage/appimage-v2.exp
+++ b/test/appimage/appimage-v2.exp
@@ -8,7 +8,7 @@ spawn $env(SHELL)
8match_max 100000 8match_max 100000
9set appimage_id $spawn_id 9set appimage_id $spawn_id
10 10
11send -- "firejail --name=appimage-test --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" 11send -- "firejail --name=test --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
@@ -79,7 +79,7 @@ expect {
79after 100 79after 100
80 80
81spawn $env(SHELL) 81spawn $env(SHELL)
82send -- "firejail --shutdown=appimage-test\r" 82send -- "firejail --shutdown=test\r"
83set spawn_id $appimage_id 83set spawn_id $appimage_id
84expect { 84expect {
85 timeout {puts "shutdown\n"} 85 timeout {puts "shutdown\n"}
diff --git a/test/chroot/chroot.sh b/test/chroot/chroot.sh
index 840f162cc..a1fb3ee38 100755
--- a/test/chroot/chroot.sh
+++ b/test/chroot/chroot.sh
@@ -11,6 +11,11 @@ rm -f unchroot
11gcc -o unchroot unchroot.c 11gcc -o unchroot unchroot.c
12sudo ./configure 12sudo ./configure
13 13
14echo "TESTING: chroot disabled (test/chroot/fs_chroot_disabled.exp)"
15./fs_chroot_disabled.exp
16
17sudo sed -i s/"# chroot no"/"chroot yes"/g /etc/firejail/firejail.config
18
14echo "TESTING: chroot (test/chroot/fs_chroot.exp)" 19echo "TESTING: chroot (test/chroot/fs_chroot.exp)"
15./fs_chroot.exp 20./fs_chroot.exp
16 21
diff --git a/test/chroot/configure b/test/chroot/configure
index a817f6566..af511f9c7 100755
--- a/test/chroot/configure
+++ b/test/chroot/configure
@@ -8,7 +8,7 @@ ROOTDIR="/tmp/chroot" # default chroot directory
8DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files 8DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files
9DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " 9DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group "
10DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc 10DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc
11DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /sbin/ifconfig /usr/bin/touch /bin/ip /bin/hostname /bin/grep /usr/bin/dig /usr/bin/openssl /usr/bin/id /usr/bin/getent /usr/bin/whoami /usr/bin/wc /usr/bin/wget /bin/umount" 11DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /usr/bin/touch /bin/grep"
12 12
13rm -fr $ROOTDIR 13rm -fr $ROOTDIR
14mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc,sys} 14mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc,sys}
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp
index 545de0c66..eb1349112 100755
--- a/test/chroot/fs_chroot.exp
+++ b/test/chroot/fs_chroot.exp
@@ -10,55 +10,61 @@ match_max 100000
10send -- "firejail --chroot=/tmp/chroot\r" 10send -- "firejail --chroot=/tmp/chroot\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Error: --chroot option is not available on Grsecurity systems" {puts "\nall done\n"; exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"}; 13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"};
15} 14}
16sleep 1 15sleep 1
17 16
18send -- "cd /home;pwd\r" 17send -- "pwd\r"
19expect { 18expect {
20 timeout {puts "TESTING ERROR 0.1\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
21 "home" 20 "/home"
22} 21}
23sleep 1 22after 100
24send -- "bash\r"
25sleep 1
26send -- "ls /\r" 23send -- "ls /\r"
27expect { 24expect {
28 timeout {puts "TESTING ERROR 0.2\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
29 "this-is-my-chroot" 26 "this-is-my-chroot"
30} 27}
31after 100 28after 100
32 29
33send -- "ps aux\r" 30send -- "ps aux\r"
34expect { 31expect {
35 timeout {puts "TESTING ERROR 1\n";exit} 32 timeout {puts "TESTING ERROR 3\n";exit}
36 "/bin/bash" 33 "/bin/bash"
37} 34}
38expect { 35expect {
39 timeout {puts "TESTING ERROR 2\n";exit} 36 timeout {puts "TESTING ERROR 4\n";exit}
40 "bash"
41}
42expect {
43 timeout {puts "TESTING ERROR 3\n";exit}
44 "ps aux" 37 "ps aux"
45} 38}
46after 100 39after 100
47 40
48send -- "ps aux | wc -l; pwd\r" 41# check /sys directory
42send -- "ls /sys\r"
49expect { 43expect {
50 timeout {puts "TESTING ERROR 5\n";exit} 44 timeout {puts "TESTING ERROR 5\n";exit}
51 "6" 45 "block"
52} 46}
53after 100
54
55# check /sys directory
56send -- "ls /sys\r"
57expect { 47expect {
58 timeout {puts "TESTING ERROR 6\n";exit} 48 timeout {puts "TESTING ERROR 6\n";exit}
59 "block" 49 "class"
50}
51expect {
52 timeout {puts "TESTING ERROR 7\n";exit}
53 "dev"
60} 54}
61after 100 55after 100
62 56
57# check /bin directory
58send -- "ls /bin/find\r"
59expect {
60 timeout {puts "TESTING ERROR 8\n";exit}
61 "No such file or directory"
62}
63after 100
64send -- "/bin/ping 1.1.1.1\r"
65expect {
66 timeout {puts "TESTING ERROR 9\n";exit}
67 "Operation not permitted"
68}
63 69
64puts "all done\n" 70puts "all done\n"
diff --git a/test/root/option_bind_directory.exp b/test/chroot/fs_chroot_disabled.exp
index 83ed6b84d..e6cfe85f3 100755
--- a/test/root/option_bind_directory.exp
+++ b/test/chroot/fs_chroot_disabled.exp
@@ -7,18 +7,11 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --bind=/tmp/chroot,mntpoint\r" 10send -- "firejail --chroot=/tmp/chroot\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 13 "feature is disabled"
14} 14}
15sleep 1 15sleep 1
16 16
17send -- "ls mntpoint;pwd\r" 17puts "all done\n"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "root"
21}
22sleep 1
23
24puts "\n"
diff --git a/test/chroot/unchroot-as-root.exp b/test/chroot/unchroot-as-root.exp
index eccb400c0..7614ed406 100755
--- a/test/chroot/unchroot-as-root.exp
+++ b/test/chroot/unchroot-as-root.exp
@@ -22,7 +22,7 @@ after 100
22send -- "./unchroot\r" 22send -- "./unchroot\r"
23expect { 23expect {
24 timeout {puts "TESTING ERROR 1\n";exit} 24 timeout {puts "TESTING ERROR 1\n";exit}
25 "Bad system call" 25 "Operation not permitted"
26} 26}
27after 100 27after 100
28 28
diff --git a/test/features/1.1.exp b/test/features/1.1.exp
deleted file mode 100755
index 34159f114..000000000
--- a/test/features/1.1.exp
+++ /dev/null
@@ -1,79 +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#
6# disable /boot
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /boot\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Permission denied"
29}
30after 100
31send -- "exit\r"
32sleep 1
33
34
35#
36# O
37#
38if { $overlay == "overlay" } {
39 send -- "firejail --noprofile --overlay\r"
40 expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "overlay option is not available" {puts "grsecurity\n"; exit}
43 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
44 }
45 sleep 1
46
47 send -- "ls -l /boot\r"
48 expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "Permission denied"
51 }
52 after 100
53 send -- "exit\r"
54 sleep 1
55}
56
57#
58# C
59#
60if { $chroot == "chroot" } {
61 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
62 expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65 }
66 sleep 1
67
68 send -- "ls -l /boot\r"
69 expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 "Permission denied"
72 }
73 after 100
74 send -- "exit\r"
75 sleep 1
76}
77
78
79puts "\nall done\n"
diff --git a/test/features/1.10.exp b/test/features/1.10.exp
deleted file mode 100755
index 6744ce826..000000000
--- a/test/features/1.10.exp
+++ /dev/null
@@ -1,82 +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#
6# disable /selinux
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /selinux\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Permission denied" {puts "denied\n"}
29 "No such file or directory" {puts "no file\n"}
30}
31after 100
32send -- "exit\r"
33sleep 1
34
35
36#
37# O
38#
39if { $overlay == "overlay" } {
40 send -- "firejail --noprofile --overlay\r"
41 expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "overlay option is not available" {puts "grsecurity\n"; exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
45 }
46 sleep 1
47
48 send -- "ls -l /selinux\r"
49 expect {
50 timeout {puts "TESTING ERROR 3\n";exit}
51 "Permission denied" {puts "denied\n"}
52 "No such file or directory" {puts "no file\n"}
53 }
54 after 100
55 send -- "exit\r"
56 sleep 1
57}
58
59#
60# C
61#
62if { $chroot == "chroot" } {
63 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
64 expect {
65 timeout {puts "TESTING ERROR 4\n";exit}
66 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
67 }
68 sleep 1
69
70 send -- "ls -l /selinux\r"
71 expect {
72 timeout {puts "TESTING ERROR 5\n";exit}
73 "Permission denied" {puts "denied\n"}
74 "No such file or directory" {puts "no file\n"}
75 }
76 after 100
77 send -- "exit\r"
78 sleep 1
79}
80
81
82puts "\nall done\n"
diff --git a/test/features/1.2.exp b/test/features/1.2.exp
deleted file mode 100755
index 56750670d..000000000
--- a/test/features/1.2.exp
+++ /dev/null
@@ -1,143 +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#
6# new /proc
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "cat /proc/mounts | grep proc --color=never\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "proc /proc proc"
29}
30expect {
31 timeout {puts "TESTING ERROR 1.2\n";exit}
32 "proc /proc proc"
33}
34expect {
35 timeout {puts "TESTING ERROR 1.3\n";exit}
36 "proc /proc/sys proc"
37}
38expect {
39 timeout {puts "TESTING ERROR 1.4\n";exit}
40 "/proc/sysrq-trigger"
41}
42#expect {
43# timeout {puts "TESTING ERROR 1.5\n";exit}
44# "proc /proc/sys/kernel/hotplug"
45#}
46expect {
47 timeout {puts "TESTING ERROR 1.6\n";exit}
48 "/proc/irq"
49}
50expect {
51 timeout {puts "TESTING ERROR 1.7\n";exit}
52 "/proc/bus"
53}
54after 100
55send -- "exit\r"
56sleep 1
57
58
59#
60# O
61#
62if { $overlay == "overlay" } {
63 send -- "firejail --noprofile --overlay\r"
64 expect {
65 timeout {puts "TESTING ERROR 2\n";exit}
66 "overlay option is not available" {puts "grsecurity\n"; exit}
67 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
68 }
69 sleep 1
70
71 send -- "cat /proc/mounts | grep proc --color=never\r"
72 expect {
73 timeout {puts "TESTING ERROR 3.1\n";exit}
74 "proc /proc proc"
75 }
76 expect {
77 timeout {puts "TESTING ERROR 3.3\n";exit}
78 "proc /proc/sys proc"
79 }
80 expect {
81 timeout {puts "TESTING ERROR 3.4\n";exit}
82 "proc /proc/sysrq-trigger proc"
83 }
84# expect {
85# timeout {puts "TESTING ERROR 3.5\n";exit}
86# "proc /proc/sys/kernel/hotplug"
87# }
88 expect {
89 timeout {puts "TESTING ERROR 3.6\n";exit}
90 "proc /proc/irq proc"
91 }
92 expect {
93 timeout {puts "TESTING ERROR 3.7\n";exit}
94 "proc /proc/bus proc"
95 }
96 after 100
97 send -- "exit\r"
98 sleep 1
99}
100
101#
102# C
103#
104if { $chroot == "chroot" } {
105 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
106 expect {
107 timeout {puts "TESTING ERROR 4\n";exit}
108 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
109 }
110 sleep 1
111
112 send -- "cat /proc/mounts | grep proc --color=never\r"
113 expect {
114 timeout {puts "TESTING ERROR 5.1\n";exit}
115 "proc /proc proc"
116 }
117 expect {
118 timeout {puts "TESTING ERROR 5.3\n";exit}
119 "proc /proc/sys proc"
120 }
121# expect {
122# timeout {puts "TESTING ERROR 5.4\n";exit}
123# "proc /proc/sysrq-trigger proc"
124# }
125# expect {
126# timeout {puts "TESTING ERROR 5.5\n";exit}
127# "proc /proc/sys/kernel/hotplug"
128# }
129# expect {
130# timeout {puts "TESTING ERROR 5.6\n";exit}
131# "proc /proc/irq proc"
132# }
133# expect {
134# timeout {puts "TESTING ERROR 5.7\n";exit}
135# "proc /proc/bus proc"
136# }
137 after 100
138 send -- "exit\r"
139 sleep 1
140}
141
142
143puts "\nall done\n"
diff --git a/test/features/1.4.exp b/test/features/1.4.exp
deleted file mode 100755
index f5db0c450..000000000
--- a/test/features/1.4.exp
+++ /dev/null
@@ -1,116 +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#
6# mask other users
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /home | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "2"
29}
30after 100
31send -- "cat /etc/passwd | grep 1001 | wc -l\r"
32expect {
33 timeout {puts "TESTING ERROR 1.1\n";exit}
34 "0"
35}
36after 100
37send -- "cat /etc/group | grep 1001 | wc -l\r"
38expect {
39 timeout {puts "TESTING ERROR 1.2\n";exit}
40 "0"
41}
42after 100
43
44send -- "exit\r"
45sleep 1
46
47
48#
49# O
50#
51if { $overlay == "overlay" } {
52 send -- "firejail --noprofile --overlay\r"
53 expect {
54 timeout {puts "TESTING ERROR 2\n";exit}
55 "overlay option is not available" {puts "grsecurity\n"; exit}
56 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
57 }
58 sleep 1
59
60 send -- "ls -l /home | wc -l\r"
61 expect {
62 timeout {puts "TESTING ERROR 3\n";exit}
63 "2"
64 }
65 after 100
66 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
67 expect {
68 timeout {puts "TESTING ERROR 3.1\n";exit}
69 "0"
70 }
71 after 100
72 send -- "cat /etc/group | grep 1001 | wc -l\r"
73 expect {
74 timeout {puts "TESTING ERROR 3.2\n";exit}
75 "0"
76 }
77 after 100
78 send -- "exit\r"
79 sleep 1
80}
81
82#
83# C
84#
85if { $chroot == "chroot" } {
86 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
87 expect {
88 timeout {puts "TESTING ERROR 4\n";exit}
89 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
90 }
91 sleep 1
92
93 send -- "ls -l /home | wc -l\r"
94 expect {
95 timeout {puts "TESTING ERROR 5\n";exit}
96 "2"
97 }
98 after 100
99 send -- "cat /etc/passwd | grep 1001 | wc -l\r"
100 expect {
101 timeout {puts "TESTING ERROR 5.1\n";exit}
102 "0"
103 }
104 after 100
105 send -- "cat /etc/group | grep 1001 | wc -l\r"
106 expect {
107 timeout {puts "TESTING ERROR 5.2\n";exit}
108 "0"
109 }
110 after 100
111 send -- "exit\r"
112 sleep 1
113}
114
115
116puts "\nall done\n"
diff --git a/test/features/1.5.exp b/test/features/1.5.exp
deleted file mode 100755
index 68709fcad..000000000
--- a/test/features/1.5.exp
+++ /dev/null
@@ -1,79 +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#
6# PID namespace
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ps aux | wc -l \r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "5"
29}
30after 100
31send -- "exit\r"
32sleep 1
33
34
35#
36# O
37#
38if { $overlay == "overlay" } {
39 send -- "firejail --noprofile --overlay\r"
40 expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "overlay option is not available" {puts "grsecurity\n"; exit}
43 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
44 }
45 sleep 1
46
47 send -- "ps aux | wc -l \r"
48 expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "5"
51 }
52 after 100
53 send -- "exit\r"
54 sleep 1
55}
56
57#
58# C
59#
60if { $chroot == "chroot" } {
61 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
62 expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65 }
66 sleep 1
67
68 send -- "ps aux | wc -l \r"
69 expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 "5"
72 }
73 after 100
74 send -- "exit\r"
75 sleep 1
76}
77
78
79puts "\nall done\n"
diff --git a/test/features/1.6.exp b/test/features/1.6.exp
deleted file mode 100755
index 0d0f08817..000000000
--- a/test/features/1.6.exp
+++ /dev/null
@@ -1,79 +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#
6# new /var/log
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /var/log/syslog | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "0"
29}
30after 100
31send -- "exit\r"
32sleep 1
33
34
35#
36# O
37#
38if { $overlay == "overlay" } {
39 send -- "firejail --noprofile --overlay\r"
40 expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "overlay option is not available" {puts "grsecurity\n"; exit}
43 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
44 }
45 sleep 1
46
47 send -- "ls -l /var/log/syslog | wc -l\r"
48 expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "0"
51 }
52 after 100
53 send -- "exit\r"
54 sleep 1
55}
56
57#
58# C
59#
60if { $chroot == "chroot" } {
61 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
62 expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65 }
66 sleep 1
67
68 send -- "ls -l /var/log/syslog | wc -l\r"
69 expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 "0"
72 }
73 after 100
74 send -- "exit\r"
75 sleep 1
76}
77
78
79puts "\nall done\n"
diff --git a/test/features/1.7.exp b/test/features/1.7.exp
deleted file mode 100755
index b3264970d..000000000
--- a/test/features/1.7.exp
+++ /dev/null
@@ -1,81 +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#
6# new /var/tmp
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "touch /var/tmp/somefile\r"
19sleep 1
20send -- "firejail --noprofile\r"
21expect {
22 timeout {puts "TESTING ERROR 0\n";exit}
23 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
24}
25sleep 1
26
27send -- "ls -l /var/tmp/somefile | wc -l\r"
28expect {
29 timeout {puts "TESTING ERROR 1\n";exit}
30 "0"
31}
32after 100
33send -- "exit\r"
34sleep 1
35
36
37#
38# O
39#
40if { $overlay == "overlay" } {
41 send -- "firejail --noprofile --overlay\r"
42 expect {
43 timeout {puts "TESTING ERROR 2\n";exit}
44 "overlay option is not available" {puts "grsecurity\n"; exit}
45 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
46 }
47 sleep 1
48
49 send -- "ls -l /var/tmp/somefile | wc -l\r"
50 expect {
51 timeout {puts "TESTING ERROR 3\n";exit}
52 "0"
53 }
54 after 100
55 send -- "exit\r"
56 sleep 1
57}
58
59#
60# C
61#
62if { $chroot == "chroot" } {
63 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
64 expect {
65 timeout {puts "TESTING ERROR 4\n";exit}
66 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
67 }
68 sleep 1
69
70 send -- "ls -l /var/tmp/somefile | wc -l\r"
71 expect {
72 timeout {puts "TESTING ERROR 5\n";exit}
73 "0"
74 }
75 after 100
76 send -- "exit\r"
77 sleep 1
78}
79
80
81puts "\nall done\n"
diff --git a/test/features/1.8.exp b/test/features/1.8.exp
deleted file mode 100755
index 028077b6f..000000000
--- a/test/features/1.8.exp
+++ /dev/null
@@ -1,169 +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#
6# disable /etc/firejail and ~/.config/firejail
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18sleep 1
19send -- "firejail --noprofile\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
23}
24sleep 1
25
26send -- "ls ~/.config/firejail\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "Permission denied"
30}
31after 100
32send -- "ls /run/firejail/bandwidth\r"
33expect {
34 timeout {puts "TESTING ERROR 1.2\n";exit}
35 "Permission denied"
36}
37after 100
38#send -- "ls /run/firejail/mnt\r"
39#expect {
40# timeout {puts "TESTING ERROR 1.3\n";exit}
41# "Permission denied"
42#}
43#after 100
44send -- "ls /run/firejail/name\r"
45expect {
46 timeout {puts "TESTING ERROR 1.4\n";exit}
47 "Permission denied"
48}
49after 100
50send -- "ls /run/firejail/network\r"
51expect {
52 timeout {puts "TESTING ERROR 1.5\n";exit}
53 "Permission denied"
54}
55after 100
56send -- "ls /run/firejail/x11\r"
57expect {
58 timeout {puts "TESTING ERROR 1.6\n";exit}
59 "Permission denied"
60}
61after 100
62send -- "exit\r"
63sleep 1
64
65
66#
67# O
68#
69if { $overlay == "overlay" } {
70 send -- "firejail --noprofile --overlay\r"
71 expect {
72 timeout {puts "TESTING ERROR 2\n";exit}
73 "overlay option is not available" {puts "grsecurity\n"; exit}
74 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
75 }
76 sleep 1
77 send -- "ls ~/.config/firejail\r"
78 expect {
79 timeout {puts "TESTING ERROR 3.1\n";exit}
80 "Permission denied"
81 }
82 after 100
83 send -- "ls /run/firejail/bandwidth\r"
84 expect {
85 timeout {puts "TESTING ERROR 3.2\n";exit}
86 "Permission denied"
87 }
88 after 100
89 #send -- "ls /run/firejail/mnt\r"
90 #expect {
91 # timeout {puts "TESTING ERROR 3.3\n";exit}
92 # "Permission denied"
93 #}
94 #after 100
95 send -- "ls /run/firejail/name\r"
96 expect {
97 timeout {puts "TESTING ERROR 3.4\n";exit}
98 "Permission denied"
99 }
100 after 100
101 send -- "ls /run/firejail/network\r"
102 expect {
103 timeout {puts "TESTING ERROR 3.5\n";exit}
104 "Permission denied"
105 }
106 after 100
107 send -- "ls /run/firejail/x11\r"
108 expect {
109 timeout {puts "TESTING ERROR 3.6\n";exit}
110 "Permission denied"
111 }
112 after 100
113
114 send -- "exit\r"
115 sleep 1
116}
117
118#
119# C
120#
121if { $chroot == "chroot" } {
122 send -- "firejail --noprofile --chroot=/tmp/chroot\r"
123 expect {
124 timeout {puts "TESTING ERROR 4\n";exit}
125 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
126 }
127 sleep 1
128 send -- "ls ~/.config/firejail\r"
129 expect {
130 timeout {puts "TESTING ERROR 5.1\n";exit}
131 "Permission denied"
132 }
133 after 100
134 send -- "ls /run/firejail/bandwidth\r"
135 expect {
136 timeout {puts "TESTING ERROR 5.2\n";exit}
137 "Permission denied"
138 }
139 after 100
140 #send -- "ls /run/firejail/mnt\r"
141 #expect {
142 # timeout {puts "TESTING ERROR 5.3\n";exit}
143 # "Permission denied"
144 #}
145 #after 100
146 send -- "ls /run/firejail/name\r"
147 expect {
148 timeout {puts "TESTING ERROR 5.4\n";exit}
149 "Permission denied"
150 }
151 after 100
152 send -- "ls /run/firejail/network\r"
153 expect {
154 timeout {puts "TESTING ERROR 5.5\n";exit}
155 "Permission denied"
156 }
157 after 100
158 send -- "ls /run/firejail/x11\r"
159 expect {
160 timeout {puts "TESTING ERROR 5.6\n";exit}
161 "Permission denied"
162 }
163 after 100
164 send -- "exit\r"
165 sleep 1
166}
167
168
169puts "\nall done\n"
diff --git a/test/features/2.1.exp b/test/features/2.1.exp
deleted file mode 100755
index 8f7ddce2c..000000000
--- a/test/features/2.1.exp
+++ /dev/null
@@ -1,127 +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#
6# hostname
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --hostname=bingo\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "hostname\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "bingo"
29}
30after 100
31send -- "cat /etc/hostname\r"
32expect {
33 timeout {puts "TESTING ERROR 1.0\n";exit}
34 "bingo"
35}
36after 100
37send -- "getent hosts bingo\r"
38expect {
39 timeout {puts "TESTING ERROR 1.1\n";exit}
40 "127.0.0.1"
41}
42expect {
43 timeout {puts "TESTING ERROR 1.2\n";exit}
44 "bingo"
45}
46after 100
47send -- "exit\r"
48sleep 1
49
50
51#
52# O
53#
54if { $overlay == "overlay" } {
55 send -- "firejail --noprofile --hostname=bingo --overlay\r"
56 expect {
57 timeout {puts "TESTING ERROR 2\n";exit}
58 "overlay option is not available" {puts "grsecurity\n"; exit}
59 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
60 }
61 sleep 1
62
63 send -- "hostname\r"
64 expect {
65 timeout {puts "TESTING ERROR 3\n";exit}
66 "bingo"
67 }
68 after 100
69 send -- "cat /etc/hostname\r"
70 expect {
71 timeout {puts "TESTING ERROR 3.0\n";exit}
72 "bingo"
73 }
74 after 100
75 send -- "getent hosts bingo\r"
76 expect {
77 timeout {puts "TESTING ERROR 3.1\n";exit}
78 "127.0.0.1"
79 }
80 expect {
81 timeout {puts "TESTING ERROR 3.2\n";exit}
82 "bingo"
83 }
84 after 100
85 send -- "exit\r"
86 sleep 1
87}
88
89#
90# C
91#
92if { $chroot == "chroot" } {
93 send -- "firejail --noprofile --hostname=bingo --chroot=/tmp/chroot\r"
94 expect {
95 timeout {puts "TESTING ERROR 4\n";exit}
96 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
97 }
98 sleep 1
99
100 send -- "hostname\r"
101 expect {
102 timeout {puts "TESTING ERROR 5\n";exit}
103 "bingo"
104 }
105 after 100
106 send -- "cat /etc/hostname\r"
107 expect {
108 timeout {puts "TESTING ERROR 5.0\n";exit}
109 "bingo"
110 }
111 after 100
112 send -- "getent hosts bingo\r"
113 expect {
114 timeout {puts "TESTING ERROR 5.1\n";exit}
115 "127.0.0.1"
116 }
117 expect {
118 timeout {puts "TESTING ERROR 5.2\n";exit}
119 "bingo"
120 }
121 after 100
122 send -- "exit\r"
123 sleep 1
124}
125
126
127puts "\nall done\n"
diff --git a/test/features/2.2.exp b/test/features/2.2.exp
deleted file mode 100755
index 94bd6f4db..000000000
--- a/test/features/2.2.exp
+++ /dev/null
@@ -1,103 +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#
6# DNS
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --dns=4.2.2.1\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "dig google.com\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "ANSWER SECTION"
29}
30expect {
31 timeout {puts "TESTING ERROR 1.1\n";exit}
32 "google.com"
33}
34expect {
35 timeout {puts "TESTING ERROR 1.3\n";exit}
36 "SERVER: 4.2.2.1"
37}
38after 100
39send -- "exit\r"
40sleep 1
41
42
43#
44# O
45#
46if { $overlay == "overlay" } {
47 send -- "firejail --noprofile --dns=4.2.2.1 --overlay\r"
48 expect {
49 timeout {puts "TESTING ERROR 2\n";exit}
50 "overlay option is not available" {puts "grsecurity\n"; exit}
51 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
52 }
53 sleep 1
54
55 send -- "dig google.com\r"
56 expect {
57 timeout {puts "TESTING ERROR 3\n";exit}
58 "ANSWER SECTION"
59 }
60 expect {
61 timeout {puts "TESTING ERROR 3.1\n";exit}
62 "google.com"
63 }
64 expect {
65 timeout {puts "TESTING ERROR 3.3\n";exit}
66 "SERVER: 4.2.2.1"
67 }
68 after 100
69 send -- "exit\r"
70 sleep 1
71}
72
73#
74# C
75#
76if { $chroot == "chroot" } {
77 send -- "firejail --noprofile --dns=4.2.2.1 --chroot=/tmp/chroot\r"
78 expect {
79 timeout {puts "TESTING ERROR 4\n";exit}
80 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
81 }
82 sleep 1
83
84 send -- "dig google.com\r"
85 expect {
86 timeout {puts "TESTING ERROR 5\n";exit}
87 "ANSWER SECTION"
88 }
89 expect {
90 timeout {puts "TESTING ERROR 5.1\n";exit}
91 "google.com"
92 }
93 expect {
94 timeout {puts "TESTING ERROR 5.3\n";exit}
95 "SERVER: 4.2.2.1"
96 }
97 after 100
98 send -- "exit\r"
99 sleep 1
100}
101
102
103puts "\nall done\n"
diff --git a/test/features/2.3.exp b/test/features/2.3.exp
deleted file mode 100755
index 1e27a7632..000000000
--- a/test/features/2.3.exp
+++ /dev/null
@@ -1,295 +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#
6# mac-vlan
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --net=eth0 --dns=8.8.8.8 --dns=8.8.4.4\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "dig google.com\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "ANSWER SECTION"
29}
30expect {
31 timeout {puts "TESTING ERROR 1.1\n";exit}
32 "google.com"
33}
34expect {
35 timeout {puts "TESTING ERROR 1.3\n";exit}
36 "SERVER:"
37}
38after 100
39
40send -- "/sbin/ifconfig\r"
41expect {
42 timeout {puts "TESTING ERROR 1.4\n";exit}
43 "eth0"
44}
45expect {
46 timeout {puts "TESTING ERROR 1.5n";exit}
47 "Link"
48}
49expect {
50 timeout {puts "TESTING ERROR 1.6\n";exit}
51 "192.168.1"
52}
53expect {
54 timeout {puts "TESTING ERROR 1.7\n";exit}
55 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
56}
57after 100
58
59send -- "exit\r"
60sleep 3
61
62send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --dns=8.8.8.8 --dns=8.8.4.4\r"
63expect {
64 timeout {puts "TESTING ERROR 0\n";exit}
65 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
66}
67sleep 1
68
69send -- "dig google.com\r"
70expect {
71 timeout {puts "TESTING ERROR 1\n";exit}
72 "ANSWER SECTION"
73}
74expect {
75 timeout {puts "TESTING ERROR 1.1\n";exit}
76 "google.com"
77}
78expect {
79 timeout {puts "TESTING ERROR 1.3\n";exit}
80 "SERVER:"
81}
82after 100
83
84send -- "/sbin/ifconfig\r"
85expect {
86 timeout {puts "TESTING ERROR 1.4\n";exit}
87 "eth0"
88}
89expect {
90 timeout {puts "TESTING ERROR 1.5n";exit}
91 "Link"
92}
93expect {
94 timeout {puts "TESTING ERROR 1.6\n";exit}
95 "192.168.1.244"
96}
97expect {
98 timeout {puts "TESTING ERROR 1.7\n";exit}
99 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
100}
101after 100
102
103send -- "exit\r"
104sleep 3
105
106#
107# O
108#
109if { $overlay == "overlay" } {
110 send -- "firejail --noprofile --net=eth0 --overlay --dns=8.8.8.8 --dns=8.8.4.4\r"
111 expect {
112 timeout {puts "TESTING ERROR 2\n";exit}
113 "overlay option is not available" {puts "grsecurity\n"; exit}
114 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
115 }
116 sleep 1
117
118 send -- "dig google.com\r"
119 expect {
120 timeout {puts "TESTING ERROR 3\n";exit}
121 "ANSWER SECTION"
122 }
123 expect {
124 timeout {puts "TESTING ERROR 3.1\n";exit}
125 "google.com"
126 }
127 expect {
128 timeout {puts "TESTING ERROR 3.3\n";exit}
129 "SERVER"
130 }
131 after 100
132
133 send -- "/sbin/ifconfig\r"
134 expect {
135 timeout {puts "TESTING ERROR 3.4\n";exit}
136 "eth0"
137 }
138 expect {
139 timeout {puts "TESTING ERROR 3.5\n";exit}
140 "Link"
141 }
142 expect {
143 timeout {puts "TESTING ERROR 3.6\n";exit}
144 "192.168.1"
145 }
146 expect {
147 timeout {puts "TESTING ERROR 3.7\n";exit}
148 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
149 }
150 after 100
151
152 send -- "exit\r"
153 sleep 3
154
155 send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay --dns=8.8.8.8 --dns=8.8.4.4\r"
156 expect {
157 timeout {puts "TESTING ERROR 2\n";exit}
158 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
159 }
160 sleep 1
161
162 send -- "dig google.com\r"
163 expect {
164 timeout {puts "TESTING ERROR 3\n";exit}
165 "ANSWER SECTION"
166 }
167 expect {
168 timeout {puts "TESTING ERROR 3.1\n";exit}
169 "google.com"
170 }
171 expect {
172 timeout {puts "TESTING ERROR 3.3\n";exit}
173 "SERVER"
174 }
175 after 100
176
177 send -- "/sbin/ifconfig\r"
178 expect {
179 timeout {puts "TESTING ERROR 3.4\n";exit}
180 "eth0"
181 }
182 expect {
183 timeout {puts "TESTING ERROR 3.5\n";exit}
184 "Link"
185 }
186 expect {
187 timeout {puts "TESTING ERROR 3.6\n";exit}
188 "192.168.1.244"
189 }
190 expect {
191 timeout {puts "TESTING ERROR 3.7\n";exit}
192 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
193 }
194 after 100
195
196 send -- "exit\r"
197 sleep 3
198}
199
200
201#
202# C
203#
204if { $chroot == "chroot" } {
205 send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
206 expect {
207 timeout {puts "TESTING ERROR 4\n";exit}
208 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
209 }
210 sleep 1
211
212 send -- "dig google.com\r"
213 expect {
214 timeout {puts "TESTING ERROR 5\n";exit}
215 "ANSWER SECTION"
216 }
217 expect {
218 timeout {puts "TESTING ERROR 5.1\n";exit}
219 "google.com"
220 }
221 expect {
222 timeout {puts "TESTING ERROR 5.3\n";exit}
223 "SERVER:"
224 }
225 after 100
226
227 send -- "/sbin/ifconfig\r"
228 expect {
229 timeout {puts "TESTING ERROR 5.4\n";exit}
230 "eth0"
231 }
232 expect {
233 timeout {puts "TESTING ERROR 5.5\n";exit}
234 "Link"
235 }
236 expect {
237 timeout {puts "TESTING ERROR 5.6\n";exit}
238 "192.168.1"
239 }
240 expect {
241 timeout {puts "TESTING ERROR 5.7\n";exit}
242 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
243 }
244 after 100
245
246 send -- "exit\r"
247 sleep 3
248
249 send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot --dns=8.8.8.8 --dns=8.8.4.4\r"
250 expect {
251 timeout {puts "TESTING ERROR 4\n";exit}
252 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
253 }
254 sleep 1
255
256 send -- "dig google.com\r"
257 expect {
258 timeout {puts "TESTING ERROR 5\n";exit}
259 "ANSWER SECTION"
260 }
261 expect {
262 timeout {puts "TESTING ERROR 5.1\n";exit}
263 "google.com"
264 }
265 expect {
266 timeout {puts "TESTING ERROR 5.3\n";exit}
267 "SERVER:"
268 }
269 after 100
270
271 send -- "/sbin/ifconfig\r"
272 expect {
273 timeout {puts "TESTING ERROR 5.4\n";exit}
274 "eth0"
275 }
276 expect {
277 timeout {puts "TESTING ERROR 5.5\n";exit}
278 "Link"
279 }
280 expect {
281 timeout {puts "TESTING ERROR 5.6\n";exit}
282 "192.168.1.244"
283 }
284 expect {
285 timeout {puts "TESTING ERROR 5.7\n";exit}
286 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
287 }
288 after 100
289
290 send -- "exit\r"
291 sleep 1
292}
293
294
295puts "\nall done\n"
diff --git a/test/features/2.4.exp b/test/features/2.4.exp
deleted file mode 100755
index ed52f4bad..000000000
--- a/test/features/2.4.exp
+++ /dev/null
@@ -1,239 +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#
6# bridge
7# - todo: ping test or equivalent on chroot
8#
9
10set timeout 10
11spawn $env(SHELL)
12match_max 100000
13set overlay [lindex $argv 0]
14set chroot [lindex $argv 1]
15
16#
17# N
18#
19send -- "firejail --noprofile --net=br0\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
23}
24sleep 1
25
26send -- "ping -c 3 10.10.20.1\r"
27expect {
28 timeout {puts "TESTING ERROR 1\n";exit}
29 " packets transmitted, 3 received, 0% packet loss"
30}
31sleep 1
32
33
34send -- "/sbin/ifconfig\r"
35expect {
36 timeout {puts "TESTING ERROR 1.4\n";exit}
37 "eth0"
38}
39expect {
40 timeout {puts "TESTING ERROR 1.5n";exit}
41 "Link"
42}
43expect {
44 timeout {puts "TESTING ERROR 1.6\n";exit}
45 "10.10.20"
46}
47expect {
48 timeout {puts "TESTING ERROR 1.7\n";exit}
49 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
50}
51after 100
52
53send -- "exit\r"
54sleep 1
55
56send -- "firejail --noprofile --net=br0 --ip=10.10.20.4\r"
57expect {
58 timeout {puts "TESTING ERROR 0\n";exit}
59 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
60}
61sleep 1
62
63send -- "ping -c 3 10.10.20.1\r"
64expect {
65 timeout {puts "TESTING ERROR 1\n";exit}
66 " packets transmitted, 3 received, 0% packet loss"
67}
68sleep 1
69
70
71send -- "/sbin/ifconfig\r"
72expect {
73 timeout {puts "TESTING ERROR 1.4\n";exit}
74 "eth0"
75}
76expect {
77 timeout {puts "TESTING ERROR 1.5n";exit}
78 "Link"
79}
80expect {
81 timeout {puts "TESTING ERROR 1.6\n";exit}
82 "10.10.20.4"
83}
84expect {
85 timeout {puts "TESTING ERROR 1.7\n";exit}
86 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
87}
88after 100
89
90send -- "exit\r"
91sleep 1
92
93
94#
95# O
96#
97if { $overlay == "overlay" } {
98 send -- "firejail --noprofile --net=br0 --overlay\r"
99 expect {
100 timeout {puts "TESTING ERROR 2\n";exit}
101 "overlay option is not available" {puts "grsecurity\n"; exit}
102 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
103 }
104 sleep 1
105
106 send -- "ping -c 3 10.10.20.1\r"
107 expect {
108 timeout {puts "TESTING ERROR 3\n";exit}
109 " packets transmitted, 3 received, 0% packet loss"
110 }
111 sleep 1
112
113
114 send -- "/sbin/ifconfig\r"
115 expect {
116 timeout {puts "TESTING ERROR 3.4\n";exit}
117 "eth0"
118 }
119 expect {
120 timeout {puts "TESTING ERROR 3.5\n";exit}
121 "Link"
122 }
123 expect {
124 timeout {puts "TESTING ERROR 3.6\n";exit}
125 "10.10.20"
126 }
127 expect {
128 timeout {puts "TESTING ERROR 3.7\n";exit}
129 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
130 }
131 after 100
132
133 send -- "exit\r"
134 sleep 1
135
136 send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --overlay\r"
137 expect {
138 timeout {puts "TESTING ERROR 2\n";exit}
139 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
140 }
141 sleep 1
142
143 send -- "ping -c 3 10.10.20.1\r"
144 expect {
145 timeout {puts "TESTING ERROR 3\n";exit}
146 " packets transmitted, 3 received, 0% packet loss"
147 }
148 sleep 1
149
150
151 send -- "/sbin/ifconfig\r"
152 expect {
153 timeout {puts "TESTING ERROR 3.4\n";exit}
154 "eth0"
155 }
156 expect {
157 timeout {puts "TESTING ERROR 3.5\n";exit}
158 "Link"
159 }
160 expect {
161 timeout {puts "TESTING ERROR 3.6\n";exit}
162 "10.10.20.4"
163 }
164 expect {
165 timeout {puts "TESTING ERROR 3.7\n";exit}
166 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
167 }
168 after 100
169
170 send -- "exit\r"
171 sleep 1
172}
173
174
175#
176# C
177#
178if { $chroot == "chroot" } {
179 send -- "firejail --noprofile --net=br0 --chroot=/tmp/chroot\r"
180 expect {
181 timeout {puts "TESTING ERROR 4\n";exit}
182 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
183 }
184 sleep 1
185
186 send -- "/sbin/ifconfig\r"
187 expect {
188 timeout {puts "TESTING ERROR 5.4\n";exit}
189 "eth0"
190 }
191 expect {
192 timeout {puts "TESTING ERROR 5.5\n";exit}
193 "Link"
194 }
195 expect {
196 timeout {puts "TESTING ERROR 5.6\n";exit}
197 "10.10.20"
198 }
199 expect {
200 timeout {puts "TESTING ERROR 5.7\n";exit}
201 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
202 }
203 after 100
204
205 send -- "exit\r"
206 sleep 1
207
208 send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --chroot=/tmp/chroot\r"
209 expect {
210 timeout {puts "TESTING ERROR 4\n";exit}
211 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
212 }
213 sleep 1
214
215 send -- "/sbin/ifconfig\r"
216 expect {
217 timeout {puts "TESTING ERROR 5.4\n";exit}
218 "eth0"
219 }
220 expect {
221 timeout {puts "TESTING ERROR 5.5\n";exit}
222 "Link"
223 }
224 expect {
225 timeout {puts "TESTING ERROR 5.6\n";exit}
226 "10.10.20.4"
227 }
228 expect {
229 timeout {puts "TESTING ERROR 5.7\n";exit}
230 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
231 }
232 after 100
233
234 send -- "exit\r"
235 sleep 1
236}
237
238
239puts "\nall done\n"
diff --git a/test/features/2.5.exp b/test/features/2.5.exp
deleted file mode 100755
index ad462e440..000000000
--- a/test/features/2.5.exp
+++ /dev/null
@@ -1,114 +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#
6# interface
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --interface=eth0.5\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "/sbin/ifconfig\r"
26expect {
27 timeout {puts "TESTING ERROR 1.4\n";exit}
28 "eth0.5"
29}
30expect {
31 timeout {puts "TESTING ERROR 1.5n";exit}
32 "Link"
33}
34expect {
35 timeout {puts "TESTING ERROR 1.6\n";exit}
36 "10.10.205.10"
37}
38expect {
39 timeout {puts "TESTING ERROR 1.7\n";exit}
40 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
41}
42after 100
43send -- "exit\r"
44sleep 1
45
46#
47# O
48#
49if { $overlay == "overlay" } {
50 send -- "firejail --noprofile --overlay --interface=eth0.6\r"
51 expect {
52 timeout {puts "TESTING ERROR 2\n";exit}
53 "overlay option is not available" {puts "grsecurity\n"; exit}
54 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
55 }
56 sleep 1
57
58 send -- "/sbin/ifconfig\r"
59 expect {
60 timeout {puts "TESTING ERROR 3.4\n";exit}
61 "eth0.6"
62 }
63 expect {
64 timeout {puts "TESTING ERROR 3.5n";exit}
65 "Link"
66 }
67 expect {
68 timeout {puts "TESTING ERROR 3.6\n";exit}
69 "10.10.206.10"
70 }
71 expect {
72 timeout {puts "TESTING ERROR 3.7\n";exit}
73 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
74 }
75 after 100
76 send -- "exit\r"
77 sleep 1
78}
79
80#
81# C
82#
83if { $chroot == "chroot" } {
84 send -- "firejail --noprofile --chroot=/tmp/chroot --interface=eth0.7\r"
85 expect {
86 timeout {puts "TESTING ERROR 4\n";exit}
87 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
88 }
89 sleep 1
90
91 send -- "/sbin/ifconfig\r"
92 expect {
93 timeout {puts "TESTING ERROR 5.4\n";exit}
94 "eth0.7"
95 }
96 expect {
97 timeout {puts "TESTING ERROR 5.5n";exit}
98 "Link"
99 }
100 expect {
101 timeout {puts "TESTING ERROR 5.6\n";exit}
102 "10.10.207.10"
103 }
104 expect {
105 timeout {puts "TESTING ERROR 5.7\n";exit}
106 "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1"
107 }
108 after 100
109 send -- "exit\r"
110 sleep 1
111}
112
113
114puts "\nall done\n"
diff --git a/test/features/2.6.exp b/test/features/2.6.exp
deleted file mode 100755
index 7fdb69052..000000000
--- a/test/features/2.6.exp
+++ /dev/null
@@ -1,77 +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#
6# default gateway
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --net=eth0 --defaultgw=192.168.1.10 --protocol=unix,inet,netlink\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ip route show\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "default via 192.168.1.10 dev eth0"
29}
30after 100
31send -- "exit\r"
32sleep 1
33
34#
35# O
36#
37if { $overlay == "overlay" } {
38 send -- "firejail --noprofile --overlay --net=eth0 --defaultgw=192.168.1.10 --protocol=unix,inet,netlink\r"
39 expect {
40 timeout {puts "TESTING ERROR 2\n";exit}
41 "overlay option is not available" {puts "grsecurity\n"; exit}
42 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
43 }
44 sleep 1
45
46 send -- "ip route show\r"
47 expect {
48 timeout {puts "TESTING ERROR 3\n";exit}
49 "default via 192.168.1.10 dev eth0"
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 --net=eth0 --defaultgw=192.168.1.10 --protocol=unix,inet,netlink\r"
61 expect {
62 timeout {puts "TESTING ERROR 4\n";exit}
63 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
64 }
65 sleep 1
66
67 send -- "ip route show\r"
68 expect {
69 timeout {puts "TESTING ERROR 5\n";exit}
70 "default via 192.168.1.10 dev eth0"
71 }
72 after 100
73 send -- "exit\r"
74 sleep 1
75}
76
77puts "\nall done\n"
diff --git a/test/features/3.1.exp b/test/features/3.1.exp
deleted file mode 100755
index fb144b857..000000000
--- a/test/features/3.1.exp
+++ /dev/null
@@ -1,167 +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#
6# private
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --private\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -al | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "6"
29}
30
31send -- "ls -al .bashrc\r"
32expect {
33 timeout {puts "TESTING ERROR 1.2\n";exit}
34 "netblue"
35}
36expect {
37 timeout {puts "TESTING ERROR 1.3\n";exit}
38 "netblue"
39}
40expect {
41 timeout {puts "TESTING ERROR 1.4\n";exit}
42 ".bashrc"
43}
44
45send -- "ls -al .Xauthority\r"
46expect {
47 timeout {puts "TESTING ERROR 1.5\n";exit}
48 "netblue"
49}
50expect {
51 timeout {puts "TESTING ERROR 1.6\n";exit}
52 "netblue"
53}
54expect {
55 timeout {puts "TESTING ERROR 1.7\n";exit}
56 ".Xauthority"
57}
58
59
60
61after 100
62send -- "exit\r"
63sleep 1
64
65#
66# O
67#
68if { $overlay == "overlay" } {
69 send -- "firejail --noprofile --overlay --private\r"
70 expect {
71 timeout {puts "TESTING ERROR 2\n";exit}
72 "overlay option is not available" {puts "grsecurity\n"; exit}
73 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
74 }
75 sleep 1
76
77 send -- "ls -al | wc -l\r"
78 expect {
79 timeout {puts "TESTING ERROR 3.1\n";exit}
80 "6"
81 }
82
83 send -- "ls -al .bashrc\r"
84 expect {
85 timeout {puts "TESTING ERROR 3.2\n";exit}
86 "netblue"
87 }
88 expect {
89 timeout {puts "TESTING ERROR 3.3\n";exit}
90 "netblue"
91 }
92 expect {
93 timeout {puts "TESTING ERROR 3.4\n";exit}
94 ".bashrc"
95 }
96
97 send -- "ls -al .Xauthority\r"
98 expect {
99 timeout {puts "TESTING ERROR 3.5\n";exit}
100 "netblue"
101 }
102 expect {
103 timeout {puts "TESTING ERROR 3.6\n";exit}
104 "netblue"
105 }
106 expect {
107 timeout {puts "TESTING ERROR 3.7\n";exit}
108 ".Xauthority"
109 }
110
111 after 100
112 send -- "exit\r"
113 sleep 1
114}
115
116#
117# C
118#
119if { $chroot == "chroot" } {
120 send -- "firejail --noprofile --chroot=/tmp/chroot --private\r"
121 expect {
122 timeout {puts "TESTING ERROR 4\n";exit}
123 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
124 }
125 sleep 1
126
127 send -- "ls -al | wc -l\r"
128 expect {
129 timeout {puts "TESTING ERROR 5.1\n";exit}
130 "5"
131 }
132
133 send -- "ls -al .bashrc\r"
134 expect {
135 timeout {puts "TESTING ERROR 5.2\n";exit}
136 "netblue"
137 }
138 expect {
139 timeout {puts "TESTING ERROR 5.3\n";exit}
140 "netblue"
141 }
142 expect {
143 timeout {puts "TESTING ERROR 5.4\n";exit}
144 ".bashrc"
145 }
146
147 send -- "ls -al .Xauthority\r"
148 expect {
149 timeout {puts "TESTING ERROR 5.5\n";exit}
150 "netblue"
151 }
152 expect {
153 timeout {puts "TESTING ERROR 5.6\n";exit}
154 "netblue"
155 }
156 expect {
157 timeout {puts "TESTING ERROR 5.7\n";exit}
158 ".Xauthority"
159 }
160
161 after 100
162 send -- "exit\r"
163 sleep 1
164}
165
166
167puts "\nall done\n"
diff --git a/test/features/3.10.exp b/test/features/3.10.exp
deleted file mode 100755
index 728ad91f5..000000000
--- a/test/features/3.10.exp
+++ /dev/null
@@ -1,187 +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#
6# whitelist tmp
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "mkdir /tmp/test1dir\r"
19sleep 1
20send -- "touch /tmp/test1dir/test1\r"
21sleep 1
22send -- "firejail --noprofile --whitelist=/tmp/test1dir\r"
23expect {
24 timeout {puts "TESTING ERROR 0\n";exit}
25 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
26}
27sleep 1
28
29send -- "ls -l /tmp | wc -l\r"
30expect {
31 timeout {puts "TESTING ERROR 1.1\n";exit}
32 "2"
33}
34send -- "ls -l /tmp\r"
35expect {
36 timeout {puts "TESTING ERROR 1.2\n";exit}
37 "netblue"
38}
39expect {
40 timeout {puts "TESTING ERROR 1.3\n";exit}
41 "netblue"
42}
43expect {
44 timeout {puts "TESTING ERROR 1.4\n";exit}
45 "test1dir"
46}
47
48send -- "ls -l /tmp/test1dir | wc -l\r"
49expect {
50 timeout {puts "TESTING ERROR 1.5\n";exit}
51 "2"
52}
53send -- "ls -l /tmp/test1dir\r"
54expect {
55 timeout {puts "TESTING ERROR 1.6\n";exit}
56 "netblue"
57}
58expect {
59 timeout {puts "TESTING ERROR 1.7\n";exit}
60 "netblue"
61}
62expect {
63 timeout {puts "TESTING ERROR 1.8\n";exit}
64 "test1"
65}
66
67
68after 100
69send -- "exit\r"
70sleep 1
71
72
73#
74# O
75#
76if { $overlay == "overlay" } {
77 send -- "firejail --noprofile --overlay --whitelist=/tmp/test1dir\r"
78 expect {
79 timeout {puts "TESTING ERROR 2\n";exit}
80 "overlay option is not available" {puts "grsecurity\n"; exit}
81 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
82 }
83 sleep 1
84
85 send -- "ls -l /tmp | wc -l\r"
86 expect {
87 timeout {puts "TESTING ERROR 3.1\n";exit}
88 "2"
89 }
90 send -- "ls -l /tmp\r"
91 expect {
92 timeout {puts "TESTING ERROR 3.2\n";exit}
93 "netblue"
94 }
95 expect {
96 timeout {puts "TESTING ERROR 3.3\n";exit}
97 "netblue"
98 }
99 expect {
100 timeout {puts "TESTING ERROR 3.4\n";exit}
101 "test1dir"
102 }
103
104 send -- "ls -l /tmp/test1dir | wc -l\r"
105 expect {
106 timeout {puts "TESTING ERROR 3.5\n";exit}
107 "2"
108 }
109 send -- "ls -l /tmp/test1dir\r"
110 expect {
111 timeout {puts "TESTING ERROR 3.6\n";exit}
112 "netblue"
113 }
114 expect {
115 timeout {puts "TESTING ERROR 3.7\n";exit}
116 "netblue"
117 }
118 expect {
119 timeout {puts "TESTING ERROR 3.8\n";exit}
120 "test1"
121 }
122
123 after 100
124 send -- "exit\r"
125 sleep 1
126}
127
128#
129# C
130#
131if { $chroot == "chroot" } {
132 send -- "mkdir /tmp/chroot/tmp/test1dir\r"
133 sleep 1
134 send -- "touch /tmp/chroot/tmp/test1dir/test1\r"
135 sleep 1
136 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/tmp/test1dir\r"
137 expect {
138 timeout {puts "TESTING ERROR 4\n";exit}
139 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
140 }
141 sleep 1
142
143 send -- "ls -l /tmp | wc -l\r"
144 expect {
145 timeout {puts "TESTING ERROR 5.1\n";exit}
146 "2"
147 }
148 send -- "ls -l /tmp\r"
149 expect {
150 timeout {puts "TESTING ERROR 5.2\n";exit}
151 "netblue"
152 }
153 expect {
154 timeout {puts "TESTING ERROR 5.3\n";exit}
155 "netblue"
156 }
157 expect {
158 timeout {puts "TESTING ERROR 5.4\n";exit}
159 "test1dir"
160 }
161
162 send -- "ls -l /tmp/test1dir | wc -l\r"
163 expect {
164 timeout {puts "TESTING ERROR 5.5\n";exit}
165 "2"
166 }
167 send -- "ls -l /tmp/test1dir\r"
168 expect {
169 timeout {puts "TESTING ERROR 5.6\n";exit}
170 "netblue"
171 }
172 expect {
173 timeout {puts "TESTING ERROR 5.7\n";exit}
174 "netblue"
175 }
176 expect {
177 timeout {puts "TESTING ERROR 5.8\n";exit}
178 "test1"
179 }
180
181 after 100
182 send -- "exit\r"
183 sleep 1
184}
185
186
187puts "\nall done\n"
diff --git a/test/features/3.11.exp b/test/features/3.11.exp
deleted file mode 100755
index 9e59b05e7..000000000
--- a/test/features/3.11.exp
+++ /dev/null
@@ -1,174 +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#
6# mkdir
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "rm -fr ~/firejail-xy76_u9\r"
19sleep 1
20
21send -- "firejail --profile=3.11.profile\r"
22expect {
23 timeout {puts "TESTING ERROR 0\n";exit}
24 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
25}
26sleep 1
27
28send -- "ls -l ~ | grep firejail-xy76_u9\r"
29expect {
30 timeout {puts "TESTING ERROR 1\n";exit}
31 "drwx------"
32}
33expect {
34 timeout {puts "TESTING ERROR 2\n";exit}
35 "netblue netblue" { puts "Debian\n"}
36 "netblue users" { puts "Arch\n"}
37}
38expect {
39 timeout {puts "TESTING ERROR 3\n";exit}
40 "firejail-xy76_u9"
41}
42after 100
43
44send -- "ls -l ~/firejail-xy76_u9\r"
45expect {
46 timeout {puts "TESTING ERROR 4\n";exit}
47 "drwx------"
48}
49expect {
50 timeout {puts "TESTING ERROR 5\n";exit}
51 "netblue netblue" { puts "Debian\n"}
52 "netblue users" { puts "Arch\n"}
53}
54expect {
55 timeout {puts "TESTING ERROR 6\n";exit}
56 "testdir"
57}
58after 100
59
60send -- "exit\r"
61sleep 1
62send -- "rm -fr ~/firejail-xy76_u9\r"
63sleep 1
64
65#
66# O
67#
68if { $overlay == "overlay" } {
69 send -- "rm -fr ~/firejail-xy76_u9\r"
70 sleep 1
71
72 send -- "firejail --profile=3.11.profile\r"
73 expect {
74 timeout {puts "TESTING ERROR 10\n";exit}
75 "overlay option is not available" {puts "grsecurity\n"; exit}
76 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
77 }
78 sleep 1
79
80 send -- "ls -l ~ | grep firejail-xy76_u9\r"
81 expect {
82 timeout {puts "TESTING ERROR 11\n";exit}
83 "drwx------"
84 }
85 expect {
86 timeout {puts "TESTING ERROR 12\n";exit}
87 "netblue netblue" { puts "Debian\n"}
88 "netblue users" { puts "Arch\n"}
89 }
90 expect {
91 timeout {puts "TESTING ERROR 13\n";exit}
92 "firejail-xy76_u9"
93 }
94 after 100
95
96 send -- "ls -l ~/firejail-xy76_u9\r"
97 expect {
98 timeout {puts "TESTING ERROR 14\n";exit}
99 "drwx------"
100 }
101 expect {
102 timeout {puts "TESTING ERROR 15\n";exit}
103 "netblue netblue" { puts "Debian\n"}
104 "netblue users" { puts "Arch\n"}
105 }
106 expect {
107 timeout {puts "TESTING ERROR 16\n";exit}
108 "testdir"
109 }
110 after 100
111
112 send -- "exit\r"
113 sleep 1
114 send -- "rm -fr ~/firejail-xy76_u9\r"
115 sleep 1
116
117
118}
119
120#
121# C
122#
123if { $chroot == "chroot" } {
124 send -- "rm -fr ~/firejail-xy76_u9\r"
125 sleep 1
126
127 send -- "firejail --profile=3.11.profile\r"
128 expect {
129 timeout {puts "TESTING ERROR 20\n";exit}
130 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
131 }
132 sleep 1
133
134 send -- "ls -l ~ | grep firejail-xy76_u9\r"
135 expect {
136 timeout {puts "TESTING ERROR 21\n";exit}
137 "drwx------"
138 }
139 expect {
140 timeout {puts "TESTING ERROR 22\n";exit}
141 "netblue netblue" { puts "Debian\n"}
142 "netblue users" { puts "Arch\n"}
143 }
144 expect {
145 timeout {puts "TESTING ERROR 23\n";exit}
146 "firejail-xy76_u9"
147 }
148 after 100
149
150 send -- "ls -l ~/firejail-xy76_u9\r"
151 expect {
152 timeout {puts "TESTING ERROR 24\n";exit}
153 "drwx------"
154 }
155 expect {
156 timeout {puts "TESTING ERROR 25\n";exit}
157 "netblue netblue" { puts "Debian\n"}
158 "netblue users" { puts "Arch\n"}
159 }
160 expect {
161 timeout {puts "TESTING ERROR 26\n";exit}
162 "testdir"
163 }
164 after 100
165
166 send -- "rm -fr ~/firejail-xy76_u9\r"
167 sleep 1
168
169 send -- "exit\r"
170
171}
172
173
174puts "\nall done\n"
diff --git a/test/features/3.11.profile b/test/features/3.11.profile
deleted file mode 100644
index 144733f8f..000000000
--- a/test/features/3.11.profile
+++ /dev/null
@@ -1,2 +0,0 @@
1mkdir ~/firejail-xy76_u9
2mkdir ~/firejail-xy76_u9/testdir
diff --git a/test/features/3.2.exp b/test/features/3.2.exp
deleted file mode 100755
index 1fdb74a42..000000000
--- a/test/features/3.2.exp
+++ /dev/null
@@ -1,82 +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#
6# read-only
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "rm -f ~/.config/firejail-test-file\r"
19sleep 1
20send -- "firejail --noprofile --read-only=/home/netblue/.config\r"
21expect {
22 timeout {puts "TESTING ERROR 0\n";exit}
23 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
24}
25sleep 1
26
27send -- "touch ~/.config/firejail-test-file\r"
28expect {
29 timeout {puts "TESTING ERROR 1\n";exit}
30 "Read-only file system"
31}
32after 100
33send -- "exit\r"
34sleep 1
35
36#
37# O
38#
39if { $overlay == "overlay" } {
40 send -- "firejail --noprofile --overlay --read-only=/home/netblue/.config\r"
41 expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "overlay option is not available" {puts "grsecurity\n"; exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
45 }
46 sleep 1
47
48 send -- "touch ~/.config/firejail-test-file\r"
49 expect {
50 timeout {puts "TESTING ERROR 3\n";exit}
51 "Read-only file system"
52 }
53 after 100
54 send -- "exit\r"
55 sleep 1
56}
57
58#
59# C
60#
61if { $chroot == "chroot" } {
62 send -- "rm -f /tmp/chroot/home/netblue/.config/firejail-test-file\r"
63 sleep 1
64 send -- "firejail --noprofile --chroot=/tmp/chroot --read-only=/home/netblue/.config\r"
65 expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
68 }
69 sleep 1
70
71 send -- "touch ~/.config/firejail-test-file\r"
72 expect {
73 timeout {puts "TESTING ERROR 5\n";exit}
74 "Read-only file system"
75 }
76 after 100
77 send -- "exit\r"
78 sleep 1
79}
80
81
82puts "\nall done\n"
diff --git a/test/features/3.3.exp b/test/features/3.3.exp
deleted file mode 100755
index 8c931dcf1..000000000
--- a/test/features/3.3.exp
+++ /dev/null
@@ -1,78 +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#
6# blacklist
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --blacklist=/home/netblue/.config\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "cd ~/.config\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Permission denied"
29}
30after 100
31send -- "exit\r"
32sleep 1
33
34
35#
36# O
37#
38if { $overlay == "overlay" } {
39 send -- "firejail --noprofile --overlay --blacklist=/home/netblue/.config\r"
40 expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "overlay option is not available" {puts "grsecurity\n"; exit}
43 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
44 }
45 sleep 1
46
47 send -- "cd ~/.config\r"
48 expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "Permission denied"
51 }
52 after 100
53 send -- "exit\r"
54 sleep 1
55}
56
57#
58# C
59#
60if { $chroot == "chroot" } {
61 send -- "firejail --noprofile --chroot=/tmp/chroot --blacklist=/home/netblue/.config\r"
62 expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
65 }
66 sleep 1
67
68 send -- "cd ~/.config\r"
69 expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 "Permission denied"
72 }
73 after 100
74 send -- "exit\r"
75 sleep 1
76}
77
78puts "\nall done\n"
diff --git a/test/features/3.4.exp b/test/features/3.4.exp
deleted file mode 100755
index 813c2d86a..000000000
--- a/test/features/3.4.exp
+++ /dev/null
@@ -1,208 +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#
6# whitelist home
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --whitelist=/home/netblue/.config\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -al | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "6"
29}
30
31send -- "ls -al .bashrc\r"
32expect {
33 timeout {puts "TESTING ERROR 1.2\n";exit}
34 "netblue"
35}
36expect {
37 timeout {puts "TESTING ERROR 1.3\n";exit}
38 "netblue"
39}
40expect {
41 timeout {puts "TESTING ERROR 1.4\n";exit}
42 ".bashrc"
43}
44
45send -- "ls -al .Xauthority\r"
46expect {
47 timeout {puts "TESTING ERROR 1.5\n";exit}
48 "netblue"
49}
50expect {
51 timeout {puts "TESTING ERROR 1.6\n";exit}
52 "netblue"
53}
54expect {
55 timeout {puts "TESTING ERROR 1.7\n";exit}
56 ".Xauthority"
57}
58
59send -- "ls -al | grep .config\r"
60expect {
61 timeout {puts "TESTING ERROR 1.8\n";exit}
62 "netblue"
63}
64expect {
65 timeout {puts "TESTING ERROR 1.9\n";exit}
66 "netblue"
67}
68expect {
69 timeout {puts "TESTING ERROR 1.10\n";exit}
70 ".config"
71}
72
73after 100
74send -- "exit\r"
75sleep 1
76
77
78#
79# O
80#
81if { $overlay == "overlay" } {
82 send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r"
83 expect {
84 timeout {puts "TESTING ERROR 2\n";exit}
85 "overlay option is not available" {puts "grsecurity\n"; exit}
86 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
87 }
88 sleep 1
89
90 send -- "ls -al | wc -l\r"
91 expect {
92 timeout {puts "TESTING ERROR 3.1\n";exit}
93 "6"
94 }
95
96 send -- "ls -al .bashrc\r"
97 expect {
98 timeout {puts "TESTING ERROR 3.2\n";exit}
99 "netblue"
100 }
101 expect {
102 timeout {puts "TESTING ERROR 3.3\n";exit}
103 "netblue"
104 }
105 expect {
106 timeout {puts "TESTING ERROR 3.4\n";exit}
107 ".bashrc"
108 }
109
110 send -- "ls -al .Xauthority\r"
111 expect {
112 timeout {puts "TESTING ERROR 3.5\n";exit}
113 "netblue"
114 }
115 expect {
116 timeout {puts "TESTING ERROR 3.6\n";exit}
117 "netblue"
118 }
119 expect {
120 timeout {puts "TESTING ERROR 3.7\n";exit}
121 ".Xauthority"
122 }
123
124 send -- "ls -al | grep .config\r"
125 expect {
126 timeout {puts "TESTING ERROR 3.8\n";exit}
127 "netblue"
128 }
129 expect {
130 timeout {puts "TESTING ERROR 3.9\n";exit}
131 "netblue"
132 }
133 expect {
134 timeout {puts "TESTING ERROR 3.10\n";exit}
135 ".config"
136 }
137
138 after 100
139 send -- "exit\r"
140 sleep 1
141}
142
143#
144# C
145#
146if { $chroot == "chroot" } {
147 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r"
148 expect {
149 timeout {puts "TESTING ERROR 4\n";exit}
150 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
151 }
152 sleep 1
153
154 send -- "ls -al | wc -l\r"
155 expect {
156 timeout {puts "TESTING ERROR 5.1\n";exit}
157 "6"
158 }
159
160 send -- "ls -al .bashrc\r"
161 expect {
162 timeout {puts "TESTING ERROR 5.2\n";exit}
163 "netblue"
164 }
165 expect {
166 timeout {puts "TESTING ERROR 5.3\n";exit}
167 "netblue"
168 }
169 expect {
170 timeout {puts "TESTING ERROR 5.4\n";exit}
171 ".bashrc"
172 }
173
174 send -- "ls -al .Xauthority\r"
175 expect {
176 timeout {puts "TESTING ERROR 5.5\n";exit}
177 "netblue"
178 }
179 expect {
180 timeout {puts "TESTING ERROR 5.6\n";exit}
181 "netblue"
182 }
183 expect {
184 timeout {puts "TESTING ERROR 5.7\n";exit}
185 ".Xauthority"
186 }
187
188 send -- "ls -al | grep .config\r"
189 expect {
190 timeout {puts "TESTING ERROR 5.8\n";exit}
191 "netblue"
192 }
193 expect {
194 timeout {puts "TESTING ERROR 5.9\n";exit}
195 "netblue"
196 }
197 expect {
198 timeout {puts "TESTING ERROR 5.10\n";exit}
199 ".config"
200 }
201
202 after 100
203 send -- "exit\r"
204 sleep 1
205}
206
207
208puts "\nall done\n"
diff --git a/test/features/3.5.exp b/test/features/3.5.exp
deleted file mode 100755
index 93bbfe054..000000000
--- a/test/features/3.5.exp
+++ /dev/null
@@ -1,83 +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#
6# private-dev
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --private-dev\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /dev | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "13" { puts "Debian\n"}
29 "12" { puts "Centos\n"}
30}
31
32after 100
33send -- "exit\r"
34sleep 1
35
36#
37# O
38#
39if { $overlay == "overlay" } {
40 send -- "firejail --noprofile --overlay --private-dev\r"
41 expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "overlay option is not available" {puts "grsecurity\n"; exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
45 }
46 sleep 1
47
48 send -- "ls -l /dev | wc -l\r"
49 expect {
50 timeout {puts "TESTING ERROR 3.1\n";exit}
51 "13" { puts "Debian\n"}
52 "12" { puts "Centos\n"}
53 }
54
55 after 100
56 send -- "exit\r"
57 sleep 1
58}
59
60#
61# C
62#
63if { $chroot == "chroot" } {
64 send -- "firejail --noprofile --chroot=/tmp/chroot --private-dev\r"
65 expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
68 }
69 sleep 1
70
71 send -- "ls -l /dev | wc -l\r"
72 expect {
73 timeout {puts "TESTING ERROR 5.1\n";exit}
74 "12"
75 }
76
77 after 100
78 send -- "exit\r"
79 sleep 1
80}
81
82
83puts "\nall done\n"
diff --git a/test/features/3.6.exp b/test/features/3.6.exp
deleted file mode 100755
index 5dcbdd483..000000000
--- a/test/features/3.6.exp
+++ /dev/null
@@ -1,87 +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#
6# private-etc
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -al /etc | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "10"
29}
30
31after 100
32send -- "exit\r"
33sleep 1
34
35#
36# O
37#
38if { $overlay == "overlay" } {
39 send -- "firejail --noprofile --overlay --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
40 expect {
41 timeout {puts "TESTING ERROR 2\n";exit}
42 "overlay option is not available" {puts "grsecurity\n"; exit}
43 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
44 }
45 sleep 1
46
47 send -- "ls -al /etc | wc -l\r"
48 expect {
49 timeout {puts "TESTING ERROR 3.1\n";exit}
50 "10"
51 }
52
53 after 100
54 send -- "exit\r"
55 sleep 1
56}
57
58#
59# C
60#
61if { $chroot == "chroot" } {
62 send -- "firejail --noprofile --chroot=/tmp/chroot --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r"
63 expect {
64 timeout {puts "TESTING ERROR 4\n";exit}
65 "chroot option is not available" {puts "grsecurity\n"; exit}
66 "private-etc feature is disabled in chroot"
67 }
68 expect {
69 timeout {puts "TESTING ERROR 5\n";exit}
70 "chroot option is not available" {puts "grsecurity\n"; exit}
71 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
72 }
73 sleep 1
74
75 send -- "ls /etc | grep firejail\r"
76 expect {
77 timeout {puts "TESTING ERROR 6\n";exit}
78 "firejail"
79 }
80
81 after 100
82 send -- "exit\r"
83 sleep 1
84}
85
86
87puts "\nall done\n"
diff --git a/test/features/3.7.exp b/test/features/3.7.exp
deleted file mode 100755
index f7f5fa67f..000000000
--- a/test/features/3.7.exp
+++ /dev/null
@@ -1,95 +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#
6# private-tmp
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "touch /tmp/test1\r"
19sleep 1
20send -- "touch /tmp/test2\r"
21sleep 1
22send -- "firejail --noprofile --private-tmp\r"
23expect {
24 timeout {puts "TESTING ERROR 0\n";exit}
25 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
26}
27sleep 1
28
29send -- "ls -al /tmp | wc -l\r"
30expect {
31 timeout {puts "TESTING ERROR 1.1\n";exit}
32 "3"
33}
34
35
36after 100
37send -- "exit\r"
38sleep 1
39
40#
41# O
42#
43if { $overlay == "overlay" } {
44 send -- "touch /tmp/test1\r"
45 sleep 1
46 send -- "touch /tmp/test2\r"
47 sleep 1
48 send -- "firejail --noprofile --overlay --private-tmp\r"
49 expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "overlay option is not available" {puts "grsecurity\n"; exit}
52 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
53 }
54 sleep 1
55
56 send -- "ls -al /tmp | wc -l\r"
57 expect {
58 timeout {puts "TESTING ERROR 3.1\n";exit}
59 "3"
60 }
61
62
63 after 100
64 send -- "exit\r"
65 sleep 1
66}
67
68#
69# C
70#
71if { $chroot == "chroot" } {
72 send -- "touch /tmp/test1\r"
73 sleep 1
74 send -- "touch /tmp/test2\r"
75 sleep 1
76 send -- "firejail --noprofile --chroot=/tmp/chroot --private-tmp\r"
77 expect {
78 timeout {puts "TESTING ERROR 4\n";exit}
79 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
80 }
81 sleep 1
82
83 send -- "ls -al /tmp | wc -l\r"
84 expect {
85 timeout {puts "TESTING ERROR 5.1\n";exit}
86 "3"
87 }
88
89 after 100
90 send -- "exit\r"
91 sleep 1
92}
93
94
95puts "\nall done\n"
diff --git a/test/features/3.8.exp b/test/features/3.8.exp
deleted file mode 100755
index 23adab634..000000000
--- a/test/features/3.8.exp
+++ /dev/null
@@ -1,87 +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#
6# private-bin
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --private-bin=bash,cat,cp,ls,wc\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /usr/bin | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "6"
29}
30
31
32after 100
33send -- "exit\r"
34sleep 1
35
36#
37# O
38#
39if { $overlay == "overlay" } {
40 send -- "firejail --noprofile --overlay --private-bin=bash,cat,cp,ls,wc\r"
41 expect {
42 timeout {puts "TESTING ERROR 2\n";exit}
43 "overlay option is not available" {puts "grsecurity\n"; exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
45 }
46 sleep 1
47
48 send -- "ls -l /usr/bin | wc -l\r"
49 expect {
50 timeout {puts "TESTING ERROR 3.1\n";exit}
51 "6"
52 }
53
54
55 after 100
56 send -- "exit\r"
57 sleep 1
58}
59
60#
61# C
62#
63if { $chroot == "chroot" } {
64 send -- "firejail --noprofile --chroot=/tmp/chroot --private-bin=bash,cat,cp,ls,wc\r"
65 expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "private-bin feature is disabled in chroot"
68 }
69 expect {
70 timeout {puts "TESTING ERROR 5\n";exit}
71 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
72 }
73 sleep 1
74
75 send -- "ls -l /usr/bin | wc -l\r"
76 expect {
77 timeout {puts "TESTING ERROR 6\n";exit}
78 "9"
79 }
80
81 after 100
82 send -- "exit\r"
83 sleep 1
84}
85
86
87puts "\nall done\n"
diff --git a/test/features/3.9.exp b/test/features/3.9.exp
deleted file mode 100755
index cfc588bf1..000000000
--- a/test/features/3.9.exp
+++ /dev/null
@@ -1,84 +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#
6# whitelist dev
7#
8
9set timeout 10
10spawn $env(SHELL)
11match_max 100000
12set overlay [lindex $argv 0]
13set chroot [lindex $argv 1]
14
15#
16# N
17#
18send -- "firejail --noprofile --whitelist=/dev/tty --whitelist=/dev/null\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25send -- "ls -l /dev | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 1.1\n";exit}
28 "3"
29}
30
31
32after 100
33send -- "exit\r"
34sleep 1
35
36
37#
38# O
39#
40if { $overlay == "overlay" } {
41 send -- "firejail --noprofile --overlay --whitelist=/dev/tty --whitelist=/dev/null\r"
42 expect {
43 timeout {puts "TESTING ERROR 2\n";exit}
44 "overlay option is not available" {puts "grsecurity\n"; exit}
45 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"}
46 }
47 sleep 1
48
49 send -- "ls -l /dev | wc -l\r"
50 expect {
51 timeout {puts "TESTING ERROR 3.1\n";exit}
52 "3"
53 }
54
55
56 after 100
57 send -- "exit\r"
58 sleep 1
59}
60
61#
62# C
63#
64if { $chroot == "chroot" } {
65 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/dev/tty --whitelist=/dev/null\r"
66 expect {
67 timeout {puts "TESTING ERROR 4\n";exit}
68 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
69 }
70 sleep 1
71
72 send -- "ls -l /dev | wc -l\r"
73 expect {
74 timeout {puts "TESTING ERROR 5.1\n";exit}
75 "3"
76 }
77
78 after 100
79 send -- "exit\r"
80 sleep 1
81}
82
83
84puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
deleted file mode 100644
index 904803234..000000000
--- a/test/features/features.txt
+++ /dev/null
@@ -1,61 +0,0 @@
1Firejail Feature Testing
2
3N - normal user filesystem
4O - overlay filesystem
5C - chroot filesystem
6
7
8
91. Default features (tesing with --noprofile)
10
111.1 disable /boot
121.2 new /proc
131.3 new /sys
14 - N, O fails remount, C fails remount
15
161.4 mask other users
17 - home directory: N, O, C
18 - /etc/passwd: N, O, C to test
19 - /etc/group: N, O, C to test
20
211.5 PID namespace
221.6 new /var/log
231.7 new /var/tmp
241.8 disable firejail config and run time information
251.9 mount namespace
261.10 disable /selinux
27
28
292. Networking features
30
312.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname)
32 - ping disabled for C by default seccomp filter, use "getent hosts bingo"
33
342.2 DNS (use --dns=4.2.2.1, use "dig google.com")
352.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com)
362.4 bridge (use --net=br0 and --noprofile; run ifconfig, netstat -rn, ping default gw)
37 - ping disabled for C by default seccomp filter - transfer test not implemented for C
382.5 interface
392.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn)
40
41
423. Filesystem features (use --noprofile)
43
443.1 private
453.2 read-only
463.3 blacklist
473.4 whitelist home
48 - N braking on Fedora
493.5 private-dev
50 - O, C - somehow /dev/log is missing
51 - N - problems on Debian wheezy 32-bit, Fedora
523.6 private-etc
53 - O not working - todo
543.7 private-tmp
553.8 private-bin
56 - O, C not working - todo
573.9 whitelist dev
58 - N not working on Debian wheezy (32-bit and 64-bit) - todo
593.10 whitelist tmp
60 - O not working on Arch Linux - todo
613.11 mkdir
diff --git a/test/features/test.sh b/test/features/test.sh
deleted file mode 100755
index b3e29bc28..000000000
--- a/test/features/test.sh
+++ /dev/null
@@ -1,119 +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
6export LC_ALL=C
7OVERLAY="overlay"
8CHROOT="chroot"
9NETWORK="network"
10
11while [[ $# -gt 0 ]]; do # Until you run out of parameters . . .
12 case "$1" in
13 --nooverlay)
14 OVERLAY="none"
15 ;;
16 --nochroot)
17 CHROOT="none"
18 ;;
19 --nonetwork)
20 NETWORK="none"
21 ;;
22 --help)
23 echo "./test.sh [--nooverlay|--nochroot|--nonetwork|--help] | grep TESTING"
24 exit
25 ;;
26 esac
27 shift # Check next set of parameters.
28done
29
30#
31# Feature testing
32#
33
34####################
35# Default features
36####################
37echo "TESTING: 1.1 disable /boot"
38./1.1.exp "$OVERLAY" "$CHROOT"
39
40echo "TESTING: 1.2 new /proc"
41./1.2.exp "$OVERLAY" "$CHROOT"
42
43echo "TESTING: 1.4 mask other users"
44./1.4.exp "$OVERLAY" "$CHROOT"
45
46echo "TESTING: 1.5 PID namespace"
47./1.5.exp "$OVERLAY" "$CHROOT"
48
49echo "TESTING: 1.6 new /var/log"
50./1.6.exp "$OVERLAY" "$CHROOT"
51
52echo "TESTING: 1.7 new /var/tmp"
53./1.7.exp "$OVERLAY" "$CHROOT"
54
55echo "TESTING: 1.8 disable firejail config and run time information"
56./1.8.exp "$OVERLAY" "$CHROOT"
57
58echo "TESTING: 1.10 disable /selinux"
59./1.10.exp "$OVERLAY" "$CHROOT"
60
61####################
62# networking features
63####################
64if [[ $NETWORK == "network" ]]
65then
66 echo "TESTING: 2.1 hostname"
67 ./2.1.exp "$OVERLAY" "$CHROOT"
68
69 echo "TESTING: 2.2 DNS"
70 ./2.2.exp "$OVERLAY" "$CHROOT"
71
72 echo "TESTING: 2.3 mac-vlan"
73 ./2.3.exp "$OVERLAY" "$CHROOT"
74
75 echo "TESTING: 2.4 bridge"
76 ./2.4.exp "$OVERLAY" "$CHROOT"
77
78 echo "TESTING: 2.5 interface"
79 ./2.5.exp "$OVERLAY" "$CHROOT"
80
81 echo "TESTING: 2.6 Default gateway"
82 ./2.6.exp "$OVERLAY" "$CHROOT"
83fi
84
85####################
86# filesystem features
87####################
88echo "TESTING: 3.1 private (fails on OpenSUSE)"
89./3.1.exp "$OVERLAY" "$CHROOT"
90
91echo "TESTING: 3.2 read-only"
92./3.2.exp "$OVERLAY" "$CHROOT"
93
94echo "TESTING: 3.3 blacklist"
95./3.3.exp "$OVERLAY" "$CHROOT"
96
97echo "TESTING: 3.4 whitelist home (fails on OpenSUSE)"
98./3.4.exp "$OVERLAY" "$CHROOT"
99
100echo "TESTING: 3.5 private-dev"
101./3.5.exp "$OVERLAY" "$CHROOT"
102
103echo "TESTING: 3.6 private-etc"
104./3.6.exp notworking "$CHROOT"
105
106echo "TESTING: 3.7 private-tmp"
107./3.7.exp "$OVERLAY" "$CHROOT"
108
109echo "TESTING: 3.8 private-bin"
110./3.8.exp notworking notworking
111
112echo "TESTING: 3.9 whitelist dev"
113./3.9.exp "$OVERLAY" "$CHROOT"
114
115echo "TESTING: 3.10 whitelist tmp"
116./3.10.exp "$OVERLAY" "$CHROOT"
117
118echo "TESTING: 3.11 mkdir"
119./3.11.exp "$OVERLAY" "$CHROOT"
diff --git a/test/overlay/firefox-x11-xorg.exp b/test/overlay/firefox-x11-xorg.exp
deleted file mode 100755
index 5457b512a..000000000
--- a/test/overlay/firefox-x11-xorg.exp
+++ /dev/null
@@ -1,89 +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 --overlay --name=test --x11=xorg firefox -no-remote www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "firefox" {puts "firefox detected\n";}
22 "iceweasel" {puts "iceweasel detected\n";}
23}
24expect {
25 timeout {puts "TESTING ERROR 3.2\n";exit}
26 "no-remote"
27}
28sleep 1
29# grsecurity exit
30send -- "file /proc/sys/kernel/grsecurity\r"
31expect {
32 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"}
35}
36send -- "firejail --overlay --name=blablabla\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41sleep 2
42
43spawn $env(SHELL)
44send -- "firemon --seccomp\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 " firefox" {puts "firefox detected\n";}
48 " iceweasel" {puts "iceweasel detected\n";}
49}
50expect {
51 timeout {puts "TESTING ERROR 5.0\n";exit}
52 "no-remote"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
56 "Seccomp: 2"
57}
58expect {
59 timeout {puts "TESTING ERROR 5.1\n";exit}
60 "name=blablabla"
61}
62sleep 1
63send -- "firemon --caps\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 " firefox" {puts "firefox detected\n";}
67 " iceweasel" {puts "iceweasel detected\n";}
68}
69expect {
70 timeout {puts "TESTING ERROR 6.0\n";exit}
71 "no-remote"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.1\n";exit}
75 "CapBnd:"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.2\n";exit}
79 "0000000000000000"
80}
81expect {
82 timeout {puts "TESTING ERROR 6.3\n";exit}
83 "name=blablabla"
84}
85sleep 1
86send -- "firejail --shutdown=test\r"
87sleep 3
88
89puts "\nall done\n"
diff --git a/test/overlay/firefox-x11.exp b/test/overlay/firefox-x11.exp
deleted file mode 100755
index 66b3d9d8e..000000000
--- a/test/overlay/firefox-x11.exp
+++ /dev/null
@@ -1,89 +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 --overlay --name=test --x11 firefox -no-remote www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "firefox" {puts "firefox detected\n";}
22 "iceweasel" {puts "iceweasel detected\n";}
23}
24expect {
25 timeout {puts "TESTING ERROR 3.2\n";exit}
26 "no-remote"
27}
28sleep 1
29# grsecurity exit
30send -- "file /proc/sys/kernel/grsecurity\r"
31expect {
32 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"}
35}
36send -- "firejail --name=blablabla --overlay\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41sleep 2
42
43spawn $env(SHELL)
44send -- "firemon --seccomp\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 " firefox" {puts "firefox detected\n";}
48 " iceweasel" {puts "iceweasel detected\n";}
49}
50expect {
51 timeout {puts "TESTING ERROR 5.0\n";exit}
52 "no-remote"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
56 "Seccomp: 2"
57}
58expect {
59 timeout {puts "TESTING ERROR 5.1\n";exit}
60 "name=blablabla"
61}
62sleep 1
63send -- "firemon --caps\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 " firefox" {puts "firefox detected\n";}
67 " iceweasel" {puts "iceweasel detected\n";}
68}
69expect {
70 timeout {puts "TESTING ERROR 6.0\n";exit}
71 "no-remote"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.1\n";exit}
75 "CapBnd:"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.2\n";exit}
79 "0000000000000000"
80}
81expect {
82 timeout {puts "TESTING ERROR 6.3\n";exit}
83 "name=blablabla"
84}
85sleep 1
86send -- "firejail --shutdown=test\r"
87sleep 3
88
89puts "\nall done\n"
diff --git a/test/overlay/firefox.exp b/test/overlay/firefox.exp
deleted file mode 100755
index 295a03f52..000000000
--- a/test/overlay/firefox.exp
+++ /dev/null
@@ -1,98 +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 --overlay firefox -no-remote www.gentoo.org\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/firefox.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
18}
19sleep 10
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "firefox" {puts "firefox detected\n";}
30 "iceweasel" {puts "iceweasel detected\n";}
31}
32expect {
33 timeout {puts "TESTING ERROR 3.2\n";exit}
34 "no-remote"
35}
36after 100
37
38# grsecurity exit
39send -- "file /proc/sys/kernel/grsecurity\r"
40expect {
41 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
42 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
43 "cannot open" {puts "grsecurity not present\n"}
44}
45
46
47send -- "firejail --name=blablabla --overlay\r"
48expect {
49 timeout {puts "TESTING ERROR 4\n";exit}
50 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
51}
52sleep 2
53
54spawn $env(SHELL)
55send -- "firemon --seccomp\r"
56expect {
57 timeout {puts "TESTING ERROR 5\n";exit}
58 " firefox" {puts "firefox detected\n";}
59 " iceweasel" {puts "iceweasel detected\n";}
60}
61expect {
62 timeout {puts "TESTING ERROR 5.0\n";exit}
63 "no-remote"
64}
65expect {
66 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
67 "Seccomp: 2"
68}
69expect {
70 timeout {puts "TESTING ERROR 5.1\n";exit}
71 "name=blablabla"
72}
73after 100
74send -- "firemon --caps\r"
75expect {
76 timeout {puts "TESTING ERROR 6\n";exit}
77 " firefox" {puts "firefox detected\n";}
78 " iceweasel" {puts "iceweasel detected\n";}
79}
80expect {
81 timeout {puts "TESTING ERROR 6.0\n";exit}
82 "no-remote"
83}
84expect {
85 timeout {puts "TESTING ERROR 6.1\n";exit}
86 "CapBnd:"
87}
88expect {
89 timeout {puts "TESTING ERROR 6.2\n";exit}
90 "0000000000000000"
91}
92expect {
93 timeout {puts "TESTING ERROR 6.3\n";exit}
94 "name=blablabla"
95}
96after 100
97
98puts "\nall done\n"
diff --git a/test/overlay/fs-named.exp b/test/overlay/fs-named.exp
deleted file mode 100755
index 9e606183f..000000000
--- a/test/overlay/fs-named.exp
+++ /dev/null
@@ -1,72 +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 --overlay-named=firejail-test\r"
11expect {
12 timeout {puts "TESTING ERROR 2\n";exit}
13 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
14 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
15 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
16}
17sleep 1
18send -- "stty -echo\r"
19after 100
20
21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "done"
25}
26after 100
27
28send -- "cat ~/_firejail_test_file; echo done\r"
29expect {
30 timeout {puts "TESTING ERROR 4\n";exit}
31 "xyzxyzxyz"
32}
33expect {
34 timeout {puts "TESTING ERROR 4.1\n";exit}
35 "done"
36}
37after 100
38
39send -- "exit\r"
40sleep 2
41
42send -- "cat ~/_firejail_test_file; echo done\r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit}
46 "done"
47}
48after 100
49
50send -- "firejail --overlay-named=firejail-test\r"
51expect {
52 timeout {puts "TESTING ERROR 2\n";exit}
53 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
54 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
55 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
56}
57sleep 1
58
59send -- "stty -echo\r"
60after 100
61send -- "cat ~/_firejail_test_file; echo done\r"
62expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 "xyzxyzxyz"
65}
66expect {
67 timeout {puts "TESTING ERROR 4.1\n";exit}
68 "done"
69}
70after 100
71
72puts "\nall done\n"
diff --git a/test/overlay/fs-tmpfs.exp b/test/overlay/fs-tmpfs.exp
deleted file mode 100755
index 8c8ebcb16..000000000
--- a/test/overlay/fs-tmpfs.exp
+++ /dev/null
@@ -1,70 +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 --overlay-clean\r"
11after 100
12send -- "file ~/.firejail\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "cannot open"
16}
17after 100
18
19send -- "firejail --overlay-tmpfs\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
23 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
24 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
25}
26sleep 1
27send -- "stty -echo\r"
28after 100
29
30send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
31expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 "done"
34}
35after 100
36
37send -- "stty -echo\r"
38after 100
39send -- "cat ~/_firejail_test_file; echo done\r"
40expect {
41 timeout {puts "TESTING ERROR 3\n";exit}
42 "xyzxyzxyz"
43}
44expect {
45 timeout {puts "TESTING ERROR 4\n";exit}
46 "done"
47}
48after 100
49
50send -- "exit\r"
51sleep 1
52
53send -- "stty -echo\r"
54after 100
55send -- "cat ~/_firejail_test_file; echo done\r"
56expect {
57 timeout {puts "TESTING ERROR 5\n";exit}
58 "xyzxyzxyz" {puts "TESTING ERROR 6\n";exit}
59 "done"
60}
61after 100
62
63send -- "file ~/.firejail\r"
64expect {
65 timeout {puts "TESTING ERROR 7\n";exit}
66 "cannot open"
67}
68after 100
69
70puts "\nall done\n"
diff --git a/test/overlay/fs.exp b/test/overlay/fs.exp
deleted file mode 100755
index e078e604c..000000000
--- a/test/overlay/fs.exp
+++ /dev/null
@@ -1,62 +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 --overlay\r"
11expect {
12 timeout {puts "TESTING ERROR 2\n";exit}
13 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
14 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
15 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
16}
17sleep 1
18
19send -- "stty -echo\r"
20after 100
21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "done"
25}
26after 100
27
28send -- "stty -echo\r"
29after 100
30send -- "cat ~/_firejail_test_file; echo done\r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "xyzxyzxyz"
34}
35expect {
36 timeout {puts "TESTING ERROR 4.1\n";exit}
37 "done"
38}
39after 100
40
41send -- "exit\r"
42sleep 2
43
44send -- "stty -echo\r"
45after 100
46send -- "cat ~/_firejail_test_file; echo done\r"
47expect {
48 timeout {puts "TESTING ERROR 5\n";exit}
49 "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit}
50 "done"
51}
52after 100
53
54# check /sys directory
55send -- "ls /sys\r"
56expect {
57 timeout {puts "TESTING ERROR 6\n";exit}
58 "block"
59}
60after 100
61
62puts "\nall done\n"
diff --git a/test/overlay/overlay.sh b/test/overlay/overlay.sh
deleted file mode 100755
index 2015942d9..000000000
--- a/test/overlay/overlay.sh
+++ /dev/null
@@ -1,62 +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
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10echo "TESTING: overlay fs (test/overlay/fs.exp)"
11rm -fr ~/_firejail_test_*
12./fs.exp
13rm -fr ~/_firejail_test_*
14
15echo "TESTING: overlay named fs (test/overlay/fs-named.exp)"
16rm -fr ~/_firejail_test_*
17./fs-named.exp
18rm -fr ~/_firejail_test_*
19
20echo "TESTING: overlay tmpfs fs (test/overlay/fs-tmpfs.exp)"
21rm -fr ~/_firejail_test_*
22./fs-tmpfs.exp
23rm -fr ~/_firejail_test_*
24
25if command -v firefox
26then
27 echo "TESTING: overlay firefox"
28 ./firefox.exp
29else
30 echo "TESTING SKIP: firefox not found"
31fi
32
33if command -v firefox
34then
35 echo "TESTING: overlay firefox x11 xorg"
36 ./firefox.exp
37else
38 echo "TESTING SKIP: firefox not found"
39fi
40
41# check xpra/xephyr
42if command -v xpra
43then
44 echo "xpra found"
45else
46 echo "xpra not found"
47 if command -v Xephyr
48 then
49 echo "Xephyr found"
50 else
51 echo "TESTING SKIP: xpra and/or Xephyr not found"
52 exit
53 fi
54fi
55
56if command -v firefox
57then
58 echo "TESTING: overlay firefox x11"
59 ./firefox-x11.exp
60else
61 echo "TESTING SKIP: firefox not found"
62fi
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_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"
diff --git a/test/ssh/login.exp b/test/ssh/login.exp
deleted file mode 100755
index 0a05b2dd1..000000000
--- a/test/ssh/login.exp
+++ /dev/null
@@ -1,52 +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 -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "ps aux | wc -l\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "5"
22}
23after 100
24
25send -- "ls -l /home | grep drw | wc -l\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "1"
29}
30after 100
31
32send -- "cat /proc/self/status | grep Seccomp\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "2"
36}
37after 100
38
39send -- "cat /proc/self/status | grep CapBnd\r"
40expect {
41 timeout {puts "TESTING ERROR 4\n";exit}
42 "0000000000000000"
43}
44after 100
45
46# preparing scp/sftp tests
47send -- "rm testfile\r"
48
49send -- "exit\r"
50sleep 1
51
52puts "\nall done\n"
diff --git a/test/ssh/scp.exp b/test/ssh/scp.exp
deleted file mode 100755
index a803e7131..000000000
--- a/test/ssh/scp.exp
+++ /dev/null
@@ -1,66 +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 -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "rm -f testfile\r"
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "echo 12345 > testfile\r"
24after 100
25send -- "scp testfile firejail-test@0:~/testfile\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "100%"
29}
30sleep 1
31
32
33send -- "ssh firejail-test@0\r"
34expect {
35 timeout {puts "TESTING ERROR 2\n";exit}
36 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
37 "an existing sandbox was detected" {puts "OK\n"}
38}
39sleep 1
40send -- "cat testfile\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "12345"
44}
45after 100
46send -- "exit\r"
47sleep 1
48
49send -- "rm testfile\r"
50after 100
51send -- "scp firejail-test@0:~/testfile testfile\r"
52expect {
53 timeout {puts "TESTING ERROR 4\n";exit}
54 "100%"
55}
56sleep 1
57send -- "cat testfile\r"
58expect {
59 timeout {puts "TESTING ERROR 5\n";exit}
60 "12345"
61}
62after 100
63send -- "rm testfile\r"
64sleep 1
65
66puts "\nall done\n"
diff --git a/test/ssh/sftp.exp b/test/ssh/sftp.exp
deleted file mode 100755
index a3299ef26..000000000
--- a/test/ssh/sftp.exp
+++ /dev/null
@@ -1,90 +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 -- "ssh firejail-test@0\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
14 "an existing sandbox was detected" {puts "OK\n"}
15}
16sleep 1
17
18send -- "rm -f testfile\r"
19after 100
20send -- "exit\r"
21sleep 1
22
23send -- "echo 12345 > testfile\r"
24after 100
25send -- "sftp firejail-test@0\r"
26expect {
27 timeout {puts "TESTING ERROR 1\n";exit}
28 "Connected to 0"
29}
30expect {
31 timeout {puts "TESTING ERROR 2\n";exit}
32 "sftp>"
33}
34after 100
35send -- "put testfile\r"
36expect {
37 timeout {puts "TESTING ERROR 3\n";exit}
38 "100%"
39}
40after 100
41send -- "exit\r"
42sleep 1
43
44
45send -- "ssh firejail-test@0\r"
46expect {
47 timeout {puts "TESTING ERROR 4\n";exit}
48 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "OK\n"}
49 "an existing sandbox was detected" {puts "OK\n"}
50}
51sleep 1
52send -- "cat testfile\r"
53expect {
54 timeout {puts "TESTING ERROR 5\n";exit}
55 "12345"
56}
57after 100
58send -- "exit\r"
59sleep 1
60
61send -- "rm testfile\r"
62after 100
63send -- "sftp firejail-test@0\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 "Connected to 0"
67}
68expect {
69 timeout {puts "TESTING ERROR 7\n";exit}
70 "sftp>"
71}
72after 100
73send -- "get testfile\r"
74expect {
75 timeout {puts "TESTING ERROR 8\n";exit}
76 "100%"
77}
78after 100
79send -- "exit\r"
80sleep 1
81send -- "cat testfile\r"
82expect {
83 timeout {puts "TESTING ERROR 9\n";exit}
84 "12345"
85}
86after 100
87send -- "rm testfile\r"
88sleep 1
89
90puts "\nall done\n"
diff --git a/test/ssh/ssh.sh b/test/ssh/ssh.sh
deleted file mode 100755
index d9fedc969..000000000
--- a/test/ssh/ssh.sh
+++ /dev/null
@@ -1,17 +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
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10echo "TESTING: ssh login (test/ssh/login.exp)"
11./login.exp
12
13echo "TESTING: sftp (test/ssh/sftp.exp)"
14./sftp.exp
15
16echo "TESTING: scp (test/ssh/scp.exp)"
17./scp.exp
diff --git a/test/stress/blacklist.exp b/test/stress/blacklist.exp
deleted file mode 100755
index 3c6801b99..000000000
--- a/test/stress/blacklist.exp
+++ /dev/null
@@ -1,59 +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
10set MAXi 100
11
12# blacklist testing
13set i 1
14send -- "firejail --profile=blacklist.profile\r"
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
18}
19
20while { $i <= $MAXi } {
21 send -- "cat ~/fj-stress-test/testfile$i\r"
22 expect {
23 timeout {puts "TESTING ERROR 1\n";exit}
24 "denied"
25 }
26 incr i
27 after 100
28}
29after 100
30
31send -- "exit\r"
32sleep 1
33
34# noblacklist testing
35set i 1
36send -- "firejail --profile=noblacklist.profile\r"
37expect {
38 timeout {puts "TESTING ERROR 1\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41
42while { $i <= $MAXi } {
43 send -- "cat ~/fj-stress-test/testfile$i\r"
44 expect {
45 timeout {puts "TESTING ERROR 1\n";exit}
46 "hello"
47 }
48 incr i
49 after 100
50}
51after 100
52
53send -- "exit\r"
54sleep 1
55
56
57
58after 100
59puts "\nall done\n"
diff --git a/test/stress/env.exp b/test/stress/env.exp
deleted file mode 100755
index 66e2d8374..000000000
--- a/test/stress/env.exp
+++ /dev/null
@@ -1,31 +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# env testing
11send -- "firejail --profile=env.profile\r"
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
15}
16
17send -- "env | grep FJSTRESS77\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "FJSTRESS77=stress"
21}
22
23send -- "env | grep FJSTRESS | wc -l\r"
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "100"
27}
28
29send -- "exit\r"
30after 100
31puts "\nall done\n"
diff --git a/test/stress/net_macvlan.exp b/test/stress/net_macvlan.exp
deleted file mode 100755
index 6471979e9..000000000
--- a/test/stress/net_macvlan.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 10
7spawn $env(SHELL)
8match_max 100000
9
10# grab 10 ip addresses
11set MAXi 210
12set i 201
13while { $i <= $MAXi } {
14 spawn $env(SHELL)
15 send -- "firejail --net=eth0 --ip=192.168.1.$i\r"
16 expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
19 }
20 incr i
21 after 100
22}
23
24
25# grab 10 more
26set MAXi 210
27set i 201
28while { $i <= $MAXi } {
29 spawn $env(SHELL)
30 send -- "firejail --net=eth0 --iprange=192.168.1.201,192.168.1.220\r"
31 expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
34 }
35 puts "************ $i ******************\n"
36 incr i
37 after 100
38}
39
40# the next one should fail, all 20 addresses are in use
41spawn $env(SHELL)
42send -- "firejail --debug --net=eth0 --iprange=192.168.1.201,192.168.1.220\r"
43expect {
44 timeout {puts "TESTING ERROR 3\n";exit}
45 "cannot assign an IP address"
46}
47
48
49
50after 100
51puts "\nall done\n"
diff --git a/test/stress/stress.sh b/test/stress/stress.sh
deleted file mode 100755
index 9db7ac9d3..000000000
--- a/test/stress/stress.sh
+++ /dev/null
@@ -1,42 +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
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10
11# blacklist testing
12rm -fr ~/fj-stress-test
13mkdir ~/fj-stress-test
14rm blacklist.profile
15rm noblacklist.profile
16rm env.profile
17for i in {1..100}
18do
19 echo "hello" > ~/fj-stress-test/testfile$i
20 echo "blacklist ~/fj-stress-test/testfile$i" >> blacklist.profile
21 echo "blacklist \${PATH}/sh" >> blacklist.profile
22 echo "noblacklist ~/fj-stress-test/testfile$i" >> noblacklist.profile
23 echo "noblacklist \${PATH}/sh" >> noblacklist.profile
24 echo "env FJSTRESS$i=stress" >> env.profile
25done
26echo "include blacklist.profile" >> noblacklist.profile
27
28echo "TESTING: stress blacklist/noblacklist (/test/stress/blacklist.exp)"
29./blacklist.exp
30
31echo "TESTING: stress env (/test/stress/env.exp)"
32./env.exp
33
34rm -fr ~/fj-stress-test
35
36rm blacklist.profile
37rm noblacklist.profile
38rm env.profile
39
40# network arp testing
41echo "TESTING: macvlan (test/stress/net_macvlan.exp)"
42./net_macvlan.exp