aboutsummaryrefslogtreecommitdiffstats
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.exp51
1 files changed, 51 insertions, 0 deletions
diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp
new file mode 100755
index 000000000..57986488e
--- /dev/null
+++ b/test/fs/read-write.exp
@@ -0,0 +1,51 @@
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}
23after 100
24
25send -- "echo mytest >~/_firejail_test_dir/test1/b;echo done\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "done"
29}
30after 100
31
32send -- "cat ~/_firejail_test_dir/a;echo done\r"
33expect {
34 timeout {puts "TESTING ERROR 3\n";exit}
35 "mytest" {puts "TESTING ERROR 4\n";exit}
36 "done"
37}
38after 100
39
40send -- "cat ~/_firejail_test_dir/test1/b;echo done\r"
41expect {
42 timeout {puts "TESTING ERROR 5\n";exit}
43 "mytest"
44}
45expect {
46 timeout {puts "TESTING ERROR 6\n";exit}
47 "done"
48}
49
50after 100
51puts "\nall done\n"