aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils')
-rwxr-xr-xtest/utils/caps-print.exp32
-rw-r--r--test/utils/caps1.profile1
-rw-r--r--test/utils/caps2.profile1
-rwxr-xr-xtest/utils/firemon-caps.exp129
-rwxr-xr-xtest/utils/utils.sh10
5 files changed, 0 insertions, 173 deletions
diff --git a/test/utils/caps-print.exp b/test/utils/caps-print.exp
deleted file mode 100755
index 381f27574..000000000
--- a/test/utils/caps-print.exp
+++ /dev/null
@@ -1,32 +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 --name=test\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 2
16
17spawn $env(SHELL)
18send -- "firejail --caps.print=test\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "setgid - disabled"
22}
23expect {
24 timeout {puts "TESTING ERROR 2\n";exit}
25 "setuid - disabled"
26}
27expect {
28 timeout {puts "TESTING ERROR 3\n";exit}
29 "net_raw - disabled"
30}
31after 100
32puts "\nall done\n"
diff --git a/test/utils/caps1.profile b/test/utils/caps1.profile
deleted file mode 100644
index 78c18fc64..000000000
--- a/test/utils/caps1.profile
+++ /dev/null
@@ -1 +0,0 @@
1caps.drop chown,kill
diff --git a/test/utils/caps2.profile b/test/utils/caps2.profile
deleted file mode 100644
index e760d4cb5..000000000
--- a/test/utils/caps2.profile
+++ /dev/null
@@ -1 +0,0 @@
1caps.keep chown,kill
diff --git a/test/utils/firemon-caps.exp b/test/utils/firemon-caps.exp
deleted file mode 100755
index 621447d45..000000000
--- a/test/utils/firemon-caps.exp
+++ /dev/null
@@ -1,129 +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 --name=bingo1 --noprofile --caps\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "firejail --name=bingo2 --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
22}
23sleep 1
24
25spawn $env(SHELL)
26send -- "firejail --name=bingo3 --noprofile --caps.drop=all\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
30}
31sleep 1
32
33spawn $env(SHELL)
34send -- "firejail --noprofile --name=bingo4 --caps.drop=chown,kill\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
38}
39sleep 1
40
41spawn $env(SHELL)
42send -- "firejail --noprofile --name=bingo5 --caps.keep=chown,kill\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
46}
47sleep 1
48
49spawn $env(SHELL)
50send -- "firejail --name=bingo6 --profile=caps1.profile\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
54}
55sleep 1
56
57spawn $env(SHELL)
58send -- "firejail --name=bingo7 --profile=caps2.profile\r"
59expect {
60 timeout {puts "TESTING ERROR 0\n";exit}
61 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
62}
63sleep 1
64
65spawn $env(SHELL)
66send -- "firemon --caps\r"
67expect {
68 timeout {puts "TESTING ERROR 8.1\n";exit}
69 "need to be root" {puts "TESTING SKIP: /proc mounted as hidepid\n"; exit}
70 "bingo1"
71}
72expect {
73 timeout {puts "TESTING ERROR 8.2\n";exit}
74 "31cffff"
75}
76expect {
77 timeout {puts "TESTING ERROR 8.3\n";exit}
78 "bingo2"
79}
80expect {
81 timeout {puts "TESTING ERROR 8.4\n";exit}
82 "fffffff"
83}
84expect {
85 timeout {puts "TESTING ERROR 8.5\n";exit}
86 "bingo3"
87}
88expect {
89 timeout {puts "TESTING ERROR 8.6\n";exit}
90 "000000000000"
91}
92
93expect {
94 timeout {puts "TESTING ERROR 8.7\n";exit}
95 "bingo4"
96}
97expect {
98 timeout {puts "TESTING ERROR 8.8\n";exit}
99 "ffffffde"
100}
101expect {
102 timeout {puts "TESTING ERROR 8.9\n";exit}
103 "bingo5"
104}
105expect {
106 timeout {puts "TESTING ERROR 8.10\n";exit}
107 "0000000000000021"
108}
109
110expect {
111 timeout {puts "TESTING ERROR 8.11\n";exit}
112 "bingo6"
113}
114expect {
115 timeout {puts "TESTING ERROR 8.12\n";exit}
116 "ffffffde"
117}
118expect {
119 timeout {puts "TESTING ERROR 8.13\n";exit}
120 "bingo7"
121}
122expect {
123 timeout {puts "TESTING ERROR 8.14\n";exit}
124 "0000000000000021"
125}
126
127after 100
128
129puts "all done\n"
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index 9f04c2625..49ff8e6de 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -61,9 +61,6 @@ echo "TESTING: fs.print (test/utils/fs-print.exp)"
61echo "TESTING: dns.print (test/utils/dns-print.exp)" 61echo "TESTING: dns.print (test/utils/dns-print.exp)"
62./dns-print.exp 62./dns-print.exp
63 63
64echo "TESTING: caps.print (test/utils/caps-print.exp)"
65./caps-print.exp
66
67echo "TESTING: seccomp.print (test/utils/seccomp-print.exp)" 64echo "TESTING: seccomp.print (test/utils/seccomp-print.exp)"
68./seccomp-print.exp 65./seccomp-print.exp
69 66
@@ -112,13 +109,6 @@ else
112 echo "TESTING SKIP: seccomp already active (test/utils/firemon-seccomp.exp)" 109 echo "TESTING SKIP: seccomp already active (test/utils/firemon-seccomp.exp)"
113fi 110fi
114 111
115if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then
116 echo "TESTING: firemon caps (test/utils/firemon-caps.exp)"
117 ./firemon-caps.exp
118else
119 echo "TESTING SKIP: other capabilities than expected (test/utils/firemon-caps.exp)"
120fi
121
122echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" 112echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)"
123./firemon-cpu.exp 113./firemon-cpu.exp
124 114