diff options
Diffstat (limited to 'test/root/private.exp')
-rwxr-xr-x | test/root/private.exp | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/test/root/private.exp b/test/root/private.exp deleted file mode 100755 index 8c89e1f31..000000000 --- a/test/root/private.exp +++ /dev/null | |||
@@ -1,111 +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 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
14 | } | ||
15 | sleep 2 | ||
16 | |||
17 | send -- "ls -l /home\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "total 0" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "ls -l /root\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "total 0" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | |||
36 | send -- "touch /opt/firejail-test-file\r" | ||
37 | after 100 | ||
38 | send -- "mkdir /opt/firejail-test-dir\r" | ||
39 | after 100 | ||
40 | send -- "touch /opt/firejail-test-dir/firejail-test-file\r" | ||
41 | after 100 | ||
42 | send -- "firejail --private-opt=firejail-test-file,firejail-test-dir --debug\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 3\n";exit} | ||
45 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
46 | } | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "find /opt | wc -l\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 4\n";exit} | ||
52 | "4" | ||
53 | } | ||
54 | after 100 | ||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | send -- "firejail --whitelist=/opt/firejail-test-file --whitelist=/opt/firejail-test-dir --debug\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
60 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
61 | } | ||
62 | sleep 1 | ||
63 | |||
64 | send -- "find /opt | wc -l\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
67 | "4" | ||
68 | } | ||
69 | after 100 | ||
70 | send -- "exit\r" | ||
71 | sleep 1 | ||
72 | |||
73 | |||
74 | send -- "touch /srv/firejail-test-file\r" | ||
75 | after 100 | ||
76 | send -- "mkdir /srv/firejail-test-dir\r" | ||
77 | after 100 | ||
78 | send -- "touch /srv/firejail-test-dir/firejail-test-file\r" | ||
79 | after 100 | ||
80 | send -- "firejail --private-srv=firejail-test-file,firejail-test-dir --debug\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 5\n";exit} | ||
83 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
84 | } | ||
85 | sleep 1 | ||
86 | |||
87 | send -- "find /srv | wc -l\r" | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 6\n";exit} | ||
90 | "4" | ||
91 | } | ||
92 | after 100 | ||
93 | send -- "exit\r" | ||
94 | sleep 1 | ||
95 | send -- "firejail --whitelist=/srv/firejail-test-file --whitelist=/srv/firejail-test-dir --debug\r" | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
98 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
99 | } | ||
100 | sleep 1 | ||
101 | |||
102 | send -- "find /srv | wc -l\r" | ||
103 | expect { | ||
104 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
105 | "4" | ||
106 | } | ||
107 | after 100 | ||
108 | send -- "exit\r" | ||
109 | sleep 1 | ||
110 | |||
111 | puts "\nall done\n" | ||