aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2019-09-25 00:11:05 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2019-09-25 00:11:05 +0200
commit4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1 (patch)
tree69f109d1349ebc6c048453f1afd4c3946da8d014 /test
parenttesting suite fixes: remove shell localization (diff)
downloadfirejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.tar.gz
firejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.tar.zst
firejail-4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1.zip
testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/fs/fs.sh2
-rwxr-xr-xtest/fs/readonly-whitelist.exp28
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
21touch ~/_firejail_test_dir/test1/b 21touch ~/_firejail_test_dir/test1/b
22echo "TESTING: read/write (test/fs/read-write.exp)" 22echo "TESTING: read/write (test/fs/read-write.exp)"
23./read-write.exp 23./read-write.exp
24echo "TESTING: readonly whitelist (test/fs/readonly-whitelist.exp)"
25./readonly-whitelist.exp
24rm -fr ~/_firejail_test_* 26rm -fr ~/_firejail_test_*
25 27
26echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" 28echo "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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10
11send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 1
17
18send -- "echo mytest > ~/_firejail_test_dir/a\r"
19expect {
20 timeout {puts "TESTING ERROR 1\n";exit}
21 "Read-only file system"
22}
23after 100
24
25send -- "exit\r"
26sleep 1
27
28puts "\nall done\n"