aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private-cache.exp
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2020-11-20 20:04:20 +0100
committerLibravatar smitsohu <smitsohu@gmail.com>2020-11-20 20:04:20 +0100
commitda53c4ebf0b7f5c6d07cb14dd7ec3ff3910fe180 (patch)
tree9475d0d33b52cc178c7b88caae1f9c0727500351 /test/fs/private-cache.exp
parenttmpfs testing (diff)
downloadfirejail-da53c4ebf0b7f5c6d07cb14dd7ec3ff3910fe180.tar.gz
firejail-da53c4ebf0b7f5c6d07cb14dd7ec3ff3910fe180.tar.zst
firejail-da53c4ebf0b7f5c6d07cb14dd7ec3ff3910fe180.zip
reimplement --private-cache using --tmpfs
Diffstat (limited to 'test/fs/private-cache.exp')
-rwxr-xr-xtest/fs/private-cache.exp30
1 files changed, 8 insertions, 22 deletions
diff --git a/test/fs/private-cache.exp b/test/fs/private-cache.exp
index 0597e8921..6e4c6bd1b 100755
--- a/test/fs/private-cache.exp
+++ b/test/fs/private-cache.exp
@@ -7,16 +7,17 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10if {[file exists ~/.cache]} { 10send -- "mkdir --mode=700 ~/.cache\r"
11 puts "found .cache directory\n"
12} else {
13 send -- "mkdir --mode=755 ~/.cache\r"
14}
15after 100 11after 100
16 12
17send -- "touch ~/.cache/abcdefg\r" 13send -- "touch ~/.cache/abcdefg\r"
18after 100 14after 100
19 15
16if { ! [file exists ~/.cache/abcdefg] } {
17 puts "TESTING ERROR 0\n"
18 exit
19}
20
20send -- "firejail --noprofile --private-cache\r" 21send -- "firejail --noprofile --private-cache\r"
21expect { 22expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 23 timeout {puts "TESTING ERROR 1\n";exit}
@@ -34,23 +35,8 @@ after 100
34send -- "exit\r" 35send -- "exit\r"
35sleep 1 36sleep 1
36 37
37send -- "rm -v ~/.cache/abcdefg\r" 38# cleanup
38expect { 39send -- "rm ~/.cache/abcdefg\r"
39 timeout {puts "TESTING ERROR 3\n";exit}
40 "removed"
41}
42after 100 40after 100
43 41
44# redo the test with --private
45
46send -- "firejail --noprofile --private --private-cache\r"
47expect {
48 timeout {puts "TESTING ERROR 4\n";exit}
49 "Warning"
50}
51sleep 1
52
53send -- "exit\r"
54sleep 1
55
56puts "\nall done\n" 42puts "\nall done\n"