aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/fs/fs.sh51
-rwxr-xr-xtest/fs/fs_dev_shm.exp16
-rwxr-xr-xtest/fs/fs_var_tmp.exp16
-rwxr-xr-xtest/fs/mkdir.exp20
-rw-r--r--test/fs/mkdir.profile12
-rwxr-xr-xtest/fs/option_blacklist.exp2
-rwxr-xr-xtest/fs/option_blacklist_file.exp25
-rwxr-xr-xtest/fs/option_blacklist_glob.exp25
-rwxr-xr-xtest/fs/private-etc.exp5
-rwxr-xr-xtest/fs/private-home-dir.exp15
-rwxr-xr-xtest/fs/private-home.exp13
-rwxr-xr-xtest/fs/read-write.exp13
-rwxr-xr-xtest/fs/whitelist-dev.exp3
-rwxr-xr-xtest/fs/whitelist-double.exp10
-rwxr-xr-xtest/fs/whitelist-readonly.exp10
15 files changed, 164 insertions, 72 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index 591fc1a06..9c3310b31 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -15,15 +15,18 @@ echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)"
15./mkdir_mkfile.exp 15./mkdir_mkfile.exp
16rm -fr ~/_firejail_test_* 16rm -fr ~/_firejail_test_*
17 17
18mkdir ~/_firejail_test_dir 18echo "TESTING: recursive mkdir (test/fs/mkdir.exp)"
19touch ~/_firejail_test_dir/a 19./mkdir.exp
20mkdir ~/_firejail_test_dir/test1 20rm -fr ~/_firejail_test_*
21touch ~/_firejail_test_dir/test1/b 21rm -fr /tmp/_firejail_test_*
22
22echo "TESTING: read/write (test/fs/read-write.exp)" 23echo "TESTING: read/write (test/fs/read-write.exp)"
23./read-write.exp 24./read-write.exp
25rm -fr ~/_firejail_test_dir
26
24echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)" 27echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)"
25./whitelist-readonly.exp 28./whitelist-readonly.exp
26rm -fr ~/_firejail_test_* 29rm -f ~/_firejail_test_dir
27 30
28echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" 31echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)"
29./sys_fs.exp 32./sys_fs.exp
@@ -37,16 +40,19 @@ fi
37 40
38echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" 41echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)"
39./fs_var_tmp.exp 42./fs_var_tmp.exp
43rm -f /var/tmp/_firejail_test_file
40 44
41echo "TESTING: private-lib (test/fs/private-lib.exp)" 45echo "TESTING: private-lib (test/fs/private-lib.exp)"
42./private-lib.exp 46./private-lib.exp
43 47
44echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" 48echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)"
45./fs_var_lock.exp 49./fs_var_lock.exp
50rm -f /var/lock/_firejail_test_file
46 51
47if [ -w /dev/shm ]; then 52if [ -w /dev/shm ]; then
48 echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" 53 echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)"
49 ./fs_dev_shm.exp 54 ./fs_dev_shm.exp
55 rm -f /dev/shm/_firejail_test_file
50else 56else
51 echo "TESTING SKIP: /dev/shm not writable" 57 echo "TESTING SKIP: /dev/shm not writable"
52fi 58fi
@@ -56,12 +62,23 @@ echo "TESTING: private (test/fs/private.exp)"
56 62
57echo "TESTING: private home (test/fs/private-home.exp)" 63echo "TESTING: private home (test/fs/private-home.exp)"
58./private-home.exp 64./private-home.exp
65rm -f ~/_firejail_test_file1
66rm -f ~/_firejail_test_file2
67rm -fr ~/_firejail_test_dir1
68rm -f ~/_firejail_test_link1
69rm -f ~/_firejail_test_link2
59 70
60echo "TESTING: private home dir (test/fs/private-home-dir.exp)" 71echo "TESTING: private home dir (test/fs/private-home-dir.exp)"
61./private-home-dir.exp 72./private-home-dir.exp
73rm -fr ~/_firejail_test_dir1
62 74
63echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" 75echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)"
64./private-homedir.exp 76./private-homedir.exp
77rm -f ~/_firejail_test_file1
78rm -f ~/_firejail_test_file2
79rm -fr ~/_firejail_test_dir1
80rm -f ~/_firejail_test_link1
81rm -f ~/_firejail_test_link2
65 82
66echo "TESTING: private-etc (test/fs/private-etc.exp)" 83echo "TESTING: private-etc (test/fs/private-etc.exp)"
67./private-etc.exp 84./private-etc.exp
@@ -74,6 +91,7 @@ echo "TESTING: private-bin (test/fs/private-bin.exp)"
74 91
75echo "TESTING: private-cache (test/fs/private-cache.exp)" 92echo "TESTING: private-cache (test/fs/private-cache.exp)"
76./private-cache.exp 93./private-cache.exp
94rm -f ~/.cache/abcdefg
77 95
78echo "TESTING: private-cwd (test/fs/private-cwd.exp)" 96echo "TESTING: private-cwd (test/fs/private-cwd.exp)"
79./private-cwd.exp 97./private-cwd.exp
@@ -83,6 +101,12 @@ echo "TESTING: macros (test/fs/macro.exp)"
83 101
84echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" 102echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)"
85./whitelist-empty.exp 103./whitelist-empty.exp
104rm -f ~/Videos/_firejail_test_fil
105rm -f ~/Pictures/_firejail_test_file
106rm -f ~/Music/_firejail_test_file
107rm -f ~/Downloads/_firejail_test_file
108rm -f ~/Documents/_firejail_test_file
109rm -f ~/Desktop/_firejail_test_file
86 110
87echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" 111echo "TESTING: private whitelist (test/fs/private-whitelist.exp)"
88./private-whitelist.exp 112./private-whitelist.exp
@@ -95,9 +119,11 @@ echo "TESTING: blacklist directory (test/fs/option_blacklist.exp)"
95 119
96echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)" 120echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)"
97./option_blacklist_file.exp 121./option_blacklist_file.exp
122rm -fr ~/_firejail_test_dir
98 123
99echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)" 124echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)"
100./option_blacklist_glob.exp 125./option_blacklist_glob.exp
126rm -fr ~/_firejail_test_dir
101 127
102echo "TESTING: noblacklist blacklist noexec (test/fs/noblacklist-blacklist-noexec.exp)" 128echo "TESTING: noblacklist blacklist noexec (test/fs/noblacklist-blacklist-noexec.exp)"
103./noblacklist-blacklist-noexec.exp 129./noblacklist-blacklist-noexec.exp
@@ -108,14 +134,13 @@ echo "TESTING: noblacklist blacklist readonly (test/fs/noblacklist-blacklist-rea
108echo "TESTING: bind as user (test/fs/option_bind_user.exp)" 134echo "TESTING: bind as user (test/fs/option_bind_user.exp)"
109./option_bind_user.exp 135./option_bind_user.exp
110 136
111echo "TESTING: recursive mkdir (test/fs/mkdir.exp)"
112./mkdir.exp
113
114echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" 137echo "TESTING: double whitelist (test/fs/whitelist-double.exp)"
115./whitelist-double.exp 138./whitelist-double.exp
139rm -f /tmp/_firejail_test_file
116 140
117echo "TESTING: whitelist (test/fs/whitelist.exp)" 141echo "TESTING: whitelist (test/fs/whitelist.exp)"
118./whitelist.exp 142./whitelist.exp
143rm -fr ~/_firejail_test_*
119 144
120echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" 145echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)"
121./whitelist-dev.exp 146./whitelist-dev.exp
@@ -131,6 +156,8 @@ echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)"
131 156
132echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)" 157echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)"
133./fscheck-tmpfs.exp 158./fscheck-tmpfs.exp
159rm -fr ~/_firejail_test_dir
160rm -fr /tmp/_firejail_test_dir
134 161
135echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)" 162echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)"
136./fscheck-private.exp 163./fscheck-private.exp
@@ -139,10 +166,4 @@ echo "TESTING: fscheck --read-only= (test/fs/fscheck-readonly.exp)"
139./fscheck-readonly.exp 166./fscheck-readonly.exp
140 167
141#cleanup 168#cleanup
142rm -fr ~/fjtest-dir 169rm -fr ~/_firejail_test*
143rm -fr ~/fjtest-dir-lnk
144rm -f ~/fjtest-file
145rm -f ~/fjtest-file-lnk
146rm -f /tmp/fjtest-file
147rm -fr /tmp/fjtest-dir
148rm -fr ~/_firejail_test_*
diff --git a/test/fs/fs_dev_shm.exp b/test/fs/fs_dev_shm.exp
index 04e6e2383..5f0503494 100755
--- a/test/fs/fs_dev_shm.exp
+++ b/test/fs/fs_dev_shm.exp
@@ -16,13 +16,13 @@ expect {
16after 100 16after 100
17send -- "stty -echo\r" 17send -- "stty -echo\r"
18 18
19send -- "echo mytest > /dev/shm/ttt;echo done\r" 19send -- "echo mytest > /dev/shm/_firejail_test_file;echo done\r"
20expect { 20expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
22 "done" 22 "done"
23} 23}
24 24
25send -- "cat /dev/shm/ttt;echo done\r" 25send -- "cat /dev/shm/_firejail_test_file;echo done\r"
26expect { 26expect {
27 timeout {puts "TESTING ERROR 2\n";exit} 27 timeout {puts "TESTING ERROR 2\n";exit}
28 "mytest" 28 "mytest"
@@ -32,13 +32,13 @@ expect {
32 "done" 32 "done"
33} 33}
34 34
35send -- "rm /dev/shm/ttt;echo done\r" 35send -- "rm /dev/shm/_firejail_test_file;echo done\r"
36expect { 36expect {
37 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 4\n";exit}
38 "done" 38 "done"
39} 39}
40 40
41send -- "cat /dev/shm/ttt;echo done\r" 41send -- "cat /dev/shm/_firejail_test_file;echo done\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "mytest" {puts "TESTING ERROR 6\n";exit} 44 "mytest" {puts "TESTING ERROR 6\n";exit}
@@ -57,13 +57,13 @@ expect {
57after 100 57after 100
58send -- "stty -echo\r" 58send -- "stty -echo\r"
59 59
60send -- "echo mytest > /dev/shm/ttt;echo done\r" 60send -- "echo mytest > /dev/shm/_firejail_test_file;echo done\r"
61expect { 61expect {
62 timeout {puts "TESTING ERROR 8\n";exit} 62 timeout {puts "TESTING ERROR 8\n";exit}
63 "done" 63 "done"
64} 64}
65 65
66send -- "cat /dev/shm/ttt;echo done\r" 66send -- "cat /dev/shm/_firejail_test_file;echo done\r"
67expect { 67expect {
68 timeout {puts "TESTING ERROR 9\n";exit} 68 timeout {puts "TESTING ERROR 9\n";exit}
69 "mytest" 69 "mytest"
@@ -73,13 +73,13 @@ expect {
73 "done" 73 "done"
74} 74}
75 75
76send -- "rm /dev/shm/ttt;echo done\r" 76send -- "rm /dev/shm/_firejail_test_file;echo done\r"
77expect { 77expect {
78 timeout {puts "TESTING ERROR 11\n";exit} 78 timeout {puts "TESTING ERROR 11\n";exit}
79 "done" 79 "done"
80} 80}
81 81
82send -- "cat /dev/shm/ttt;echo done\r" 82send -- "cat /dev/shm/_firejail_test_file;echo done\r"
83expect { 83expect {
84 timeout {puts "TESTING ERROR 12\n";exit} 84 timeout {puts "TESTING ERROR 12\n";exit}
85 "mytest" {puts "TESTING ERROR 13\n";exit} 85 "mytest" {puts "TESTING ERROR 13\n";exit}
diff --git a/test/fs/fs_var_tmp.exp b/test/fs/fs_var_tmp.exp
index 004425719..c7d4b0c20 100755
--- a/test/fs/fs_var_tmp.exp
+++ b/test/fs/fs_var_tmp.exp
@@ -16,13 +16,13 @@ expect {
16after 100 16after 100
17send -- "stty -echo\r" 17send -- "stty -echo\r"
18 18
19send -- "echo mytest > /var/tmp/ttt;echo done\r" 19send -- "echo mytest > /var/tmp/_firejail_test_file;echo done\r"
20expect { 20expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 21 timeout {puts "TESTING ERROR 1\n";exit}
22 "done" 22 "done"
23} 23}
24 24
25send -- "cat /var/tmp/ttt;echo done\r" 25send -- "cat /var/tmp/_firejail_test_file;echo done\r"
26expect { 26expect {
27 timeout {puts "TESTING ERROR 2\n";exit} 27 timeout {puts "TESTING ERROR 2\n";exit}
28 "mytest" 28 "mytest"
@@ -32,13 +32,13 @@ expect {
32 "done" 32 "done"
33} 33}
34 34
35send -- "rm /var/tmp/ttt;echo done\r" 35send -- "rm /var/tmp/_firejail_test_file;echo done\r"
36expect { 36expect {
37 timeout {puts "TESTING ERROR 4\n";exit} 37 timeout {puts "TESTING ERROR 4\n";exit}
38 "done" 38 "done"
39} 39}
40 40
41send -- "cat /var/tmp/ttt;echo done\r" 41send -- "cat /var/tmp/_firejail_test_file;echo done\r"
42expect { 42expect {
43 timeout {puts "TESTING ERROR 5\n";exit} 43 timeout {puts "TESTING ERROR 5\n";exit}
44 "mytest" {puts "TESTING ERROR 6\n";exit} 44 "mytest" {puts "TESTING ERROR 6\n";exit}
@@ -58,13 +58,13 @@ expect {
58after 100 58after 100
59send -- "stty -echo\r" 59send -- "stty -echo\r"
60 60
61send -- "echo mytest > /var/tmp/ttt;echo done\r" 61send -- "echo mytest > /var/tmp/_firejail_test_file;echo done\r"
62expect { 62expect {
63 timeout {puts "TESTING ERROR 8\n";exit} 63 timeout {puts "TESTING ERROR 8\n";exit}
64 "done" 64 "done"
65} 65}
66 66
67send -- "cat /var/tmp/ttt;echo done\r" 67send -- "cat /var/tmp/_firejail_test_file;echo done\r"
68expect { 68expect {
69 timeout {puts "TESTING ERROR 9\n";exit} 69 timeout {puts "TESTING ERROR 9\n";exit}
70 "mytest" 70 "mytest"
@@ -74,13 +74,13 @@ expect {
74 "done" 74 "done"
75} 75}
76 76
77send -- "rm /var/tmp/ttt;echo done\r" 77send -- "rm /var/tmp/_firejail_test_file;echo done\r"
78expect { 78expect {
79 timeout {puts "TESTING ERROR 11\n";exit} 79 timeout {puts "TESTING ERROR 11\n";exit}
80 "done" 80 "done"
81} 81}
82 82
83send -- "cat /var/tmp/ttt;echo done\r" 83send -- "cat /var/tmp/_firejail_test_file;echo done\r"
84expect { 84expect {
85 timeout {puts "TESTING ERROR 12\n";exit} 85 timeout {puts "TESTING ERROR 12\n";exit}
86 "mytest" {puts "TESTING ERROR 13\n";exit} 86 "mytest" {puts "TESTING ERROR 13\n";exit}
diff --git a/test/fs/mkdir.exp b/test/fs/mkdir.exp
index 8b787f114..da04a431c 100755
--- a/test/fs/mkdir.exp
+++ b/test/fs/mkdir.exp
@@ -7,34 +7,34 @@ set timeout 3
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "rm -fr ~/.firejail_test\r" 10send -- "rm -fr ~/_firejail_test_dir\r"
11after 100 11after 100
12 12
13send -- "firejail --profile=mkdir.profile find ~/.firejail_test\r" 13send -- "firejail --profile=mkdir.profile find ~/_firejail_test_dir\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 1.1\n";exit} 15 timeout {puts "TESTING ERROR 1.1\n";exit}
16 ".firejail_test/a/b/c/d.txt" 16 "_firejail_test_dir/_firejail_test_file"
17} 17}
18send -- "rm -rf ~/.firejail_test\r" 18send -- "rm -rf ~/_firejail_test_dir\r"
19after 100 19after 100
20 20
21send -- "firejail --profile=mkdir.profile find /tmp/.firejail_test\r" 21send -- "firejail --profile=mkdir.profile find /tmp/_firejail_test_dir\r"
22expect { 22expect {
23 timeout {puts "TESTING ERROR 2.1\n";exit} 23 timeout {puts "TESTING ERROR 2.1\n";exit}
24 "/tmp/.firejail_test/a/b/c/d.txt" 24 "_firejail_test_dir/_firejail_test_file"
25} 25}
26send -- "rm -rf /tmp/.firejail_test\r" 26send -- "rm -rf /tmp/_firejail_test_dir\r"
27after 100 27after 100
28 28
29set UID [exec id -u] 29set UID [exec id -u]
30set fexist [file exist /run/user/$UID] 30set fexist [file exist /run/user/$UID]
31if { $fexist } { 31if { $fexist } {
32 send -- "firejail --profile=mkdir.profile find /run/user/$UID/.firejail_test\r" 32 send -- "firejail --profile=mkdir.profile find /run/user/$UID/_firejail_test_dir\r"
33 expect { 33 expect {
34 timeout {puts "TESTING ERROR 3.1\n";exit} 34 timeout {puts "TESTING ERROR 3.1\n";exit}
35 "/run/user/$UID/.firejail_test/a/b/c/d.txt" 35 "_firejail_test_dir/_firejail_test_file"
36 } 36 }
37 send -- "rm -rf /run/user/$UID/.firejail_test\r" 37 send -- "rm -rf /run/user/$UID/_firejail_test_dir\r"
38 after 100 38 after 100
39 39
40 40
diff --git a/test/fs/mkdir.profile b/test/fs/mkdir.profile
index 35c27c872..fba93f466 100644
--- a/test/fs/mkdir.profile
+++ b/test/fs/mkdir.profile
@@ -1,6 +1,6 @@
1mkdir ~/.firejail_test/a/b/c 1mkdir ~/_firejail_test_dir
2mkfile ~/.firejail_test/a/b/c/d.txt 2mkfile ~/_firejail_test_dir/_firejail_test_file
3mkdir /tmp/.firejail_test/a/b/c 3mkdir /tmp/_firejail_test_dir
4mkfile /tmp/.firejail_test/a/b/c/d.txt 4mkfile /tmp/_firejail_test_dir/_firejail_test_file
5mkdir ${RUNUSER}/.firejail_test/a/b/c 5mkdir ${RUNUSER}/_firejail_test_dir
6mkfile ${RUNUSER}/.firejail_test/a/b/c/d.txt 6mkfile ${RUNUSER}/_firejail_test_dir/_firejail_test_file
diff --git a/test/fs/option_blacklist.exp b/test/fs/option_blacklist.exp
index 6ee2b07ca..48dfcc069 100755
--- a/test/fs/option_blacklist.exp
+++ b/test/fs/option_blacklist.exp
@@ -35,4 +35,4 @@ expect {
35} 35}
36after 100 36after 100
37 37
38puts "\n" 38puts "\nall done\n"
diff --git a/test/fs/option_blacklist_file.exp b/test/fs/option_blacklist_file.exp
index b0bcc741b..247e69121 100755
--- a/test/fs/option_blacklist_file.exp
+++ b/test/fs/option_blacklist_file.exp
@@ -7,7 +7,12 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --blacklist=/etc/passwd\r" 10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14
15send -- "firejail --blacklist=/etc/passwd --blacklist=~/_firejail_test_dir\r"
11expect { 16expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 17 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 18 "Child process initialized"
@@ -17,6 +22,16 @@ sleep 1
17send -- "cat /etc/passwd;echo done\r" 22send -- "cat /etc/passwd;echo done\r"
18expect { 23expect {
19 timeout {puts "TESTING ERROR 1\n";exit} 24 timeout {puts "TESTING ERROR 1\n";exit}
25 "No such file or directory"
26}
27expect {
28 timeout {puts "TESTING ERROR 2\n";exit}
29 "done"
30}
31after 100
32send -- "cat ~/_firejail_test_dir/a;echo done\r"
33expect {
34 timeout {puts "TESTING ERROR 1\n";exit}
20 "Permission denied" 35 "Permission denied"
21} 36}
22expect { 37expect {
@@ -25,4 +40,10 @@ expect {
25} 40}
26after 100 41after 100
27 42
28puts "\n" 43send -- "exit\r"
44sleep 1
45
46send -- "rm -fr ~/_firejail_test_dir\r"
47after 100
48
49puts "\nall done\n"
diff --git a/test/fs/option_blacklist_glob.exp b/test/fs/option_blacklist_glob.exp
index ee79eabf4..a4be4a97d 100755
--- a/test/fs/option_blacklist_glob.exp
+++ b/test/fs/option_blacklist_glob.exp
@@ -7,26 +7,41 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --blacklist=testdir1/*\r" 10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
18
19send -- "firejail --blacklist=~/_firejail_test_dir/*\r"
11expect { 20expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 21 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized" 22 "Child process initialized"
14} 23}
15sleep 1 24sleep 1
16send -- "cd testdir1\r" 25send -- "cd ~/_firejail_test_dir\r"
17sleep 1 26sleep 1
18 27
19send -- "cat .file\r" 28send -- "cat a\r"
20expect { 29expect {
21 timeout {puts "TESTING ERROR 1\n";exit} 30 timeout {puts "TESTING ERROR 1\n";exit}
22 "Permission denied" 31 "Permission denied"
23} 32}
24 33
25send -- "ls .directory\r" 34send -- "ls test1\r"
26expect { 35expect {
27 timeout {puts "TESTING ERROR 2\n";exit} 36 timeout {puts "TESTING ERROR 2\n";exit}
28 "Permission denied" 37 "Permission denied"
29} 38}
30after 100 39after 100
31 40
32puts "\n" 41send -- "exit\r"
42sleep 1
43
44send -- "rm -fr ~/_firejail_test_dir\r"
45after 100
46
47puts "\nall done\n"
diff --git a/test/fs/private-etc.exp b/test/fs/private-etc.exp
index c9a74f96e..7d0e9f619 100755
--- a/test/fs/private-etc.exp
+++ b/test/fs/private-etc.exp
@@ -64,9 +64,6 @@ expect {
64} 64}
65after 100 65after 100
66 66
67 67send -- "exit\r"
68
69
70
71after 100 68after 100
72puts "\nall done\n" 69puts "\nall done\n"
diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp
index 75ac5aea5..bd8cab16f 100755
--- a/test/fs/private-home-dir.exp
+++ b/test/fs/private-home-dir.exp
@@ -21,13 +21,13 @@ if {[file exists ~/.Xauthority]} {
21 send -- "touch ~/.Xauthority\r" 21 send -- "touch ~/.Xauthority\r"
22} 22}
23after 100 23after 100
24send -- "rm -fr ~/_firejail_test_dir_\r" 24send -- "rm -fr ~/_firejail_test_dir1_\r"
25after 100 25after 100
26send -- "mkdir ~/_firejail_test_dir_\r" 26send -- "mkdir ~/_firejail_test_dir1_\r"
27sleep 1 27sleep 1
28 28
29# testing profile and private 29# testing profile and private
30send -- "firejail --private=~/_firejail_test_dir_\r" 30send -- "firejail --private=~/_firejail_test_dir1_\r"
31expect { 31expect {
32 timeout {puts "TESTING ERROR 0\n";exit} 32 timeout {puts "TESTING ERROR 0\n";exit}
33 "Child process initialized" 33 "Child process initialized"
@@ -67,12 +67,12 @@ expect {
67 "private directory is not owned by the current user" 67 "private directory is not owned by the current user"
68} 68}
69sleep 1 69sleep 1
70send -- "mkdir ~/_firejail_test_dir_/test_dir_2\r" 70send -- "mkdir ~/_firejail_test_dir1_/test_dir_2\r"
71after 100 71after 100
72send -- "touch ~/_firejail_test_dir_/test_dir_2/testfile\r" 72send -- "touch ~/_firejail_test_dir1_/test_dir_2/testfile\r"
73sleep 1 73sleep 1
74 74
75send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" 75send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir1_\r"
76expect { 76expect {
77 timeout {puts "TESTING ERROR 10\n";exit} 77 timeout {puts "TESTING ERROR 10\n";exit}
78 "Disable" 78 "Disable"
@@ -98,7 +98,8 @@ after 100
98send "exit\r" 98send "exit\r"
99sleep 1 99sleep 1
100 100
101send -- "rm -fr ~/_firejail_test_dir_\r" 101send -- "rm -fr ~/_firejail_test_dir1\r"
102after 100 102after 100
103 103
104
104puts "\nall done\n" 105puts "\nall done\n"
diff --git a/test/fs/private-home.exp b/test/fs/private-home.exp
index 2f297e93f..6fbe8b0f6 100755
--- a/test/fs/private-home.exp
+++ b/test/fs/private-home.exp
@@ -95,8 +95,19 @@ expect {
95 "broken symbolic link" 95 "broken symbolic link"
96} 96}
97send -- "exit\r" 97send -- "exit\r"
98sleep 1
98 99
99send -- "rm -f ~/_firejail_test*\r" 100send -- "echo cleanup\r"
101after 100
102send -- "rm -f ~/_firejail_test_file1\r"
103after 100
104send -- "rm -f ~/_firejail_test_file2\r"
105after 100
106send -- "rm -fr ~/_firejail_test_dir1\r"
107after 100
108send -- "rm -f ~/_firejail_test_link1\r"
109after 100
110send -- "rm -f ~/_firejail_test_link2\r"
100after 100 111after 100
101 112
102puts "\nall done\n" 113puts "\nall done\n"
diff --git a/test/fs/read-write.exp b/test/fs/read-write.exp
index ad51c2db1..6c0f755da 100755
--- a/test/fs/read-write.exp
+++ b/test/fs/read-write.exp
@@ -7,6 +7,14 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
10 18
11send -- "firejail --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r" 19send -- "firejail --read-only=~/_firejail_test_dir --read-write=~/_firejail_test_dir/test1\r"
12expect { 20expect {
@@ -32,4 +40,9 @@ expect {
32} 40}
33 41
34after 100 42after 100
43send -- "exit\r"
44sleep 1
45
46send -- "rm -fr ~/_firejail_test_dir\r"
47after 100
35puts "\nall done\n" 48puts "\nall done\n"
diff --git a/test/fs/whitelist-dev.exp b/test/fs/whitelist-dev.exp
index ad5c54a9c..d0466bbeb 100755
--- a/test/fs/whitelist-dev.exp
+++ b/test/fs/whitelist-dev.exp
@@ -61,6 +61,9 @@ expect {
61 "19" {puts "OK\n"} 61 "19" {puts "OK\n"}
62 "20" {puts "OK\n"} 62 "20" {puts "OK\n"}
63 "21" {puts "OK\n"} 63 "21" {puts "OK\n"}
64 "22" {puts "OK\n"}
65 "23" {puts "OK\n"}
66 "24" {puts "OK\n"}
64} 67}
65after 100 68after 100
66 69
diff --git a/test/fs/whitelist-double.exp b/test/fs/whitelist-double.exp
index 5ce9d8ad7..e653517a6 100755
--- a/test/fs/whitelist-double.exp
+++ b/test/fs/whitelist-double.exp
@@ -7,17 +7,17 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "echo 123 > /tmp/firejal-deleteme\r" 10send -- "echo 123 > /tmp/_firejail_test_file\r"
11sleep 1 11sleep 1
12 12
13send -- "firejail --whitelist=/tmp/firejal-deleteme --whitelist=/tmp/firejal-deleteme\r" 13send -- "firejail --whitelist=/tmp/_firejail_test_file --whitelist=/tmp/_firejail_test_file\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "Child process initialized" 16 "Child process initialized"
17} 17}
18sleep 1 18sleep 1
19 19
20send -- "cat /tmp/firejal-deleteme\r" 20send -- "cat /tmp/_firejail_test_file\r"
21expect { 21expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
23 "123" 23 "123"
@@ -26,13 +26,13 @@ expect {
26send -- "exit\r" 26send -- "exit\r"
27sleep 1 27sleep 1
28 28
29send -- "cat /tmp/firejal-deleteme\r" 29send -- "cat /tmp/_firejail_test_file\r"
30expect { 30expect {
31 timeout {puts "TESTING ERROR 2\n";exit} 31 timeout {puts "TESTING ERROR 2\n";exit}
32 "123" 32 "123"
33} 33}
34 34
35send -- "rm -v /tmp/firejal-deleteme\r" 35send -- "rm -v /tmp/_firejail_test_file\r"
36expect { 36expect {
37 timeout {puts "TESTING ERROR 3\n";exit} 37 timeout {puts "TESTING ERROR 3\n";exit}
38 "removed" 38 "removed"
diff --git a/test/fs/whitelist-readonly.exp b/test/fs/whitelist-readonly.exp
index e5c9cc400..f9d78b7c0 100755
--- a/test/fs/whitelist-readonly.exp
+++ b/test/fs/whitelist-readonly.exp
@@ -7,6 +7,14 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "mkdir ~/_firejail_test_dir\r"
11after 100
12send -- "touch ~/_firejail_test_dir/a\r"
13after 100
14send -- "mkdir ~/_firejail_test_dir/test1\r"
15after 100
16send -- "touch ~/_firejail_test_dir/test1/b\r"
17after 100
10 18
11send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r" 19send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r"
12expect { 20expect {
@@ -25,4 +33,6 @@ after 100
25send -- "exit\r" 33send -- "exit\r"
26sleep 1 34sleep 1
27 35
36send -- "rm -fr ~/_firejail_test_dir\r"
37after 100
28puts "\nall done\n" 38puts "\nall done\n"