aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-10-30 16:09:57 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-10-30 16:09:57 -0400
commit66042d7dbc60f183e9d77fefd93a9584e3cf35ef (patch)
tree9d54205a755125c61c87f7f8e9c0e48743c28b88 /test
parenttesting, fixed cryptocat.profile (diff)
downloadfirejail-66042d7dbc60f183e9d77fefd93a9584e3cf35ef.tar.gz
firejail-66042d7dbc60f183e9d77fefd93a9584e3cf35ef.tar.zst
firejail-66042d7dbc60f183e9d77fefd93a9584e3cf35ef.zip
fix --ignore=quiet
Diffstat (limited to 'test')
-rwxr-xr-xtest/private-lib/gnome-calculator.exp8
-rwxr-xr-xtest/profiles/ignore.exp43
-rw-r--r--test/profiles/ignore2.profile2
-rw-r--r--test/profiles/ignore3.profile4
4 files changed, 50 insertions, 7 deletions
diff --git a/test/private-lib/gnome-calculator.exp b/test/private-lib/gnome-calculator.exp
index 590da34cf..6d20c36f4 100755
--- a/test/private-lib/gnome-calculator.exp
+++ b/test/private-lib/gnome-calculator.exp
@@ -7,7 +7,9 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail gnome-calculator\r" 10# gnome-calculator uses quiet at the top of the profile
11# we need to use --ignore
12send -- "firejail --ignore=quiet gnome-calculator\r"
11expect { 13expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 14 timeout {puts "TESTING ERROR 0\n";exit}
13 "Reading profile /etc/firejail/gnome-calculator.profile" 15 "Reading profile /etc/firejail/gnome-calculator.profile"
@@ -50,7 +52,7 @@ send -- "firemon --seccomp\r"
50expect { 52expect {
51 timeout {puts "TESTING ERROR 5\n";exit} 53 timeout {puts "TESTING ERROR 5\n";exit}
52 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} 54 "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit}
53 ":firejail gnome-calculator" 55 ":firejail --ignore=quiet gnome-calculator"
54} 56}
55expect { 57expect {
56 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} 58 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
@@ -64,7 +66,7 @@ after 100
64send -- "firemon --caps\r" 66send -- "firemon --caps\r"
65expect { 67expect {
66 timeout {puts "TESTING ERROR 6\n";exit} 68 timeout {puts "TESTING ERROR 6\n";exit}
67 ":firejail gnome-calculator" 69 ":firejail --ignore=quiet gnome-calculator"
68} 70}
69expect { 71expect {
70 timeout {puts "TESTING ERROR 6.1\n";exit} 72 timeout {puts "TESTING ERROR 6.1\n";exit}
diff --git a/test/profiles/ignore.exp b/test/profiles/ignore.exp
index cdb38e97b..8463d6cc8 100755
--- a/test/profiles/ignore.exp
+++ b/test/profiles/ignore.exp
@@ -19,7 +19,7 @@ expect {
19 BLACKLIST {puts "TESTING ERROR 2\n";exit} 19 BLACKLIST {puts "TESTING ERROR 2\n";exit}
20 "Child process initialized" 20 "Child process initialized"
21} 21}
22sleep 1 22after 100
23send -- "exit\r" 23send -- "exit\r"
24sleep 1 24sleep 1
25 25
@@ -28,23 +28,58 @@ expect {
28 timeout {puts "TESTING ERROR 3\n";exit} 28 timeout {puts "TESTING ERROR 3\n";exit}
29 "Child process initialized" 29 "Child process initialized"
30} 30}
31sleep 1 31after 100
32 32
33send -- "ps aux | wc -l\r" 33send -- "ps aux | wc -l\r"
34expect { 34expect {
35 timeout {puts "TESTING ERROR 4\n";exit} 35 timeout {puts "TESTING ERROR 4\n";exit}
36 "5" 36 "5"
37} 37}
38after 100
39send -- "exit\r"
38sleep 1 40sleep 1
41
42send -- "firejail --ignore=private --ignore=shell --profile=ignore.profile \r"
43expect {
44 timeout {puts "TESTING ERROR 5\n";exit}
45 "Child process initialized"
46}
47after 100
48
49send -- "ps aux | wc -l\r"
50expect {
51 timeout {puts "TESTING ERROR 6\n";exit}
52 "5"
53}
54after 100
39send -- "exit\r" 55send -- "exit\r"
40sleep 1 56sleep 1
41 57
42send -- "firejail --debug --profile=ignore2.profile\r" 58send -- "firejail --debug --profile=ignore2.profile\r"
43expect { 59expect {
44 timeout {puts "TESTING ERROR 5\n";exit} 60 timeout {puts "TESTING ERROR 7\n";exit}
45 BLACKLIST {puts "TESTING ERROR 6\n";exit} 61 BLACKLIST {puts "TESTING ERROR 8\n";exit}
46 "Child process initialized" 62 "Child process initialized"
47} 63}
48 64
49after 100 65after 100
66send -- "exit\r"
67sleep 1
68
69send -- "firejail --ignore=quiet --ignore=shell --profile=ignore.profile \r"
70expect {
71 timeout {puts "TESTING ERROR 9\n";exit}
72 "Child process initialized"
73}
74after 100
75
76send -- "ps aux | wc -l\r"
77expect {
78 timeout {puts "TESTING ERROR 10\n";exit}
79 "5"
80}
81after 100
82send -- "exit\r"
83after 100
84
50puts "\nall done\n" 85puts "\nall done\n"
diff --git a/test/profiles/ignore2.profile b/test/profiles/ignore2.profile
index 49fcd8324..c85cd9544 100644
--- a/test/profiles/ignore2.profile
+++ b/test/profiles/ignore2.profile
@@ -1,3 +1,5 @@
1ignore seccomp 1ignore seccomp
2ignore shell
2private 3private
3seccomp 4seccomp
5shell none
diff --git a/test/profiles/ignore3.profile b/test/profiles/ignore3.profile
new file mode 100644
index 000000000..f0c9699e1
--- /dev/null
+++ b/test/profiles/ignore3.profile
@@ -0,0 +1,4 @@
1quiet
2private
3seccomp
4shell none