diff options
Diffstat (limited to 'test/fs/fs.sh')
-rwxr-xr-x | test/fs/fs.sh | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh new file mode 100755 index 000000000..611b62b09 --- /dev/null +++ b/test/fs/fs.sh | |||
@@ -0,0 +1,116 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | |||
9 | rm -fr ~/_firejail_test_* | ||
10 | echo "TESTING: mkdir/mkfile (test/fs/mkdir_mkfile.exp)" | ||
11 | ./mkdir_mkfile.exp | ||
12 | rm -fr ~/_firejail_test_* | ||
13 | |||
14 | mkdir ~/_firejail_test_dir | ||
15 | touch ~/_firejail_test_dir/a | ||
16 | mkdir ~/_firejail_test_dir/test1 | ||
17 | touch ~/_firejail_test_dir/test1/b | ||
18 | echo "TESTING: read/write (test/fs/read-write.exp)" | ||
19 | ./read-write.exp | ||
20 | rm -fr ~/_firejail_test_* | ||
21 | |||
22 | echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" | ||
23 | ./sys_fs.exp | ||
24 | |||
25 | echo "TESTING: kmsg access (test/fs/kmsg.exp)" | ||
26 | ./kmsg.exp | ||
27 | |||
28 | echo "TESTING: read/write /var/tmp (test/fs/fs_var_tmp.exp)" | ||
29 | ./fs_var_tmp.exp | ||
30 | |||
31 | echo "TESTING: read/write /var/lock (test/fs/fs_var_lock.exp)" | ||
32 | ./fs_var_lock.exp | ||
33 | |||
34 | echo "TESTING: read/write /dev/shm (test/fs/fs_dev_shm.exp)" | ||
35 | ./fs_dev_shm.exp | ||
36 | |||
37 | echo "TESTING: private (test/fs/private.exp)" | ||
38 | ./private.exp | ||
39 | |||
40 | echo "TESTING: private home (test/fs/private-home.exp)" | ||
41 | ./private-home.exp | ||
42 | |||
43 | echo "TESTING: private home dir (test/fs/private-home-dir.exp)" | ||
44 | ./private-home-dir.exp | ||
45 | |||
46 | echo "TESTING: private home dir same as user home (test/fs/private-homedir.exp)" | ||
47 | ./private-homedir.exp | ||
48 | |||
49 | echo "TESTING: private-etc (test/fs/private-etc.exp)" | ||
50 | ./private-etc.exp | ||
51 | |||
52 | echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)" | ||
53 | ./private-etc-empty.exp | ||
54 | |||
55 | echo "TESTING: private-bin (test/fs/private-bin.exp)" | ||
56 | ./private-bin.exp | ||
57 | |||
58 | echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" | ||
59 | ./whitelist-empty.exp | ||
60 | |||
61 | echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" | ||
62 | ./private-whitelist.exp | ||
63 | |||
64 | echo "TESTING: whitelist ~/Downloads (test/fs/whitelist-downloads.exp)" | ||
65 | ./whitelist-downloads.exp | ||
66 | |||
67 | echo "TESTING: invalid filename (test/fs/invalid_filename.exp)" | ||
68 | ./invalid_filename.exp | ||
69 | |||
70 | echo "TESTING: blacklist directory (test/fs/option_blacklist.exp)" | ||
71 | ./option_blacklist.exp | ||
72 | |||
73 | echo "TESTING: blacklist file (test/fs/option_blacklist_file.exp)" | ||
74 | ./option_blacklist_file.exp | ||
75 | |||
76 | echo "TESTING: blacklist glob (test/fs/option_blacklist_glob.exp)" | ||
77 | ./option_blacklist_glob.exp | ||
78 | |||
79 | echo "TESTING: bind as user (test/fs/option_bind_user.exp)" | ||
80 | ./option_bind_user.exp | ||
81 | |||
82 | echo "TESTING: recursive mkdir (test/fs/mkdir.exp)" | ||
83 | ./mkdir.exp | ||
84 | |||
85 | echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" | ||
86 | ./whitelist-double.exp | ||
87 | |||
88 | echo "TESTING: whitelist (test/fs/whitelist.exp)" | ||
89 | ./whitelist.exp | ||
90 | |||
91 | echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" | ||
92 | ./whitelist-dev.exp | ||
93 | |||
94 | echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" | ||
95 | ./fscheck-bindnoroot.exp | ||
96 | |||
97 | echo "TESTING: fscheck --tmpfs non root (test/fs/fscheck-tmpfs.exp)" | ||
98 | ./fscheck-tmpfs.exp | ||
99 | |||
100 | echo "TESTING: fscheck --private= (test/fs/fscheck-private.exp)" | ||
101 | ./fscheck-private.exp | ||
102 | |||
103 | echo "TESTING: fscheck --read-only= (test/fs/fscheck-readonly.exp)" | ||
104 | ./fscheck-readonly.exp | ||
105 | |||
106 | #cleanup | ||
107 | rm -fr ~/fjtest-dir | ||
108 | rm -fr ~/fjtest-dir-lnk | ||
109 | rm -f ~/fjtest-file | ||
110 | rm -f ~/fjtest-file-lnk | ||
111 | rm -f /tmp/fjtest-file | ||
112 | rm -fr /tmp/fjtest-dir | ||
113 | rm -fr ~/_firejail_test_* | ||
114 | |||
115 | |||
116 | |||