summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* genfile: implement the --set-time optionHEADmasterSergey Poznyakoff2023-05-171-3/+42
| | | | | * doc/genfile.texi: Document changes. * tests/genfile.c: New options: --set-time and --no-dereference.
* Update copyright yearPaul Eggert2023-01-063-4/+4
| | | | | | | UPDATE_COPYRIGHT_USE_INTERVALS=1 \ UPDATE_COPYRIGHT_MAX_LINE_LENGTH=79 \ gnulib/build-aux/update-copyright \ $(git ls-files | sed -e '/^gnulib$/d; /^COPYING$/d')
* Package PRINT_INT inside do-whilePaul Eggert2022-09-101-8/+12
| | | | | * tests/genfile.c (PRINT_INT): Put statement body inside do-while to avoid if-else issues.
* Modernize integer handlingPaul Eggert2022-09-102-41/+54
| | | | | | | | | | | | | | | | | | | | | | | | It’s now safe to assume C99 sprintf %jd, etc. * am/system.m4 (PU_SYSTEM): Do not require gl_INTTOSTR. * gnulib.modules, paxlib.modules: Remove inttostr. Add strtoimax, strtoumax. * lib/system.h (UINTMAX_STRSIZE_BOUND): Remove. * paxlib/error.c (chown_error_details, read_error_details) (read_warn_details, read_fatal_details, seek_error_details) (seek_warn_details, write_error_details): * paxlib/rtape.c (rmt_read, rmt_write, rmt_lseek, rmt_ioctl): * rmt/rmt.c (rmt_reply): * tests/genfile.c (verify_file, print_stat): Use C99 printf formats instead of doing it by hand. * paxlib/paxlib.h, rmt/rmt.c, tests/genfile.c: Do not include inttostr.h. * paxlib/paxlib.h (STRINGIFY_BIGINT): Remove. * tests/argcv.c (xtonum): Use strtol for signed int, not strtoul. * tests/genfile.c (checkpoint, verify_file, parse_opt) (exec_checkpoint, process_checkpoint, exec_command): Prefer uintmax_t to size_t for counters unrelated to object size. (PRINT_INT): New macro. (print_stat): Prefer uintmax_t to unsigned for modes.
* Fix sys_reset_uid_gid; minor changes in genfile.cSergey Poznyakoff2021-02-131-11/+13
| | | | | | | | | * lib/system.h (ERRNO_IS_EACCES): Remove. Not used anymore. (sys_reset_uid_gid): Re-initialize supplementary groups when switching privileges. Fix ordering of setgid and setuid calls. * tests/genfile.c (EXIT_USAGE) (EXIT_UNAVAILABLE): New exit codes. Use them as appropriate.
* Improve genfile exec modeSergey Poznyakoff2018-12-281-41/+34
| | | | | | | | | | | | | | | | | | | | | This commit introduces interprocess communication between genfile and subsidiary command in exec mode. Instead of using sleep as part of the checkpoint action chain (as GNU tar did so far), genfile now inserts --checkpoint-action=wait=SIGUSR1 into the command line and sends the process the SIGUSR1 after having finished with the checkpoint. This eliminates the race condition and speeds up the tests based on exec mode. The "wait" action is introduced in GNU tar 1.30.90. * doc/genfile.texi: Document changes. * tests/genfile.c (checkpoint_granularity): New variable. (parse_opt): Optional argument to --run specifies granularity. (CHECKPOINT_TEXT): Customize for genfile. (exec_command): Take command as arguments. Insert the --checkpoint and --checkpoint-action options after the command name. Use checkpoint action wait=SIGUSR1 for synchronization. Send SIGUSR1 after processing checkpoint.
* Improve genfileSergey Poznyakoff2017-05-291-12/+29
| | | | | | | * tests/genfile.c: Rename --unlink option to --delete, retaining old name as alias. Call unlink or rmdir depending on the type of the argument. * doc/genfile.texi: Document changes.
* genfile: new option --quietSergey Poznyakoff2016-03-181-4/+12
| | | | | | * tests/genfile.c: New option --quite: suppress error exit if the created file is not sparse. * doc/genfile.texi: Document --quiet.
* genfile: remove unused variablePavel Raiskup2015-12-051-1/+0
| | | | * tests/genfile.c (generate_sparse_file): Remove unused 'i'.
* genfile: improve sparse modeSergey Poznyakoff2014-11-071-9/+70
| | | | | | | | * tests/genfile.c (generate_sparse_file): Handle '-' argument (read from stdin); If content strings starts with '=', treat it as fragment size and use default pattern to fill it. * doc/genfile.texi: Document changes to genfile.
* maint: remove lint uncovered by tar's new use of manywarningsPaul Eggert2012-12-181-5/+13
| | | | | | | | | | | | | | * lib/rmt.h, lib/rtapelib.c (rmt_command, rmt_dev_name__): Now pointer to const. * lib/rtapelib.c (rmt_open__): Check return codes from dup2, close. Don't mishandle the case when 'pipe' allocates file descriptor 0. * lib/system.h (sys_reset_uid_gid): Check return codes from setuid, setgid. * tests/genfile.c (mkhole, exec_checkpoint): Check return code from ftruncate. (mkhole): Don't call fseek twice. (exec_checkpoint): Check return code from system. (exec_command): Check return code from pipe.
* Adjust to recent gnulib changes with parse-datetime and getopt-gnu.Paul Eggert2010-10-111-3/+3
| | | | | | | | | * doc/.gitignore: Replace getdate.texi with parse-datetime.texi. * gnulib.modules: Replace getdate with parse-datetime, and getopt with getopt-gnu. * paxlib.modules: Replace getopt with getopt-gnu. * tests/genfile.c: Include parse-datetime.h, not getdate.h. All instances of get_date replaced with parse_datetime.
* paxutils: use POSIX interface for file time-settingPaul Eggert2010-09-141-2/+1
| | | | | | | | | | | This is a minor cleanup to use the POSIX.1-2008 interface for setting file time stamps to nanosecond resolution, rather than the pre-2008 gnulib interface. On older hosts, it falls back on gnulib's implementation of the POSIX interface. * configure.ac: Don't check for utimes; it's not used. * gnulib.modules: Add utimensat. * tests/genfile.c: Don't include utimens.h. (exec_checkpoint): Use POSIX utimensat function, not utimens.
* paxutils: remove lint discovered by Sun C compilerPaul Eggert2010-09-041-4/+4
| | | | | | | | * paxlib/paxlib.h (pax_exit): Remove stray semicolon that I introduced in the previous patch; sorry about that. * tests/genfile.c (print_stat): Don't assume that mode_t promotes to unsigned int when calling a varargs function; that assumption is not portable.
* Add a missing include.Sergey Poznyakoff2010-03-021-1/+4
| | | | * tests/argcv.c [HAVE_CONFIG_H]: Include config.h
* Improve genfile --runSergey Poznyakoff2009-08-081-9/+37
| | | | | | * tests/genfile.c: Change the use of --run option. Implement --unlink action. * doc/genfile.texi: Document changes in genfile
* Avoid undefined ctype usage.Eric Blake2009-06-182-9/+10
| | | | | | * tests/argcv.c (escaped_length, escape_copy, argcv_string): Pass correct type to ctype macros. * tests/genfile.c (print_stat, exec_command): Likewise.
* (verify_file): Improve error diagnostics.Sergey Poznyakoff2008-05-201-5/+3
|
* Remove setenv.hSergey Poznyakoff2008-02-181-4/+3
|
* Relicense under GPLv3Sergey Poznyakoff2007-06-273-5/+5
|
* Print errno status on errors.Sergey Poznyakoff2007-06-211-3/+3
|
* Resolve testsuite failures on cygwin.Sergey Poznyakoff2007-06-211-11/+13
|
* Implement new option --seek (similar to `dd seek=')Sergey Poznyakoff2006-12-071-4/+19
|
* (exec_command): Add extra spaces.Sergey Poznyakoff2006-09-271-2/+2
|
* (reg_action): Return void, not int.Paul Eggert2006-08-071-20/+17
| | | | | (generate_simple_file, exec_command): Remove unused var. (print_stat): Avoid GCC warning about uninitialized var.
* (get_size): Rewrite to avoid numeric overflow.Sergey Poznyakoff2006-07-031-8/+24
|
* Use ST_IS_SPARSE instead of IS_SPARSE_FILESergey Poznyakoff2006-06-251-4/+2
|
* New options --files-from and --null (same as in tar).Sergey Poznyakoff2006-06-021-11/+75
|
* Behave as described in the docs in sparse file creation mode. Verify created ↵Sergey Poznyakoff2006-04-251-6/+41
| | | | file, unless it goes to stdout.
* (print_stat): mode keyword can be optionallySergey Poznyakoff2006-04-111-4/+28
| | | | | followed by a punctuation sign and a number, specifying the mask to be applied to the mode before printing.
* Properly initialize i18n.Sergey Poznyakoff2006-03-111-3/+6
|
* Fix creation of large filesSergey Poznyakoff2005-12-081-4/+4
|
* Include getdate.h and setenv.h; needed for C99 conformance, to declarePaul Eggert2005-11-041-0/+2
| | | | the function prototypes.
* (print_stat): Use umaxstrSergey Poznyakoff2005-06-231-3/+5
|
* Improve support for time stamps and other wide integers.Paul Eggert2005-06-221-18/+11
| | | | | | | | | | | | | | | | | | | | * gnulib.modules: Add inttostr, quote, quotearg. * lib/system.h (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove. (INT_STRLEN_BOUND): Remove. Include "intprops.h" instead. (UINTMAX_STRSIZE_BOUND): Define in terms of INT_BUFSIZE_BOUND, not INT_STRLEN_BOUND. [HAVE_UTIME_H]: Don't include utime.h. * paxlib/DISTFILES: Remove convert.c. * paxlib/convert.c: Remove. * paxlib/error.c: Include quote.h, quotearg.h. * paxlib/paxlib.h: Include inttostr.h. (STRINGIFY_BIGINT): Define in terms of umaxtostr. (stringify_uintmax_t_backwards): Remove decl. * tests/genfile.c: Include <utimens.h> instead of rolling our own. (exec_checkpoint): Use utimens instead of rolling our own. Don't pass extra args to error. (main): Wrap message inside _().
* * tests/genfile.c: Port to Solaris 8.Paul Eggert2005-06-211-50/+50
| | | | | | | | | | Include <signal.h>, for 'signal'. (SIGCHLD) [! defined SIGCHLD && defined SIGCLD]: Define. (child_exited, sig_child): Remove; not needed. (exec_command): Use a prototype. (main): Set SIGCHLD handler to default, not to sig_child. And do this only if SIGCHLD is defined. This uses the same pattern that src/tar.c uses.
* Update FSF postal mail address.Paul Eggert2005-05-153-3/+3
|
* Minor fixSergey Poznyakoff2005-05-131-1/+1
|
* Add new filesSergey Poznyakoff2005-05-123-0/+448
|
* Major rewrite. Add new operation mode: --run.Sergey Poznyakoff2005-05-121-100/+415
|
* Allow --length=0Sergey Poznyakoff2005-03-211-3/+0
|
* Improved help outputSergey Poznyakoff2005-02-031-6/+27
|
* New mode `--stat' prints selected fields from struct stat for existing files.Sergey Poznyakoff2005-02-021-8/+109
|
* (parse_opt): Allow --length=0Sergey Poznyakoff2004-09-081-1/+1
|
* New fileSergey Poznyakoff2004-09-072-0/+302