aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/caps.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:27:31 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:27:31 -0400
commita1272742cfbdbfe999a701f804b58ceb4605713d (patch)
tree16d6013c8d99d9e4370d1672b4018f958081f416 /test/filters/caps.exp
parentMerge pull request #490 from reinerh/master (diff)
downloadfirejail-a1272742cfbdbfe999a701f804b58ceb4605713d.tar.gz
firejail-a1272742cfbdbfe999a701f804b58ceb4605713d.tar.zst
firejail-a1272742cfbdbfe999a701f804b58ceb4605713d.zip
added make test-filters
Diffstat (limited to 'test/filters/caps.exp')
-rwxr-xr-xtest/filters/caps.exp72
1 files changed, 72 insertions, 0 deletions
diff --git a/test/filters/caps.exp b/test/filters/caps.exp
new file mode 100755
index 000000000..034d6a733
--- /dev/null
+++ b/test/filters/caps.exp
@@ -0,0 +1,72 @@
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 --caps.keep=chown,fowner --noprofile\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 2
16
17send -- "cat /proc/self/status\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "CapBnd: 0000000000000009"
21}
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "Seccomp:"
25}
26send -- "exit\r"
27sleep 1
28
29send -- "firejail --caps.drop=all --noprofile\r"
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Child process initialized"
33}
34sleep 2
35
36send -- "cat /proc/self/status\r"
37expect {
38 timeout {puts "TESTING ERROR 5\n";exit}
39 "CapBnd: 0000000000000000"
40}
41expect {
42 timeout {puts "TESTING ERROR 6\n";exit}
43 "Seccomp:"
44}
45send -- "exit\r"
46sleep 1
47
48send -- "firejail --caps.drop=chown,dac_override,dac_read_search,fowner --noprofile\r"
49expect {
50 timeout {puts "TESTING ERROR 7\n";exit}
51 "Child process initialized"
52}
53sleep 2
54
55send -- "cat /proc/self/status\r"
56expect {
57 timeout {puts "TESTING ERROR 8\n";exit}
58 "CapBnd:"
59}
60expect {
61 timeout {puts "TESTING ERROR 9\n";exit}
62 "fffffff0"
63}
64expect {
65 timeout {puts "TESTING ERROR 10\n";exit}
66 "Seccomp:"
67}
68send -- "exit\r"
69sleep 1
70
71
72puts "\nall done\n"