summaryrefslogtreecommitdiff
path: root/tests/mkdir
AgeCommit message (Collapse)Author
2017-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2016-12-18tests: support non-MLS enabled SELinux systemsNicolas Iooss
When running "make check" on a Linux system running SELinux with a non-MLS policy, tests/mkdir/restorecon.sh test fails with: chcon: invalid context: root:object_r:tmp_t:s0: Invalid argument Indeed in such a configuration, contexts cannot have ":s0" suffix. * init.cfg (get_selinux_type): Refactor this function to here from various tests. Update to work with a non-MLS policy. (mls_enabled_): A new function to detect if MLS is enabled. (skip_if_mcstransd_is_running_): Update to not skip when MLS is not enabled. * tests/mkdir/restorecon.sh: Use a valid non-MLS context when needed. * tests/install/install-Z-selinux.sh: Likewise. * tests/cp/cp-a-selinux.sh: Likewise. * tests/misc/selinux.sh: Likewise. * tests/misc/chcon.sh: Skip if non-MLS as --range used throughout. Fixes http://bugs.gnu.org/22631
2016-04-18tests: let mkdir/p-v.sh fail when compare failsBernhard Voelker
* tests/mkdir/p-v.sh: Set fail=1 when compare fails: the latter only sets a non-Zero return code; evaluating that is up to the caller.
2016-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * gnulib: Update to latest with copyright year adjusted. * tests/init.sh: Sync with gnulib to pick up copyright year. * bootstrap: Likewise. * tests/sample-test: Adjust to use the single most recent year.
2015-10-14tests: avoid false failures with default ACLsPádraig Brady
To reproduce: setfacl -dm group::rx . setfacl -dm other::rx . make check * init.cfg (require_no_default_acl_): A new function to skip when default ACLs are detected, or if the getfacl utility is not available then skip if any non LSM ACLs detected. * tests/cp/existing-perm-race.sh: Call require_no_default_acl_. * tests/mkdir/parents.sh: Likewise. * tests/mkdir/perm.sh: Likewise.
2015-05-23mkdir: fix -pZ with existing parent directoriesPádraig Brady
When the parent directory exists and has a different default context to the final directory, the context was incorrectly left as that of the parent directory. * src/mkdir.c (process_dir): Because defaultcon() is called for existing ancestors (as it must be to avoid races), then we must unconditionally call restorecon() on the last component due to the already documented caveat with make_dir_parents(). Alternatively you could temp disable o->set_security_context around make_dir_parents(), but that would be subject to races. * tests (tests/mkdir/restorecon.sh): Add a TODO for improvement. Reference mknod and mkfifo with print_ver_. * NEWS: Mention the bug fix. Fixes http://bugs.gnu.org/20616
2015-01-14tests: add extra protection against unexpected exitsPádraig Brady
Many tests use `program ... && fail=1` to ensure expected error situations are indicated. However that would mask an unexpected exit (like a crash). Therefore explicitly check the expected exit code. Note where error messages are also verified, the extra protection is not added. * tests/init.sh (returns_): A new helper function to check the return code of a command, and used throughout the tests. * cfg.mk (sc_prohibit_and_fail_1): Add a syntax check to avoid new instances of this issue.
2015-01-01maint: update all copyright year number rangesPádraig Brady
Run "make update-copyright" and then... * tests/sample-test: Adjust to use the single most recent year. * tests/du/bind-mount-dir-cycle-v2.sh: Fix case in copyright message, so that year is updated automatically in future.
2014-05-05tests: initial SMACK testsJarkko Sakkinen
* init.cfg (require_smack_): New function. * local.mk: Referenced new tests. * tests/id/smack.sh: SMACK tests (new file). * tests/mkdir/smack-no-root.sh: SMACK tests (new file). * tests/mkdir/smack-root.sh: SMACK tests (new file).
2014-01-02maint: update all copyright year number rangesBernhard Voelker
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2013-11-27selinux: adjust utils to run restorecon with -ZPádraig Brady
cp, mv, install, mkdir, mkfifo, mknod are adjusted so that: -Z no longer accepts an argument. -Z or --context without an argument do not warn without SELinux. --context with an argument will warn without SELinux. * src/local.mk: Reference the new selinux module where required. * src/system.h: Make the argument to --context optional. * src/mkdir.c: Likewise. Also handle the SMACK case for --context. Note we currently silently ignore -Z with SMACK. * src/mkfifo.c: Likewise. * src/mknod.c: Likewise. * src/install.c: Likewise. Note install(1) by default already set the context for target files to their system default, albeit with an older method. Use the -Z option to select between the old and new context restoration behavior, and document the differences and details for how context restoration is done in new and old methods, with a view disabling the old method entirely in future. * src/cp.c: Make the argument to --context optional. Note -Z implies --no-preserve=context. I.E. -Z overrides that aspect of -a no matter what order specified. (struct cp_options): Document the context handling options. (main): Check/adjust option combinations after all options are processed, to both simplify processing and to make handling independent of order of options on the command line. Also improve the diagnostics from a failed call to setfscreatecon(). (set_process_security_ctx): A new function, refactored to set the default context from the source file, or with the type adjusted as per the system default for the destination path. (set_file_security_ctx): A new function refactored to set the security context of an existing file, either based on the process context or the default system context for a path. (copy_internal): Use the refactored functions to simplify error handling and consistently fail or warn as needed. (copy_reg): Likewise. (copy_internal): With --preserve=context, also copy context from non regular files. Note for directories this may impact the copying of subsequent files to that directory? (copy_attr): If we're handling SELinux explicitly, then exclude to avoid the redudant copy with --preserve=context, and the problematic copy with -Z. Note SELinux attribute exclusion also now honors cp -a --no-preserve=context. Note there was a very small window over 10 years ago, where attr_copy_file was available, while attr_copy_check_permissions was not, so we don't bother adding an explicit m4 check for the latter function. * src/mv.c: Support --context, but don't allow specifying an argument. * src/chcon.c: Adjust a comment to be specific to SELinux. * src/runcon.c: Likewise. * src/copy.c: Honor the context settings to "restorecon" as appropriate. * src/copy.h: Add a new setting to select "restorecon" functionality. * tests/mkdir/selinux.sh: s/-Z/--context=/ * tests/cp/cp-a-selinux.sh: Augment this test with cases testing basic -Z functionality, and also test the various invalid option combinations and option precedence. * tests/mkdir/restorecon.sh: Add a new test for the more involved mkdir -Z handling, since the directory changing and non existent directories need to be specially handled. Also check the similar but simpler handling of -Z by mk{nod,fifo}. * tests/local.mk: Reference the new test. * doc/coreutils.texi (cp invocation): Update as per interface changes. (mv invocation): Likewise. (install invocation): Likewise. (mkfifo invocation): Likewise. (mknod invocation): Likewise. (mkdir invocation): Likewise. * NEWS: Mention the new feature and change in behavior.
2013-05-11mkdir: don't assume umask equals POSIX default ACL maskPaul Eggert
This fixes Bug#14371, reported by Killer Bassist. * NEWS: Document this. * src/mkdir.c (struct mkdir_options): Remove member ancestor_mode. New member umask_value. All uses changed. * src/mkdir.c (make_ancestor): Fix umask assumption. * src/mkdir.c, src/mkfifo.c, src/mknod.c (main): Leave umask alone. This requires invoking lchmod after creating the file, which introduces a race condition, but this can't be avoided on hosts with "POSIX" default ACLs, and there's no easy way with network file systems to tell what kind of host the directory is on. * tests/local.mk (all_tests): Add tests/mkdir/p-acl.sh. * tests/mkdir/p-acl.sh: New file.
2013-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright", but then also run this, perl -pi -e 's/2\d\d\d-//' tests/sample-test to make that one script use the single most recent year number.
2012-09-05build: don't use recursive make for tests/ subdirectoryStefano Lattarini
* Makefile.am (SUBDIRS): Remove 'tests'. (include): The '$(top_srcdir)/tests/local.mk' file. (check-root): Remove this convenience target, it's no longer needed now that the "real" check-root target once in 'tests/Makefile' will land in the top-level makefile. * configure.ac (AC_CONFIG_FILES): Remove 'tests/Makefile'. * tests/Makefile.am: Rename ... * tests/local.mk: ... like this, with a lot of adjustments. * tests/init.cfg: Move ... * init.cfg: ... here. This is necessary, for a limitation of the gnulib-provided 'tests/init.sh', which unconditionally look for 'init.cfg' in the $(srcdir) directory. * tests/*/*.sh: Adjust: expect init.sh to be in '$srcdir/tests', not in '$srcdir', and extend $PATH with './src', not with '../src'. * tests/Coreutils.pm: Adjust similarly. * tests/pr/pr-tests.pl ($pfx): Likewise.
2012-08-30tests: add .sh and .pl suffixes to shell and perl tests, respectivelyStefano Lattarini
Not only this shrinks the size of the generated Makefile (from > 6300 lines to ~3000), but will allow further simplifications in future changes. * tests/Makefile.am (TEST_EXTENSIONS): Add '.sh' and '.pl'. (PL_LOG_COMPILER, SH_LOG_COMPILER): New, still defined simply to $(LOG_COMPILER) for the time being. (TESTS, root_tests): Adjust as described. * All tests: Rename as described.
2012-04-04tests: convert nearly all `...` expressions to $(...)Jim Meyering
Exempt init.sh because it runs before we're assured to have a shell that groks $(...). Exempt *.mk because "$" would have to be doubled, and besides, any `...` expression in a .mk file is almost certainly evaluated before init.sh is run. Finally, also exempt the perl-based tests, because perl's `...` cannot be converted to $(...). Do that by running this command: git grep -l '`.*`' tests \ | grep -Ev 'init\.sh|\.mk$' | xargs grep -Lw perl \ | xargs perl -pi -e 's/`(.*?)`/\$($1)/g' One minor fix-up change was required after that, due to how quoting differs: diff --git a/tests/chmod/equals b/tests/chmod/equals - expected_perms=$(eval 'echo \$expected_'$dest) + expected_perms=$(eval 'echo $expected_'$dest) Another was to make these required quoting adjustments: diff --git a/tests/misc/stty b/tests/misc/stty ... - rev=$(eval echo "\\\$REV_$opt") + rev=$(eval echo "\$REV_$opt") ... - rev1=$(eval echo "\\\$REV_$opt1") - rev2=$(eval echo "\\\$REV_$opt2") + rev1=$(eval echo "\$REV_$opt1") + rev2=$(eval echo "\$REV_$opt2") Also, transform two files that were needlessly excluded above: (both use perl, but are mostly bourne shell) perl -pi -e 's/`(.*?)`/\$($1)/g' \ tests/du/long-from-unreadable tests/init.cfg
2012-01-27maint: use single copyright year rangeJim Meyering
Run "make update-copyright".
2012-01-09tests: change `...' to '...' on lines not matching /[=\$]/Jim Meyering
Exempt lines with '$' or '=', since those are prone to improper conversion. Run this: git grep -l "\`[^']*'" tests \ |xargs perl -pi -e '/[=\$]/ and next;s/\`([^'\''"]*?'\'')/'\''$1/g'
2012-01-09tests: adjust \`...' quoting to '...' to adapt to latest gnulibJim Meyering
Run this: git grep -l "\\\\\`[^']*'" tests \ |xargs perl -pi -e 's/\\\`(.*?'\'')/'\''$1/g
2012-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2011-12-01tests: adjust PATH to generally include /sbin and /usr/sbinBernhard Voelker
Commit 5eeaca94 added /sbin to the PATH for tests using mkfs. For other tests, e.g. tests/cp-fiemap-perf using filefrag, we need /usr/sbin also. Add both directories generally for the tests, "since many of us always augment our PATH with all of the sbin paths all of the time anyway" (Bob in http://lists.gnu.org/archive/html/coreutils/2011-11/msg00107.html). The previous commit is hereby obsolete. * tests/init.cfg (sanitize_path_): Add /sbin and /usr/sbin to PATH unless already included. Needed for tests using admin tools like mkfs and filefrag on systems where the user's environment does not have these directories in the PATH. * tests/init.cfg (require_mkfs_PATH_): Remove obsolete function. * tests/cp/cp-a-selinux: Remove require_mkfs_PATH_ call. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/sparse-fiemap: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/rm/read-only: Likewise.
2011-11-22tests: use "compare exp out", not "compare out exp"Jim Meyering
Likewise, when an empty file is expected, use "compare /dev/null out", not "compare out /dev/null". I.e., specify the expected/desired contents via the first file name. Prompted by a suggestion from Bruno Haible in http://thread.gmane.org/gmane.comp.gnu.grep.bugs/4020/focus=29154 Run these commands: git grep -l -E 'compare [^ ]+ exp' \ |xargs perl -pi -e 's/(compare) (\S+) (exp\S*)/$1 $3 $2/' git grep -l -E 'compare [^ ]+ /dev/null' \ |xargs perl -pi -e 's/(compare) (\S+) (\/dev\/null)/$1 $3 $2/' * tests/chgrp/no-x: As above. * tests/chmod/no-x: Likewise. * tests/chmod/silent: Likewise. * tests/chmod/thru-dangling: Likewise. * tests/chown/basic: Likewise. * tests/chown/deref: Likewise. * tests/chown/preserve-root: Likewise. * tests/cp/abuse: Likewise. * tests/cp/backup-is-src: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/fail-perm: Likewise. * tests/cp/into-self: Likewise. * tests/cp/proc-zero-len: Likewise. * tests/cp/src-base-dot: Likewise. * tests/cp/thru-dangling: Likewise. * tests/dd/reblock: Likewise. * tests/dd/unblock-sync: Likewise. * tests/du/2g: Likewise. * tests/du/8gb: Likewise. * tests/du/basic: Likewise. * tests/du/bigtime: Likewise. * tests/du/deref-args: Likewise. * tests/du/exclude: Likewise. * tests/du/files0-from-dir: Likewise. * tests/du/hard-link: Likewise. * tests/du/inacc-dest: Likewise. * tests/du/inacc-dir: Likewise. * tests/du/long-sloop: Likewise. * tests/du/max-depth: Likewise. * tests/du/move-dir-while-traversing: Likewise. * tests/du/no-deref: Likewise. * tests/du/no-x: Likewise. * tests/du/one-file-system: Likewise. * tests/du/slash: Likewise. * tests/du/trailing-slash: Likewise. * tests/install/strip-program: Likewise. * tests/ln/hard-backup: Likewise. * tests/ls/block-size: Likewise. * tests/ls/color-clear-to-eol: Likewise. * tests/ls/color-dtype-dir: Likewise. * tests/ls/color-norm: Likewise. * tests/ls/dangle: Likewise. * tests/ls/dired: Likewise. * tests/ls/file-type: Likewise. * tests/ls/follow-slink: Likewise. * tests/ls/infloop: Likewise. * tests/ls/m-option: Likewise. * tests/ls/no-arg: Likewise. * tests/ls/recursive: Likewise. * tests/ls/rt-1: Likewise. * tests/ls/stat-dtype: Likewise. * tests/ls/stat-failed: Likewise. * tests/ls/stat-free-symlinks: Likewise. * tests/ls/x-option: Likewise. * tests/misc/arch: Likewise. * tests/misc/cat-buf: Likewise. * tests/misc/cat-proc: Likewise. * tests/misc/chcon: Likewise. * tests/misc/csplit: Likewise. * tests/misc/df-P: Likewise. * tests/misc/fmt-long-line: Likewise. * tests/misc/groups-dash: Likewise. * tests/misc/groups-version: Likewise. * tests/misc/head-pos: Likewise. * tests/misc/nl: Likewise. * tests/misc/od-N: Likewise. * tests/misc/od-multiple-t: Likewise. * tests/misc/od-x8: Likewise. * tests/misc/printf: Likewise. * tests/misc/printf-hex: Likewise. * tests/misc/pwd-option: Likewise. * tests/misc/readlink-fp-loop: Likewise. * tests/misc/runcon-no-reorder: Likewise. * tests/misc/seq-long-double: Likewise. * tests/misc/sort-NaN-infloop: Likewise. * tests/misc/sort-benchmark-random: Likewise. * tests/misc/sort-debug-keys: Likewise. * tests/misc/sort-float: Likewise. * tests/misc/sort-merge-fdlimit: Likewise. * tests/misc/sort-unique-segv: Likewise. * tests/misc/stat-hyphen: Likewise. * tests/misc/stat-slash: Likewise. * tests/misc/stdbuf: Likewise. * tests/misc/sum-sysv: Likewise. * tests/misc/tac-2-nonseekable: Likewise. * tests/misc/tac-continue: Likewise. * tests/misc/tr-case-class: Likewise. * tests/misc/truncate-fail-diag: Likewise. * tests/misc/wc-files0: Likewise. * tests/mkdir/selinux: Likewise. * tests/mv/backup-dir: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/dir2dir: Likewise. * tests/mv/dup-source: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-verbose: Likewise. * tests/mv/i-link-no: Likewise. * tests/mv/into-self: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/perm-1: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/trailing-slash: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/rm/cycle: Likewise. * tests/rm/dir-no-w: Likewise. * tests/rm/dir-nonrecur: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/fail-eacces: Likewise. * tests/rm/i-never: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/interactive-always: Likewise. * tests/rm/interactive-once: Likewise. * tests/rm/isatty: Likewise. * tests/rm/one-file-system: Likewise. * tests/rm/rm3: Likewise. * tests/rm/rm5: Likewise. * tests/rm/unread2: Likewise. * tests/rm/v-slash: Likewise. * tests/sample-test: Likewise. * tests/split/b-chunk: Likewise. * tests/split/fail: Likewise. * tests/split/l-chunk: Likewise. * tests/split/lines: Likewise. * tests/split/r-chunk: Likewise. * tests/split/suffix-length: Likewise. * tests/tail-2/big-4gb: Likewise. * tests/tail-2/follow-name: Likewise. * tests/tail-2/follow-stdin: Likewise. * tests/tail-2/pipe-f: Likewise. * tests/tail-2/pipe-f2: Likewise. * tests/tail-2/start-middle: Likewise. * tests/touch/60-seconds: Likewise. * tests/touch/fail-diag: Likewise. * tests/touch/not-owner: Likewise. * tests/touch/relative: Likewise.
2011-11-22tests: use compare, not "diff", in a few stray testsJim Meyering
* tests/install/basic-1: Use compare, not diff. * tests/mkdir/p-v: Likewise. * tests/mv/part-fail: Likewise. * tests/rm/rm1: Likewise. * tests/rm/rm2: Likewise. * tests/touch/not-owner: Likewise.
2011-09-07tests: adjust PATH to include /sbin for mkfs-using testsBernhard Voelker
* tests/init.cfg (require_mkfs_PATH_): New function to test whether mkfs is in PATH, otherwise adding /sbin to PATH. Needed for distributions (OpenSuSE, Solaris) in which sudo does not include /sbin in PATH. * tests/cp/cp-a-selinux: Use require_mkfs_PATH_. * tests/cp/cp-mv-enotsup-xattr: Likewise. * tests/cp/sparse-fiemap: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/rm/read-only: Likewise.
2011-08-08tests: complete the renaming framework_failure -> framework_failure_Stefano Lattarini
These changes were mostly mechanical, made by running the following command: git grep -lw framework_failure | grep -v ChangeLog \ | xargs perl -pi -e 's/\b(framework_failure)\b/${1}_/' and then editing init.cfg and `tests/cp/cp-a-selinux' by hand. * tests/init.cfg (framework_failure): Remove, `framework_failure_' from init.sh should be used instead in the tests. Remove now-obsolete "FIXME" comment. (is_local_dir_, require_strace_, require_membership_in_two_groups_, require_sparse_support_, skip_if_mcstransd_is_running_, mkfifo_or_skip_) Use `framework_failure_', not `framework_failure'. * Many test scripts: Likewise.
2011-06-17tests: remove skip_test_ function; use new skip_ insteadJim Meyering
* tests/init.cfg (skip_test_): Remove function. Use skip_ in place of skip_test_ everywhere else. * cfg.mk (sc_prohibit_skip_): Remove rule. * tests/**: Use skip_, not skip_test_, everywhere.
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-11-17tests: convert the multi-prog $VERBOSE/--version usesJim Meyering
E.g., -test "$VERBOSE" = yes && { env -- pwd --version; readlink --version; } +print_ver_ pwd readlink -test "$VERBOSE" = yes && { stdbuf --version; mv --version; } +print_ver_ stdbuf mv Use this command: git grep -l 'VERBOSE.*--version'|xargs perl -ni \ -e '/^test "\$VERBOSE" = yes && { .*--version/ or print,next;' \ -e 's/env -- //g;' \ -e 's/test "\$VERBOSE" = yes && { /print_ver_ /;' \ -e ' s/(\w+) --version;/$1/g; s/ *}$//; print'
2010-11-17tests: substitute the single-program $VERBOSE/--version usesJim Meyering
Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
2010-11-17tests: convert remaining uses of test-lib.sh to init.shJim Meyering
RHS='. "\${srcdir=.}/init.sh"; path_prepend_ ../src' git grep -l test-lib.sh \ | xargs perl -pi -e 's,^\. \$srcdir/test-lib\.sh$,'"$RHS",
2010-11-17tests: convert 'if test "$VERBOSE" = yes; then' to test ... &&Jim Meyering
2010-11-17tests: convert first batch of tests from test-lib.sh to init.shJim Meyering
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
2010-09-07tests: exclude some tests when running on NFSPádraig Brady
All tests currently pass on NFS on Linux kernel 2.6.22 at least, but some fail on 2.6.9, so we exclude those here. * tests/init.cfg (is_local_dir_): A new function returning if the specified directory is on a local file system. (require_local_dir_): A new function to skip tests if the current directory is not on a local file system. * tests/cp/existing-perm-race: Skip if non local. * tests/cp/file-perm-race: Likewise. * tests/cp/parent-perm: Likewise. * tests/cp/parent-perm-race: Likewise. * tests/cp/preserve-2: Likewise. * tests/mv/part-symlink: Likewise. * tests/du/basic: Use refactored function. * tests/install/basic-1: Likewise. * tests/mkdir/p-3: Likewise. * tests/dd/skip-seek-past-dev: Likewise. * tests/du/slink: Likewise. Remove redundant test for NFS file system. * tests/misc/join: s/local/locale/.
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-10-30tests: factor 350 fail=0 initializations into test-lib.shJim Meyering
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
2009-10-29tests: don't let a fail=1 env. setting induce unwarranted test failureJim Meyering
* cfg.mk (sc_fail_is_initialized): New rule. Fix the offenders: * tests/cp/acl: Set fail=0 * tests/cp/backup-is-src: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/reflink-auto: Likewise. * tests/cp/same-file: Likewise. * tests/ln/backup-1: Likewise. * tests/misc/su-fail: Likewise. * tests/misc/truncate-owned-by-other: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/selinux: Likewise. * tests/mkdir/special-1: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise.
2009-08-26tests: mkdir/selinux: avoid spurious failure on some SELinux systemsJim Meyering
* tests/test-lib.sh (require_selinux_enforcing_): New function. * tests/mkdir/selinux: Use it. Otherwise, this test would fail on Rawhide with SELinux disabled.
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2009-03-27tests: migrate setgid-check into test-lib.shJim Meyering
* tests/test-lib.sh (skip_if_setgid_): New function. * tests/setgid-check: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove setgid-check. * tests/chmod/c-option: Use the new function rather than sourcing the separate file. * tests/cp/cp-parents: Likewise. * tests/install/install-C: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise.
2009-03-20tests: avoid spurious mkdir/selinux test failure on HP-UX 11.23Jim Meyering
* tests/mkdir/selinux: Accept yet another diagnostic. Reported by Matthew Woehlke.
2009-03-02tests: reflect the s/+/./ SELinux indicator changeJim Meyering
* tests/mkdir/perm: Now that this test is no longer always skipped, make it work independently of ls: use stat, not ls, to get perm string. * test-lib.sh (rwx_to_mode_): Use stat, not ls to get perm string This test was run only when RUN_VERY_EXPENSIVE_TESTS=yes was set.
2008-09-10tests: use "Exit $fail", not (exit $fail); exit $failJim Meyering
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63 * tests/**: Convert all uses: This restrictive change converted the vast majority: git grep -l '^(exit \$fail); exit \$fail$' \ | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/' And this did the rest, plus a few undesirable ones, so I manually backed out the changes to ChangeLog-* and build-aux/check.mk: git grep -l -E '\(exit [^)]+\); exit ' \ | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
2008-06-26tests: accommodate difference in an AIX 5.3 diagnosticPeter O'Gorman
* tests/mkdir/selinux: Handle different strerror (ENOTSUP) spelling.
2008-05-27in 280+ tests/* files, use $srcdir, not $top_srcdir/testsJim Meyering
2008-05-27prefer abs_srcdir over abs_top_srcdir, ...Jim Meyering
so that e.g., tests/* may refer to absolute names without hard-coding the name of the containing directory (tests/, here). * tests/check.mk (TESTS_ENVIRONMENT): Define abs_srcdir. * tests/pr/pr-tests: Use $abs_srcdir/pr not $abs_top_srcdir/tests/pr. * tests/chmod/c-option: Use $abs_srcdir, not $abs_top_srcdir/tests. * tests/cp/cp-parents: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-2: Likewise. * tests/mv/leak-fd: Likewise. * tests/mv/mv-special-1: Likewise. * tests/mv/part-fail: Likewise. * tests/mv/part-hardlink: Likewise. * tests/mv/part-rename: Likewise. * tests/mv/part-symlink: Likewise. * tests/mv/partition-perm: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/mv/to-symlink: Likewise. * tests/rm/one-file-system: Likewise. * tests/sample-test: Likewise.
2008-05-06tests: hoist the sourcing of "lang-default"Jim Meyering
* tests/check.mk (TESTS_ENVIRONMENT): Source lang-default here, ... ... rather than in each of 100+ test scripts. * tests/chgrp/basic: * tests/chgrp/no-x: * tests/chmod/c-option: * tests/chmod/no-x: * tests/chmod/setgid: * tests/chmod/thru-dangling: * tests/chmod/umask-x: * tests/chmod/usage: * tests/chown/basic: * tests/chown/deref: * tests/chown/preserve-root: * tests/cp/abuse: * tests/cp/acl: * tests/cp/backup-is-src: * tests/cp/cp-a-selinux: * tests/cp/cp-i: * tests/cp/cp-mv-backup: * tests/cp/deref-slink: * tests/cp/fail-perm: * tests/cp/into-self: * tests/cp/link-preserve: * tests/cp/preserve-gid: * tests/cp/same-file: * tests/cp/slink-2-slink: * tests/cp/special-f: * tests/cp/symlink-slash: * tests/cp/thru-dangling: * tests/du/basic: * tests/du/hard-link: * tests/du/inacc-dest: * tests/du/long-sloop: * tests/du/no-x: * tests/install/basic-1: * tests/ln/hard-backup: * tests/ln/sf-1: * tests/ls/file-type: * tests/ls/infloop: * tests/ls/nameless-uid: * tests/ls/rt-1: * tests/ls/stat-failed: * tests/ls/symlink-slash: * tests/ls/x-option: * tests/misc/chcon: * tests/misc/chcon-fail: * tests/misc/csplit: * tests/misc/df-P: * tests/misc/groups-dash: * tests/misc/groups-version: * tests/misc/nohup: * tests/misc/printf-surprise: * tests/misc/runcon-no-reorder: * tests/misc/selinux: * tests/misc/split-a: * tests/misc/split-fail: * tests/misc/tac-continue: * tests/misc/wc-files0: * tests/mkdir/p-v: * tests/mkdir/selinux: * tests/mv/acl: * tests/mv/backup-dir: * tests/mv/backup-is-src: * tests/mv/childproof: * tests/mv/diag: * tests/mv/dir2dir: * tests/mv/dup-source: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/hard-verbose: * tests/mv/i-2: * tests/mv/i-3: * tests/mv/i-4: * tests/mv/i-5: * tests/mv/i-link-no: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/mv-special-1: * tests/mv/part-fail: * tests/mv/part-symlink: * tests/mv/partition-perm: * tests/mv/perm-1: * tests/mv/reply-no: * tests/mv/sticky-to-xpart: * tests/mv/update: * tests/rm/cycle: * tests/rm/dir-no-w: * tests/rm/dir-nonrecur: * tests/rm/fail-2eperm: * tests/rm/fail-eacces: * tests/rm/inaccessible: * tests/rm/interactive-always: * tests/rm/interactive-once: * tests/rm/isatty: * tests/rm/one-file-system: * tests/rm/r-1: * tests/rm/r-2: * tests/rm/rm1: * tests/rm/rm2: * tests/rm/rm3: * tests/rm/rm4: * tests/rm/rm5: * tests/rm/unread2: * tests/rm/v-slash: * tests/touch/fail-diag: * tests/touch/not-owner:
2008-04-27tests: don't source envvar-check manually, test-lib.sh does itJim Meyering
* tests/cp/abuse: Remove ". $top_srcdir/tests/envvar-check". * tests/cp/parent-perm: Likewise. * tests/cp/special-f: Likewise. * tests/ls/proc-selinux-segfault: Likewise. * tests/misc/help-version: Likewise. * tests/mkdir/selinux: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise. * tests/sample-test: Remove commented out suggestion.
2008-04-21tests: convert umask-check to a functionJim Meyering
* tests/test-lib.sh (working_umask_or_skip_): New function, from... * tests/umask-check: ...here. Remove file. * tests/Makefile.am (EXTRA_DIST): Remove umask-check. * tests/mkdir/perm: Use the function rather than sourcing the file. * tests/cp/cp-parents: Likewise. * tests/cp/parent-perm: Likewise. Bruno Haible reported that parent-perm was failing to run umask-check.
2008-04-21Revamp test-related Makefiles.Jim Meyering
One side-effect of this change is that "make check" now works even if you put "." early in your shell's search PATH (don't do that!). Remove all test-related Makefile.am files, except those generated by mk-script. Instead, tests/Makefile.am now lists not only the tests directly under tests/, but also those in tests/*/ that are not generated by mk-script, e.g., cp/abuse, cp/acl, mv/i-1, etc. A lot of these changes are like this: -. $srcdir/../lang-default +. $top_srcdir/tests/lang-default -. $srcdir/../test-lib.sh +. $top_srcdir/tests/test-lib.sh * configure.ac (AC_CONFIG_FILES): Remove corresponding Makefiles. * tests/check.mk (vc_exe_in_TESTS): Relax syntax requirements. * tests/rwx-to-mode: Remove file. Rewritten as... * tests/test-lib.sh (rwx_to_mode_): ...this new function. * tests/Makefile.am (EXTRA_DIST): Remove rwx-to-mode. (SUBDIRS): Remove each dir with a removed Makefile.am. (EXTRA_DIST): Add $(TESTS). (TESTS): Add over 300 entries.