summaryrefslogtreecommitdiffstats
path: root/test/overlay/fs-tmpfs.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/overlay/fs-tmpfs.exp')
-rwxr-xr-xtest/overlay/fs-tmpfs.exp62
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --overlay-clean\r"
8after 100
9send -- "file ~/.firejail\r"
10expect {
11 timeout {puts "TESTING ERROR 0\n";exit}
12 "cannot open"
13}
14after 100
15
16send -- "firejail --overlay-tmpfs\r"
17expect {
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}
23sleep 1
24
25send -- "echo xyzxyzxyz > ~/_firejail_test_file; echo done\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "done"
29}
30after 100
31
32send -- "cat ~/_firejail_test_file; echo done\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "xyzxyzxyz"
36}
37expect {
38 timeout {puts "TESTING ERROR 4\n";exit}
39 "done"
40}
41after 100
42
43send -- "exit\r"
44sleep 1
45
46send -- "cat ~/_firejail_test_file; echo done\r"
47expect {
48 timeout {puts "TESTING ERROR 5\n";exit}
49 "xyzxyzxyz" {puts "TESTING ERROR 6\n";exit}
50 "done"
51}
52after 100
53
54send -- "file ~/.firejail\r"
55expect {
56 timeout {puts "TESTING ERROR 7\n";exit}
57 "cannot open"
58}
59after 100
60
61puts "\nall done\n"
62