diff options
author | netblue30 <netblue30@protonmail.com> | 2023-03-08 16:23:30 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-03-08 16:23:30 -0500 |
commit | acf8efb878b84882a9df61eff51fdcaceb522a4c (patch) | |
tree | 88042e5d0723c36a10efc05774335bd0df52703a /test | |
parent | Merge pull request #5717 from glitsj16/aa-examples (diff) | |
download | firejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.tar.gz firejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.tar.zst firejail-acf8efb878b84882a9df61eff51fdcaceb522a4c.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/capabilities/capabilities.sh | 23 | ||||
-rwxr-xr-x | test/capabilities/caps-join.exp (renamed from test/filters/caps-join.exp) | 0 | ||||
-rwxr-xr-x | test/capabilities/caps-print.exp (renamed from test/filters/caps-print.exp) | 0 | ||||
-rwxr-xr-x | test/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-x | test/filters/filters.sh | 24 | ||||
-rwxr-xr-x | test/firecfg/firecfg.exp | 13 | ||||
-rwxr-xr-x | test/firecfg/firecfg.sh | 5 |
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 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | export 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 | |||
18 | echo "TESTING: capabilities print (test/filters/caps-print.exp)" | ||
19 | ./caps-print.exp | ||
20 | |||
21 | echo "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 | ||
60 | if 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 |
63 | else | 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)" |
65 | fi | 65 | #fi |
66 | 66 | # | |
67 | echo "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 | # | |
70 | echo "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 | ||
73 | rm -f seccomp-test-file | 73 | rm -f seccomp-test-file |
74 | if [[ $(uname -m) == "x86_64" ]]; then | 74 | if [[ $(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 | } |
15 | after 100 | ||
15 | 16 | ||
17 | send -- "file /tmp/ttt/ping\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 0\n";exit} | ||
20 | "ping: symbolic link to /usr/bin/firejail" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "firecfg --list\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "/usr/local/bin/ping" | ||
28 | } | ||
16 | after 100 | 29 | after 100 |
17 | 30 | ||
18 | puts "\nall done\n" | 31 | puts "\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 | |||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | export LC_ALL=C | 8 | export LC_ALL=C |
9 | 9 | ||
10 | sudo mkdir /tmp/ttt | ||
10 | sudo firecfg | 11 | sudo firecfg |
12 | sudo firecfg --bindir=/tmp/ttt | ||
13 | |||
11 | echo "TESTING: firecfg (test/firecfg/firecfg.exp)" | 14 | echo "TESTING: firecfg (test/firecfg/firecfg.exp)" |
12 | ./firecfg.exp | 15 | ./firecfg.exp |
16 | |||
17 | sudo rm -fr /tmp/ttt | ||