diff options
Diffstat (limited to 'test/fscheck-privatekeep.exp')
-rwxr-xr-x | test/fscheck-privatekeep.exp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/test/fscheck-privatekeep.exp b/test/fscheck-privatekeep.exp new file mode 100755 index 000000000..513dcc37a --- /dev/null +++ b/test/fscheck-privatekeep.exp | |||
@@ -0,0 +1,93 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # dir | ||
8 | #send -- "firejail --net=br0 --private.keep=fscheck-dir\r" | ||
9 | #expect { | ||
10 | # timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | # "Error" | ||
12 | #} | ||
13 | #after 100 | ||
14 | |||
15 | # .. | ||
16 | send -- "firejail --net=br0 --private.keep=../test/fscheck-dir\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "Error" | ||
20 | } | ||
21 | after 100 | ||
22 | |||
23 | # dir link | ||
24 | send -- "firejail --net=br0 --private.keep=fscheck-dir-link\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1\n";exit} | ||
27 | "Error" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | # .. | ||
32 | send -- "firejail --net=br0 --private.keep=../test/fscheck-dir-link\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
35 | "Error" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | # file link | ||
40 | send -- "firejail --net=br0 --private.keep=fscheck-file-link\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | "Error" | ||
44 | } | ||
45 | after 100 | ||
46 | |||
47 | # file | ||
48 | #send -- "firejail --net=br0 --private.keep=fscheck-file\r" | ||
49 | #expect { | ||
50 | # timeout {puts "TESTING ERROR 2.1\n";exit} | ||
51 | # "Error" | ||
52 | #} | ||
53 | #after 100 | ||
54 | |||
55 | # .. | ||
56 | send -- "firejail --net=br0 --private.keep=../test/fscheck-file\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
59 | "Error" | ||
60 | } | ||
61 | after 100 | ||
62 | |||
63 | # no dir | ||
64 | send -- "firejail --net=br0 --private.keep=../test/nodir\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3\n";exit} | ||
67 | "Error" | ||
68 | } | ||
69 | after 100 | ||
70 | |||
71 | # no file | ||
72 | send -- "firejail --net=br0 --private.keep=../test/nofile\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
75 | "Error" | ||
76 | } | ||
77 | after 100 | ||
78 | |||
79 | # same owner | ||
80 | send -- "firejail --net=br0 --private=/etc\r" | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 4\n";exit} | ||
83 | "Error" | ||
84 | } | ||
85 | after 100 | ||
86 | |||
87 | # same owner | ||
88 | send -- "firejail --net=br0 --private=/etc/shadow\r" | ||
89 | expect { | ||
90 | timeout {puts "TESTING ERROR 4\n";exit} | ||
91 | "Error" | ||
92 | } | ||
93 | after 100 | ||