aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/seccomp-empty.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/seccomp-empty.exp')
-rwxr-xr-xtest/filters/seccomp-empty.exp148
1 files changed, 148 insertions, 0 deletions
diff --git a/test/filters/seccomp-empty.exp b/test/filters/seccomp-empty.exp
new file mode 100755
index 000000000..11b275c7d
--- /dev/null
+++ b/test/filters/seccomp-empty.exp
@@ -0,0 +1,148 @@
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 --debug --seccomp=chmod,fchmod,fchmodat --private\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "VALIDATE_ARCHITECTURE"
14}
15expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit}
17 "mount"
18}
19expect {
20 timeout {puts "TESTING ERROR 0.2\n";exit}
21 "ptrace"
22}
23expect {
24 timeout {puts "TESTING ERROR 0.3\n";exit}
25 "chmod"
26}
27expect {
28 timeout {puts "TESTING ERROR 0.4\n";exit}
29 "fchmod"
30}
31expect {
32 timeout {puts "TESTING ERROR 0.5\n";exit}
33 "fchmodat"
34}
35expect {
36 timeout {puts "TESTING ERROR 0.6\n";exit}
37 "RETURN_ALLOW"
38}
39expect {
40 timeout {puts "TESTING ERROR 0.7\n";exit}
41 "Child process initialized"
42}
43sleep 2
44send -- "exit\r"
45sleep 3
46puts "\n"
47
48send -- "firejail --debug --seccomp.drop=chmod,fchmod,fchmodat --private\r"
49expect {
50 timeout {puts "TESTING ERROR 1\n";exit}
51 "VALIDATE_ARCHITECTURE"
52}
53expect {
54 timeout {puts "TESTING ERROR 1.1\n";exit}
55 "mount" {puts "TESTING ERROR 1.2\n";exit}
56 "ptrace" {puts "TESTING ERROR 1.3\n";exit}
57 "chmod"
58}
59expect {
60 timeout {puts "TESTING ERROR 1.4\n";exit}
61 "fchmod"
62}
63expect {
64 timeout {puts "TESTING ERROR 1.5\n";exit}
65 "fchmodat"
66}
67expect {
68 timeout {puts "TESTING ERROR 1.6\n";exit}
69 "RETURN_ALLOW"
70}
71expect {
72 timeout {puts "TESTING ERROR 1.7\n";exit}
73 "Child process initialized"
74}
75sleep 2
76send -- "exit\r"
77puts "\n"
78
79sleep 2
80send -- "firejail --debug --profile=seccomp.profile --private\r"
81expect {
82 timeout {puts "TESTING ERROR 2\n";exit}
83 "VALIDATE_ARCHITECTURE"
84}
85expect {
86 timeout {puts "TESTING ERROR 2.1\n";exit}
87 "mount"
88}
89expect {
90 timeout {puts "TESTING ERROR 2.2\n";exit}
91 "ptrace"
92}
93expect {
94 timeout {puts "TESTING ERROR 2.3\n";exit}
95 "chmod"
96}
97expect {
98 timeout {puts "TESTING ERROR 2.4\n";exit}
99 "fchmod"
100}
101expect {
102 timeout {puts "TESTING ERROR 2.5\n";exit}
103 "fchmodat"
104}
105expect {
106 timeout {puts "TESTING ERROR 2.6\n";exit}
107 "RETURN_ALLOW"
108}
109expect {
110 timeout {puts "TESTING ERROR 2.7\n";exit}
111 "Child process initialized"
112}
113sleep 2
114send -- "exit\r"
115sleep 3
116puts "\n"
117
118send -- "firejail --debug --profile=seccomp-empty.profile --private\r"
119expect {
120 timeout {puts "TESTING ERROR 3\n";exit}
121 "VALIDATE_ARCHITECTURE"
122}
123expect {
124 timeout {puts "TESTING ERROR 3.1\n";exit}
125 "mount" {puts "TESTING ERROR 3.2\n";exit}
126 "ptrace" {puts "TESTING ERROR 3.3\n";exit}
127 "chmod"
128}
129expect {
130 timeout {puts "TESTING ERROR 3.4\n";exit}
131 "fchmod"
132}
133expect {
134 timeout {puts "TESTING ERROR 3.5\n";exit}
135 "fchmodat"
136}
137expect {
138 timeout {puts "TESTING ERROR 3.6\n";exit}
139 "RETURN_ALLOW"
140}
141expect {
142 timeout {puts "TESTING ERROR 3.7\n";exit}
143 "Child process initialized"
144}
145sleep 2
146send -- "exit\r"
147puts "\n"
148