diff options
Diffstat (limited to 'test/fs')
-rwxr-xr-x | test/fs/private-home-dir.exp | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp index 5491be834..f85a939b1 100755 --- a/test/fs/private-home-dir.exp +++ b/test/fs/private-home-dir.exp | |||
@@ -21,6 +21,8 @@ if {[file exists ~/.Xauthority]} { | |||
21 | send -- "touch ~/.Xauthority\r" | 21 | send -- "touch ~/.Xauthority\r" |
22 | } | 22 | } |
23 | after 100 | 23 | after 100 |
24 | send -- "rm -fr ~/_firejail_test_dir_\r" | ||
25 | after 100 | ||
24 | send -- "mkdir ~/_firejail_test_dir_\r" | 26 | send -- "mkdir ~/_firejail_test_dir_\r" |
25 | sleep 1 | 27 | sleep 1 |
26 | 28 | ||
@@ -65,6 +67,64 @@ expect { | |||
65 | "private directory should be owned by the current user" | 67 | "private directory should be owned by the current user" |
66 | } | 68 | } |
67 | sleep 1 | 69 | sleep 1 |
70 | send -- "mkdir ~/_firejail_test_dir_/test_dir_2\r" | ||
71 | after 100 | ||
72 | send -- "touch ~/_firejail_test_dir_/test_dir_2/testfile\r" | ||
73 | sleep 1 | ||
68 | 74 | ||
75 | send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 6\n";exit} | ||
78 | "Not blacklist" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 7\n";exit} | ||
82 | "test_dir_2" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 8\n";exit} | ||
86 | "Child process initialized" | ||
87 | } | ||
88 | |||
89 | sleep 1 | ||
90 | |||
91 | send -- "find ~\r" | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 9\n";exit} | ||
94 | "testfile" | ||
95 | } | ||
96 | after 100 | ||
97 | |||
98 | send -- "exit\r" | ||
99 | sleep 1 | ||
100 | |||
101 | send -- "firejail --debug --noprofile --allow-private-blacklist --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 10\n";exit} | ||
104 | "Disable" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 11\n";exit} | ||
108 | "test_dir_2" | ||
109 | } | ||
110 | expect { | ||
111 | timeout {puts "TESTING ERROR 12\n";exit} | ||
112 | "Child process initialized" | ||
113 | } | ||
114 | |||
115 | sleep 1 | ||
116 | |||
117 | send -- "ls ~/test_dir_2\r" | ||
118 | expect { | ||
119 | timeout {puts "TESTING ERROR 13\n";exit} | ||
120 | "cannot open directory" | ||
121 | } | ||
122 | after 100 | ||
123 | |||
124 | send "exit\r" | ||
125 | sleep 1 | ||
126 | |||
127 | send -- "rm -fr ~/_firejail_test_dir_\r" | ||
128 | after 100 | ||
69 | 129 | ||
70 | puts "all done\n" | 130 | puts "\nall done\n" |