aboutsummaryrefslogtreecommitdiffstats
path: root/test/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'test/profiles')
-rwxr-xr-xtest/profiles/ignore.exp50
-rw-r--r--test/profiles/ignore.profile3
-rw-r--r--test/profiles/ignore2.profile3
-rwxr-xr-xtest/profiles/profiles.sh7
4 files changed, 61 insertions, 2 deletions
diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp
new file mode 100755
index 000000000..281697b26
--- /dev/null
+++ b/test/profiles/ignore.exp
@@ -0,0 +1,50 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --profile=ignore.profile --ignore=seccomp \r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Error: please use --profile after --ignore"
14}
15
16send -- "firejail --debug --ignore=seccomp\r"
17expect {
18 timeout {puts "TESTING ERROR 1\n";exit}
19 BLACKLIST {puts "TESTING ERROR 2\n";exit}
20 "Child process initialized"
21}
22sleep 1
23send -- "exit\r"
24sleep 1
25
26send -- "firejail --ignore=seccomp --ignore=shell --profile=ignore.profile \r"
27expect {
28 timeout {puts "TESTING ERROR 3\n";exit}
29 "Child process initialized"
30}
31sleep 1
32
33send -- "ps aux | wc -l\r"
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "5"
37}
38sleep 1
39send -- "exit\r"
40sleep 1
41
42send -- "firejail --debug --profile=ignore2.profile\r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 BLACKLIST {puts "TESTING ERROR 6\n";exit}
46 "Child process initialized"
47}
48
49
50puts "\nall done\n"
diff --git a/test/profiles/ignore.profile b/test/profiles/ignore.profile
new file mode 100644
index 000000000..aec231ad2
--- /dev/null
+++ b/test/profiles/ignore.profile
@@ -0,0 +1,3 @@
1private
2seccomp
3shell none
diff --git a/test/profiles/ignore2.profile b/test/profiles/ignore2.profile
new file mode 100644
index 000000000..49fcd8324
--- /dev/null
+++ b/test/profiles/ignore2.profile
@@ -0,0 +1,3 @@
1ignore seccomp
2private
3seccomp
diff --git a/test/profiles/profiles.sh b/test/profiles/profiles.sh
index a20ed5432..e3adc8a4f 100755
--- a/test/profiles/profiles.sh
+++ b/test/profiles/profiles.sh
@@ -14,9 +14,12 @@ do
14 ./test-profile.exp $PROFILE 14 ./test-profile.exp $PROFILE
15done 15done
16 16
17echo "TESTING: profile syntax (profiles/profile_syntax.exp)" 17echo "TESTING: profile syntax (test/profiles/profile_syntax.exp)"
18./profile_syntax.exp 18./profile_syntax.exp
19 19
20echo "TESTING: profile syntax 2 (profiles/profile_syntax2.exp)" 20echo "TESTING: profile syntax 2 (test/profiles/profile_syntax2.exp)"
21./profile_syntax2.exp 21./profile_syntax2.exp
22 22
23echo "TESTING: ignore command (test/profiles/ignore.exp)"
24./ignore.exp
25