diff options
author | smitsohu <smitsohu@gmail.com> | 2019-09-25 00:11:05 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2019-09-25 00:11:05 +0200 |
commit | 4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1 (patch) | |
tree | 69f109d1349ebc6c048453f1afd4c3946da8d014 /test | |
parent | testing suite fixes: remove shell localization (diff) | |
download | firejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.tar.gz firejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.tar.zst firejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/fs/fs.sh | 2 | ||||
-rwxr-xr-x | test/fs/readonly-whitelist.exp | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index c60d44904..7ea8de542 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -21,6 +21,8 @@ mkdir ~/_firejail_test_dir/test1 | |||
21 | touch ~/_firejail_test_dir/test1/b | 21 | touch ~/_firejail_test_dir/test1/b |
22 | echo "TESTING: read/write (test/fs/read-write.exp)" | 22 | echo "TESTING: read/write (test/fs/read-write.exp)" |
23 | ./read-write.exp | 23 | ./read-write.exp |
24 | echo "TESTING: readonly whitelist (test/fs/readonly-whitelist.exp)" | ||
25 | ./readonly-whitelist.exp | ||
24 | rm -fr ~/_firejail_test_* | 26 | rm -fr ~/_firejail_test_* |
25 | 27 | ||
26 | echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" | 28 | echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" |
diff --git a/test/fs/readonly-whitelist.exp b/test/fs/readonly-whitelist.exp new file mode 100755 index 000000000..784fc36bd --- /dev/null +++ b/test/fs/readonly-whitelist.exp | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2019 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | |||
11 | send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 1 | ||
17 | |||
18 | send -- "echo mytest > ~/_firejail_test_dir/a\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 1\n";exit} | ||
21 | "Read-only file system" | ||
22 | } | ||
23 | after 100 | ||
24 | |||
25 | send -- "exit\r" | ||
26 | sleep 1 | ||
27 | |||
28 | puts "\nall done\n" | ||