diff options
Diffstat (limited to 'tests/stddirs.sh')
-rw-r--r-- | tests/stddirs.sh | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/stddirs.sh b/tests/stddirs.sh index e08e6bf..b3cd521 100644 --- a/tests/stddirs.sh +++ b/tests/stddirs.sh @@ -14,13 +14,13 @@ make_basic() { # Creates a file+directory structure with various permissions for tests make_perms() { - "$XTOUCH" -p -M000 "$1/0" - "$XTOUCH" -p -M444 "$1/r" - "$XTOUCH" -p -M222 "$1/w" - "$XTOUCH" -p -M644 "$1/rw" - "$XTOUCH" -p -M555 "$1/rx" - "$XTOUCH" -p -M311 "$1/wx" - "$XTOUCH" -p -M755 "$1/rwx" + "$XTOUCH" -p -M000 "$1/f---" + "$XTOUCH" -p -M444 "$1/fr--" + "$XTOUCH" -p -M222 "$1/f-w-" + "$XTOUCH" -p -M644 "$1/frw-" + "$XTOUCH" -p -M311 "$1/f-wx" + "$XTOUCH" -p -M555 "$1/fr-x" "$1/dr-x/" + "$XTOUCH" -p -M755 "$1/frwx" "$1/drwx/" } # Creates a file+directory structure with various symbolic and hard links @@ -48,6 +48,12 @@ make_loops() { ln -s deeply/nested/loop/nested "$1/skip" } +# Creates a file+directory structure with inaccessible files +make_inaccessible() { + "$XTOUCH" -p -M000 "$1/file" "$1/dir/" + ln -s dir/file "$1/link" +} + # Creates a file+directory structure with varying timestamps make_times() { "$XTOUCH" -p -t "1991-12-14 00:00" "$1/a" @@ -71,6 +77,9 @@ make_weirdnames() { "$XTOUCH" -p "$1/\\/i" "$XTOUCH" -p "$1/ /j" "$XTOUCH" -p "$1/[/k" + "$XTOUCH" -p "$1/{/l" + "$XTOUCH" -p "$1/*/m" + "$XTOUCH" -p "$1/"$'\n/n' } # Creates a very deep directory structure for testing PATH_MAX handling @@ -133,6 +142,7 @@ make_stddirs() { make_perms "$TMP/perms" make_links "$TMP/links" make_loops "$TMP/loops" + make_inaccessible "$TMP/inaccessible" make_times "$TMP/times" make_weirdnames "$TMP/weirdnames" make_deep "$TMP/deep" @@ -148,5 +158,6 @@ clean_stddirs() { fi done + chmod -R +rwX "$TMP" rm -rf "$TMP" } |