diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-12 07:36:41 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-12 07:36:41 -0500 |
commit | ca79ff961cc303670f1ccb8841495ddd7f17a76b (patch) | |
tree | 51de876c47e405afec28eed5562337782265eebe /test/overlay/fs-tmpfs.exp | |
parent | testing (diff) | |
download | firejail-ca79ff961cc303670f1ccb8841495ddd7f17a76b.tar.gz firejail-ca79ff961cc303670f1ccb8841495ddd7f17a76b.tar.zst firejail-ca79ff961cc303670f1ccb8841495ddd7f17a76b.zip |
testing
Diffstat (limited to 'test/overlay/fs-tmpfs.exp')
-rwxr-xr-x | test/overlay/fs-tmpfs.exp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/test/overlay/fs-tmpfs.exp b/test/overlay/fs-tmpfs.exp new file mode 100755 index 000000000..658d16779 --- /dev/null +++ b/test/overlay/fs-tmpfs.exp | |||
@@ -0,0 +1,62 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --overlay-clean\r" | ||
8 | after 100 | ||
9 | send -- "file ~/.firejail\r" | ||
10 | expect { | ||
11 | timeout {puts "TESTING ERROR 0\n";exit} | ||
12 | "cannot open" | ||
13 | } | ||
14 | after 100 | ||
15 | |||
16 | send -- "firejail --overlay-tmpfs\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 1\n";exit} | ||
19 | "not available for kernels older than 3.18" {puts "\nTESTING: overlayfs not available\n"; exit} | ||
20 | "Error: --overlay option is not available on Grsecurity systems" {puts "\nTESTING: overlayfs not available\n"; exit} | ||
21 | "Child process initialized" {puts "found\n"} | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "done" | ||
29 | } | ||
30 | after 100 | ||
31 | |||
32 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 3\n";exit} | ||
35 | "xyzxyzxyz" | ||
36 | } | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | "done" | ||
40 | } | ||
41 | after 100 | ||
42 | |||
43 | send -- "exit\r" | ||
44 | sleep 1 | ||
45 | |||
46 | send -- "cat ~/_firejail_test_file; echo done\r" | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5\n";exit} | ||
49 | "xyzxyzxyz" {puts "TESTING ERROR 6\n";exit} | ||
50 | "done" | ||
51 | } | ||
52 | after 100 | ||
53 | |||
54 | send -- "file ~/.firejail\r" | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 7\n";exit} | ||
57 | "cannot open" | ||
58 | } | ||
59 | after 100 | ||
60 | |||
61 | puts "\nall done\n" | ||
62 | |||