diff options
author | netblue30 <netblue30@protonmail.com> | 2023-03-08 17:09:17 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-03-08 17:09:17 -0500 |
commit | aa0194eae75871f3fb5e15d31a9060527711adae (patch) | |
tree | bb535822c1469d4a1d6a736b7b58616b37d19d7d /test/utils | |
parent | testing (diff) | |
download | firejail-aa0194eae75871f3fb5e15d31a9060527711adae.tar.gz firejail-aa0194eae75871f3fb5e15d31a9060527711adae.tar.zst firejail-aa0194eae75871f3fb5e15d31a9060527711adae.zip |
testing
Diffstat (limited to 'test/utils')
-rwxr-xr-x | test/utils/caps-print.exp | 32 | ||||
-rw-r--r-- | test/utils/caps1.profile | 1 | ||||
-rw-r--r-- | test/utils/caps2.profile | 1 | ||||
-rwxr-xr-x | test/utils/firemon-caps.exp | 129 | ||||
-rwxr-xr-x | test/utils/utils.sh | 10 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=test\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 --caps.print=test\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "setgid - disabled" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 2\n";exit} | ||
25 | "setuid - disabled" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3\n";exit} | ||
29 | "net_raw - disabled" | ||
30 | } | ||
31 | after 100 | ||
32 | puts "\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 @@ | |||
1 | caps.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 @@ | |||
1 | caps.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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --name=bingo1 --noprofile --caps\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 | spawn $env(SHELL) | ||
18 | send -- "firejail --name=bingo2 --noprofile\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | spawn $env(SHELL) | ||
26 | send -- "firejail --name=bingo3 --noprofile --caps.drop=all\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | spawn $env(SHELL) | ||
34 | send -- "firejail --noprofile --name=bingo4 --caps.drop=chown,kill\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 3\n";exit} | ||
37 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
38 | } | ||
39 | sleep 1 | ||
40 | |||
41 | spawn $env(SHELL) | ||
42 | send -- "firejail --noprofile --name=bingo5 --caps.keep=chown,kill\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 4\n";exit} | ||
45 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
46 | } | ||
47 | sleep 1 | ||
48 | |||
49 | spawn $env(SHELL) | ||
50 | send -- "firejail --name=bingo6 --profile=caps1.profile\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 5\n";exit} | ||
53 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
54 | } | ||
55 | sleep 1 | ||
56 | |||
57 | spawn $env(SHELL) | ||
58 | send -- "firejail --name=bingo7 --profile=caps2.profile\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 0\n";exit} | ||
61 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
62 | } | ||
63 | sleep 1 | ||
64 | |||
65 | spawn $env(SHELL) | ||
66 | send -- "firemon --caps\r" | ||
67 | expect { | ||
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 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 8.2\n";exit} | ||
74 | "31cffff" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 8.3\n";exit} | ||
78 | "bingo2" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 8.4\n";exit} | ||
82 | "fffffff" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 8.5\n";exit} | ||
86 | "bingo3" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 8.6\n";exit} | ||
90 | "000000000000" | ||
91 | } | ||
92 | |||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 8.7\n";exit} | ||
95 | "bingo4" | ||
96 | } | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 8.8\n";exit} | ||
99 | "ffffffde" | ||
100 | } | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 8.9\n";exit} | ||
103 | "bingo5" | ||
104 | } | ||
105 | expect { | ||
106 | timeout {puts "TESTING ERROR 8.10\n";exit} | ||
107 | "0000000000000021" | ||
108 | } | ||
109 | |||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 8.11\n";exit} | ||
112 | "bingo6" | ||
113 | } | ||
114 | expect { | ||
115 | timeout {puts "TESTING ERROR 8.12\n";exit} | ||
116 | "ffffffde" | ||
117 | } | ||
118 | expect { | ||
119 | timeout {puts "TESTING ERROR 8.13\n";exit} | ||
120 | "bingo7" | ||
121 | } | ||
122 | expect { | ||
123 | timeout {puts "TESTING ERROR 8.14\n";exit} | ||
124 | "0000000000000021" | ||
125 | } | ||
126 | |||
127 | after 100 | ||
128 | |||
129 | puts "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)" | |||
61 | echo "TESTING: dns.print (test/utils/dns-print.exp)" | 61 | echo "TESTING: dns.print (test/utils/dns-print.exp)" |
62 | ./dns-print.exp | 62 | ./dns-print.exp |
63 | 63 | ||
64 | echo "TESTING: caps.print (test/utils/caps-print.exp)" | ||
65 | ./caps-print.exp | ||
66 | |||
67 | echo "TESTING: seccomp.print (test/utils/seccomp-print.exp)" | 64 | echo "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)" |
113 | fi | 110 | fi |
114 | 111 | ||
115 | if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then | ||
116 | echo "TESTING: firemon caps (test/utils/firemon-caps.exp)" | ||
117 | ./firemon-caps.exp | ||
118 | else | ||
119 | echo "TESTING SKIP: other capabilities than expected (test/utils/firemon-caps.exp)" | ||
120 | fi | ||
121 | |||
122 | echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" | 112 | echo "TESTING: firemon cpu (test/utils/firemon-cpu.exp)" |
123 | ./firemon-cpu.exp | 113 | ./firemon-cpu.exp |
124 | 114 | ||