diff options
Diffstat (limited to 'test/profiles/profile_readonly.exp')
-rwxr-xr-x | test/profiles/profile_readonly.exp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/profiles/profile_readonly.exp b/test/profiles/profile_readonly.exp new file mode 100755 index 000000000..c1c9544a6 --- /dev/null +++ b/test/profiles/profile_readonly.exp | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "mkdir /tmp/firejailtestdir\r" | ||
8 | send -- "touch /tmp/firejailtestfile\r" | ||
9 | sleep 1 | ||
10 | |||
11 | send -- "firejail --profile=readonly.profile\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 2 | ||
17 | |||
18 | send -- "ls > /tmp/firejailtestdir/ttt\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "Read-only file system" | ||
22 | } | ||
23 | sleep 1 | ||
24 | |||
25 | send -- "ls > /tmp/firejailtestfile\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "Read-only file system" | ||
29 | } | ||
30 | send -- "exit\r" | ||
31 | after 100 | ||
32 | |||
33 | send -- "rm -fr /tmp/firejailtest*\r" | ||
34 | after 100 | ||
35 | |||
36 | puts "\nall done\n" | ||