aboutsummaryrefslogtreecommitdiffstats
path: root/test/overlay
diff options
context:
space:
mode:
Diffstat (limited to 'test/overlay')
-rwxr-xr-xtest/overlay/firefox-x11-xorg.exp89
-rwxr-xr-xtest/overlay/firefox-x11.exp89
-rwxr-xr-xtest/overlay/firefox.exp98
-rwxr-xr-xtest/overlay/fs-named.exp72
-rwxr-xr-xtest/overlay/fs-tmpfs.exp70
-rwxr-xr-xtest/overlay/fs.exp62
-rwxr-xr-xtest/overlay/overlay.sh62
7 files changed, 0 insertions, 542 deletions
diff --git a/test/overlay/firefox-x11-xorg.exp b/test/overlay/firefox-x11-xorg.exp
deleted file mode 100755
index 5457b512a..000000000
--- a/test/overlay/firefox-x11-xorg.exp
+++ /dev/null
@@ -1,89 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay --name=test --x11=xorg firefox -no-remote www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "firefox" {puts "firefox detected\n";}
22 "iceweasel" {puts "iceweasel detected\n";}
23}
24expect {
25 timeout {puts "TESTING ERROR 3.2\n";exit}
26 "no-remote"
27}
28sleep 1
29# grsecurity exit
30send -- "file /proc/sys/kernel/grsecurity\r"
31expect {
32 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"}
35}
36send -- "firejail --overlay --name=blablabla\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41sleep 2
42
43spawn $env(SHELL)
44send -- "firemon --seccomp\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 " firefox" {puts "firefox detected\n";}
48 " iceweasel" {puts "iceweasel detected\n";}
49}
50expect {
51 timeout {puts "TESTING ERROR 5.0\n";exit}
52 "no-remote"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
56 "Seccomp: 2"
57}
58expect {
59 timeout {puts "TESTING ERROR 5.1\n";exit}
60 "name=blablabla"
61}
62sleep 1
63send -- "firemon --caps\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 " firefox" {puts "firefox detected\n";}
67 " iceweasel" {puts "iceweasel detected\n";}
68}
69expect {
70 timeout {puts "TESTING ERROR 6.0\n";exit}
71 "no-remote"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.1\n";exit}
75 "CapBnd:"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.2\n";exit}
79 "0000000000000000"
80}
81expect {
82 timeout {puts "TESTING ERROR 6.3\n";exit}
83 "name=blablabla"
84}
85sleep 1
86send -- "firejail --shutdown=test\r"
87sleep 3
88
89puts "\nall done\n"
diff --git a/test/overlay/firefox-x11.exp b/test/overlay/firefox-x11.exp
deleted file mode 100755
index 66b3d9d8e..000000000
--- a/test/overlay/firefox-x11.exp
+++ /dev/null
@@ -1,89 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay --name=test --x11 firefox -no-remote www.gentoo.org\r"
11sleep 10
12
13spawn $env(SHELL)
14send -- "firejail --list\r"
15expect {
16 timeout {puts "TESTING ERROR 3\n";exit}
17 ":firejail"
18}
19expect {
20 timeout {puts "TESTING ERROR 3.1\n";exit}
21 "firefox" {puts "firefox detected\n";}
22 "iceweasel" {puts "iceweasel detected\n";}
23}
24expect {
25 timeout {puts "TESTING ERROR 3.2\n";exit}
26 "no-remote"
27}
28sleep 1
29# grsecurity exit
30send -- "file /proc/sys/kernel/grsecurity\r"
31expect {
32 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
33 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
34 "cannot open" {puts "grsecurity not present\n"}
35}
36send -- "firejail --name=blablabla --overlay\r"
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
40}
41sleep 2
42
43spawn $env(SHELL)
44send -- "firemon --seccomp\r"
45expect {
46 timeout {puts "TESTING ERROR 5\n";exit}
47 " firefox" {puts "firefox detected\n";}
48 " iceweasel" {puts "iceweasel detected\n";}
49}
50expect {
51 timeout {puts "TESTING ERROR 5.0\n";exit}
52 "no-remote"
53}
54expect {
55 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
56 "Seccomp: 2"
57}
58expect {
59 timeout {puts "TESTING ERROR 5.1\n";exit}
60 "name=blablabla"
61}
62sleep 1
63send -- "firemon --caps\r"
64expect {
65 timeout {puts "TESTING ERROR 6\n";exit}
66 " firefox" {puts "firefox detected\n";}
67 " iceweasel" {puts "iceweasel detected\n";}
68}
69expect {
70 timeout {puts "TESTING ERROR 6.0\n";exit}
71 "no-remote"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.1\n";exit}
75 "CapBnd:"
76}
77expect {
78 timeout {puts "TESTING ERROR 6.2\n";exit}
79 "0000000000000000"
80}
81expect {
82 timeout {puts "TESTING ERROR 6.3\n";exit}
83 "name=blablabla"
84}
85sleep 1
86send -- "firejail --shutdown=test\r"
87sleep 3
88
89puts "\nall done\n"
diff --git a/test/overlay/firefox.exp b/test/overlay/firefox.exp
deleted file mode 100755
index 295a03f52..000000000
--- a/test/overlay/firefox.exp
+++ /dev/null
@@ -1,98 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay firefox -no-remote www.gentoo.org\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/firefox.profile"
14}
15expect {
16 timeout {puts "TESTING ERROR 1\n";exit}
17 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
18}
19sleep 10
20
21spawn $env(SHELL)
22send -- "firejail --list\r"
23expect {
24 timeout {puts "TESTING ERROR 3\n";exit}
25 ":firejail"
26}
27expect {
28 timeout {puts "TESTING ERROR 3.1\n";exit}
29 "firefox" {puts "firefox detected\n";}
30 "iceweasel" {puts "iceweasel detected\n";}
31}
32expect {
33 timeout {puts "TESTING ERROR 3.2\n";exit}
34 "no-remote"
35}
36after 100
37
38# grsecurity exit
39send -- "file /proc/sys/kernel/grsecurity\r"
40expect {
41 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
42 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
43 "cannot open" {puts "grsecurity not present\n"}
44}
45
46
47send -- "firejail --name=blablabla --overlay\r"
48expect {
49 timeout {puts "TESTING ERROR 4\n";exit}
50 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
51}
52sleep 2
53
54spawn $env(SHELL)
55send -- "firemon --seccomp\r"
56expect {
57 timeout {puts "TESTING ERROR 5\n";exit}
58 " firefox" {puts "firefox detected\n";}
59 " iceweasel" {puts "iceweasel detected\n";}
60}
61expect {
62 timeout {puts "TESTING ERROR 5.0\n";exit}
63 "no-remote"
64}
65expect {
66 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
67 "Seccomp: 2"
68}
69expect {
70 timeout {puts "TESTING ERROR 5.1\n";exit}
71 "name=blablabla"
72}
73after 100
74send -- "firemon --caps\r"
75expect {
76 timeout {puts "TESTING ERROR 6\n";exit}
77 " firefox" {puts "firefox detected\n";}
78 " iceweasel" {puts "iceweasel detected\n";}
79}
80expect {
81 timeout {puts "TESTING ERROR 6.0\n";exit}
82 "no-remote"
83}
84expect {
85 timeout {puts "TESTING ERROR 6.1\n";exit}
86 "CapBnd:"
87}
88expect {
89 timeout {puts "TESTING ERROR 6.2\n";exit}
90 "0000000000000000"
91}
92expect {
93 timeout {puts "TESTING ERROR 6.3\n";exit}
94 "name=blablabla"
95}
96after 100
97
98puts "\nall done\n"
diff --git a/test/overlay/fs-named.exp b/test/overlay/fs-named.exp
deleted file mode 100755
index 9e606183f..000000000
--- a/test/overlay/fs-named.exp
+++ /dev/null
@@ -1,72 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay-named=firejail-test\r"
11expect {
12 timeout {puts "TESTING ERROR 2\n";exit}
13 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
14 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
15 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
16}
17sleep 1
18send -- "stty -echo\r"
19after 100
20
21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "done"
25}
26after 100
27
28send -- "cat ~/_firejail_test_file; echo done\r"
29expect {
30 timeout {puts "TESTING ERROR 4\n";exit}
31 "xyzxyzxyz"
32}
33expect {
34 timeout {puts "TESTING ERROR 4.1\n";exit}
35 "done"
36}
37after 100
38
39send -- "exit\r"
40sleep 2
41
42send -- "cat ~/_firejail_test_file; echo done\r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit}
46 "done"
47}
48after 100
49
50send -- "firejail --overlay-named=firejail-test\r"
51expect {
52 timeout {puts "TESTING ERROR 2\n";exit}
53 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
54 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
55 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
56}
57sleep 1
58
59send -- "stty -echo\r"
60after 100
61send -- "cat ~/_firejail_test_file; echo done\r"
62expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 "xyzxyzxyz"
65}
66expect {
67 timeout {puts "TESTING ERROR 4.1\n";exit}
68 "done"
69}
70after 100
71
72puts "\nall done\n"
diff --git a/test/overlay/fs-tmpfs.exp b/test/overlay/fs-tmpfs.exp
deleted file mode 100755
index 8c8ebcb16..000000000
--- a/test/overlay/fs-tmpfs.exp
+++ /dev/null
@@ -1,70 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay-clean\r"
11after 100
12send -- "file ~/.firejail\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "cannot open"
16}
17after 100
18
19send -- "firejail --overlay-tmpfs\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
23 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
24 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
25}
26sleep 1
27send -- "stty -echo\r"
28after 100
29
30send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
31expect {
32 timeout {puts "TESTING ERROR 2\n";exit}
33 "done"
34}
35after 100
36
37send -- "stty -echo\r"
38after 100
39send -- "cat ~/_firejail_test_file; echo done\r"
40expect {
41 timeout {puts "TESTING ERROR 3\n";exit}
42 "xyzxyzxyz"
43}
44expect {
45 timeout {puts "TESTING ERROR 4\n";exit}
46 "done"
47}
48after 100
49
50send -- "exit\r"
51sleep 1
52
53send -- "stty -echo\r"
54after 100
55send -- "cat ~/_firejail_test_file; echo done\r"
56expect {
57 timeout {puts "TESTING ERROR 5\n";exit}
58 "xyzxyzxyz" {puts "TESTING ERROR 6\n";exit}
59 "done"
60}
61after 100
62
63send -- "file ~/.firejail\r"
64expect {
65 timeout {puts "TESTING ERROR 7\n";exit}
66 "cannot open"
67}
68after 100
69
70puts "\nall done\n"
diff --git a/test/overlay/fs.exp b/test/overlay/fs.exp
deleted file mode 100755
index e078e604c..000000000
--- a/test/overlay/fs.exp
+++ /dev/null
@@ -1,62 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --overlay\r"
11expect {
12 timeout {puts "TESTING ERROR 2\n";exit}
13 "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit}
14 "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit}
15 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "found\n"}
16}
17sleep 1
18
19send -- "stty -echo\r"
20after 100
21send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "done"
25}
26after 100
27
28send -- "stty -echo\r"
29after 100
30send -- "cat ~/_firejail_test_file; echo done\r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "xyzxyzxyz"
34}
35expect {
36 timeout {puts "TESTING ERROR 4.1\n";exit}
37 "done"
38}
39after 100
40
41send -- "exit\r"
42sleep 2
43
44send -- "stty -echo\r"
45after 100
46send -- "cat ~/_firejail_test_file; echo done\r"
47expect {
48 timeout {puts "TESTING ERROR 5\n";exit}
49 "xyzxyzxyz" {puts "TESTING ERROR 5.1\n";exit}
50 "done"
51}
52after 100
53
54# check /sys directory
55send -- "ls /sys\r"
56expect {
57 timeout {puts "TESTING ERROR 6\n";exit}
58 "block"
59}
60after 100
61
62puts "\nall done\n"
diff --git a/test/overlay/overlay.sh b/test/overlay/overlay.sh
deleted file mode 100755
index 2015942d9..000000000
--- a/test/overlay/overlay.sh
+++ /dev/null
@@ -1,62 +0,0 @@
1#!/bin/bash
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C
9
10echo "TESTING: overlay fs (test/overlay/fs.exp)"
11rm -fr ~/_firejail_test_*
12./fs.exp
13rm -fr ~/_firejail_test_*
14
15echo "TESTING: overlay named fs (test/overlay/fs-named.exp)"
16rm -fr ~/_firejail_test_*
17./fs-named.exp
18rm -fr ~/_firejail_test_*
19
20echo "TESTING: overlay tmpfs fs (test/overlay/fs-tmpfs.exp)"
21rm -fr ~/_firejail_test_*
22./fs-tmpfs.exp
23rm -fr ~/_firejail_test_*
24
25if command -v firefox
26then
27 echo "TESTING: overlay firefox"
28 ./firefox.exp
29else
30 echo "TESTING SKIP: firefox not found"
31fi
32
33if command -v firefox
34then
35 echo "TESTING: overlay firefox x11 xorg"
36 ./firefox.exp
37else
38 echo "TESTING SKIP: firefox not found"
39fi
40
41# check xpra/xephyr
42if command -v xpra
43then
44 echo "xpra found"
45else
46 echo "xpra not found"
47 if command -v Xephyr
48 then
49 echo "Xephyr found"
50 else
51 echo "TESTING SKIP: xpra and/or Xephyr not found"
52 exit
53 fi
54fi
55
56if command -v firefox
57then
58 echo "TESTING: overlay firefox x11"
59 ./firefox-x11.exp
60else
61 echo "TESTING SKIP: firefox not found"
62fi