From 86f0049bff0c8c802bb07fcb52ae468608ec0920 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 20 Jul 2018 12:59:26 -0400 Subject: tests: Add tests for mode 000 --- tests.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 2cf8062..b861760 100755 --- a/tests.sh +++ b/tests.sh @@ -73,6 +73,7 @@ make_basic "$TMP/basic" # Creates a file+directory structure with various permissions for tests function make_perms() { + installp -m000 /dev/null "$1/0" installp -m444 /dev/null "$1/r" installp -m222 /dev/null "$1/w" installp -m644 /dev/null "$1/rw" @@ -208,6 +209,8 @@ posix_tests=( test_exec_plus_status test_exec_plus_semicolon test_flag_comma + test_perm_000 + test_perm_000_minus test_perm_222 test_perm_222_minus test_perm_644 @@ -285,6 +288,7 @@ bsd_tests=( test_uid_name test_mnewer test_H_mnewer + test_perm_000_plus test_perm_222_plus test_perm_644_plus test_size_T @@ -365,6 +369,7 @@ gnu_tests=( test_ignore_readdir_race test_ignore_readdir_race_root test_ignore_readdir_race_notdir + test_perm_000_slash test_perm_222_slash test_perm_644_slash test_perm_symbolic_slash @@ -1079,6 +1084,22 @@ function test_ignore_readdir_race_notdir() { invoke_bfs scratch -mindepth 1 -ignore_readdir_race -execdir rm -r '{}' \; -execdir touch '{}' \; } +function test_perm_000() { + bfs_diff perms -perm 000 +} + +function test_perm_000_minus() { + bfs_diff perms -perm -000 +} + +function test_perm_000_slash() { + bfs_diff perms -perm /000 +} + +function test_perm_000_plus() { + bfs_diff perms -perm +000 +} + function test_perm_222() { bfs_diff perms -perm 222 } -- cgit v1.2.3