diff options
Diffstat (limited to 'test/fs/private.exp')
-rwxr-xr-x | test/fs/private.exp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/fs/private.exp b/test/fs/private.exp new file mode 100755 index 000000000..8114ee45d --- /dev/null +++ b/test/fs/private.exp | |||
@@ -0,0 +1,58 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | |||
11 | if {[file exists ~/.asoundrc]} { | ||
12 | puts "found .asoundrc file\n" | ||
13 | } else { | ||
14 | send -- "touch ~/.asoundrc\r" | ||
15 | } | ||
16 | after 100 | ||
17 | |||
18 | if {[file exists ~/.Xauthority]} { | ||
19 | puts "found .Xauthority file\n" | ||
20 | } else { | ||
21 | send -- "touch ~/.Xauthority\r" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | # testing profile and private | ||
26 | send -- "firejail --private\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0\n";exit} | ||
29 | "Child process initialized" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | send -- "ls -l ~\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1\n";exit} | ||
36 | "total 0" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "ls -al ~\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 2\n";exit} | ||
43 | ".asoundrc" | ||
44 | } | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 3\n";exit} | ||
47 | ".bashrc" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 4\n";exit} | ||
51 | ".Xauthority" | ||
52 | } | ||
53 | after 100 | ||
54 | |||
55 | send -- "exit\r" | ||
56 | sleep 1 | ||
57 | |||
58 | puts "all done\n" | ||