aboutsummaryrefslogtreecommitdiffstats
path: root/test/profile_readonly.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/profile_readonly.exp')
-rwxr-xr-xtest/profile_readonly.exp64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/profile_readonly.exp b/test/profile_readonly.exp
new file mode 100755
index 000000000..046b0d738
--- /dev/null
+++ b/test/profile_readonly.exp
@@ -0,0 +1,64 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "mkdir /tmp/firejailtestdir\r"
8sleep 1
9send -- "touch /tmp/firejailtestfile\r"
10sleep 1
11
12send -- "firejail --profile=readonly.profile\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "Child process initialized"
16}
17
18# testing private only
19send -- "bash\r"
20sleep 1
21
22
23send -- "ls > /tmp/firejailtestdir/ttt;pwd\r"
24expect {
25 timeout {puts "TESTING ERROR 1\n";exit}
26 "Read-only file system"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.1\n";exit}
30 "home"
31}
32sleep 1
33
34send -- "ls > /tmp/firejailtestfile;pwd\r"
35expect {
36 timeout {puts "TESTING ERROR 2\n";exit}
37 "Read-only file system"
38}
39expect {
40 timeout {puts "TESTING ERROR 2.1\n";exit}
41 "home"
42}
43sleep 1
44
45send -- "exit\r"
46sleep 1
47send -- "pwd\r"
48expect {
49 timeout {puts "TESTING ERROR 3\n";exit}
50 "home"
51}
52sleep 1
53send -- "exit\r"
54sleep 1
55send -- "pwd\r"
56expect {
57 timeout {puts "TESTING ERROR 4\n";exit}
58 "home"
59}
60sleep 2
61send -- "rm -fr /tmp/firejailtest*\r"
62sleep 1
63
64puts "\n"