diff options
author | netblue30 <netblue30@protonmail.com> | 2023-02-28 09:51:26 -0500 |
---|---|---|
committer | netblue30 <netblue30@protonmail.com> | 2023-02-28 09:51:26 -0500 |
commit | 27c4d069f322fbeca07c88e0e96208233103a5db (patch) | |
tree | fb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test/features/3.4.exp | |
parent | fix cppcheck/scan-build problems (diff) | |
download | firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip |
chroot testing
Diffstat (limited to 'test/features/3.4.exp')
-rwxr-xr-x | test/features/3.4.exp | 208 |
1 files changed, 0 insertions, 208 deletions
diff --git a/test/features/3.4.exp b/test/features/3.4.exp deleted file mode 100755 index 813c2d86a..000000000 --- a/test/features/3.4.exp +++ /dev/null | |||
@@ -1,208 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | # | ||
6 | # whitelist home | ||
7 | # | ||
8 | |||
9 | set timeout 10 | ||
10 | spawn $env(SHELL) | ||
11 | match_max 100000 | ||
12 | set overlay [lindex $argv 0] | ||
13 | set chroot [lindex $argv 1] | ||
14 | |||
15 | # | ||
16 | # N | ||
17 | # | ||
18 | send -- "firejail --noprofile --whitelist=/home/netblue/.config\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0\n";exit} | ||
21 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls -al | wc -l\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
28 | "6" | ||
29 | } | ||
30 | |||
31 | send -- "ls -al .bashrc\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
34 | "netblue" | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
38 | "netblue" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
42 | ".bashrc" | ||
43 | } | ||
44 | |||
45 | send -- "ls -al .Xauthority\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 1.5\n";exit} | ||
48 | "netblue" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
52 | "netblue" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
56 | ".Xauthority" | ||
57 | } | ||
58 | |||
59 | send -- "ls -al | grep .config\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 1.8\n";exit} | ||
62 | "netblue" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 1.9\n";exit} | ||
66 | "netblue" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 1.10\n";exit} | ||
70 | ".config" | ||
71 | } | ||
72 | |||
73 | after 100 | ||
74 | send -- "exit\r" | ||
75 | sleep 1 | ||
76 | |||
77 | |||
78 | # | ||
79 | # O | ||
80 | # | ||
81 | if { $overlay == "overlay" } { | ||
82 | send -- "firejail --noprofile --overlay --whitelist=/home/netblue/.config\r" | ||
83 | expect { | ||
84 | timeout {puts "TESTING ERROR 2\n";exit} | ||
85 | "overlay option is not available" {puts "grsecurity\n"; exit} | ||
86 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"} | ||
87 | } | ||
88 | sleep 1 | ||
89 | |||
90 | send -- "ls -al | wc -l\r" | ||
91 | expect { | ||
92 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
93 | "6" | ||
94 | } | ||
95 | |||
96 | send -- "ls -al .bashrc\r" | ||
97 | expect { | ||
98 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
99 | "netblue" | ||
100 | } | ||
101 | expect { | ||
102 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
103 | "netblue" | ||
104 | } | ||
105 | expect { | ||
106 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
107 | ".bashrc" | ||
108 | } | ||
109 | |||
110 | send -- "ls -al .Xauthority\r" | ||
111 | expect { | ||
112 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
113 | "netblue" | ||
114 | } | ||
115 | expect { | ||
116 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
117 | "netblue" | ||
118 | } | ||
119 | expect { | ||
120 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
121 | ".Xauthority" | ||
122 | } | ||
123 | |||
124 | send -- "ls -al | grep .config\r" | ||
125 | expect { | ||
126 | timeout {puts "TESTING ERROR 3.8\n";exit} | ||
127 | "netblue" | ||
128 | } | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 3.9\n";exit} | ||
131 | "netblue" | ||
132 | } | ||
133 | expect { | ||
134 | timeout {puts "TESTING ERROR 3.10\n";exit} | ||
135 | ".config" | ||
136 | } | ||
137 | |||
138 | after 100 | ||
139 | send -- "exit\r" | ||
140 | sleep 1 | ||
141 | } | ||
142 | |||
143 | # | ||
144 | # C | ||
145 | # | ||
146 | if { $chroot == "chroot" } { | ||
147 | send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/home/netblue/.config\r" | ||
148 | expect { | ||
149 | timeout {puts "TESTING ERROR 4\n";exit} | ||
150 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
151 | } | ||
152 | sleep 1 | ||
153 | |||
154 | send -- "ls -al | wc -l\r" | ||
155 | expect { | ||
156 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
157 | "6" | ||
158 | } | ||
159 | |||
160 | send -- "ls -al .bashrc\r" | ||
161 | expect { | ||
162 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
163 | "netblue" | ||
164 | } | ||
165 | expect { | ||
166 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
167 | "netblue" | ||
168 | } | ||
169 | expect { | ||
170 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
171 | ".bashrc" | ||
172 | } | ||
173 | |||
174 | send -- "ls -al .Xauthority\r" | ||
175 | expect { | ||
176 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
177 | "netblue" | ||
178 | } | ||
179 | expect { | ||
180 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
181 | "netblue" | ||
182 | } | ||
183 | expect { | ||
184 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
185 | ".Xauthority" | ||
186 | } | ||
187 | |||
188 | send -- "ls -al | grep .config\r" | ||
189 | expect { | ||
190 | timeout {puts "TESTING ERROR 5.8\n";exit} | ||
191 | "netblue" | ||
192 | } | ||
193 | expect { | ||
194 | timeout {puts "TESTING ERROR 5.9\n";exit} | ||
195 | "netblue" | ||
196 | } | ||
197 | expect { | ||
198 | timeout {puts "TESTING ERROR 5.10\n";exit} | ||
199 | ".config" | ||
200 | } | ||
201 | |||
202 | after 100 | ||
203 | send -- "exit\r" | ||
204 | sleep 1 | ||
205 | } | ||
206 | |||
207 | |||
208 | puts "\nall done\n" | ||