diff options
Diffstat (limited to 'test/filters/seccomp-empty.exp')
-rwxr-xr-x | test/filters/seccomp-empty.exp | 148 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --debug --seccomp=chmod,fchmod,fchmodat --private\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "VALIDATE_ARCHITECTURE" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
17 | "mount" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
21 | "ptrace" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
25 | "chmod" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
29 | "fchmod" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 0.5\n";exit} | ||
33 | "fchmodat" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 0.6\n";exit} | ||
37 | "RETURN_ALLOW" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 0.7\n";exit} | ||
41 | "Child process initialized" | ||
42 | } | ||
43 | sleep 2 | ||
44 | send -- "exit\r" | ||
45 | sleep 3 | ||
46 | puts "\n" | ||
47 | |||
48 | send -- "firejail --debug --seccomp.drop=chmod,fchmod,fchmodat --private\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 1\n";exit} | ||
51 | "VALIDATE_ARCHITECTURE" | ||
52 | } | ||
53 | expect { | ||
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 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
61 | "fchmod" | ||
62 | } | ||
63 | expect { | ||
64 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
65 | "fchmodat" | ||
66 | } | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
69 | "RETURN_ALLOW" | ||
70 | } | ||
71 | expect { | ||
72 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
73 | "Child process initialized" | ||
74 | } | ||
75 | sleep 2 | ||
76 | send -- "exit\r" | ||
77 | puts "\n" | ||
78 | |||
79 | sleep 2 | ||
80 | send -- "firejail --debug --profile=seccomp.profile --private\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 2\n";exit} | ||
83 | "VALIDATE_ARCHITECTURE" | ||
84 | } | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
87 | "mount" | ||
88 | } | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
91 | "ptrace" | ||
92 | } | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
95 | "chmod" | ||
96 | } | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
99 | "fchmod" | ||
100 | } | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 2.5\n";exit} | ||
103 | "fchmodat" | ||
104 | } | ||
105 | expect { | ||
106 | timeout {puts "TESTING ERROR 2.6\n";exit} | ||
107 | "RETURN_ALLOW" | ||
108 | } | ||
109 | expect { | ||
110 | timeout {puts "TESTING ERROR 2.7\n";exit} | ||
111 | "Child process initialized" | ||
112 | } | ||
113 | sleep 2 | ||
114 | send -- "exit\r" | ||
115 | sleep 3 | ||
116 | puts "\n" | ||
117 | |||
118 | send -- "firejail --debug --profile=seccomp-empty.profile --private\r" | ||
119 | expect { | ||
120 | timeout {puts "TESTING ERROR 3\n";exit} | ||
121 | "VALIDATE_ARCHITECTURE" | ||
122 | } | ||
123 | expect { | ||
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 | } | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
131 | "fchmod" | ||
132 | } | ||
133 | expect { | ||
134 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
135 | "fchmodat" | ||
136 | } | ||
137 | expect { | ||
138 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
139 | "RETURN_ALLOW" | ||
140 | } | ||
141 | expect { | ||
142 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
143 | "Child process initialized" | ||
144 | } | ||
145 | sleep 2 | ||
146 | send -- "exit\r" | ||
147 | puts "\n" | ||
148 | |||