summaryrefslogtreecommitdiffstats
path: root/test/utils/caps.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/caps.exp')
-rwxr-xr-xtest/utils/caps.exp129
1 files changed, 129 insertions, 0 deletions
diff --git a/test/utils/caps.exp b/test/utils/caps.exp
new file mode 100755
index 000000000..ab1067921
--- /dev/null
+++ b/test/utils/caps.exp
@@ -0,0 +1,129 @@
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 --name=bingo1 --noprofile --caps\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17spawn $env(SHELL)
18send -- "firejail --name=bingo2 --noprofile\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Child process initialized"
22}
23sleep 1
24
25spawn $env(SHELL)
26send -- "firejail --name=bingo3 --noprofile --caps.drop=all\r"
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "Child process initialized"
30}
31sleep 1
32
33spawn $env(SHELL)
34send -- "firejail --noprofile --name=bingo4 --caps.drop=chown,kill\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 "Child process initialized"
38}
39sleep 1
40
41spawn $env(SHELL)
42send -- "firejail --noprofile --name=bingo5 --caps.keep=chown,kill\r"
43expect {
44 timeout {puts "TESTING ERROR 4\n";exit}
45 "Child process initialized"
46}
47sleep 1
48
49spawn $env(SHELL)
50send -- "firejail --name=bingo6 --profile=caps1.profile\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 "Child process initialized"
54}
55sleep 1
56
57spawn $env(SHELL)
58send -- "firejail --name=bingo7 --profile=caps2.profile\r"
59expect {
60 timeout {puts "TESTING ERROR 0\n";exit}
61 "Child process initialized"
62}
63sleep 1
64
65spawn $env(SHELL)
66send -- "firemon --caps\r"
67expect {
68 timeout {puts "TESTING ERROR 8.1\n";exit}
69 "bingo1"
70}
71expect {
72 timeout {puts "TESTING ERROR 8.2\n";exit}
73 "31cffff"
74}
75expect {
76 timeout {puts "TESTING ERROR 8.3\n";exit}
77 "bingo2"
78}
79expect {
80 timeout {puts "TESTING ERROR 8.4\n";exit}
81 "fffffff"
82}
83expect {
84 timeout {puts "TESTING ERROR 8.5\n";exit}
85 "bingo3"
86}
87expect {
88 timeout {puts "TESTING ERROR 8.6\n";exit}
89 "000000000000"
90}
91
92expect {
93 timeout {puts "TESTING ERROR 8.7\n";exit}
94 "bingo4"
95}
96expect {
97 timeout {puts "TESTING ERROR 8.8\n";exit}
98 "ffffffde"
99}
100expect {
101 timeout {puts "TESTING ERROR 8.9\n";exit}
102 "bingo5"
103}
104expect {
105 timeout {puts "TESTING ERROR 8.10\n";exit}
106 "0000000000000021"
107}
108
109expect {
110 timeout {puts "TESTING ERROR 8.11\n";exit}
111 "bingo6"
112}
113expect {
114 timeout {puts "TESTING ERROR 8.12\n";exit}
115 "ffffffde"
116}
117expect {
118 timeout {puts "TESTING ERROR 8.13\n";exit}
119 "bingo7"
120}
121expect {
122 timeout {puts "TESTING ERROR 8.14\n";exit}
123 "0000000000000021"
124}
125
126after 100
127
128puts "all done\n"
129