summaryrefslogtreecommitdiffstats
path: root/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2018-07-20 12:59:26 -0400
committerTavian Barnes <tavianator@tavianator.com>2018-07-20 12:59:26 -0400
commit86f0049bff0c8c802bb07fcb52ae468608ec0920 (patch)
tree935897cfcdbf707ad661008df4e430fcff5b1d35 /tests.sh
parent510a7bd65c680fcf292493b5c00ce32c90a5155c (diff)
downloadbfs-86f0049bff0c8c802bb07fcb52ae468608ec0920.tar.xz
tests: Add tests for mode 000
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh21
1 files changed, 21 insertions, 0 deletions
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
}