aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private-home-dir.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/private-home-dir.exp')
-rwxr-xr-xtest/fs/private-home-dir.exp70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp
new file mode 100755
index 000000000..5491be834
--- /dev/null
+++ b/test/fs/private-home-dir.exp
@@ -0,0 +1,70 @@
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
11if {[file exists ~/.asoundrc]} {
12 puts "found .asoundrc file\n"
13} else {
14 send -- "touch ~/.asoundrc\r"
15}
16after 100
17
18if {[file exists ~/.Xauthority]} {
19 puts "found .Xauthority file\n"
20} else {
21 send -- "touch ~/.Xauthority\r"
22}
23after 100
24send -- "mkdir ~/_firejail_test_dir_\r"
25sleep 1
26
27# testing profile and private
28send -- "firejail --private=~/_firejail_test_dir_\r"
29expect {
30 timeout {puts "TESTING ERROR 0\n";exit}
31 "Child process initialized"
32}
33sleep 1
34
35send -- "ls -l ~\r"
36expect {
37 timeout {puts "TESTING ERROR 1\n";exit}
38 "total 0"
39}
40after 100
41
42send -- "ls -al ~\r"
43expect {
44 timeout {puts "TESTING ERROR 2\n";exit}
45 ".asoundrc"
46}
47expect {
48 timeout {puts "TESTING ERROR 3\n";exit}
49 ".bashrc"
50}
51expect {
52 timeout {puts "TESTING ERROR 4\n";exit}
53 ".Xauthority"
54}
55after 100
56
57send -- "exit\r"
58sleep 1
59
60
61# testing profile and private
62send -- "firejail --private=/etc\r"
63expect {
64 timeout {puts "TESTING ERROR 5\n";exit}
65 "private directory should be owned by the current user"
66}
67sleep 1
68
69
70puts "all done\n"