diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-20 17:52:30 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-20 17:52:30 -0500 |
commit | 62b9173095929c7ef21b9fb2385f54ceba956aa7 (patch) | |
tree | 01cd4400eda9486b7160cf7d306149f92b6ca3e8 /test/filters/caps.exp | |
parent | chroot testing (diff) | |
download | firejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.tar.gz firejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.tar.zst firejail-62b9173095929c7ef21b9fb2385f54ceba956aa7.zip |
caps testing
Diffstat (limited to 'test/filters/caps.exp')
-rwxr-xr-x | test/filters/caps.exp | 73 |
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 | } |
15 | sleep 2 | 15 | after 100 |
16 | 16 | ||
17 | send -- "cat /proc/self/status\r" | 17 | send -- "cat /proc/self/status\r" |
18 | expect { | 18 | expect { |
@@ -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 | } |
34 | sleep 2 | 34 | after 100 |
35 | 35 | ||
36 | send -- "cat /proc/self/status\r" | 36 | send -- "cat /proc/self/status\r" |
37 | expect { | 37 | expect { |
@@ -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 | } |
53 | sleep 2 | 53 | after 100 |
54 | 54 | ||
55 | send -- "cat /proc/self/status\r" | 55 | send -- "cat /proc/self/status\r" |
56 | expect { | 56 | expect { |
@@ -66,7 +66,74 @@ expect { | |||
66 | "Seccomp:" | 66 | "Seccomp:" |
67 | } | 67 | } |
68 | send -- "exit\r" | 68 | send -- "exit\r" |
69 | sleep 1 | ||
70 | |||
71 | |||
72 | send -- "firejail --profile=caps1.profile --debug\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 11\n";exit} | ||
75 | "Drop CAP_SYS_MODULE" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 12\n";exit} | ||
79 | "Drop CAP_SYS_ADMIN" | ||
80 | } | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 13\n";exit} | ||
83 | "Drop CAP_" {puts "TESTING ERROR 14\n";exit} | ||
84 | "Child process initialized" | ||
85 | } | ||
69 | after 100 | 86 | after 100 |
87 | send -- "exit\r" | ||
88 | sleep 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" | ||
113 | send -- "firejail --profile=caps3.profile\r" | ||
114 | expect { | ||
115 | timeout {puts "TESTING ERROR 18\n";exit} | ||
116 | "Child process initialized" | ||
117 | } | ||
118 | after 100 | ||
119 | |||
120 | send -- "cat /proc/self/status\r" | ||
121 | expect { | ||
122 | timeout {puts "TESTING ERROR 19\n";exit} | ||
123 | "CapBnd:" | ||
124 | } | ||
125 | expect { | ||
126 | timeout {puts "TESTING ERROR 20\n";exit} | ||
127 | "fffffff0" | ||
128 | } | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 21\n";exit} | ||
131 | "Seccomp:" | ||
132 | } | ||
133 | send -- "exit\r" | ||
134 | sleep 1 | ||
135 | |||
136 | |||
137 | |||
138 | after 100 | ||
72 | puts "\nall done\n" | 139 | puts "\nall done\n" |