diff options
Diffstat (limited to 'test/fs/private-home.exp')
-rwxr-xr-x | test/fs/private-home.exp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp new file mode 100755 index 000000000..de5a88dea --- /dev/null +++ b/test/fs/private-home.exp | |||
@@ -0,0 +1,45 @@ | |||
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 | # create some test files in user home directory | ||
11 | send -- "touch ~/_firejail_test_file1\r" | ||
12 | send -- "touch ~/_firejail_test_file2\r" | ||
13 | send -- "mkdir ~/_firejail_test_dir1\r" | ||
14 | send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r" | ||
15 | send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r" | ||
16 | after 100 | ||
17 | |||
18 | send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "Child process initialized" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "find ~\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 2\n";exit} | ||
28 | "_firejail_test_file3" | ||
29 | } | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 3\n";exit} | ||
32 | "_firejail_test_file2" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4\n";exit} | ||
36 | "_firejail_test_file1" | ||
37 | } | ||
38 | after 100 | ||
39 | |||
40 | send -- "rm -f ~/_firejail_test_file*\r" | ||
41 | send -- "rm -fr ~/_firejail_test_dir*\r" | ||
42 | after 100 | ||
43 | |||
44 | puts "\nall done\n" | ||
45 | |||