From 7be7e2d326540135273b221f594cd22057ac04dc Mon Sep 17 00:00:00 2001 From: smitsohu Date: Thu, 26 Sep 2019 01:22:59 +0200 Subject: testing: rename and simplify cf. previous commits 5bb476f74efb4754b6f5f8d711c6b77898ef9385 and 4b1a6094d7f4d9c25ff4f0f9a31bcd83732910a1 --- test/fs/fs.sh | 10 +++++----- test/fs/private-cache.exp | 6 +++--- test/fs/readonly-whitelist.exp | 28 ---------------------------- test/fs/whitelist-readonly.exp | 28 ++++++++++++++++++++++++++++ test/fs/whitelist-whitespace.exp | 7 ------- 5 files changed, 36 insertions(+), 43 deletions(-) delete mode 100755 test/fs/readonly-whitelist.exp create mode 100755 test/fs/whitelist-readonly.exp (limited to 'test/fs') diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 7ea8de542..fa642443f 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh @@ -21,8 +21,8 @@ mkdir ~/_firejail_test_dir/test1 touch ~/_firejail_test_dir/test1/b echo "TESTING: read/write (test/fs/read-write.exp)" ./read-write.exp -echo "TESTING: readonly whitelist (test/fs/readonly-whitelist.exp)" -./readonly-whitelist.exp +echo "TESTING: whitelist readonly (test/fs/whitelist-readonly.exp)" +./whitelist-readonly.exp rm -fr ~/_firejail_test_* echo "TESTING: /sys/fs access (test/fs/sys_fs.exp)" @@ -108,15 +108,15 @@ echo "TESTING: recursive mkdir (test/fs/mkdir.exp)" echo "TESTING: double whitelist (test/fs/whitelist-double.exp)" ./whitelist-double.exp -echo "TESTING: whitelist file with whitespaces (test/fs/whitelist-whitespace.exp)" -./whitelist-whitespace.exp - echo "TESTING: whitelist (test/fs/whitelist.exp)" ./whitelist.exp echo "TESTING: whitelist dev, var(test/fs/whitelist-dev.exp)" ./whitelist-dev.exp +echo "TESTING: whitelist with whitespaces (test/fs/whitelist-whitespace.exp)" +./whitelist-whitespace.exp + echo "TESTING: fscheck --bind non root (test/fs/fscheck-bindnoroot.exp)" ./fscheck-bindnoroot.exp diff --git a/test/fs/private-cache.exp b/test/fs/private-cache.exp index 0a1f00eb5..ddff2d02d 100755 --- a/test/fs/private-cache.exp +++ b/test/fs/private-cache.exp @@ -21,10 +21,10 @@ expect { } sleep 1 -send -- "ls ~/.cache | wc -l\r" +send -- "ls -l ~/.cache\r" expect { timeout {puts "TESTING ERROR 2\n";exit} - "\n0" + "total 0" } after 100 @@ -43,7 +43,7 @@ after 100 send -- "firejail --noprofile --private --private-cache\r" expect { timeout {puts "TESTING ERROR 4\n";exit} - "tmpfs not mounted" + "Warning" } sleep 1 diff --git a/test/fs/readonly-whitelist.exp b/test/fs/readonly-whitelist.exp deleted file mode 100755 index 784fc36bd..000000000 --- a/test/fs/readonly-whitelist.exp +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/expect -f -# This file is part of Firejail project -# Copyright (C) 2014-2019 Firejail Authors -# License GPL v2 - -set timeout 10 -spawn $env(SHELL) -match_max 100000 - - -send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r" -expect { - timeout {puts "TESTING ERROR 0\n";exit} - "Child process initialized" -} -sleep 1 - -send -- "echo mytest > ~/_firejail_test_dir/a\r" -expect { - timeout {puts "TESTING ERROR 1\n";exit} - "Read-only file system" -} -after 100 - -send -- "exit\r" -sleep 1 - -puts "\nall done\n" diff --git a/test/fs/whitelist-readonly.exp b/test/fs/whitelist-readonly.exp new file mode 100755 index 000000000..784fc36bd --- /dev/null +++ b/test/fs/whitelist-readonly.exp @@ -0,0 +1,28 @@ +#!/usr/bin/expect -f +# This file is part of Firejail project +# Copyright (C) 2014-2019 Firejail Authors +# License GPL v2 + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + + +send -- "firejail --noprofile --whitelist=~/_firejail_test_dir --read-only=~\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "echo mytest > ~/_firejail_test_dir/a\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Read-only file system" +} +after 100 + +send -- "exit\r" +sleep 1 + +puts "\nall done\n" diff --git a/test/fs/whitelist-whitespace.exp b/test/fs/whitelist-whitespace.exp index b16668557..959fb9409 100755 --- a/test/fs/whitelist-whitespace.exp +++ b/test/fs/whitelist-whitespace.exp @@ -14,13 +14,6 @@ expect { } sleep 1 -send -- "ls ~ | wc -l\r" -expect { - timeout {puts "TESTING ERROR 2\n";exit} - "\n1" -} -after 100 - send -- "ls ~\r" expect { timeout {puts "TESTING ERROR 3\n";exit} -- cgit v1.2.3-54-g00ecf