diff options
author | 2023-02-28 09:51:26 -0500 | |
---|---|---|
committer | 2023-02-28 09:51:26 -0500 | |
commit | 27c4d069f322fbeca07c88e0e96208233103a5db (patch) | |
tree | fb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test/features/3.1.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.1.exp')
-rwxr-xr-x | test/features/3.1.exp | 167 |
1 files changed, 0 insertions, 167 deletions
diff --git a/test/features/3.1.exp b/test/features/3.1.exp deleted file mode 100755 index fb144b857..000000000 --- a/test/features/3.1.exp +++ /dev/null | |||
@@ -1,167 +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 | # private | ||
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 --private\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 | |||
60 | |||
61 | after 100 | ||
62 | send -- "exit\r" | ||
63 | sleep 1 | ||
64 | |||
65 | # | ||
66 | # O | ||
67 | # | ||
68 | if { $overlay == "overlay" } { | ||
69 | send -- "firejail --noprofile --overlay --private\r" | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 2\n";exit} | ||
72 | "overlay option is not available" {puts "grsecurity\n"; exit} | ||
73 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"} | ||
74 | } | ||
75 | sleep 1 | ||
76 | |||
77 | send -- "ls -al | wc -l\r" | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
80 | "6" | ||
81 | } | ||
82 | |||
83 | send -- "ls -al .bashrc\r" | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
86 | "netblue" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
90 | "netblue" | ||
91 | } | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
94 | ".bashrc" | ||
95 | } | ||
96 | |||
97 | send -- "ls -al .Xauthority\r" | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
100 | "netblue" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
104 | "netblue" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
108 | ".Xauthority" | ||
109 | } | ||
110 | |||
111 | after 100 | ||
112 | send -- "exit\r" | ||
113 | sleep 1 | ||
114 | } | ||
115 | |||
116 | # | ||
117 | # C | ||
118 | # | ||
119 | if { $chroot == "chroot" } { | ||
120 | send -- "firejail --noprofile --chroot=/tmp/chroot --private\r" | ||
121 | expect { | ||
122 | timeout {puts "TESTING ERROR 4\n";exit} | ||
123 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
124 | } | ||
125 | sleep 1 | ||
126 | |||
127 | send -- "ls -al | wc -l\r" | ||
128 | expect { | ||
129 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
130 | "5" | ||
131 | } | ||
132 | |||
133 | send -- "ls -al .bashrc\r" | ||
134 | expect { | ||
135 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
136 | "netblue" | ||
137 | } | ||
138 | expect { | ||
139 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
140 | "netblue" | ||
141 | } | ||
142 | expect { | ||
143 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
144 | ".bashrc" | ||
145 | } | ||
146 | |||
147 | send -- "ls -al .Xauthority\r" | ||
148 | expect { | ||
149 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
150 | "netblue" | ||
151 | } | ||
152 | expect { | ||
153 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
154 | "netblue" | ||
155 | } | ||
156 | expect { | ||
157 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
158 | ".Xauthority" | ||
159 | } | ||
160 | |||
161 | after 100 | ||
162 | send -- "exit\r" | ||
163 | sleep 1 | ||
164 | } | ||
165 | |||
166 | |||
167 | puts "\nall done\n" | ||