summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2019-08-28 11:15:18 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2019-08-28 11:15:18 -0400
commit26ae0b23436a51b09b9be726ef97e27f36579fc9 (patch)
treedd8855b0f0c9ec9f651e4afdb99d5ae9e3e98bd1 /test
parentMerge pull request #2929 from aoand/master (diff)
downloadfirejail-26ae0b23436a51b09b9be726ef97e27f36579fc9.tar.gz
firejail-26ae0b23436a51b09b9be726ef97e27f36579fc9.tar.zst
firejail-26ae0b23436a51b09b9be726ef97e27f36579fc9.zip
seccomp numeric testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/filters/filters.sh3
-rwxr-xr-xtest/filters/seccomp-numeric.exp44
2 files changed, 47 insertions, 0 deletions
diff --git a/test/filters/filters.sh b/test/filters/filters.sh
index 114978f65..10e50539b 100755
--- a/test/filters/filters.sh
+++ b/test/filters/filters.sh
@@ -110,6 +110,9 @@ echo "TESTING: seccomp chmod profile - seccomp lists (test/filters/seccomp-chmod
110echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)" 110echo "TESTING: seccomp empty (test/filters/seccomp-empty.exp)"
111./seccomp-empty.exp 111./seccomp-empty.exp
112 112
113echo "TESTING: seccomp numeric (test/filters/seccomp-numeric.exp)"
114./seccomp-numeric.exp
115
113if [ "$(uname -m)" = "x86_64" ]; then 116if [ "$(uname -m)" = "x86_64" ]; then
114 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)" 117 echo "TESTING: seccomp dual filter (test/filters/seccomp-dualfilter.exp)"
115 ./seccomp-dualfilter.exp 118 ./seccomp-dualfilter.exp
diff --git a/test/filters/seccomp-numeric.exp b/test/filters/seccomp-numeric.exp
new file mode 100755
index 000000000..77f6d60b0
--- /dev/null
+++ b/test/filters/seccomp-numeric.exp
@@ -0,0 +1,44 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch seccomp-test-file\r"
11after 100
12
13send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory"
17}
18after 100
19
20send -- "firejail --seccomp=\\\$263:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "No such file or directory"
24}
25after 100
26
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT mkdir seccomp-test-dir\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "No such file or directory"
31}
32after 100
33
34send -- "firejail --seccomp=unlinkat:ENOENT,\\\$83:ENOENT mkdir seccomp-test-dir\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 "No such file or directory"
38}
39after 100
40
41send -- "rm seccomp-test-file\r"
42#send -- "rm -fr seccomp-test-dir\r"
43after 100
44puts "all done\n"