aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/caps-join.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2019-01-08 14:39:36 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2019-01-08 14:39:36 -0500
commita45897aef62277c58cbc9991ed5ffe6766287ac3 (patch)
tree1715a055f91b70d5080eda7ed684558a8ab610e1 /test/filters/caps-join.exp
parenttesting seccomp/join (diff)
downloadfirejail-a45897aef62277c58cbc9991ed5ffe6766287ac3.tar.gz
firejail-a45897aef62277c58cbc9991ed5ffe6766287ac3.tar.zst
firejail-a45897aef62277c58cbc9991ed5ffe6766287ac3.zip
test caps join
Diffstat (limited to 'test/filters/caps-join.exp')
-rwxr-xr-xtest/filters/caps-join.exp96
1 files changed, 96 insertions, 0 deletions
diff --git a/test/filters/caps-join.exp b/test/filters/caps-join.exp
new file mode 100755
index 000000000..2e29ef763
--- /dev/null
+++ b/test/filters/caps-join.exp
@@ -0,0 +1,96 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2018 Firejail Authors
4# License GPL v2
5
6set timeout 10
7match_max 100000
8spawn $env(SHELL)
9set id1 $spawn_id
10spawn $env(SHELL)
11set id2 $spawn_id
12
13send -- "stty -echo\r"
14after 100
15
16#
17# regular run
18#
19set spawn_id $id1
20send -- "firejail --name=jointesting\r"
21expect {
22 timeout {puts "TESTING ERROR 0\n";exit}
23 "Child process initialized"
24}
25sleep 1
26
27set spawn_id $id2
28
29send -- "firejail --join=jointesting cat /proc/self/status\r"
30expect {
31 timeout {puts "TESTING ERROR 1\n";exit}
32 "CapBnd: 0000000000000000"
33}
34sleep 1
35
36set spawn_id $id1
37send -- "exit\r"
38after 100
39
40#
41# no caps
42#
43set spawn_id $id1
44send -- "firejail --name=jointesting --noprofile\r"
45expect {
46 timeout {puts "TESTING ERROR 10\n";exit}
47 "Child process initialized"
48}
49sleep 1
50
51set spawn_id $id2
52
53send -- "firejail --join=jointesting cat /proc/self/status\r"
54expect {
55 timeout {puts "TESTING ERROR 11\n";exit}
56 "CapBnd:"
57}
58expect {
59 timeout {puts "TESTING ERROR 12\n";exit}
60 "fffffffff"
61}
62expect {
63 timeout {puts "TESTING ERROR 13\n";exit}
64 "CapAmb:"
65}
66sleep 1
67
68set spawn_id $id1
69send -- "exit\r"
70after 100
71
72#
73# no caps
74#
75set spawn_id $id1
76send -- "firejail --name=jointesting --noprofile --caps.keep=chown,fowner\r"
77expect {
78 timeout {puts "TESTING ERROR20\n";exit}
79 "Child process initialized"
80}
81sleep 1
82
83set spawn_id $id2
84
85send -- "firejail --join=jointesting cat /proc/self/status\r"
86expect {
87 timeout {puts "TESTING ERROR 21\n";exit}
88 "CapBnd: 0000000000000009"
89}
90sleep 1
91
92set spawn_id $id1
93send -- "exit\r"
94after 100
95
96puts "all done\n"