summaryrefslogtreecommitdiffstats
path: root/test/fs/read-write.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/read-write.exp')
-rwxr-xr-xtest/fs/read-write.exp49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp
new file mode 100755
index 000000000..cfca15605
--- /dev/null
+++ b/test/fs/read-write.exp
@@ -0,0 +1,49 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18send -- "echo mytest >~/_firejail_test_dir/a;echo done\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "done"
22}
23
24send -- "echo mytest >~/_firejail_test_dir/test1/b;echo done\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "done"
28}
29
30send -- "cat ~/_firejail_test_dir/a;echo done\r"
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "mytest" {puts "TESTING ERROR 4\n";exit}
34 "done"
35}
36
37
38send -- "cat ~/_firejail_test_dir/test1/b;echo done\r"
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 "mytest"
42}
43expect {
44 timeout {puts "TESTING ERROR 6\n";exit}
45 "done"
46}
47
48after 100
49puts "\nall done\n"