aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private-home.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/private-home.exp')
-rwxr-xr-xtest/fs/private-home.exp45
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# create some test files in user home directory
11send -- "touch ~/_firejail_test_file1\r"
12send -- "touch ~/_firejail_test_file2\r"
13send -- "mkdir ~/_firejail_test_dir1\r"
14send -- "mkdir ~/_firejail_test_dir1/_firejail_test_dir2\r"
15send -- "touch ~/_firejail_test_dir1/_firejail_test_dir2/_firejail_test_file3\r"
16after 100
17
18send -- "firejail --private-home=_firejail_test_file1,_firejail_test_file2,_firejail_test_dir1\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Child process initialized"
22}
23after 100
24
25send -- "find ~\r"
26expect {
27 timeout {puts "TESTING ERROR 2\n";exit}
28 "_firejail_test_file3"
29}
30expect {
31 timeout {puts "TESTING ERROR 3\n";exit}
32 "_firejail_test_file2"
33}
34expect {
35 timeout {puts "TESTING ERROR 4\n";exit}
36 "_firejail_test_file1"
37}
38after 100
39
40send -- "rm -f ~/_firejail_test_file*\r"
41send -- "rm -fr ~/_firejail_test_dir*\r"
42after 100
43
44puts "\nall done\n"
45