summaryrefslogtreecommitdiff
path: root/tests/misc
AgeCommit message (Collapse)Author
2007-08-29Ensure that TMPDIR is valid. Otherwise, it would cause test failures.Jim Meyering
* tests/misc/tty-eof: Set TMPDIR=. * tests/misc/sort-compress: Likewise.
2007-08-26tests/misc/fold: Fix a typo: missing \ in a never-seen diagnosticJim Meyering
2007-08-25Remove all .cvsignore files from version control.Jim Meyering
2007-08-18Run each Coreutils.pm-based test in its own subdirectory.Jim Meyering
* tests/CuTmpdir.pm: New file. * tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm. * tests/misc/od, tests/misc/base64, tests/misc/basename: * tests/misc/cut, tests/misc/date, tests/misc/dirname: * tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail: * tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum: * tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum: * tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag: * tests/misc/wc-files0-from, tests/misc/xstrtol: * tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from: * tests/expr/basic, tests/factor/basic, tests/fmt/basic: * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1: * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec: * tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1: * tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it. * tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test", not "../../src/test", so it works when run from a subdirectory. * tests/ls-2/tests: Create temp files and dirs from within the perl script, so that they're removed, when run from a subdirectory.
2007-08-16Consolidate od tests.Jim Meyering
* tests/misc/od: Perform od-zero-len's test here. Include boilerplate code, so tests run in a subdirectory. * tests/misc/od-zero-len: Remove this file.
2007-08-15od --skip (-j) works even on files in /proc, when the kernel liesJim Meyering
* src/od.c (skip): Don't let kernel misinformation (nonempty files in /proc with stat.st_size == 0) make "od -j N" misbehave. Patch by Paul Eggert. * NEWS: Document this work-around. * tests/misc/od-zero-len: New file, test for the above.
2007-08-14Add tests for the just-fixed "od -j N FILE" bug.Jim Meyering
* tests/misc/od: New file, test for the above. * tests/misc/Makefile.am (TESTS): Add od.
2007-08-04Exercise xstrtol's diagnostics via pr's --pages option.Jim Meyering
* tests/misc/xstrtol: New file. * tests/misc/Makefile.am (TESTS): Add xstrtol.
2007-07-26sort: Improve sort --random-sort test.Bob Proulx
Jim Meyering wrote: > so if your test were to run sort -R twice, and compare *those* outputs, > then it would trigger on this bug. Thanks. I don't have a system with the failure so I was working blind. Here is a rework of the patch. Bob >From 76dafb0dde4f8d685eb2b4b43fbf3c1cf9f0ff4b Mon Sep 17 00:00:00 2001 From: Bob Proulx <bob@proulx.com> Date: Thu, 26 Jul 2007 02:19:49 -0600 Subject: [PATCH] sort: Improve sort --random-sort test. * tests/misc/sort-rand: If "locale" is available pick a random non-C locale and check "sort --random-sort" behavior using it. Signed-off-by: Bob Proulx <bob@proulx.com>
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-11If there's a GPL vN copyright comment, require that N == 3.Jim Meyering
* Makefile.maint (sc_GPL_version): New rule. * tests/misc/arch: Fix the sole violation.
2007-07-10Skip "arch" test if it's not built.Jim Meyering
* tests/misc/Makefile.am (built_programs): Define. (TESTS_ENVIRONMENT): Add $(built_programs), for... * tests/misc/arch: ...this: skip the test if arch is not built. * src/Makefile.am (built_programs.list): New rule. * tests/Makefile.am (built_programs): Rename from all_programs. (TESTS_ENVIRONMENT): Use built_programs, not all_programs. * tests/help-version: Likewise. * NEWS: Mention that using --enable-no-install-program=X may cause "make check" to fail. Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10New program: archKarel Zak
* NEWS: Mention arch. * README: Add arch to the list of programs. * AUTHORS: Add arch. * src/uname.c: Include "uname.h". (PROGRAM_NAME): Handle arch, too. (ARCH_AUTHORS): Define. (uname_long_options, arch_long_options): Renamed and new globals. (usage): Handle arch-mode as well as uname-mode. (decode_switches): New function, extracted from main, to handle arch-mode as well as uname-mode. (main): Handle both modes. * src/uname-arch.c: New program, alias for "uname -m". * src/uname-uname.c: New file, default uname mode. * src/uname.h: New file, uname modes. * src/Makefile.am (EXTRA_PROGRAMS): Add arch. (uname_SOURCES, arch_SOURCES): Define. * man/arch.x: New file. * man/Makefile.am (dist_man_MANS): Add arch.1. (arch.1): New dependency. * tests/misc/arch: New test, compare "arch" with "uname -m" * configure.ac (OPTIONAL_BIN_PROGS): Add arch. (MAN): Add arch.1. * .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c from the always-include-<config.h> rule. Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Jim Meyering <jim@meyering.net>
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-05-22cut: diagnose a range starting with 0 (-f 0-2) as invalid, andJim Meyering
give a better diagnostic for a field-number/offset of 0. * NEWS: Mention the fix. * src/cut.c (ADD_RANGE_PAIR): Add an explicit check for 0. Based on a patch from James Youngman. * tests/misc/cut: Add tests for the above.
2007-04-12split --line-bytes=N (-C N): don't create an empty file.Paul Eggert
* src/split.c (line_bytes_split): Don't create an empty line afterwards if the last buffer happens to be exactly full. * tests/misc/split-fail: Add a test case for this. * NEWS: mention this.
2007-03-29* src/runcon.c (main): Don't reorder arguments. Reported byJim Meyering
Ulrich Drepper in <http://bugzilla.redhat.com/232652>. * tests/misc/runcon-no-reorder: New file. Test for the above. * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
2007-03-29* tests/cp/cp-a-selinux: New file. Test for the bug reported inJim Meyering
* tests/cp/Makefile.am (TESTS): Add cp-a-selinux. * tests/selinux: New file. * tests/Makefile.am (EXTRA_DIST): Add selinux. * tests/misc/selinux: Source the new script, rather than open coding it. Change how "cp -a" and "cp --preserve=context" work with SELinux. Now, cp -a attempts to preserve context, but failure to do so does not change cp's exit status. However "cp --preserve=context" is similar, but failure *does* cause cp to exit with nonzero status. * src/copy.h (struct cp_options) [require_preserve_context]: New member. * src/copy.c (copy_reg, copy_internal): Implement the above. * src/mv.c (cp_option_init): Initialize the new member. * src/install.c (cp_option_init): Likewise. * src/cp.c (cp_option_init): Likewise. (decode_preserve_arg): Set it or reset it. FIXME: add an on-writable-NFS-only test
2007-03-29* tests/misc/selinux [VERBOSE]: Print version info for eachJim Meyering
of the tested tools, not just ls.
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-18Fix a bug in how pr -m -s works.Jim Meyering
* NEWS: Describe how the fix affects pr. * src/pr.c (init_parameters): The --merge (-m) option does not imply --expand-tabs (-e), so don't set "untabify_input". Reported by Wis Macomson. * tests/misc/pr: New file. Test for the above fix. * tests/misc/Makefile.am (TESTS): Add pr. * THANKS: Update.
2007-03-17* tests/misc/tty-eof: Add shuf to the list of tested commands.Jim Meyering
2007-03-03pwd-unreadable-parent: Skip test on ia64/Linux, too.Jim Meyering
* tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD. Reported by Bob Proulx.
2007-03-02pwd-unreadable-parent: Skip test on non-Linux/GNU systems.Jim Meyering
* tests/misc/pwd-unreadable-parent: Rather than trying to decide whether this test has a chance of succeeding, run it only when $(host_os) is linux-gnu. It was failing on powerpc-apple-darwin8.8.0 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
2007-03-02* tests/misc/pwd-long: Also allow "+" in $PWD.Jim Meyering
2007-02-28* tests/misc/df-P: This script *is* executable.Jim Meyering
2007-02-27Add a test for today's df -P fix.Jim Meyering
* tests/misc/df-P: New file. * tests/misc/Makefile.am (TESTS): Add df-P.
2007-02-24Don't skip this test on new-enough Linux/GNU systems.Jim Meyering
* tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0, rather than for __GETCWD_PREFIX in config.h (the latter is no longer defined, ever, due to gnulib changes). * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
2007-02-24* NEWS: sort no longer compresses temporaries by default.Paul Eggert
* bootstrap.conf: Remove findprog. * doc/coreutils.texi (sort invocation): The default is to not compress. Don't treat "" specially. * src/sort.c: Don't include findprog.h. (create_temp): Compress only if the user specified --compress-program. * tests/misc/sort-compress: Adjusts tests to match new behavior.
2007-02-23With -Dlint, make shuf free all heap-allocated storage.Jim Meyering
* src/shuf.c (main): Move declaration of input_lines to function scope, and initialize to NULL, so we can free it. [lint]: Free all malloc'd memory. * tests/misc/shuf: Also test shuf's -e and -i options.
2007-02-21* tests/misc/date: Remove vestigial use of Data::Dumper.Jim Meyering
2007-02-19* NEWS: sort now uses a --compress-program option rather thanPaul Eggert
an environment variable. * doc/coreutils.texi (sort invocation): Document this. * src/sort.c (usage): Likewise. (COMPRESS_PROGRAM_OPTION): New const. (long_options, create_temp, main): Support new option. * tests/misc/sort-compress: Test it.
2007-02-13Also check for and print stderr output, in case a program fails.Jim Meyering
* tests/misc/tty-eof: Occasionally (not reproducible), this test would fail, with one or more programs exiting nonzero, e.g., tty-eof: sha224sum exited with status 1 (expected 0) Now, maybe we'll get a clue, the next time that happens.
2007-02-12* tests/misc/pwd-unreadable-parent: Skip the test if we'reJim Meyering
definitely using the replacement. * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
2007-02-03Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlinkJim Meyering
* NEWS: Mention the bug fix. * tests/misc/pwd-unreadable-parent: New file. * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
2007-01-24Fix a typo.Jim Meyering
* tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir. * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
2007-01-24Don't depend on "which".Jim Meyering
* tests/misc/sort-compress (SORT): Use $abs_builddir, now which. * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
2007-01-24Test sort compression.Dan Hipschman
* tests/misc/Makefile.am: Add the test. * tests/misc/sort-compress: New file containing the tests.
2007-01-20* tests/misc/pwd-long: Work properly even when run from theJim Meyering
wrong one of two or more bind-mounted sibling directories. Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
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"'
2007-01-11* tests/misc/test-diag: Work also when libc's error functionJim Meyering
reports the entire program name ("../../src/test"), rather than just the final component.
2007-01-04[ChangeLog]Jim Meyering
When decoding, always allow newlines in input, with almost no performance impact. * src/base64.c (do_decode): Initialize decode context. Call base64_decode one more time, after all input is processed. (usage): When decoding, newlines are always accepted. * tests/misc/base64: Add a bunch of tests, for the above. * gl/lib/base64.c: Include <string.h>. (base64_decode_ctx_init, get_4, decode_4): New functions. (base64_decode): Efficiently handle interspersed newlines. (base64_decode_alloc): Update signature. * gl/lib/base64.h (struct base64_decode_context): Define. (base64_decode_ctx_init): Add prototype. (base64_decode, base64_decode_alloc): Update prototypes. [doc/ChangeLog] * coreutils.texi (base64 invocation): When decoding, newlines are always accepted.
2007-01-03Avoid spurious test failures on MacOS X 10.3.9, in a German locale.Bruno Haible
* tests/chown/deref: Apply lang-default. * tests/misc/split-a: Likewise. * tests/mv/reply-no: Likewise. Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-30* tests/misc/base64: Factor a long, repetitive string.Jim Meyering
2006-12-20"cut -f 2- A B" no longer triggers a double-free bugJim Meyering
* src/cut.c (cut_fields): Set file-scoped global to NULL after freeing it. This avoids a double-free (and core dump on some systems) for this usage: "echo 1>a; echo 2>b; cut -f2- a b". Reported by James Hunt in <http://bugzilla.redhat.com/220312>. * NEWS: List this bug fix. * THANKS: Mention him. * tests/misc/cut: New file. * tests/misc/Makefile.am (TESTS): Add cut.
2006-12-06Make the output of "make check" more reproducible.Jim Meyering
* tests/misc/date-sec: Don't emit any diagnostic about sleeping.
2006-12-03* tests/misc/date-sec: Output a fixed string.Jim Meyering
2006-10-26Avoid a shell bug in Tru64 4.0 sh's handling of double-quoted strings.Jim Meyering
[patch by Paul Eggert] * tests/chmod/c-option: When double-quoting part of a word, prefer to double-quote the whole word. This is a bit easier to read (at least for me), and in some cases it avoids a shell bug with Tru64 4.0 sh reported by Nelson H. F. Beebe. For example, instead of "$abs_srcdir"/../setgid-check we now write "$abs_srcdir/../setgid-check". * tests/cp/cp-parents: Likewise. * tests/du/inaccessible-cwd: Likewise. * tests/du/long-from-unreadable: Likewise. * tests/install/basic-1: Likewise. * tests/install/trap: Likewise. * tests/misc/close-stdout: Likewise. * tests/mkdir/concurrent-1: Likewise. * tests/mkdir/p-1: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/parents: Likewise. * tests/mkdir/perm: Likewise. * tests/readlink/can-e: Likewise. * tests/readlink/can-f: Likewise. * tests/readlink/can-m: Likewise. * tests/rm/inaccessible: Likewise. * tests/rm/unread3: Likewise. * tests/touch/no-create-missing: Likewise. * lib/.cvsignore: Add uinttostr.c.
2006-10-23* tests/misc/pwd-long: Whoops. Don't exec the perl script. Otherwise, the ↵Jim Meyering
sh-trap-based clean-up code isn't run.
2006-10-23* tests/misc/pwd-long: Undo last change, since it made Perl invokeJim Meyering
pwd via a shell. Instead, ensure that the absolute name of the pwd binary consists solely of reasonable characters.