aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-03-03 17:23:43 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-03-03 17:23:43 -0500
commit295a207490bb7338d6f1ad89830620da2597ebdc (patch)
tree6c9abb217ae181ec8266a4125a6db1b684038990 /test/filters
parenttesting firecfg (diff)
downloadfirejail-295a207490bb7338d6f1ad89830620da2597ebdc.tar.gz
firejail-295a207490bb7338d6f1ad89830620da2597ebdc.tar.zst
firejail-295a207490bb7338d6f1ad89830620da2597ebdc.zip
testing: moving apparmor out from filters group
Diffstat (limited to 'test/filters')
-rwxr-xr-xtest/filters/apparmor.exp59
-rwxr-xr-xtest/filters/filters.sh12
2 files changed, 6 insertions, 65 deletions
diff --git a/test/filters/apparmor.exp b/test/filters/apparmor.exp
deleted file mode 100755
index a8f73c797..000000000
--- a/test/filters/apparmor.exp
+++ /dev/null
@@ -1,59 +0,0 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2023 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --name=test1 --apparmor\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=test2 --apparmor\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 -- "firemon --apparmor\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "test1:firejail --name=test1 --apparmor"
30}
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "AppArmor: firejail-default//&unconfined enforce"
34}
35expect {
36 timeout {puts "TESTING ERROR 4\n";exit}
37 "test2:firejail --name=test2 --apparmor"
38}
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 "AppArmor: firejail-default//&unconfined enforce"
42}
43after 100
44
45send -- "firejail --apparmor.print=test1\r"
46expect {
47 timeout {puts "TESTING ERROR 6\n";exit}
48 "AppArmor: firejail-default//&unconfined enforce"
49}
50after 100
51
52send -- "firejail --apparmor.print=test2\r"
53expect {
54 timeout {puts "TESTING ERROR 7\n";exit}
55 "AppArmor: firejail-default//&unconfined enforce"
56}
57after 100
58
59puts "\nall done\n"
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index 1d145ac4b..2d115db1b 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -13,12 +13,12 @@ if [[ -f /etc/debian_version ]]; then
13fi 13fi
14export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" 14export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail"
15 15
16if [[ -f /sys/kernel/security/apparmor/profiles ]]; then 16#if [[ -f /sys/kernel/security/apparmor/profiles ]]; then
17 echo "TESTING: apparmor (test/filters/apparmor.exp)" 17# echo "TESTING: apparmor (test/filters/apparmor.exp)"
18 ./apparmor.exp 18# ./apparmor.exp
19else 19#else
20 echo "TESTING SKIP: no apparmor support in Linux kernel (test/filters/apparmor.exp)" 20# echo "TESTING SKIP: no apparmor support in Linux kernel (test/filters/apparmor.exp)"
21fi 21#fi
22 22
23if [[ $(uname -m) == "x86_64" ]]; then 23if [[ $(uname -m) == "x86_64" ]]; then
24 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" 24 echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)"