diff options
Diffstat (limited to 'test/fs/fs.sh')
-rwxr-xr-x | test/fs/fs.sh | 51 |
1 files changed, 36 insertions, 15 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 |
16 | rm -fr ~/_firejail_test_* | 16 | rm -fr ~/_firejail_test_* |
17 | 17 | ||
18 | mkdir ~/_firejail_test_dir | 18 | echo "TESTING: recursive mkdir (test/fs/mkdir.exp)" |
19 | touch ~/_firejail_test_dir/a | 19 | ./mkdir.exp |
20 | mkdir ~/_firejail_test_dir/test1 | 20 | rm -fr ~/_firejail_test_* |
21 | touch ~/_firejail_test_dir/test1/b | 21 | rm -fr /tmp/_firejail_test_* |
22 | |||
22 | echo "TESTING: read/write (test/fs/read-write.exp)" | 23 | echo "TESTING: read/write (test/fs/read-write.exp)" |
23 | ./read-write.exp | 24 | ./read-write.exp |
25 | rm -fr ~/_firejail_test_dir | ||
26 | |||
24 | echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)" | 27 | echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)" |
25 | ./whitelist-readonly.exp | 28 | ./whitelist-readonly.exp |
26 | rm -fr ~/_firejail_test_* | 29 | rm -f ~/_firejail_test_dir |
27 | 30 | ||
28 | echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" | 31 | echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" |
29 | ./sys_fs.exp | 32 | ./sys_fs.exp |
@@ -37,16 +40,19 @@ fi | |||
37 | 40 | ||
38 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" | 41 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" |
39 | ./fs_var_tmp.exp | 42 | ./fs_var_tmp.exp |
43 | rm -f /var/tmp/_firejail_test_file | ||
40 | 44 | ||
41 | echo "TESTING: private-lib (test/fs/private-lib.exp)" | 45 | echo "TESTING: private-lib (test/fs/private-lib.exp)" |
42 | ./private-lib.exp | 46 | ./private-lib.exp |
43 | 47 | ||
44 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" | 48 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" |
45 | ./fs_var_lock.exp | 49 | ./fs_var_lock.exp |
50 | rm -f /var/lock/_firejail_test_file | ||
46 | 51 | ||
47 | if [ -w /dev/shm ]; then | 52 | if [ -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 | ||
50 | else | 56 | else |
51 | echo "TESTING SKIP: /dev/shm not writable" | 57 | echo "TESTING SKIP: /dev/shm not writable" |
52 | fi | 58 | fi |
@@ -56,12 +62,23 @@ echo "TESTING: private (test/fs/private.exp)" | |||
56 | 62 | ||
57 | echo "TESTING: private home (test/fs/private-home.exp)" | 63 | echo "TESTING: private home (test/fs/private-home.exp)" |
58 | ./private-home.exp | 64 | ./private-home.exp |
65 | rm -f ~/_firejail_test_file1 | ||
66 | rm -f ~/_firejail_test_file2 | ||
67 | rm -fr ~/_firejail_test_dir1 | ||
68 | rm -f ~/_firejail_test_link1 | ||
69 | rm -f ~/_firejail_test_link2 | ||
59 | 70 | ||
60 | echo "TESTING: private home dir (test/fs/private-home-dir.exp)" | 71 | echo "TESTING: private home dir (test/fs/private-home-dir.exp)" |
61 | ./private-home-dir.exp | 72 | ./private-home-dir.exp |
73 | rm -fr ~/_firejail_test_dir1 | ||
62 | 74 | ||
63 | echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" | 75 | echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" |
64 | ./private-homedir.exp | 76 | ./private-homedir.exp |
77 | rm -f ~/_firejail_test_file1 | ||
78 | rm -f ~/_firejail_test_file2 | ||
79 | rm -fr ~/_firejail_test_dir1 | ||
80 | rm -f ~/_firejail_test_link1 | ||
81 | rm -f ~/_firejail_test_link2 | ||
65 | 82 | ||
66 | echo "TESTING: private-etc (test/fs/private-etc.exp)" | 83 | echo "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 | ||
75 | echo "TESTING: private-cache (test/fs/private-cache.exp)" | 92 | echo "TESTING: private-cache (test/fs/private-cache.exp)" |
76 | ./private-cache.exp | 93 | ./private-cache.exp |
94 | rm -f ~/.cache/abcdefg | ||
77 | 95 | ||
78 | echo "TESTING: private-cwd (test/fs/private-cwd.exp)" | 96 | echo "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 | ||
84 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" | 102 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" |
85 | ./whitelist-empty.exp | 103 | ./whitelist-empty.exp |
104 | rm -f ~/Videos/_firejail_test_fil | ||
105 | rm -f ~/Pictures/_firejail_test_file | ||
106 | rm -f ~/Music/_firejail_test_file | ||
107 | rm -f ~/Downloads/_firejail_test_file | ||
108 | rm -f ~/Documents/_firejail_test_file | ||
109 | rm -f ~/Desktop/_firejail_test_file | ||
86 | 110 | ||
87 | echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" | 111 | echo "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 | ||
96 | echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)" | 120 | echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)" |
97 | ./option_blacklist_file.exp | 121 | ./option_blacklist_file.exp |
122 | rm -fr ~/_firejail_test_dir | ||
98 | 123 | ||
99 | echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)" | 124 | echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)" |
100 | ./option_blacklist_glob.exp | 125 | ./option_blacklist_glob.exp |
126 | rm -fr ~/_firejail_test_dir | ||
101 | 127 | ||
102 | echo "TESTING: noblacklist blacklist noexec (test/fs/noblacklist-blacklist-noexec.exp)" | 128 | echo "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 | |||
108 | echo "TESTING: bind as user (test/fs/option_bind_user.exp)" | 134 | echo "TESTING: bind as user (test/fs/option_bind_user.exp)" |
109 | ./option_bind_user.exp | 135 | ./option_bind_user.exp |
110 | 136 | ||
111 | echo "TESTING: recursive mkdir (test/fs/mkdir.exp)" | ||
112 | ./mkdir.exp | ||
113 | |||
114 | echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" | 137 | echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" |
115 | ./whitelist-double.exp | 138 | ./whitelist-double.exp |
139 | rm -f /tmp/_firejail_test_file | ||
116 | 140 | ||
117 | echo "TESTING: whitelist (test/fs/whitelist.exp)" | 141 | echo "TESTING: whitelist (test/fs/whitelist.exp)" |
118 | ./whitelist.exp | 142 | ./whitelist.exp |
143 | rm -fr ~/_firejail_test_* | ||
119 | 144 | ||
120 | echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" | 145 | echo "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 | ||
132 | echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)" | 157 | echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)" |
133 | ./fscheck-tmpfs.exp | 158 | ./fscheck-tmpfs.exp |
159 | rm -fr ~/_firejail_test_dir | ||
160 | rm -fr /tmp/_firejail_test_dir | ||
134 | 161 | ||
135 | echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)" | 162 | echo "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 |
142 | rm -fr ~/fjtest-dir | 169 | rm -fr ~/_firejail_test* |
143 | rm -fr ~/fjtest-dir-lnk | ||
144 | rm -f ~/fjtest-file | ||
145 | rm -f ~/fjtest-file-lnk | ||
146 | rm -f /tmp/fjtest-file | ||
147 | rm -fr /tmp/fjtest-dir | ||
148 | rm -fr ~/_firejail_test_* | ||