aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/caps.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-20 17:52:30 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-20 17:52:30 -0500
commit62b9173095929c7ef21b9fb2385f54ceba956aa7 (patch)
tree01cd4400eda9486b7160cf7d306149f92b6ca3e8 /test/filters/caps.exp
parentchroot testing (diff)
downloadfirejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.tar.gz
firejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.tar.zst
firejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.zip
caps testing
Diffstat (limited to 'test/filters/caps.exp')
-rwxr-xr-xtest/filters/caps.exp73
1 files changed, 70 insertions, 3 deletions
diff --git a/test/filters/caps.exp b/test/filters/caps.exp
index 7f7cf7dd1..2954f2e58 100755
--- a/test/filters/caps.exp
+++ b/test/filters/caps.exp
@@ -12,7 +12,7 @@ expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized" 13 "Child process initialized"
14} 14}
15sleep 2 15after 100
16 16
17send -- "cat /proc/self/status\r" 17send -- "cat /proc/self/status\r"
18expect { 18expect {
@@ -31,7 +31,7 @@ expect {
31 timeout {puts "TESTING ERROR 4\n";exit} 31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Child process initialized" 32 "Child process initialized"
33} 33}
34sleep 2 34after 100
35 35
36send -- "cat /proc/self/status\r" 36send -- "cat /proc/self/status\r"
37expect { 37expect {
@@ -50,7 +50,7 @@ expect {
50 timeout {puts "TESTING ERROR 7\n";exit} 50 timeout {puts "TESTING ERROR 7\n";exit}
51 "Child process initialized" 51 "Child process initialized"
52} 52}
53sleep 2 53after 100
54 54
55send -- "cat /proc/self/status\r" 55send -- "cat /proc/self/status\r"
56expect { 56expect {
@@ -66,7 +66,74 @@ expect {
66 "Seccomp:" 66 "Seccomp:"
67} 67}
68send -- "exit\r" 68send -- "exit\r"
69sleep 1
70
71
72send -- "firejail --profile=caps1.profile --debug\r"
73expect {
74 timeout {puts "TESTING ERROR 11\n";exit}
75 "Drop CAP_SYS_MODULE"
76}
77expect {
78 timeout {puts "TESTING ERROR 12\n";exit}
79 "Drop CAP_SYS_ADMIN"
80}
81expect {
82 timeout {puts "TESTING ERROR 13\n";exit}
83 "Drop CAP_" {puts "TESTING ERROR 14\n";exit}
84 "Child process initialized"
85}
69after 100 86after 100
87send -- "exit\r"
88sleep 1
70 89
71 90
91## tofix: possible problem with caps.keep in profile files
92##send -- "firejail --caps.keep=chown,fowner --noprofile\r"
93#send -- "firejail --profile=caps2.profile\r"
94#expect {
95# timeout {puts "TESTING ERROR 15\n";exit}
96# "Child process initialized"
97#}
98#after 100
99#
100#send -- "cat /proc/self/status\r"
101#expect {
102# timeout {puts "TESTING ERROR 16\n";exit}
103# "CapBnd: 0000000000000009"
104#}
105#expect {
106# timeout {puts "TESTING ERROR 17\n";exit}
107# "Seccomp:"
108#}
109#send -- "exit\r"
110#sleep 1
111
112#send -- "firejail --caps.drop=chown,dac_override,dac_read_search,fowner --noprofile\r"
113send -- "firejail --profile=caps3.profile\r"
114expect {
115 timeout {puts "TESTING ERROR 18\n";exit}
116 "Child process initialized"
117}
118after 100
119
120send -- "cat /proc/self/status\r"
121expect {
122 timeout {puts "TESTING ERROR 19\n";exit}
123 "CapBnd:"
124}
125expect {
126 timeout {puts "TESTING ERROR 20\n";exit}
127 "fffffff0"
128}
129expect {
130 timeout {puts "TESTING ERROR 21\n";exit}
131 "Seccomp:"
132}
133send -- "exit\r"
134sleep 1
135
136
137
138after 100
72puts "\nall done\n" 139puts "\nall done\n"