summaryrefslogtreecommitdiff
path: root/tests/mkdir
AgeCommit message (Collapse)Author
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.
2008-04-16tests: accommodate built-in mknod more cleanly stillMatthew Woehlke
* tests/mkdir/selinux: Use "env" rather than "nice".
2008-04-16tests: accommodate built-in mknod more cleanlyJim Meyering
* tests/mkdir/selinux: Undo most of previous change, bc22dbbf844f31ddaf2e68b167d0128a985d73ab, and instead invoke the command via "nice". Using "exec" should be enough, but isn't with OpenBSD's PD KSH v5.2.14 99/07/13.2. Eric Blake suggested using nice.
2008-04-16tests: add a comment explaining the potential failureJim Meyering
2008-04-16tests: avoid mkdir/selinux failure when mknod is a shell built-inJim Meyering
* tests/mkdir/selinux: Skip the mknod test if it's a built-in.
2008-04-14tests: accommodate a different errno string on Irix 6.5Jim Meyering
* tests/mkdir/selinux: Also handle "Not supported". Reported by Peter Fales.
2008-04-12tests: Accommodate a different errno value on OSF/1 4.0F.Jim Meyering
* tests/mkdir/selinux: Also handle "Function not implemented".
2008-04-08tests: accommodate a different errno value on HPUX-10.20Jim Meyering
* tests/mkdir/selinux: Also handle "Unknown system error". Reported by Peter Fales.
2008-03-29avoid failure of new test on kernel without SELinux supportJim Meyering
* tests/mkdir/selinux: Also accept ENOENT. Reported by Sven Joachim. Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-29tests: accept ENOTSUP message as well as the EINVAL oneJim Meyering
This test would fail on most non-Linux systems because the original expected an "Invalid argument" diagnostic, yet they all produced "Operation not supported". * tests/mkdir/selinux: Accept both strings. Factor out duplication.
2008-03-28mknod, mkfifo: don't segfault when diagnosing invalid SELinux contextJim Meyering
Identical to the bug fixed by 72d052896a9092b811961a8f3e6ca5d151a59be5. * src/mkfifo.c (main): Use "scontext", not NULL optarg in diagnostic. * src/mknod.c (main): Likewise. Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler. * tests/mkdir/selinux: Test for the above fixes. * NEWS: Mention the fixes.
2008-03-28Require that "(exit $fail); exit $fail" be last line of each test.Jim Meyering
* maint.mk (sc_require_test_exit_idiom): New rule to enforce policy. * tests/cp/acl: Adhere to the new policy. * tests/cp/preserve-gid: Likewise. * tests/dd/misc: * tests/install/create-leading: * tests/ln/sf-1: * tests/ls/symlink-slash: * tests/misc/help-version: * tests/misc/ls-time: * tests/misc/nice: * tests/misc/shred-remove: * tests/misc/stty: * tests/misc/stty-row-col: * tests/mkdir/p-1: * tests/mkdir/p-2: * tests/mkdir/p-3: * tests/mkdir/p-v: * tests/mkdir/special-1: * tests/mkdir/writable-under-readonly: * tests/mv/acl: * tests/mv/backup-is-src: * tests/mv/diag: * tests/mv/dir-file: * tests/mv/force: * tests/mv/hard-link-1: * tests/mv/i-2: * tests/mv/i-4: * tests/mv/into-self: * tests/mv/into-self-2: * tests/mv/into-self-3: * tests/mv/partition-perm: * tests/mv/to-symlink: * tests/rmdir/ignore: * tests/tail-2/assert: * tests/tail-2/assert-2: * tests/touch/dangling-symlink: * tests/touch/dir-1: * tests/touch/empty-file: * tests/touch/fifo: * tests/touch/no-rights: Likewise. Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-26Test for mkdir bug fix.Jim Meyering
* tests/mkdir/selinux: New file: test for today's fix. * tests/mkdir/Makefile.am (TESTS): Add selinux.
2008-02-09tests: Remove priv-check. Use new require_root_ function instead.Jim Meyering
* tests/priv-check: Remove file. * tests/Makefile.am (EXTRA_DIST): Remove priv-check. * tests/test-lib.sh (require_root_): New function. Use this function rather than sourcing the priv-check file. * tests/sample-test: Use require_root_ rather than priv-check. * tests/chown/basic: Likewise. * tests/cp/cp-a-selinux: Likewise. * tests/cp/preserve-gid: Likewise. * tests/cp/special-bits: Likewise. * tests/ls/nameless-uid: Likewise. * tests/misc/chcon: Likewise. * tests/mkdir/writable-under-readonly: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/rm/fail-2eperm: Likewise. * tests/rm/no-give-up: Likewise. * tests/rm/one-file-system: Likewise. * tests/tail-2/append-only: Likewise. * tests/touch/now-owned-by-other: Likewise. * tests/rm/fail-eperm: Use skip_if_root_ rather than priv-check. * Makefile.maint (sc_root_tests): Reflect this change: search for the new function name.
2008-02-07mkdir, split: write --verbose output to stdout, not stderr.Steven Schubiger
* src/mkdir.c (verbose_output): New function. (announce_mkdir): Use it. * src/split.c (usage): Update. * src/split.c (cwrite): Write to stdout, not stderr. * doc/coreutils.texi (split invocation): Remove the mention of --verbose output being printed to stderr. * tests/mkdir/p-v: Redirect stdout, not stderr. * tests/misc/split-a: Likewise. * NEWS: Mention this change. * TODO: Remove this item.
2007-10-14Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.Jim Meyering
* tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition. * tests/chgrp/Makefile.am: Likewise. * tests/chmod/Makefile.am: Likewise. * tests/chown/Makefile.am: Likewise. * tests/cp/Makefile.am: Likewise. * tests/dd/Makefile.am: Likewise. * tests/du/Makefile.am: Likewise. * tests/install/Makefile.am: Likewise. * tests/ln/Makefile.am: Likewise. * tests/ls/Makefile.am: Likewise. * tests/misc/Makefile.am: Likewise. * tests/mkdir/Makefile.am: Likewise. * tests/mv/Makefile.am: Likewise. * tests/readlink/Makefile.am: Likewise. * tests/rm/Makefile.am: Likewise. * tests/rmdir/Makefile.am: Likewise. * tests/tail-2/Makefile.am: Likewise. * tests/touch/Makefile.am: Likewise. * tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]: [CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]: [REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here. * tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR. * tests/dd/skip-seek: Don't use $ENV{PROG}. * tests/rm/empty-name: Likewise. * tests/rm/unreadable: Likewise. * tests/mv/i-1: Likewise.
2007-09-15Enable some previously omitted test scripts. Add a test cross-check.Jim Meyering
* tests/rm/Makefile.am (TESTS): Add empty-name and unreadable. * tests/rm/empty-name: Likewise. * tests/rm/unreadable: Reenable this test. Adjust for new rm. * tests/mkdir/Makefile.am: Add writable-under-readonly. * tests/mkdir/writable-under-readonly: Add some comments. This test is always skipped, for now. * tests/Makefile.am (ta): Hook up the new root-only script. * tests/tail-2/infloop-1: Make this test pass. * tests/tail-2/Makefile.am (TESTS): Add infloop-1. * tests/tail-2/fflush: Remove unused file. * tests/check.mk (vc_executable_is_in_TESTS): More portable. * tests/check.mk (check): Depend on the above. * build-aux/check.mk: Remove comment mentioning AUTHORS file.
2007-09-15Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.Jim Meyering
tests/check.mk (top_srcdir): Define. tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir), $(abs_top_srcdir), and $(abs_top_builddir), since they're defined via the included tests/check.mk.
2007-09-15More misc, test-related changes. (some to allow running tests as root)Jim Meyering
2007-09-15Convert tests/mkdir/ to use test-lib.sh.Jim Meyering
2007-08-25Remove all .cvsignore files from version control.Jim Meyering
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-03-29ls: Add support for SELinux and a slightly modified -Z option.Jim Meyering
I started with the patches from Red Hat. The entries below tell how the code evolved. * src/ls.c (print_long_format, print_file_name_and_frills): When there is no security context (due to getfilecon/lgetfilecon failing with e.g. ENOTSUP), print it as "?", not "". * src/ls.c (print_file_name_and_frills): Make -Z work without -l. (length_of_file_name_and_frills): Likewise. * src/ls.c: Remove the --lcontext and --scontext options. Change the way -Z, --context work so that it no longer implies -l. Thus, -Z -l will work like -lcontext and -Z without -l will work like --scontext. Adjust tests to reflect new 'ls -l' syntax -- affects only systems with SELinux when operating on a file with no ACL. These tests assumed that everything before the first space on each line is the 10-byte mode string. But there may also be a "+" in the 11th column, just before the space. However, note that this is not new. The same thing would have happened even without the change below, when listing a file with an ACL. * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm: * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod: * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm: Don't make compilation depend on USE_ACL. An SELinux security context counts as an "alternate access control method", so ls must output a "+" for each file with a security context. * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally. (FILE_HAS_ACL): Remove macro definition. Use f->have_acl directly. (gobble_file): Record whether a file has a security context, and update the condition used to determine whether to print the "+". (gobble_file): Call getfilecon/lgetfilecon also when format == long_format, so that we get the "+". * src/ls.c (gobble_file): Add a comment explaining why (with a security context option) ls doesn't exit nonzero due to e.g., getfilecon failing with errno == ENOTSUP. * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due to ENOTSUP. * src/ls.c (gobble_file): Factor out three small blocks using getfilecon and lgetfilecon. Don't ignore return value from getfilecon and lgetfilecon. * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C ternary operator). (print_scontext_format): Likewise. (print_scontext): Declare to be "bool", not int. Adjust uses. * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX). * tests/misc/chcon: New file. * tests/misc/chcon-fail: New file. * tests/Makefile.am (check-root): Run new, root-only misc/chcon test. * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail. * tests/misc/Makefile.am (TESTS): Add selinux. * tests/misc/selinux: New file. * tests/help-version: Skip chcon.
2007-03-20Skip part of this test when "." is not a local file system.Jim Meyering
* tests/mkdir/p-3: Likewise.
2007-03-18Fix a generic NFS-related test failure.Jim Meyering
* tests/mkdir/p-3: When setting up an unreadable "." in an inaccessible parent, make the parent inaccessible *after* making "." unreadable. Otherwise, running "chmod a-r ." in an already- inaccessible parent would fail on NFS with "Stale NFS file handle". Signed-off-by: Jim Meyering <jim@meyering.net>
2007-02-24Remove the "gnits" option; it prohibits my using "+" as a versionJim Meyering
string suffix, and all it does (beyond the default "gnu" option) is to _require_ the THANKS file. * configure.ac (AM_INIT_AUTOMAKE): Remove it. Remove all AUTOMAKE_OPTIONS settings in Makefile.am files. * tests/chgrp/Makefile.am, tests/chmod/Makefile.am: * tests/chown/Makefile.am, tests/cp/Makefile.am: * tests/du/Makefile.am, tests/expr/Makefile.am: * tests/factor/Makefile.am, tests/general/Makefile.am: * tests/install/Makefile.am, tests/ln/Makefile.am: * tests/ls/Makefile.am, tests/mkdir/Makefile.am: * tests/mv/Makefile.am, tests/readlink/Makefile.am: * tests/rm/Makefile.am, tests/rmdir/Makefile.am: * tests/seq/Makefile.am, tests/stty/Makefile.am: * tests/tee/Makefile.am, tests/touch/Makefile.am:
2007-01-13Put CU_TEST_NAME in the environment for each test run by "make check".Jim Meyering
* Transform all Makefile.am files so that when running "make check", CU_TEST_NAME is set to the name of the test. This is so that when I run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check" on the entire package it is more convenient to map a leak or error found in a valgrind log file back to the offending test. Use this command: (echo tests/Makefile.am.in; find tests -name Makefile.am) \ |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \ -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'