diff options
Diffstat (limited to 'test/profile_followlnk.exp')
-rwxr-xr-x | test/profile_followlnk.exp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/profile_followlnk.exp b/test/profile_followlnk.exp new file mode 100755 index 000000000..e2ede2865 --- /dev/null +++ b/test/profile_followlnk.exp | |||
@@ -0,0 +1,68 @@ | |||
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 | sleep 1 | ||
9 | send -- "ln -s /tmp/firejailtestdir /tmp/firejailtestdirlnk\r" | ||
10 | sleep 1 | ||
11 | send -- "touch /tmp/firejailtestfile\r" | ||
12 | sleep 1 | ||
13 | send -- "ln -s /tmp/firejailtestfile /tmp/firejailtestfilelnk\r" | ||
14 | sleep 1 | ||
15 | |||
16 | send -- "firejail --profile=readonly-lnk.profile --debug\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0\n";exit} | ||
19 | "Child process initialized" | ||
20 | } | ||
21 | |||
22 | # testing private only | ||
23 | send -- "bash\r" | ||
24 | sleep 1 | ||
25 | |||
26 | |||
27 | send -- "ls > /tmp/firejailtestdirlnk/ttt;pwd\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 1\n";exit} | ||
30 | "Read-only file system" | ||
31 | } | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
34 | "home" | ||
35 | } | ||
36 | sleep 1 | ||
37 | |||
38 | send -- "ls > /tmp/firejailtestfilelnk;pwd\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 2\n";exit} | ||
41 | "Read-only file system" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
45 | "home" | ||
46 | } | ||
47 | sleep 1 | ||
48 | |||
49 | send -- "exit\r" | ||
50 | sleep 1 | ||
51 | send -- "pwd\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 3\n";exit} | ||
54 | "home" | ||
55 | } | ||
56 | sleep 1 | ||
57 | send -- "exit\r" | ||
58 | sleep 1 | ||
59 | send -- "pwd\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 4\n";exit} | ||
62 | "home" | ||
63 | } | ||
64 | sleep 2 | ||
65 | send -- "rm -fr /tmp/firejailtest*\r" | ||
66 | sleep 1 | ||
67 | |||
68 | puts "\n" | ||