diff options
author | netblue30 <netblue30@protonmail.com> | 2023-02-28 09:51:26 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-02-28 09:51:26 -0500 |
commit | 27c4d069f322fbeca07c88e0e96208233103a5db (patch) | |
tree | fb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test | |
parent | fix cppcheck/scan-build problems (diff) | |
download | firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip |
chroot testing
Diffstat (limited to 'test')
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) | |||
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | set appimage_id $spawn_id | 10 | set appimage_id $spawn_id |
11 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r" | 11 | send -- "firejail --name=test --debug --appimage Leafpad-0.8.17-x86_64.AppImage testfile\r" |
12 | expect { | 12 | expect { |
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 { | |||
91 | after 100 | 91 | after 100 |
92 | 92 | ||
93 | spawn $env(SHELL) | 93 | spawn $env(SHELL) |
94 | send -- "firejail --shutdown=appimage-test\r" | 94 | send -- "firejail --shutdown=test\r" |
95 | 95 | ||
96 | set spawn_id $appimage_id | 96 | set spawn_id $appimage_id |
97 | expect { | 97 | expect { |
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) | |||
8 | match_max 100000 | 8 | match_max 100000 |
9 | set appimage_id $spawn_id | 9 | set appimage_id $spawn_id |
10 | 10 | ||
11 | send -- "firejail --name=appimage-test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" | 11 | send -- "firejail --name=test --debug --appimage Leafpad-0.8.17-x86_64.AppImage\r" |
12 | expect { | 12 | expect { |
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 { | |||
79 | after 100 | 79 | after 100 |
80 | 80 | ||
81 | spawn $env(SHELL) | 81 | spawn $env(SHELL) |
82 | send -- "firejail --shutdown=appimage-test\r" | 82 | send -- "firejail --shutdown=test\r" |
83 | 83 | ||
84 | set spawn_id $appimage_id | 84 | set spawn_id $appimage_id |
85 | expect { | 85 | expect { |
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) | |||
8 | match_max 100000 | 8 | match_max 100000 |
9 | set appimage_id $spawn_id | 9 | set appimage_id $spawn_id |
10 | 10 | ||
11 | send -- "firejail --name=appimage-test --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" | 11 | send -- "firejail --name=test --appimage Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage\r" |
12 | expect { | 12 | expect { |
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 { | |||
79 | after 100 | 79 | after 100 |
80 | 80 | ||
81 | spawn $env(SHELL) | 81 | spawn $env(SHELL) |
82 | send -- "firejail --shutdown=appimage-test\r" | 82 | send -- "firejail --shutdown=test\r" |
83 | set spawn_id $appimage_id | 83 | set spawn_id $appimage_id |
84 | expect { | 84 | expect { |
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 | |||
11 | gcc -o unchroot unchroot.c | 11 | gcc -o unchroot unchroot.c |
12 | sudo ./configure | 12 | sudo ./configure |
13 | 13 | ||
14 | echo "TESTING: chroot disabled (test/chroot/fs_chroot_disabled.exp)" | ||
15 | ./fs_chroot_disabled.exp | ||
16 | |||
17 | sudo sed -i s/"# chroot no"/"chroot yes"/g /etc/firejail/firejail.config | ||
18 | |||
14 | echo "TESTING: chroot (test/chroot/fs_chroot.exp)" | 19 | echo "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 | |||
8 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files | 8 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files |
9 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " | 9 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " |
10 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc | 10 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc |
11 | DEFAULT_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" | 11 | DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/netstat /bin/ping /usr/bin/touch /bin/grep" |
12 | 12 | ||
13 | rm -fr $ROOTDIR | 13 | rm -fr $ROOTDIR |
14 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc,sys} | 14 | mkdir -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 | |||
10 | send -- "firejail --chroot=/tmp/chroot\r" | 10 | send -- "firejail --chroot=/tmp/chroot\r" |
11 | expect { | 11 | expect { |
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 | } |
16 | sleep 1 | 15 | sleep 1 |
17 | 16 | ||
18 | send -- "cd /home;pwd\r" | 17 | send -- "pwd\r" |
19 | expect { | 18 | expect { |
20 | timeout {puts "TESTING ERROR 0.1\n";exit} | 19 | timeout {puts "TESTING ERROR 1\n";exit} |
21 | "home" | 20 | "/home" |
22 | } | 21 | } |
23 | sleep 1 | 22 | after 100 |
24 | send -- "bash\r" | ||
25 | sleep 1 | ||
26 | send -- "ls /\r" | 23 | send -- "ls /\r" |
27 | expect { | 24 | expect { |
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 | } |
31 | after 100 | 28 | after 100 |
32 | 29 | ||
33 | send -- "ps aux\r" | 30 | send -- "ps aux\r" |
34 | expect { | 31 | expect { |
35 | timeout {puts "TESTING ERROR 1\n";exit} | 32 | timeout {puts "TESTING ERROR 3\n";exit} |
36 | "/bin/bash" | 33 | "/bin/bash" |
37 | } | 34 | } |
38 | expect { | 35 | expect { |
39 | timeout {puts "TESTING ERROR 2\n";exit} | 36 | timeout {puts "TESTING ERROR 4\n";exit} |
40 | "bash" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "ps aux" | 37 | "ps aux" |
45 | } | 38 | } |
46 | after 100 | 39 | after 100 |
47 | 40 | ||
48 | send -- "ps aux | wc -l; pwd\r" | 41 | # check /sys directory |
42 | send -- "ls /sys\r" | ||
49 | expect { | 43 | expect { |
50 | timeout {puts "TESTING ERROR 5\n";exit} | 44 | timeout {puts "TESTING ERROR 5\n";exit} |
51 | "6" | 45 | "block" |
52 | } | 46 | } |
53 | after 100 | ||
54 | |||
55 | # check /sys directory | ||
56 | send -- "ls /sys\r" | ||
57 | expect { | 47 | expect { |
58 | timeout {puts "TESTING ERROR 6\n";exit} | 48 | timeout {puts "TESTING ERROR 6\n";exit} |
59 | "block" | 49 | "class" |
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 7\n";exit} | ||
53 | "dev" | ||
60 | } | 54 | } |
61 | after 100 | 55 | after 100 |
62 | 56 | ||
57 | # check /bin directory | ||
58 | send -- "ls /bin/find\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 8\n";exit} | ||
61 | "No such file or directory" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "/bin/ping 1.1.1.1\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 9\n";exit} | ||
67 | "Operation not permitted" | ||
68 | } | ||
63 | 69 | ||
64 | puts "all done\n" | 70 | puts "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 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --bind=/tmp/chroot,mntpoint\r" | 10 | send -- "firejail --chroot=/tmp/chroot\r" |
11 | expect { | 11 | expect { |
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 | } |
15 | sleep 1 | 15 | sleep 1 |
16 | 16 | ||
17 | send -- "ls mntpoint;pwd\r" | 17 | puts "all done\n" |
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "root" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | puts "\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 | |||
22 | send -- "./unchroot\r" | 22 | send -- "./unchroot\r" |
23 | expect { | 23 | expect { |
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 | } |
27 | after 100 | 27 | after 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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /boot\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "Permission denied" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | # | ||
36 | # O | ||
37 | # | ||
38 | if { $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 | # | ||
60 | if { $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 | |||
79 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /selinux\r" | ||
26 | expect { | ||
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 | } | ||
31 | after 100 | ||
32 | send -- "exit\r" | ||
33 | sleep 1 | ||
34 | |||
35 | |||
36 | # | ||
37 | # O | ||
38 | # | ||
39 | if { $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 | # | ||
62 | if { $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 | |||
82 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "cat /proc/mounts | grep proc --color=never\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "proc /proc proc" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
32 | "proc /proc proc" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
36 | "proc /proc/sys proc" | ||
37 | } | ||
38 | expect { | ||
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 | #} | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
48 | "/proc/irq" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
52 | "/proc/bus" | ||
53 | } | ||
54 | after 100 | ||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | |||
58 | |||
59 | # | ||
60 | # O | ||
61 | # | ||
62 | if { $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 | # | ||
104 | if { $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 | |||
143 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /home | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "2" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "cat /etc/passwd | grep 1001 | wc -l\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
34 | "0" | ||
35 | } | ||
36 | after 100 | ||
37 | send -- "cat /etc/group | grep 1001 | wc -l\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
40 | "0" | ||
41 | } | ||
42 | after 100 | ||
43 | |||
44 | send -- "exit\r" | ||
45 | sleep 1 | ||
46 | |||
47 | |||
48 | # | ||
49 | # O | ||
50 | # | ||
51 | if { $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 | # | ||
85 | if { $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 | |||
116 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ps aux | wc -l \r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "5" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | # | ||
36 | # O | ||
37 | # | ||
38 | if { $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 | # | ||
60 | if { $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 | |||
79 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /var/log/syslog | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "0" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | # | ||
36 | # O | ||
37 | # | ||
38 | if { $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 | # | ||
60 | if { $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 | |||
79 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "touch /var/tmp/somefile\r" | ||
19 | sleep 1 | ||
20 | send -- "firejail --noprofile\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 0\n";exit} | ||
23 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
24 | } | ||
25 | sleep 1 | ||
26 | |||
27 | send -- "ls -l /var/tmp/somefile | wc -l\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1\n";exit} | ||
30 | "0" | ||
31 | } | ||
32 | after 100 | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | |||
37 | # | ||
38 | # O | ||
39 | # | ||
40 | if { $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 | # | ||
62 | if { $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 | |||
81 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | sleep 1 | ||
19 | send -- "firejail --noprofile\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "ls ~/.config/firejail\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
29 | "Permission denied" | ||
30 | } | ||
31 | after 100 | ||
32 | send -- "ls /run/firejail/bandwidth\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
35 | "Permission denied" | ||
36 | } | ||
37 | after 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 | ||
44 | send -- "ls /run/firejail/name\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
47 | "Permission denied" | ||
48 | } | ||
49 | after 100 | ||
50 | send -- "ls /run/firejail/network\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
53 | "Permission denied" | ||
54 | } | ||
55 | after 100 | ||
56 | send -- "ls /run/firejail/x11\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
59 | "Permission denied" | ||
60 | } | ||
61 | after 100 | ||
62 | send -- "exit\r" | ||
63 | sleep 1 | ||
64 | |||
65 | |||
66 | # | ||
67 | # O | ||
68 | # | ||
69 | if { $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 | # | ||
121 | if { $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 | |||
169 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --hostname=bingo\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "hostname\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "bingo" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "cat /etc/hostname\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.0\n";exit} | ||
34 | "bingo" | ||
35 | } | ||
36 | after 100 | ||
37 | send -- "getent hosts bingo\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
40 | "127.0.0.1" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
44 | "bingo" | ||
45 | } | ||
46 | after 100 | ||
47 | send -- "exit\r" | ||
48 | sleep 1 | ||
49 | |||
50 | |||
51 | # | ||
52 | # O | ||
53 | # | ||
54 | if { $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 | # | ||
92 | if { $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 | |||
127 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --dns=4.2.2.1\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "dig google.com\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "ANSWER SECTION" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
32 | "google.com" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
36 | "SERVER: 4.2.2.1" | ||
37 | } | ||
38 | after 100 | ||
39 | send -- "exit\r" | ||
40 | sleep 1 | ||
41 | |||
42 | |||
43 | # | ||
44 | # O | ||
45 | # | ||
46 | if { $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 | # | ||
76 | if { $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 | |||
103 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --net=eth0 --dns=8.8.8.8 --dns=8.8.4.4\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "dig google.com\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "ANSWER SECTION" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
32 | "google.com" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
36 | "SERVER:" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "/sbin/ifconfig\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
43 | "eth0" | ||
44 | } | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
47 | "Link" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
51 | "192.168.1" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
55 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
56 | } | ||
57 | after 100 | ||
58 | |||
59 | send -- "exit\r" | ||
60 | sleep 3 | ||
61 | |||
62 | send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --dns=8.8.8.8 --dns=8.8.4.4\r" | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 0\n";exit} | ||
65 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
66 | } | ||
67 | sleep 1 | ||
68 | |||
69 | send -- "dig google.com\r" | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 1\n";exit} | ||
72 | "ANSWER SECTION" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
76 | "google.com" | ||
77 | } | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
80 | "SERVER:" | ||
81 | } | ||
82 | after 100 | ||
83 | |||
84 | send -- "/sbin/ifconfig\r" | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
87 | "eth0" | ||
88 | } | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
91 | "Link" | ||
92 | } | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
95 | "192.168.1.244" | ||
96 | } | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
99 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
100 | } | ||
101 | after 100 | ||
102 | |||
103 | send -- "exit\r" | ||
104 | sleep 3 | ||
105 | |||
106 | # | ||
107 | # O | ||
108 | # | ||
109 | if { $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 | # | ||
204 | if { $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 | |||
295 | puts "\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 | |||
10 | set timeout 10 | ||
11 | spawn $env(SHELL) | ||
12 | match_max 100000 | ||
13 | set overlay [lindex $argv 0] | ||
14 | set chroot [lindex $argv 1] | ||
15 | |||
16 | # | ||
17 | # N | ||
18 | # | ||
19 | send -- "firejail --noprofile --net=br0\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "ping -c 3 10.10.20.1\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1\n";exit} | ||
29 | " packets transmitted, 3 received, 0% packet loss" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | |||
34 | send -- "/sbin/ifconfig\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
37 | "eth0" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
41 | "Link" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
45 | "10.10.20" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
49 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
50 | } | ||
51 | after 100 | ||
52 | |||
53 | send -- "exit\r" | ||
54 | sleep 1 | ||
55 | |||
56 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 0\n";exit} | ||
59 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
60 | } | ||
61 | sleep 1 | ||
62 | |||
63 | send -- "ping -c 3 10.10.20.1\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 1\n";exit} | ||
66 | " packets transmitted, 3 received, 0% packet loss" | ||
67 | } | ||
68 | sleep 1 | ||
69 | |||
70 | |||
71 | send -- "/sbin/ifconfig\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
74 | "eth0" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
78 | "Link" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
82 | "10.10.20.4" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
86 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
87 | } | ||
88 | after 100 | ||
89 | |||
90 | send -- "exit\r" | ||
91 | sleep 1 | ||
92 | |||
93 | |||
94 | # | ||
95 | # O | ||
96 | # | ||
97 | if { $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 | # | ||
178 | if { $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 | |||
239 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --interface=eth0.5\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "/sbin/ifconfig\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
28 | "eth0.5" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
32 | "Link" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
36 | "10.10.205.10" | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
40 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
41 | } | ||
42 | after 100 | ||
43 | send -- "exit\r" | ||
44 | sleep 1 | ||
45 | |||
46 | # | ||
47 | # O | ||
48 | # | ||
49 | if { $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 | # | ||
83 | if { $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 | |||
114 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --net=eth0 --defaultgw=192.168.1.10 --protocol=unix,inet,netlink\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ip route show\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "default via 192.168.1.10 dev eth0" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | # | ||
35 | # O | ||
36 | # | ||
37 | if { $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 | # | ||
59 | if { $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 | |||
77 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --private\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -al | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "6" | ||
29 | } | ||
30 | |||
31 | send -- "ls -al .bashrc\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
34 | "netblue" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
38 | "netblue" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
42 | ".bashrc" | ||
43 | } | ||
44 | |||
45 | send -- "ls -al .Xauthority\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
48 | "netblue" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
52 | "netblue" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
56 | ".Xauthority" | ||
57 | } | ||
58 | |||
59 | |||
60 | |||
61 | after 100 | ||
62 | send -- "exit\r" | ||
63 | sleep 1 | ||
64 | |||
65 | # | ||
66 | # O | ||
67 | # | ||
68 | if { $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 | # | ||
119 | if { $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 | |||
167 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "mkdir /tmp/test1dir\r" | ||
19 | sleep 1 | ||
20 | send -- "touch /tmp/test1dir/test1\r" | ||
21 | sleep 1 | ||
22 | send -- "firejail --noprofile --whitelist=/tmp/test1dir\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 0\n";exit} | ||
25 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
26 | } | ||
27 | sleep 1 | ||
28 | |||
29 | send -- "ls -l /tmp | wc -l\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
32 | "2" | ||
33 | } | ||
34 | send -- "ls -l /tmp\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
37 | "netblue" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
41 | "netblue" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
45 | "test1dir" | ||
46 | } | ||
47 | |||
48 | send -- "ls -l /tmp/test1dir | wc -l\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
51 | "2" | ||
52 | } | ||
53 | send -- "ls -l /tmp/test1dir\r" | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
56 | "netblue" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
60 | "netblue" | ||
61 | } | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 1.8\n";exit} | ||
64 | "test1" | ||
65 | } | ||
66 | |||
67 | |||
68 | after 100 | ||
69 | send -- "exit\r" | ||
70 | sleep 1 | ||
71 | |||
72 | |||
73 | # | ||
74 | # O | ||
75 | # | ||
76 | if { $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 | # | ||
131 | if { $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 | |||
187 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "rm -fr ~/firejail-xy76_u9\r" | ||
19 | sleep 1 | ||
20 | |||
21 | send -- "firejail --profile=3.11.profile\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 0\n";exit} | ||
24 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
25 | } | ||
26 | sleep 1 | ||
27 | |||
28 | send -- "ls -l ~ | grep firejail-xy76_u9\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 1\n";exit} | ||
31 | "drwx------" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 2\n";exit} | ||
35 | "netblue netblue" { puts "Debian\n"} | ||
36 | "netblue users" { puts "Arch\n"} | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 3\n";exit} | ||
40 | "firejail-xy76_u9" | ||
41 | } | ||
42 | after 100 | ||
43 | |||
44 | send -- "ls -l ~/firejail-xy76_u9\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 4\n";exit} | ||
47 | "drwx------" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 5\n";exit} | ||
51 | "netblue netblue" { puts "Debian\n"} | ||
52 | "netblue users" { puts "Arch\n"} | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 6\n";exit} | ||
56 | "testdir" | ||
57 | } | ||
58 | after 100 | ||
59 | |||
60 | send -- "exit\r" | ||
61 | sleep 1 | ||
62 | send -- "rm -fr ~/firejail-xy76_u9\r" | ||
63 | sleep 1 | ||
64 | |||
65 | # | ||
66 | # O | ||
67 | # | ||
68 | if { $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 | # | ||
123 | if { $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 | |||
174 | puts "\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 @@ | |||
1 | mkdir ~/firejail-xy76_u9 | ||
2 | mkdir ~/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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "rm -f ~/.config/firejail-test-file\r" | ||
19 | sleep 1 | ||
20 | send -- "firejail --noprofile --read-only=/home/netblue/.config\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 0\n";exit} | ||
23 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
24 | } | ||
25 | sleep 1 | ||
26 | |||
27 | send -- "touch ~/.config/firejail-test-file\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1\n";exit} | ||
30 | "Read-only file system" | ||
31 | } | ||
32 | after 100 | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | # | ||
37 | # O | ||
38 | # | ||
39 | if { $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 | # | ||
61 | if { $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 | |||
82 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --blacklist=/home/netblue/.config\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "cd ~/.config\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "Permission denied" | ||
29 | } | ||
30 | after 100 | ||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | # | ||
36 | # O | ||
37 | # | ||
38 | if { $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 | # | ||
60 | if { $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 | |||
78 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --whitelist=/home/netblue/.config\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -al | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "6" | ||
29 | } | ||
30 | |||
31 | send -- "ls -al .bashrc\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
34 | "netblue" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
38 | "netblue" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
42 | ".bashrc" | ||
43 | } | ||
44 | |||
45 | send -- "ls -al .Xauthority\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
48 | "netblue" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
52 | "netblue" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
56 | ".Xauthority" | ||
57 | } | ||
58 | |||
59 | send -- "ls -al | grep .config\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 1.8\n";exit} | ||
62 | "netblue" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 1.9\n";exit} | ||
66 | "netblue" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 1.10\n";exit} | ||
70 | ".config" | ||
71 | } | ||
72 | |||
73 | after 100 | ||
74 | send -- "exit\r" | ||
75 | sleep 1 | ||
76 | |||
77 | |||
78 | # | ||
79 | # O | ||
80 | # | ||
81 | if { $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 | # | ||
146 | if { $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 | |||
208 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --private-dev\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /dev | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "13" { puts "Debian\n"} | ||
29 | "12" { puts "Centos\n"} | ||
30 | } | ||
31 | |||
32 | after 100 | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | # | ||
37 | # O | ||
38 | # | ||
39 | if { $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 | # | ||
63 | if { $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 | |||
83 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --private-etc=group,hostname,hosts,nsswitch.conf,passwd,resolv.conf,skel\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -al /etc | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "10" | ||
29 | } | ||
30 | |||
31 | after 100 | ||
32 | send -- "exit\r" | ||
33 | sleep 1 | ||
34 | |||
35 | # | ||
36 | # O | ||
37 | # | ||
38 | if { $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 | # | ||
61 | if { $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 | |||
87 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "touch /tmp/test1\r" | ||
19 | sleep 1 | ||
20 | send -- "touch /tmp/test2\r" | ||
21 | sleep 1 | ||
22 | send -- "firejail --noprofile --private-tmp\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 0\n";exit} | ||
25 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
26 | } | ||
27 | sleep 1 | ||
28 | |||
29 | send -- "ls -al /tmp | wc -l\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
32 | "3" | ||
33 | } | ||
34 | |||
35 | |||
36 | after 100 | ||
37 | send -- "exit\r" | ||
38 | sleep 1 | ||
39 | |||
40 | # | ||
41 | # O | ||
42 | # | ||
43 | if { $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 | # | ||
71 | if { $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 | |||
95 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --private-bin=bash,cat,cp,ls,wc\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /usr/bin | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "6" | ||
29 | } | ||
30 | |||
31 | |||
32 | after 100 | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | # | ||
37 | # O | ||
38 | # | ||
39 | if { $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 | # | ||
63 | if { $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 | |||
87 | puts "\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 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --whitelist=/dev/tty --whitelist=/dev/null\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -l /dev | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "3" | ||
29 | } | ||
30 | |||
31 | |||
32 | after 100 | ||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | |||
37 | # | ||
38 | # O | ||
39 | # | ||
40 | if { $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 | # | ||
64 | if { $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 | |||
84 | puts "\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 @@ | |||
1 | Firejail Feature Testing | ||
2 | |||
3 | N - normal user filesystem | ||
4 | O - overlay filesystem | ||
5 | C - chroot filesystem | ||
6 | |||
7 | |||
8 | |||
9 | 1. Default features (tesing with --noprofile) | ||
10 | |||
11 | 1.1 disable /boot | ||
12 | 1.2 new /proc | ||
13 | 1.3 new /sys | ||
14 | - N, O fails remount, C fails remount | ||
15 | |||
16 | 1.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 | |||
21 | 1.5 PID namespace | ||
22 | 1.6 new /var/log | ||
23 | 1.7 new /var/tmp | ||
24 | 1.8 disable firejail config and run time information | ||
25 | 1.9 mount namespace | ||
26 | 1.10 disable /selinux | ||
27 | |||
28 | |||
29 | 2. Networking features | ||
30 | |||
31 | 2.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 | |||
34 | 2.2 DNS (use --dns=4.2.2.1, use "dig google.com") | ||
35 | 2.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com) | ||
36 | 2.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 | ||
38 | 2.5 interface | ||
39 | 2.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) | ||
40 | |||
41 | |||
42 | 3. Filesystem features (use --noprofile) | ||
43 | |||
44 | 3.1 private | ||
45 | 3.2 read-only | ||
46 | 3.3 blacklist | ||
47 | 3.4 whitelist home | ||
48 | - N braking on Fedora | ||
49 | 3.5 private-dev | ||
50 | - O, C - somehow /dev/log is missing | ||
51 | - N - problems on Debian wheezy 32-bit, Fedora | ||
52 | 3.6 private-etc | ||
53 | - O not working - todo | ||
54 | 3.7 private-tmp | ||
55 | 3.8 private-bin | ||
56 | - O, C not working - todo | ||
57 | 3.9 whitelist dev | ||
58 | - N not working on Debian wheezy (32-bit and 64-bit) - todo | ||
59 | 3.10 whitelist tmp | ||
60 | - O not working on Arch Linux - todo | ||
61 | 3.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 | |||
6 | export LC_ALL=C | ||
7 | OVERLAY="overlay" | ||
8 | CHROOT="chroot" | ||
9 | NETWORK="network" | ||
10 | |||
11 | while [[ $# -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. | ||
28 | done | ||
29 | |||
30 | # | ||
31 | # Feature testing | ||
32 | # | ||
33 | |||
34 | #################### | ||
35 | # Default features | ||
36 | #################### | ||
37 | echo "TESTING: 1.1 disable /boot" | ||
38 | ./1.1.exp "$OVERLAY" "$CHROOT" | ||
39 | |||
40 | echo "TESTING: 1.2 new /proc" | ||
41 | ./1.2.exp "$OVERLAY" "$CHROOT" | ||
42 | |||
43 | echo "TESTING: 1.4 mask other users" | ||
44 | ./1.4.exp "$OVERLAY" "$CHROOT" | ||
45 | |||
46 | echo "TESTING: 1.5 PID namespace" | ||
47 | ./1.5.exp "$OVERLAY" "$CHROOT" | ||
48 | |||
49 | echo "TESTING: 1.6 new /var/log" | ||
50 | ./1.6.exp "$OVERLAY" "$CHROOT" | ||
51 | |||
52 | echo "TESTING: 1.7 new /var/tmp" | ||
53 | ./1.7.exp "$OVERLAY" "$CHROOT" | ||
54 | |||
55 | echo "TESTING: 1.8 disable firejail config and run time information" | ||
56 | ./1.8.exp "$OVERLAY" "$CHROOT" | ||
57 | |||
58 | echo "TESTING: 1.10 disable /selinux" | ||
59 | ./1.10.exp "$OVERLAY" "$CHROOT" | ||
60 | |||
61 | #################### | ||
62 | # networking features | ||
63 | #################### | ||
64 | if [[ $NETWORK == "network" ]] | ||
65 | then | ||
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" | ||
83 | fi | ||
84 | |||
85 | #################### | ||
86 | # filesystem features | ||
87 | #################### | ||
88 | echo "TESTING: 3.1 private (fails on OpenSUSE)" | ||
89 | ./3.1.exp "$OVERLAY" "$CHROOT" | ||
90 | |||
91 | echo "TESTING: 3.2 read-only" | ||
92 | ./3.2.exp "$OVERLAY" "$CHROOT" | ||
93 | |||
94 | echo "TESTING: 3.3 blacklist" | ||
95 | ./3.3.exp "$OVERLAY" "$CHROOT" | ||
96 | |||
97 | echo "TESTING: 3.4 whitelist home (fails on OpenSUSE)" | ||
98 | ./3.4.exp "$OVERLAY" "$CHROOT" | ||
99 | |||
100 | echo "TESTING: 3.5 private-dev" | ||
101 | ./3.5.exp "$OVERLAY" "$CHROOT" | ||
102 | |||
103 | echo "TESTING: 3.6 private-etc" | ||
104 | ./3.6.exp notworking "$CHROOT" | ||
105 | |||
106 | echo "TESTING: 3.7 private-tmp" | ||
107 | ./3.7.exp "$OVERLAY" "$CHROOT" | ||
108 | |||
109 | echo "TESTING: 3.8 private-bin" | ||
110 | ./3.8.exp notworking notworking | ||
111 | |||
112 | echo "TESTING: 3.9 whitelist dev" | ||
113 | ./3.9.exp "$OVERLAY" "$CHROOT" | ||
114 | |||
115 | echo "TESTING: 3.10 whitelist tmp" | ||
116 | ./3.10.exp "$OVERLAY" "$CHROOT" | ||
117 | |||
118 | echo "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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay --name=test --x11=xorg firefox -no-remote www.gentoo.org\r" | ||
11 | sleep 10 | ||
12 | |||
13 | spawn $env(SHELL) | ||
14 | send -- "firejail --list\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 3\n";exit} | ||
17 | ":firejail" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
21 | "firefox" {puts "firefox detected\n";} | ||
22 | "iceweasel" {puts "iceweasel detected\n";} | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
26 | "no-remote" | ||
27 | } | ||
28 | sleep 1 | ||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
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 | } | ||
36 | send -- "firejail --overlay --name=blablabla\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
40 | } | ||
41 | sleep 2 | ||
42 | |||
43 | spawn $env(SHELL) | ||
44 | send -- "firemon --seccomp\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 5\n";exit} | ||
47 | " firefox" {puts "firefox detected\n";} | ||
48 | " iceweasel" {puts "iceweasel detected\n";} | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
52 | "no-remote" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
56 | "Seccomp: 2" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
60 | "name=blablabla" | ||
61 | } | ||
62 | sleep 1 | ||
63 | send -- "firemon --caps\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 6\n";exit} | ||
66 | " firefox" {puts "firefox detected\n";} | ||
67 | " iceweasel" {puts "iceweasel detected\n";} | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
71 | "no-remote" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
75 | "CapBnd:" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
79 | "0000000000000000" | ||
80 | } | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
83 | "name=blablabla" | ||
84 | } | ||
85 | sleep 1 | ||
86 | send -- "firejail --shutdown=test\r" | ||
87 | sleep 3 | ||
88 | |||
89 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay --name=test --x11 firefox -no-remote www.gentoo.org\r" | ||
11 | sleep 10 | ||
12 | |||
13 | spawn $env(SHELL) | ||
14 | send -- "firejail --list\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 3\n";exit} | ||
17 | ":firejail" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
21 | "firefox" {puts "firefox detected\n";} | ||
22 | "iceweasel" {puts "iceweasel detected\n";} | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
26 | "no-remote" | ||
27 | } | ||
28 | sleep 1 | ||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
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 | } | ||
36 | send -- "firejail --name=blablabla --overlay\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
40 | } | ||
41 | sleep 2 | ||
42 | |||
43 | spawn $env(SHELL) | ||
44 | send -- "firemon --seccomp\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 5\n";exit} | ||
47 | " firefox" {puts "firefox detected\n";} | ||
48 | " iceweasel" {puts "iceweasel detected\n";} | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
52 | "no-remote" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
56 | "Seccomp: 2" | ||
57 | } | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
60 | "name=blablabla" | ||
61 | } | ||
62 | sleep 1 | ||
63 | send -- "firemon --caps\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 6\n";exit} | ||
66 | " firefox" {puts "firefox detected\n";} | ||
67 | " iceweasel" {puts "iceweasel detected\n";} | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
71 | "no-remote" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
75 | "CapBnd:" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
79 | "0000000000000000" | ||
80 | } | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
83 | "name=blablabla" | ||
84 | } | ||
85 | sleep 1 | ||
86 | send -- "firejail --shutdown=test\r" | ||
87 | sleep 3 | ||
88 | |||
89 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay firefox -no-remote www.gentoo.org\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Reading profile /etc/firejail/firefox.profile" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
18 | } | ||
19 | sleep 10 | ||
20 | |||
21 | spawn $env(SHELL) | ||
22 | send -- "firejail --list\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | ":firejail" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "firefox" {puts "firefox detected\n";} | ||
30 | "iceweasel" {puts "iceweasel detected\n";} | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
34 | "no-remote" | ||
35 | } | ||
36 | after 100 | ||
37 | |||
38 | # grsecurity exit | ||
39 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
40 | expect { | ||
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 | |||
47 | send -- "firejail --name=blablabla --overlay\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 4\n";exit} | ||
50 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
51 | } | ||
52 | sleep 2 | ||
53 | |||
54 | spawn $env(SHELL) | ||
55 | send -- "firemon --seccomp\r" | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5\n";exit} | ||
58 | " firefox" {puts "firefox detected\n";} | ||
59 | " iceweasel" {puts "iceweasel detected\n";} | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
63 | "no-remote" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
67 | "Seccomp: 2" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
71 | "name=blablabla" | ||
72 | } | ||
73 | after 100 | ||
74 | send -- "firemon --caps\r" | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 6\n";exit} | ||
77 | " firefox" {puts "firefox detected\n";} | ||
78 | " iceweasel" {puts "iceweasel detected\n";} | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
82 | "no-remote" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
86 | "CapBnd:" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
90 | "0000000000000000" | ||
91 | } | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
94 | "name=blablabla" | ||
95 | } | ||
96 | after 100 | ||
97 | |||
98 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay-named=firejail-test\r" | ||
11 | expect { | ||
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 | } | ||
17 | sleep 1 | ||
18 | send -- "stty -echo\r" | ||
19 | after 100 | ||
20 | |||
21 | send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 3\n";exit} | ||
24 | "done" | ||
25 | } | ||
26 | after 100 | ||
27 | |||
28 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 4\n";exit} | ||
31 | "xyzxyzxyz" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
35 | "done" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "exit\r" | ||
40 | sleep 2 | ||
41 | |||
42 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5\n";exit} | ||
45 | "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit} | ||
46 | "done" | ||
47 | } | ||
48 | after 100 | ||
49 | |||
50 | send -- "firejail --overlay-named=firejail-test\r" | ||
51 | expect { | ||
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 | } | ||
57 | sleep 1 | ||
58 | |||
59 | send -- "stty -echo\r" | ||
60 | after 100 | ||
61 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 4\n";exit} | ||
64 | "xyzxyzxyz" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
68 | "done" | ||
69 | } | ||
70 | after 100 | ||
71 | |||
72 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay-clean\r" | ||
11 | after 100 | ||
12 | send -- "file ~/.firejail\r" | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 0\n";exit} | ||
15 | "cannot open" | ||
16 | } | ||
17 | after 100 | ||
18 | |||
19 | send -- "firejail --overlay-tmpfs\r" | ||
20 | expect { | ||
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 | } | ||
26 | sleep 1 | ||
27 | send -- "stty -echo\r" | ||
28 | after 100 | ||
29 | |||
30 | send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 2\n";exit} | ||
33 | "done" | ||
34 | } | ||
35 | after 100 | ||
36 | |||
37 | send -- "stty -echo\r" | ||
38 | after 100 | ||
39 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 3\n";exit} | ||
42 | "xyzxyzxyz" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 4\n";exit} | ||
46 | "done" | ||
47 | } | ||
48 | after 100 | ||
49 | |||
50 | send -- "exit\r" | ||
51 | sleep 1 | ||
52 | |||
53 | send -- "stty -echo\r" | ||
54 | after 100 | ||
55 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5\n";exit} | ||
58 | "xyzxyzxyz" {puts "TESTING ERROR 6\n";exit} | ||
59 | "done" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | send -- "file ~/.firejail\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 7\n";exit} | ||
66 | "cannot open" | ||
67 | } | ||
68 | after 100 | ||
69 | |||
70 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --overlay\r" | ||
11 | expect { | ||
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 | } | ||
17 | sleep 1 | ||
18 | |||
19 | send -- "stty -echo\r" | ||
20 | after 100 | ||
21 | send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 3\n";exit} | ||
24 | "done" | ||
25 | } | ||
26 | after 100 | ||
27 | |||
28 | send -- "stty -echo\r" | ||
29 | after 100 | ||
30 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 4\n";exit} | ||
33 | "xyzxyzxyz" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
37 | "done" | ||
38 | } | ||
39 | after 100 | ||
40 | |||
41 | send -- "exit\r" | ||
42 | sleep 2 | ||
43 | |||
44 | send -- "stty -echo\r" | ||
45 | after 100 | ||
46 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5\n";exit} | ||
49 | "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit} | ||
50 | "done" | ||
51 | } | ||
52 | after 100 | ||
53 | |||
54 | # check /sys directory | ||
55 | send -- "ls /sys\r" | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 6\n";exit} | ||
58 | "block" | ||
59 | } | ||
60 | after 100 | ||
61 | |||
62 | puts "\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 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | export LC_ALL=C | ||
9 | |||
10 | echo "TESTING: overlay fs (test/overlay/fs.exp)" | ||
11 | rm -fr ~/_firejail_test_* | ||
12 | ./fs.exp | ||
13 | rm -fr ~/_firejail_test_* | ||
14 | |||
15 | echo "TESTING: overlay named fs (test/overlay/fs-named.exp)" | ||
16 | rm -fr ~/_firejail_test_* | ||
17 | ./fs-named.exp | ||
18 | rm -fr ~/_firejail_test_* | ||
19 | |||
20 | echo "TESTING: overlay tmpfs fs (test/overlay/fs-tmpfs.exp)" | ||
21 | rm -fr ~/_firejail_test_* | ||
22 | ./fs-tmpfs.exp | ||
23 | rm -fr ~/_firejail_test_* | ||
24 | |||
25 | if command -v firefox | ||
26 | then | ||
27 | echo "TESTING: overlay firefox" | ||
28 | ./firefox.exp | ||
29 | else | ||
30 | echo "TESTING SKIP: firefox not found" | ||
31 | fi | ||
32 | |||
33 | if command -v firefox | ||
34 | then | ||
35 | echo "TESTING: overlay firefox x11 xorg" | ||
36 | ./firefox.exp | ||
37 | else | ||
38 | echo "TESTING SKIP: firefox not found" | ||
39 | fi | ||
40 | |||
41 | # check xpra/xephyr | ||
42 | if command -v xpra | ||
43 | then | ||
44 | echo "xpra found" | ||
45 | else | ||
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 | ||
54 | fi | ||
55 | |||
56 | if command -v firefox | ||
57 | then | ||
58 | echo "TESTING: overlay firefox x11" | ||
59 | ./firefox-x11.exp | ||
60 | else | ||
61 | echo "TESTING SKIP: firefox not found" | ||
62 | fi | ||
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 | |||
6 | set timeout 5 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=apache /etc/init.d/apache2 start\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --tree\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "root:apache:firejail --name=apache /etc/init.d/apache2" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "www-data::/usr/sbin/apache2" | ||
27 | } | ||
28 | sleep 2 | ||
29 | |||
30 | |||
31 | send -- "rm index.html\r" | ||
32 | sleep 1 | ||
33 | send -- "wget 127.0.0.1\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 3\n";exit} | ||
36 | "saved" | ||
37 | } | ||
38 | send -- "cat index.html\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "DOCTYPE html PUBLIC" | ||
42 | } | ||
43 | |||
44 | sleep 1 | ||
45 | send -- "rm index.html\r" | ||
46 | |||
47 | send -- "firejail --join=apache\r" | ||
48 | sleep 2 | ||
49 | |||
50 | send -- "ls /dev\r" | ||
51 | expect { | ||
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 | } | ||
59 | sleep 1 | ||
60 | send -- "ls -al /tmp;pwd\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 10\n";exit} | ||
63 | "X11-unix" {puts "TESTING ERROR 11\n";exit} | ||
64 | "/root" | ||
65 | } | ||
66 | sleep 2 | ||
67 | |||
68 | puts "\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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "rm /etc/firejail/firejail.config\r" | ||
12 | after 100 | ||
13 | |||
14 | send -- "firejail\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "firejail.config not found" | ||
18 | } | ||
19 | |||
20 | # seccomp | ||
21 | send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r" | ||
22 | after 100 | ||
23 | send -- "firejail --noprofile --seccomp\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "seccomp feature is disabled in Firejail configuration file\r" | ||
27 | } | ||
28 | |||
29 | # whitelist | ||
30 | send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r" | ||
31 | after 100 | ||
32 | send -- "firejail --noprofile --whitelist=~/.config\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "whitelist feature is disabled in Firejail configuration file\r" | ||
36 | } | ||
37 | |||
38 | # network | ||
39 | send -- "echo \"network no\" > /etc/firejail/firejail.config\r" | ||
40 | after 100 | ||
41 | send -- "firejail --noprofile --net=eth0\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "networking feature is disabled in Firejail configuration file\r" | ||
45 | } | ||
46 | |||
47 | # bind | ||
48 | send -- "echo \"bind no\" > /etc/firejail/firejail.config\r" | ||
49 | after 100 | ||
50 | send -- "firejail --noprofile --bind=/tmp,/var/tmp\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 5\n";exit} | ||
53 | "bind feature is disabled in Firejail configuration file\r" | ||
54 | } | ||
55 | |||
56 | # overlay | ||
57 | send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r" | ||
58 | after 100 | ||
59 | send -- "firejail --noprofile --overlay\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 6\n";exit} | ||
62 | "overlayfs feature is disabled in Firejail configuration file\r" | ||
63 | } | ||
64 | |||
65 | # private-home | ||
66 | send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r" | ||
67 | after 100 | ||
68 | send -- "firejail --noprofile --private-home=/tmp\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 7\n";exit} | ||
71 | "private-home feature is disabled in Firejail configuration file\r" | ||
72 | } | ||
73 | |||
74 | # chroot | ||
75 | send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r" | ||
76 | after 100 | ||
77 | send -- "firejail --noprofile --chroot=/tmp\r" | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 8\n";exit} | ||
80 | "chroot feature is disabled in Firejail configuration file\r" | ||
81 | } | ||
82 | |||
83 | # userns | ||
84 | send -- "echo \"userns no\" > /etc/firejail/firejail.config\r" | ||
85 | after 100 | ||
86 | send -- "firejail --noprofile --noroot\r" | ||
87 | expect { | ||
88 | timeout {puts "TESTING ERROR 9\n";exit} | ||
89 | "noroot feature is disabled in Firejail configuration file\r" | ||
90 | } | ||
91 | sleep 1 | ||
92 | |||
93 | # netfilter-default | ||
94 | send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r" | ||
95 | after 100 | ||
96 | send -- "firejail --noprofile\r" | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 10\n";exit} | ||
99 | "netfilter-default file blablabla not available\r" | ||
100 | } | ||
101 | after 100 | ||
102 | |||
103 | # strings | ||
104 | send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r" | ||
105 | after 100 | ||
106 | send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r" | ||
107 | after 100 | ||
108 | send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r" | ||
109 | sleep 1 | ||
110 | send -- "stty -echo\r" | ||
111 | after 100 | ||
112 | send -- "firejail --noprofile echo done\r" | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 11\n";exit} | ||
115 | "done\r" | ||
116 | } | ||
117 | sleep 1 | ||
118 | |||
119 | after 100 | ||
120 | send -- "echo \"join no\" > /etc/firejail/firejail.config\r" | ||
121 | after 100 | ||
122 | send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r" | ||
123 | after 100 | ||
124 | send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r" | ||
125 | after 100 | ||
126 | send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r" | ||
127 | after 100 | ||
128 | send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r" | ||
129 | after 100 | ||
130 | send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r" | ||
131 | after 100 | ||
132 | send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r" | ||
133 | after 100 | ||
134 | send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r" | ||
135 | after 100 | ||
136 | send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r" | ||
137 | after 100 | ||
138 | send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r" | ||
139 | after 100 | ||
140 | send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r" | ||
141 | after 100 | ||
142 | send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r" | ||
143 | after 100 | ||
144 | send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r" | ||
145 | after 100 | ||
146 | send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r" | ||
147 | after 100 | ||
148 | send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r" | ||
149 | after 100 | ||
150 | send -- "echo \"xephyr-window-title no\" >> /etc/firejail/firejail.config\r" | ||
151 | after 100 | ||
152 | send -- "echo \"remount-proc-sys no\" >> /etc/firejail/firejail.config\r" | ||
153 | after 100 | ||
154 | send -- "echo \"disable-mnt no\" >> /etc/firejail/firejail.config\r" | ||
155 | after 100 | ||
156 | send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r" | ||
157 | after 100 | ||
158 | send -- "firejail --noprofile\r" | ||
159 | expect { | ||
160 | timeout {puts "TESTING ERROR 12\n";exit} | ||
161 | "" | ||
162 | } | ||
163 | after 100 | ||
164 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firecfg --debug\r" | ||
11 | sleep 1 | ||
12 | |||
13 | send -- "firecfg --debug --clean\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "less removed" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "stty -echo\r" | ||
21 | after 100 | ||
22 | send -- "file /usr/local/bin/firefox; echo done\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 1\n";exit} | ||
25 | "symbolic link to /usr/bin/firejail" {puts "TESTING ERROR 2\n";exit} | ||
26 | "done" | ||
27 | } | ||
28 | sleep 1 | ||
29 | |||
30 | send -- "firecfg --debug\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "less created" | ||
34 | } | ||
35 | sleep 1 | ||
36 | |||
37 | send -- "file /usr/local/bin/less\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 4\n";exit} | ||
40 | "symbolic link to /usr/bin/firejail" | ||
41 | } | ||
42 | sleep 1 | ||
43 | |||
44 | send -- "firecfg --list\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 5\n";exit} | ||
47 | "/usr/local/bin/less" | ||
48 | } | ||
49 | sleep 1 | ||
50 | |||
51 | send -- "firecfg --fix\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 6\n";exit} | ||
54 | "this option is not supported for root user" | ||
55 | } | ||
56 | sleep 1 | ||
57 | |||
58 | send -- "firecfg --fix-sound\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 7\n";exit} | ||
61 | "PulseAudio configured, please logout and login back again" | ||
62 | } | ||
63 | sleep 1 | ||
64 | |||
65 | send -- "firecfg --version\r" | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 8\n";exit} | ||
68 | "firecfg version" | ||
69 | } | ||
70 | sleep 1 | ||
71 | |||
72 | send -- "firecfg --blablabla\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 9\n";exit} | ||
75 | "invalid command line option" | ||
76 | } | ||
77 | sleep 1 | ||
78 | |||
79 | |||
80 | puts "\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 | |||
2 | bind yes | ||
3 | chroot yes | ||
4 | chroot-desktop yes | ||
5 | cache-tmpfs yes | ||
6 | file-transfer yes | ||
7 | firejail-prompt no | ||
8 | follow-symlink-as-user no | ||
9 | follow-symlink-private-bin no | ||
10 | force-nonewprivs no | ||
11 | join yes | ||
12 | network yes | ||
13 | overlayfs yes | ||
14 | private-bin-no-local no | ||
15 | private-home yes | ||
16 | quiet-by-default no | ||
17 | remount-proc-sys yes | ||
18 | restricted-network no | ||
19 | # netfilter-default /etc/iptables.iptables.rules | ||
20 | seccomp yes | ||
21 | userns yes | ||
22 | whitelist yes | ||
23 | x11 yes | ||
24 | xephyr-screen 800x600 | ||
25 | xephyr-window-title yes | ||
26 | xephyr-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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # start firemon | ||
11 | set firemon_id $spawn_id | ||
12 | send -- "firemon\r" | ||
13 | sleep 1 | ||
14 | |||
15 | # start firejail | ||
16 | spawn $env(SHELL) | ||
17 | set firejail_id $spawn_id | ||
18 | send -- "firejail\r" | ||
19 | expect { | ||
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 | ||
25 | set spawn_id $firemon_id | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "exec" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2\n";exit} | ||
32 | "/bin/bash -c /bin/bash" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 3\n";exit} | ||
36 | "exec" | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 4\n";exit} | ||
40 | "/bin/bash" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 5\n";exit} | ||
44 | "fork" | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 6\n";exit} | ||
48 | "child" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 7\n";exit} | ||
52 | "/bin/bash" | ||
53 | } | ||
54 | after 100 | ||
55 | |||
56 | # exit firejail | ||
57 | set spawn_id $firejail_id | ||
58 | send -- "exit\r" | ||
59 | sleep 1 | ||
60 | |||
61 | # get messages on firemon | ||
62 | set spawn_id $firemon_id | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 8\n";exit} | ||
65 | "exit" | ||
66 | } | ||
67 | |||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 9\n";exit} | ||
70 | "EXIT SANDBOX" | ||
71 | } | ||
72 | |||
73 | |||
74 | puts "\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 | |||
6 | set timeout 5 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=dhcpd /etc/init.d/isc-dhcp-server start\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --tree\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "root:/usr/sbin/dhcpd" | ||
22 | } | ||
23 | sleep 2 | ||
24 | |||
25 | send -- "tail -n 200 /var/log/syslog\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "Internet Systems Consortium DHCP Server" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "Wrote 0 leases to leases file" | ||
33 | } | ||
34 | sleep 2 | ||
35 | |||
36 | send -- "firejail --join=dhcpd\r" | ||
37 | sleep 2 | ||
38 | |||
39 | send -- "ls /dev\r" | ||
40 | expect { | ||
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 | } | ||
48 | sleep 2 | ||
49 | |||
50 | |||
51 | puts "\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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "firejail --name=jointesting --cpu=0 --nice=2\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
15 | } | ||
16 | sleep 2 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --join=jointesting\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "Switching to pid" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
27 | } | ||
28 | sleep 1 | ||
29 | send -- "ps aux\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 3\n";exit} | ||
32 | "/bin/bash" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "/bin/bash" | ||
37 | } | ||
38 | |||
39 | send -- "exit\r" | ||
40 | sleep 1 | ||
41 | send -- "firejail --join-network=jointesting\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 5\n";exit} | ||
44 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
45 | } | ||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | send -- "firejail --join-filesystem=jointesting\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 6\n";exit} | ||
51 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
52 | } | ||
53 | |||
54 | after 100 | ||
55 | |||
56 | puts "\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 | |||
6 | set timeout 10 | ||
7 | cd /home | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | send -- "su - nobody -s /usr/bin/firejail\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
15 | } | ||
16 | after 100 | ||
17 | |||
18 | send -- "cat /proc/self/status | grep Seccomp\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | "2" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "cat /proc/self/status | grep CapBnd\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 4\n";exit} | ||
28 | "0000000000000000" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "exit\r" | ||
33 | sleep 1 | ||
34 | |||
35 | puts "\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 | |||
6 | set timeout 5 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=nginx /etc/init.d/nginx start\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --tree\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "root::nginx: master process /usr/sbin/nginx" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "www-data::nginx: worker process" | ||
27 | } | ||
28 | sleep 2 | ||
29 | |||
30 | |||
31 | send -- "rm index.html\r" | ||
32 | sleep 1 | ||
33 | send -- "wget 127.0.0.1\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 3\n";exit} | ||
36 | "saved" | ||
37 | } | ||
38 | send -- "cat index.html\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "DOCTYPE html PUBLIC" | ||
42 | } | ||
43 | |||
44 | sleep 1 | ||
45 | send -- "rm index.html\r" | ||
46 | |||
47 | send -- "firejail --join=nginx\r" | ||
48 | sleep 2 | ||
49 | |||
50 | send -- "ls /dev\r" | ||
51 | expect { | ||
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 | } | ||
59 | sleep 1 | ||
60 | send -- "ls -al /tmp;pwd\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 10\n";exit} | ||
63 | "X11-unix" {puts "TESTING ERROR 11\n";exit} | ||
64 | "/root" | ||
65 | } | ||
66 | sleep 2 | ||
67 | |||
68 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --bind=tmpfile,/etc/passwd\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "cat /etc/passwd;pwd\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "hello" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --tmpfs=/var\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls -l /var;pwd\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "total 0" | ||
21 | } | ||
22 | after 100 | ||
23 | send -- "exit\r" | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "firejail --debug-check-filename --tmpfs=\"bla&&bla\"\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 13.1\n";exit} | ||
29 | "Checking filename bla&&bla" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 13.2\n";exit} | ||
33 | "Error:" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 13.3\n";exit} | ||
37 | "is an invalid filename" | ||
38 | } | ||
39 | after 100 | ||
40 | |||
41 | |||
42 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | send -- "ls -l /home\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "total 0" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "ls -l /root\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "total 0" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | |||
36 | send -- "touch /opt/firejail-test-file\r" | ||
37 | after 100 | ||
38 | send -- "mkdir /opt/firejail-test-dir\r" | ||
39 | after 100 | ||
40 | send -- "touch /opt/firejail-test-dir/firejail-test-file\r" | ||
41 | after 100 | ||
42 | send -- "firejail --private-opt=firejail-test-file,firejail-test-dir --debug\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 3\n";exit} | ||
45 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
46 | } | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "find /opt | wc -l\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 4\n";exit} | ||
52 | "4" | ||
53 | } | ||
54 | after 100 | ||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
60 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
61 | } | ||
62 | sleep 1 | ||
63 | |||
64 | send -- "find /opt | wc -l\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
67 | "4" | ||
68 | } | ||
69 | after 100 | ||
70 | send -- "exit\r" | ||
71 | sleep 1 | ||
72 | |||
73 | |||
74 | send -- "touch /srv/firejail-test-file\r" | ||
75 | after 100 | ||
76 | send -- "mkdir /srv/firejail-test-dir\r" | ||
77 | after 100 | ||
78 | send -- "touch /srv/firejail-test-dir/firejail-test-file\r" | ||
79 | after 100 | ||
80 | send -- "firejail --private-srv=firejail-test-file,firejail-test-dir --debug\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 5\n";exit} | ||
83 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
84 | } | ||
85 | sleep 1 | ||
86 | |||
87 | send -- "find /srv | wc -l\r" | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 6\n";exit} | ||
90 | "4" | ||
91 | } | ||
92 | after 100 | ||
93 | send -- "exit\r" | ||
94 | sleep 1 | ||
95 | send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r" | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
98 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
99 | } | ||
100 | sleep 1 | ||
101 | |||
102 | send -- "find /srv | wc -l\r" | ||
103 | expect { | ||
104 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
105 | "4" | ||
106 | } | ||
107 | after 100 | ||
108 | send -- "exit\r" | ||
109 | sleep 1 | ||
110 | |||
111 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --profile=tmpfs.profile\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls -l /var;pwd\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "total 0" | ||
21 | } | ||
22 | after 100 | ||
23 | send -- "exit\r" | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "firejail --debug-check-filename --profile=tmpfs-bad.profile\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 13.1\n";exit} | ||
29 | "Checking filename bla&&bla" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 13.2\n";exit} | ||
33 | "Error:" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 13.3\n";exit} | ||
37 | "is an invalid filename" | ||
38 | } | ||
39 | after 100 | ||
40 | |||
41 | |||
42 | puts "\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 | |||
9 | export LC_ALL=C | ||
10 | |||
11 | #******************************** | ||
12 | # firecfg | ||
13 | #******************************** | ||
14 | if command -v less | ||
15 | then | ||
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 | ||
20 | else | ||
21 | echo "TESTING SKIP: firecfg, less not found" | ||
22 | fi | ||
23 | |||
24 | #******************************** | ||
25 | # servers | ||
26 | #******************************** | ||
27 | if [[ -f /etc/init.d/snmpd ]] | ||
28 | then | ||
29 | echo "TESTING: snmpd (test/root/snmpd.exp)" | ||
30 | ./snmpd.exp | ||
31 | else | ||
32 | echo "TESTING SKIP: snmpd not found" | ||
33 | fi | ||
34 | |||
35 | |||
36 | if [[ -f /etc/init.d/apache2 ]] | ||
37 | then | ||
38 | echo "TESTING: apache2 (test/root/apache2.exp)" | ||
39 | ./apache2.exp | ||
40 | else | ||
41 | echo "TESTING SKIP: apache2 not found" | ||
42 | fi | ||
43 | |||
44 | if [[ -f /etc/init.d/isc-dhcp-server ]] | ||
45 | then | ||
46 | echo "TESTING: isc dhcp server (test/root/isc-dhscp.exp)" | ||
47 | ./isc-dhcp.exp | ||
48 | else | ||
49 | echo "TESTING SKIP: isc dhcp server not found" | ||
50 | fi | ||
51 | |||
52 | if [[ -f /etc/init.d/unbound ]] | ||
53 | then | ||
54 | echo "TESTING: unbound (test/root/unbound.exp)" | ||
55 | ./unbound.exp | ||
56 | else | ||
57 | echo "TESTING SKIP: unbound not found" | ||
58 | fi | ||
59 | |||
60 | if [[ -f /etc/init.d/nginx ]] | ||
61 | then | ||
62 | echo "TESTING: nginx (test/root/nginx.exp)" | ||
63 | ./nginx.exp | ||
64 | else | ||
65 | echo "TESTING SKIP: nginx not found" | ||
66 | fi | ||
67 | |||
68 | #******************************** | ||
69 | # filesystem | ||
70 | #******************************** | ||
71 | echo "TESTING: fs private (test/root/private.exp)" | ||
72 | ./private.exp | ||
73 | |||
74 | echo "TESTING: fs whitelist mnt, opt, media (test/root/whitelist-mnt.exp)" | ||
75 | ./whitelist.exp | ||
76 | |||
77 | #******************************** | ||
78 | # utils | ||
79 | #******************************** | ||
80 | echo "TESTING: join (test/root/join.exp)" | ||
81 | ./join.exp | ||
82 | |||
83 | echo "TESTING: login-nobody (test/root/login_nobody.exp)" | ||
84 | ./login_nobody.exp | ||
85 | |||
86 | #******************************** | ||
87 | # seccomp | ||
88 | #******************************** | ||
89 | echo "TESTING: seccomp umount (test/root/seccomp-umount.exp)" | ||
90 | ./seccomp-umount.exp | ||
91 | |||
92 | echo "TESTING: seccomp chmod (test/root/seccomp-chmod.exp)" | ||
93 | ./seccomp-chmod.exp | ||
94 | |||
95 | echo "TESTING: seccomp chown (test/root/seccomp-chown.exp)" | ||
96 | ./seccomp-chown.exp | ||
97 | |||
98 | #******************************** | ||
99 | # command line options | ||
100 | #******************************** | ||
101 | echo "TESTING: firejail configuration (test/root/checkcfg.exp)" | ||
102 | ./checkcfg.exp | ||
103 | cp ../../etc/firejail.config /etc/firejail/. | ||
104 | |||
105 | echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" | ||
106 | ./option_tmpfs.exp | ||
107 | |||
108 | echo "TESTING: profile tmpfs (test/root/profile_tmpfs)" | ||
109 | ./profile_tmpfs.exp | ||
110 | |||
111 | echo "TESTING: bind directory (test/root/option_bind_directory.exp)" | ||
112 | ./option_bind_directory.exp | ||
113 | |||
114 | echo "TESTING: bind file (test/root/option_bind_file.exp)" | ||
115 | echo hello > tmpfile | ||
116 | ./option_bind_file.exp | ||
117 | rm -f tmpfile | ||
118 | |||
119 | #******************************** | ||
120 | # firemon | ||
121 | #******************************** | ||
122 | echo "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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --seccomp=chmod,fchmod,fchmodat --private\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | send -- "stty -echo\r" | ||
18 | after 100 | ||
19 | send -- "cd ~; echo done\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "done" | ||
23 | } | ||
24 | |||
25 | send -- "touch testfile; echo done\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "done" | ||
29 | } | ||
30 | |||
31 | send -- "ls -l testfile; echo done\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 3\n";exit} | ||
34 | "testfile" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | "done" | ||
39 | } | ||
40 | |||
41 | send -- "chmod +x testfile; echo done\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 5\n";exit} | ||
44 | "Bad system call" | ||
45 | } | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 6\n";exit} | ||
48 | "done" | ||
49 | } | ||
50 | |||
51 | send -- "exit\r" | ||
52 | after 100 | ||
53 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --seccomp=chown,fchown,fchownat,lchown --private\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | send -- "stty -echo\r" | ||
18 | after 100 | ||
19 | send -- "touch testfile; echo done\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "done" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | send -- "ls -l testfile; echo done\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "testfile" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "done" | ||
34 | } | ||
35 | after 100 | ||
36 | |||
37 | send -- "chown netblue:netblue testfile; echo done\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 2\n";exit} | ||
40 | "Bad system call" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "done" | ||
45 | } | ||
46 | |||
47 | |||
48 | send -- "exit\r" | ||
49 | after 100 | ||
50 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --seccomp --noprofile\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | send -- "umount /proc\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "Bad system call" | ||
21 | } | ||
22 | |||
23 | send -- "exit\r" | ||
24 | after 100 | ||
25 | puts "\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 | |||
6 | set timeout 5 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=snmpd /etc/init.d/snmpd start\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --tree\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "snmp:/usr/sbin/snmpd" | ||
22 | } | ||
23 | sleep 2 | ||
24 | |||
25 | send -- "tail /var/log/syslog\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "snmpd" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "NET-SNMP version" | ||
33 | } | ||
34 | |||
35 | send -- "firejail --join=snmpd\r" | ||
36 | sleep 2 | ||
37 | |||
38 | send -- "ls /dev\r" | ||
39 | expect { | ||
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 | } | ||
47 | sleep 2 | ||
48 | |||
49 | sleep 2 | ||
50 | puts "\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 @@ | |||
1 | tmpfs 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 @@ | |||
1 | tmpfs /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 | |||
6 | set timeout 5 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=unbound unbound\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --tree\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2\n";exit} | ||
21 | "unbound:unbound" | ||
22 | } | ||
23 | sleep 2 | ||
24 | |||
25 | send -- "tail /var/log/syslog\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 3\n";exit} | ||
28 | "unbound" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 4\n";exit} | ||
32 | "info: start of service" | ||
33 | } | ||
34 | sleep 2 | ||
35 | |||
36 | send -- "firejail --join=unbound\r" | ||
37 | sleep 2 | ||
38 | |||
39 | send -- "ls /dev\r" | ||
40 | expect { | ||
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 | } | ||
48 | sleep 2 | ||
49 | |||
50 | |||
51 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "touch /mnt/firejail-test-file\r" | ||
11 | after 100 | ||
12 | send -- "mkdir /mnt/firejail-test-dir\r" | ||
13 | after 100 | ||
14 | send -- "touch /mnt/firejail-test-dir/firejail-test-file\r" | ||
15 | after 100 | ||
16 | send -- "firejail --whitelist=/mnt/firejail-test-file --whitelist=/mnt/firejail-test-dir --debug\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0\n";exit} | ||
19 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
20 | } | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "find /mnt | wc -l\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 1\n";exit} | ||
26 | "4" | ||
27 | } | ||
28 | after 100 | ||
29 | send -- "exit\r" | ||
30 | sleep 1 | ||
31 | |||
32 | |||
33 | send -- "touch /opt/firejail-test-file\r" | ||
34 | after 100 | ||
35 | send -- "mkdir /opt/firejail-test-dir\r" | ||
36 | after 100 | ||
37 | send -- "touch /opt/firejail-test-dir/firejail-test-file\r" | ||
38 | after 100 | ||
39 | send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 2\n";exit} | ||
42 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
43 | } | ||
44 | sleep 1 | ||
45 | |||
46 | send -- "find /opt | wc -l\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 3\n";exit} | ||
49 | "4" | ||
50 | } | ||
51 | after 100 | ||
52 | send -- "exit\r" | ||
53 | sleep 1 | ||
54 | |||
55 | send -- "touch /media/firejail-test-file\r" | ||
56 | after 100 | ||
57 | send -- "mkdir /media/firejail-test-dir\r" | ||
58 | after 100 | ||
59 | send -- "touch /media/firejail-test-dir/firejail-test-file\r" | ||
60 | after 100 | ||
61 | send -- "firejail --whitelist=/media/firejail-test-file --whitelist=/media/firejail-test-dir --debug\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 -- "find /media | wc -l\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 5\n";exit} | ||
71 | "4" | ||
72 | } | ||
73 | after 100 | ||
74 | send -- "exit\r" | ||
75 | sleep 1 | ||
76 | |||
77 | |||
78 | send -- "firejail --whitelist=/var/run --whitelist=/var/lock --debug\r" | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 6\n";exit} | ||
81 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
82 | } | ||
83 | sleep 1 | ||
84 | |||
85 | send -- "find /var | wc -l\r" | ||
86 | expect { | ||
87 | timeout {puts "TESTING ERROR 7\n";exit} | ||
88 | "" | ||
89 | } | ||
90 | after 100 | ||
91 | send -- "exit\r" | ||
92 | sleep 1 | ||
93 | |||
94 | send -- "touch /srv/firejail-test-file\r" | ||
95 | after 100 | ||
96 | send -- "mkdir /srv/firejail-test-dir\r" | ||
97 | after 100 | ||
98 | send -- "touch /srv/firejail-test-dir/firejail-test-file\r" | ||
99 | after 100 | ||
100 | send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r" | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 8\n";exit} | ||
103 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
104 | } | ||
105 | sleep 1 | ||
106 | |||
107 | send -- "find /srv | wc -l\r" | ||
108 | expect { | ||
109 | timeout {puts "TESTING ERROR 9\n";exit} | ||
110 | "4" | ||
111 | } | ||
112 | after 100 | ||
113 | send -- "exit\r" | ||
114 | |||
115 | |||
116 | after 100 | ||
117 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
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 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "ps aux | wc -l\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "5" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "ls -l /home | grep drw | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "1" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "cat /proc/self/status | grep Seccomp\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "2" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "cat /proc/self/status | grep CapBnd\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 4\n";exit} | ||
42 | "0000000000000000" | ||
43 | } | ||
44 | after 100 | ||
45 | |||
46 | # preparing scp/sftp tests | ||
47 | send -- "rm testfile\r" | ||
48 | |||
49 | send -- "exit\r" | ||
50 | sleep 1 | ||
51 | |||
52 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
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 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "rm -f testfile\r" | ||
19 | after 100 | ||
20 | send -- "exit\r" | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "echo 12345 > testfile\r" | ||
24 | after 100 | ||
25 | send -- "scp testfile firejail-test@0:~/testfile\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "100%" | ||
29 | } | ||
30 | sleep 1 | ||
31 | |||
32 | |||
33 | send -- "ssh firejail-test@0\r" | ||
34 | expect { | ||
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 | } | ||
39 | sleep 1 | ||
40 | send -- "cat testfile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3\n";exit} | ||
43 | "12345" | ||
44 | } | ||
45 | after 100 | ||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "rm testfile\r" | ||
50 | after 100 | ||
51 | send -- "scp firejail-test@0:~/testfile testfile\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 4\n";exit} | ||
54 | "100%" | ||
55 | } | ||
56 | sleep 1 | ||
57 | send -- "cat testfile\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 5\n";exit} | ||
60 | "12345" | ||
61 | } | ||
62 | after 100 | ||
63 | send -- "rm testfile\r" | ||
64 | sleep 1 | ||
65 | |||
66 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "ssh firejail-test@0\r" | ||
11 | expect { | ||
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 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "rm -f testfile\r" | ||
19 | after 100 | ||
20 | send -- "exit\r" | ||
21 | sleep 1 | ||
22 | |||
23 | send -- "echo 12345 > testfile\r" | ||
24 | after 100 | ||
25 | send -- "sftp firejail-test@0\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1\n";exit} | ||
28 | "Connected to 0" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 2\n";exit} | ||
32 | "sftp>" | ||
33 | } | ||
34 | after 100 | ||
35 | send -- "put testfile\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 3\n";exit} | ||
38 | "100%" | ||
39 | } | ||
40 | after 100 | ||
41 | send -- "exit\r" | ||
42 | sleep 1 | ||
43 | |||
44 | |||
45 | send -- "ssh firejail-test@0\r" | ||
46 | expect { | ||
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 | } | ||
51 | sleep 1 | ||
52 | send -- "cat testfile\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 5\n";exit} | ||
55 | "12345" | ||
56 | } | ||
57 | after 100 | ||
58 | send -- "exit\r" | ||
59 | sleep 1 | ||
60 | |||
61 | send -- "rm testfile\r" | ||
62 | after 100 | ||
63 | send -- "sftp firejail-test@0\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 6\n";exit} | ||
66 | "Connected to 0" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 7\n";exit} | ||
70 | "sftp>" | ||
71 | } | ||
72 | after 100 | ||
73 | send -- "get testfile\r" | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 8\n";exit} | ||
76 | "100%" | ||
77 | } | ||
78 | after 100 | ||
79 | send -- "exit\r" | ||
80 | sleep 1 | ||
81 | send -- "cat testfile\r" | ||
82 | expect { | ||
83 | timeout {puts "TESTING ERROR 9\n";exit} | ||
84 | "12345" | ||
85 | } | ||
86 | after 100 | ||
87 | send -- "rm testfile\r" | ||
88 | sleep 1 | ||
89 | |||
90 | puts "\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 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | export LC_ALL=C | ||
9 | |||
10 | echo "TESTING: ssh login (test/ssh/login.exp)" | ||
11 | ./login.exp | ||
12 | |||
13 | echo "TESTING: sftp (test/ssh/sftp.exp)" | ||
14 | ./sftp.exp | ||
15 | |||
16 | echo "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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | set MAXi 100 | ||
11 | |||
12 | # blacklist testing | ||
13 | set i 1 | ||
14 | send -- "firejail --profile=blacklist.profile\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
18 | } | ||
19 | |||
20 | while { $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 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | # noblacklist testing | ||
35 | set i 1 | ||
36 | send -- "firejail --profile=noblacklist.profile\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 1\n";exit} | ||
39 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
40 | } | ||
41 | |||
42 | while { $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 | } | ||
51 | after 100 | ||
52 | |||
53 | send -- "exit\r" | ||
54 | sleep 1 | ||
55 | |||
56 | |||
57 | |||
58 | after 100 | ||
59 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # env testing | ||
11 | send -- "firejail --profile=env.profile\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
15 | } | ||
16 | |||
17 | send -- "env | grep FJSTRESS77\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "FJSTRESS77=stress" | ||
21 | } | ||
22 | |||
23 | send -- "env | grep FJSTRESS | wc -l\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3\n";exit} | ||
26 | "100" | ||
27 | } | ||
28 | |||
29 | send -- "exit\r" | ||
30 | after 100 | ||
31 | puts "\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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # grab 10 ip addresses | ||
11 | set MAXi 210 | ||
12 | set i 201 | ||
13 | while { $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 | ||
26 | set MAXi 210 | ||
27 | set i 201 | ||
28 | while { $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 | ||
41 | spawn $env(SHELL) | ||
42 | send -- "firejail --debug --net=eth0 --iprange=192.168.1.201,192.168.1.220\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 3\n";exit} | ||
45 | "cannot assign an IP address" | ||
46 | } | ||
47 | |||
48 | |||
49 | |||
50 | after 100 | ||
51 | puts "\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 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | export LC_ALL=C | ||
9 | |||
10 | |||
11 | # blacklist testing | ||
12 | rm -fr ~/fj-stress-test | ||
13 | mkdir ~/fj-stress-test | ||
14 | rm blacklist.profile | ||
15 | rm noblacklist.profile | ||
16 | rm env.profile | ||
17 | for i in {1..100} | ||
18 | do | ||
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 | ||
25 | done | ||
26 | echo "include blacklist.profile" >> noblacklist.profile | ||
27 | |||
28 | echo "TESTING: stress blacklist/noblacklist (/test/stress/blacklist.exp)" | ||
29 | ./blacklist.exp | ||
30 | |||
31 | echo "TESTING: stress env (/test/stress/env.exp)" | ||
32 | ./env.exp | ||
33 | |||
34 | rm -fr ~/fj-stress-test | ||
35 | |||
36 | rm blacklist.profile | ||
37 | rm noblacklist.profile | ||
38 | rm env.profile | ||
39 | |||
40 | # network arp testing | ||
41 | echo "TESTING: macvlan (test/stress/net_macvlan.exp)" | ||
42 | ./net_macvlan.exp | ||