aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2023-03-08 16:23:30 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2023-03-08 16:23:30 -0500
commitacf8efb878b84882a9df61eff51fdcaceb522a4c (patch)
tree88042e5d0723c36a10efc05774335bd0df52703a /test
parentMerge pull request #5717 from glitsj16/aa-examples (diff)
downloadfirejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.tar.gz
firejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.tar.zst
firejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/capabilities/capabilities.sh23
-rwxr-xr-xtest/capabilities/caps-join.exp (renamed from test/filters/caps-join.exp)0
-rwxr-xr-xtest/capabilities/caps-print.exp (renamed from test/filters/caps-print.exp)0
-rwxr-xr-xtest/capabilities/caps.exp (renamed from test/filters/caps.exp)0
-rw-r--r--test/capabilities/caps1.profile (renamed from test/filters/caps1.profile)0
-rw-r--r--test/capabilities/caps2.profile (renamed from test/filters/caps2.profile)0
-rw-r--r--test/capabilities/caps3.profile (renamed from test/filters/caps3.profile)0
-rwxr-xr-xtest/filters/filters.sh24
-rwxr-xr-xtest/firecfg/firecfg.exp13
-rwxr-xr-xtest/firecfg/firecfg.sh5
10 files changed, 53 insertions, 12 deletions
diff --git a/test/capabilities/capabilities.sh b/test/capabilities/capabilities.sh
new file mode 100755
index 000000000..50279cd4f
--- /dev/null
+++ b/test/capabilities/capabilities.sh
@@ -0,0 +1,23 @@
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
10
11#if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then
12 echo "TESTING: capabilities (test/filters/caps.exp)"
13 ./caps.exp
14#else
15# echo "TESTING SKIP: other capabilities than expected (test/filters/caps.exp)"
16#fi
17
18echo "TESTING: capabilities print (test/filters/caps-print.exp)"
19./caps-print.exp
20
21echo "TESTING: capabilities join (test/filters/caps-join.exp)"
22./caps-join.exp
23
diff --git a/test/filters/caps-join.exp b/test/capabilities/caps-join.exp
index 1830143fb..1830143fb 100755
--- a/test/filters/caps-join.exp
+++ b/test/capabilities/caps-join.exp
diff --git a/test/filters/caps-print.exp b/test/capabilities/caps-print.exp
index b403f9ffe..b403f9ffe 100755
--- a/test/filters/caps-print.exp
+++ b/test/capabilities/caps-print.exp
diff --git a/test/filters/caps.exp b/test/capabilities/caps.exp
index dbd63efda..dbd63efda 100755
--- a/test/filters/caps.exp
+++ b/test/capabilities/caps.exp
diff --git a/test/filters/caps1.profile b/test/capabilities/caps1.profile
index 8b0c3b340..8b0c3b340 100644
--- a/test/filters/caps1.profile
+++ b/test/capabilities/caps1.profile
diff --git a/test/filters/caps2.profile b/test/capabilities/caps2.profile
index ad49719f1..ad49719f1 100644
--- a/test/filters/caps2.profile
+++ b/test/capabilities/caps2.profile
diff --git a/test/filters/caps3.profile b/test/capabilities/caps3.profile
index ad49719f1..ad49719f1 100644
--- a/test/filters/caps3.profile
+++ b/test/capabilities/caps3.profile
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index 2d115db1b..e19047e6f 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -57,18 +57,18 @@ echo "TESTING: noroot (test/filters/noroot.exp)"
57./noroot.exp 57./noroot.exp
58 58
59 59
60if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then 60#if grep -q "^CapBnd:\\s0000003fffffffff" /proc/self/status; then
61 echo "TESTING: capabilities (test/filters/caps.exp)" 61# echo "TESTING: capabilities (test/filters/caps.exp)"
62 ./caps.exp 62# ./caps.exp
63else 63#else
64 echo "TESTING SKIP: other capabilities than expected (test/filters/caps.exp)" 64# echo "TESTING SKIP: other capabilities than expected (test/filters/caps.exp)"
65fi 65#fi
66 66#
67echo "TESTING: capabilities print (test/filters/caps-print.exp)" 67#echo "TESTING: capabilities print (test/filters/caps-print.exp)"
68./caps-print.exp 68#./caps-print.exp
69 69#
70echo "TESTING: capabilities join (test/filters/caps-join.exp)" 70#echo "TESTING: capabilities join (test/filters/caps-join.exp)"
71./caps-join.exp 71#./caps-join.exp
72 72
73rm -f seccomp-test-file 73rm -f seccomp-test-file
74if [[ $(uname -m) == "x86_64" ]]; then 74if [[ $(uname -m) == "x86_64" ]]; then
diff --git a/test/firecfg/firecfg.exp b/test/firecfg/firecfg.exp
index 0249fb7fa..755eea3a1 100755
--- a/test/firecfg/firecfg.exp
+++ b/test/firecfg/firecfg.exp
@@ -12,7 +12,20 @@ expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "ping: symbolic link to /usr/bin/firejail" 13 "ping: symbolic link to /usr/bin/firejail"
14} 14}
15after 100
15 16
17send -- "file /tmp/ttt/ping\r"
18expect {
19 timeout {puts "TESTING ERROR 0\n";exit}
20 "ping: symbolic link to /usr/bin/firejail"
21}
22after 100
23
24send -- "firecfg --list\r"
25expect {
26 timeout {puts "TESTING ERROR 1\n";exit}
27 "/usr/local/bin/ping"
28}
16after 100 29after 100
17 30
18puts "\nall done\n" 31puts "\nall done\n"
diff --git a/test/firecfg/firecfg.sh b/test/firecfg/firecfg.sh
index 6b03cc841..6f2bb5244 100755
--- a/test/firecfg/firecfg.sh
+++ b/test/firecfg/firecfg.sh
@@ -7,6 +7,11 @@ export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C 8export LC_ALL=C
9 9
10sudo mkdir /tmp/ttt
10sudo firecfg 11sudo firecfg
12sudo firecfg --bindir=/tmp/ttt
13
11echo "TESTING: firecfg (test/firecfg/firecfg.exp)" 14echo "TESTING: firecfg (test/firecfg/firecfg.exp)"
12./firecfg.exp 15./firecfg.exp
16
17sudo rm -fr /tmp/ttt