Commit Graph

70 Commits

Author SHA1 Message Date
Masatake YAMATO d652d4c666 lsns: add columns for parent namespaces and owner namespaces
See ioctl_ns(2) about parent and owner namespaces.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2021-04-13 06:22:51 +09:00
Evgeny Vereshchagin b62ec52e8f tests: add a fuzz target calling fdisk_script_read_file
It has already found a couple of issues mentioned in
https://github.com/karelzak/util-linux/issues/1023#issuecomment-671910621
2020-08-10 23:30:50 +00:00
Evgeny Vereshchagin 877356164a tests: integrate test_last_fuzz into the testsuite
by adding tests/ts/* and a testcase triggering https://github.com/karelzak/util-linux/pull/1097

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-08-06 12:33:11 +00:00
Evgeny Vereshchagin 7b4ab119f4 tests: integrate test_mount_fuzz into the testsuite
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-08-06 12:33:11 +00:00
Radka Skvarilova 02238bff66 tests: add new test for chfn gecos
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=1743555
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-16 13:22:29 +01:00
Karel Zak 85ecd3719b tests: add script and scriptlive replay
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-22 13:48:54 +01:00
Patrick Steinhardt eebc9e4dc2 tests: (col) avoid hardcoding of errno string
The col/multibyte test has a hardcoded error string as part of its
expected output that is returned by glibc's strerror(3P) function. Even
though many of these strings are the same across libc implementations,
they are not standardiced and some are certainly different. One example
is the string for EILSEQ on musl libc.

To fix this, we introduce a new test helper "test_strerror". The helper
can be invoked with an error code like "EILSEQ", which will cause it to
print out the the respective error message for that code. Note that
"test_strerror" cannot act on the error's value (e.g. 84 for EILSEQ), as
these aren't standardized either. Instead, we thus need to have an array
of the error's string representation ("EILSEQ") to its respective error
code (the define EILSEQ). The array can trivially be extended as
required, thus it is only sparsely populated with EILSEQ right now.

To fix the col/multibyte test, we introduce a call to sed(1) to replace
the strerror(3P) message from EILSEQ with "EILSEQ". Furthermore, as
we're running tests with the POSIX locale by default which treats all
bytes as valid multibyte sequences, we have to change to the C.UTF-8
locale instead to actually get an error.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2019-08-27 09:37:01 +02:00
Karel Zak 43b4a4d3c7 tests: add --use-system-commands
This change allows to use commands from $PATH rather than from
$top_builddir. There two basic use cases:

* check differences between installed and git version
  run.sh --use-system-command --show-diff

* check system binaries by upstream tests (for example tests from
  src.rpm package)

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-04 17:14:12 +01:00
Ruediger Meier bd0be5e02a hardlink: add first simple tests
The test still fails without pcre2 and may also make problems on
exotic file systems.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-11-15 21:26:14 +01:00
Karel Zak 22db7b5132 tests: use TS_HELPER_CAL
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-02 10:16:27 +01:00
Vaclav Dolezal cad13ba344 tests: add tests for encode functions from lib/mbsalign.c
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-01-10 17:40:53 +01:00
Masatake YAMATO 5d075a7828 lsns: add a case for testing netnsid column
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-11-27 15:54:54 +01:00
Philip Prindeville 0047626887 libuuid: add support for hash-based UUIDs
Adding V3 and V5 UUIDs per RFC-4122.

[kzak@redhat.com: - fix symbols file]

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-05 11:26:39 +02:00
Karel Zak 4a61c960ce tests: use sample-fdisk-mkpart-fullspec
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-07-11 14:26:33 +02:00
Karel Zak 9e9b1afd39 tests: use sample-fdisk-mkpart
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-07-11 13:33:52 +02:00
Sami Kerola 83893f2678 uuidparse: add new command
This command will analyze and print information about UUID's.  The command
is based on libuuid/src/uuid_time.c but modified to use libsmartcol.

[kzak@redhat.com: - minor coding style changes]

Reference: http://marc.info/?l=util-linux-ng&m=149735980715600&w=2
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-26 14:46:35 +02:00
Sami Kerola 70ca1a7772
tailf: remove deprecated utility
March 2017 is gone, it is time to remove this utility as scheduled in
earlier commit, and promised in manual page.

Reference: 3f8478a71c
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-04-02 16:51:00 +01:00
Masatake YAMATO c1cc045d12 tests: add cases for testing fincore command
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2017-03-23 12:46:40 +01:00
Heiko Carstens 2ae9a58e0d lsmem: add testcase
Add a single s390 specific test case to verify that the contents of
various output formats do not change in incompatible way if the
lsmem code is changed.

This is based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Karel Zak 10146e56b0 tests: add flock tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-10-31 14:30:02 +01:00
Stanislav Brabec a0a8e98844 tests: Add helper for TIOCSTI exploit
This helper/exploit injects "id -u -n\n" to the vulnerable calling terminal.

Use id -u -n to get a reproducible output of test cases based on it.

What can happen:

Nothing, no exploit: pty is not accessible, sedsid() disconnected the task from
pty, TIOCSTI failed.

The command is injected to the unprivileged environment pty, and you see e. g.
"nobody": This is acceptable.

The command is injected to the caller (privileged) pty, and you see "root" (or
caller uid name): This is not acceptable and has security implications.

References:

CVE-2016-2779
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2779
http://seclists.org/oss-sec/2016/q1/448
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815922
https://bugzilla.redhat.com/show_bug.cgi?id=173008
https://bugzilla.suse.com/show_bug.cgi?id=968674
https://bugzilla.suse.com/show_bug.cgi?id=968675

CVE-2016-2781
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-2781
http://seclists.org/oss-sec/2016/q1/452

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Cc: Federico Bento <up201407890@alunos.dcc.fc.up.pt>
2016-09-29 14:24:00 +02:00
Karel Zak 36eb51ebb4 tests: add libsmartcols title test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-14 12:49:46 +02:00
Karel Zak fa4691833a libsmartcols: add application to test library features
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-09-13 13:08:02 +02:00
Karel Zak 078720a76f tests: add chrt test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-07-11 10:25:13 +02:00
Sami Kerola 244d48331e
tests: add uuidd output check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 20:17:07 +01:00
Sami Kerola 4d3f964e4a
tests: add uuid parser check
The check is based on code by Theodore Ts'o to test libuuid, from which
unstable output is commented out.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:39:21 +01:00
Sami Kerola cdf6406dde tests: add colcrt regression tests
Thanks to Alaa Mubaied for providing crash1 input file making colcrt to
crash.  The crash2 was generated using American Fuzzy Lop.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-10 22:12:03 +01:00
Sami Kerola 98f8b800dc tests: add way to control mkfs.minix time stamps
Needed in order to create reproducable file systems image files, so that
out come of mkfs.minix can be checksum'ed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-08-03 11:27:37 +02:00
Sami Kerola 8090b31e5a tests: add scriptreplay test
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-08 21:53:37 +01:00
Sami Kerola 6a40c65f81 tests: check script options work as expected
Options --flush and --timing remain unchecked, as I do not have an idea
how to check them reliably.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-06 14:36:38 +01:00
Michael Marineau 4a4a0927c6 libfdisk: (gpt) add API for raw partition attributes
The existing APIs can only toggle individual bits or get and set bits in
a complex text representation, making it impractical to use libfdisk for
manipulating the GPT partition attribute field in more complex ways such
as updating a value that is multiple bits wide. For example priority
based partition selection originally designed for ChromeOS includes two
integer values that are 4-bits wide.

http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format#TOC-Trusting-the-GPT

[kzak@redhat.com: - add new symbols to .sym file and docs
                  - remove unused variables from test program]

Signed-off-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-05-05 12:39:36 +02:00
Sami Kerola 5fac518cef tests: add test_dmesg that has fixed boot time
This allows testing time stamp formats.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-03-23 10:34:49 +01:00
Ruediger Meier 51d455ce16 tests: mount/move also tests findmnt vs. mountpoint
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-03-19 17:11:43 +01:00
Karel Zak ef5fb28001 logger: add -DTEST_LOGGER
"make test_logger" now compiles logger(1) test program
to overwrite system datetime stuff, hostname and PID, for example:

   export TZ=GMT
   export LOGGER_TEST_TIMEOFDAY=1234567890.123456
   export LOGGER_TEST_HOSTNAME=foo
   export LOGGER_TEST_GETPID=123

   ./test_logger --rfc5424 --no-act --stderr -i --tag MyTag mesg
   <13>1 2009-02-13T23:31:30.123456+00:00 foo MyTag 123 - [timeQuality tzKnown="1" isSynced="0"] mesg

if the LOGGER_TEST_* variables are not specified then default to
standard logger(1) behavior.

Note that it would be possible to use for example "unshare --utc" to
make hostname stable and portable, but LOGGER_TEST_* variables allow
to keep the tests less complex.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-16 14:01:53 +01:00
Federico Simoncelli f4822fdfc5 tests: add blkdiscard offsets test
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2014-10-27 09:16:46 +01:00
Karel Zak 5f17695729 tests: add sfdisk test
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:54:58 +02:00
Ondrej Oprala 14ad2353cc libs/debug: accept human readable names for _DEBUG=
For example
	$ LIBMOUNT_DEBUG=tab,cache findmnt

to debug only TAB and CACHE subsystem.

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-13 12:33:47 +02:00
Sami Kerola 0f85e0535b tests: add rename(1) checks
Check basic file moves, symlink relinking, and both file moves and
symlinks when operations are have directory in destination path.

Reviewed-by: Ruediger Meier <sweet_f_a@gmx.de>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-18 18:34:15 +01:00
Ruediger Meier 15b2606c4f tests: fix python tests for dist and out-of-tree builds
- add python helper scripts to the dist
- helper scripts are always in srcdir
- python libs are in builddir
- abort tests if helpers are missing

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-06-04 10:14:24 +02:00
Ruediger Meier 2c972db424 tests: remove test_fsck.cramfs (reverts 6c32ae78)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-19 23:49:22 +02:00
Ruediger Meier 0eb90ba264 tests: introduce TS_CMD_UUIDGEN (never use installed one)
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-13 17:38:45 +02:00
Sami Kerola 2556c387aa tests: check kill all user processes
CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 19:04:57 +01:00
Sami Kerola d39182c1e0 tests: check kill is converting signals names correctly
CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 19:04:56 +01:00
Sami Kerola 6b93dcbee1 tests: add signal receiver program
Target to kill with a check that will be written later.

CC: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 19:04:52 +01:00
Sami Kerola 59ac7e76c6 tests: check swaplabel, and perform more swapon boundary tests
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-12 12:06:35 +01:00
Sami Kerola da051b5aaa tests: add last(1) test
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-29 18:14:09 +01:00
Ondrej Oprala 90eb39874f pylibmount: add regression tests
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 15:11:06 +02:00
Karel Zak 8810d532a8 tests: add losetup tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-05-13 13:13:24 +02:00
Ondrej Oprala 7e658c15a2 wipefs: add --backup
[kzak@redhat.com: - don't wipe if failed to create a backup file
                  - use ts_scsi_debug_init in the regression tests]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-26 12:27:37 +02:00
Ondrej Oprala 3a8f26bdcc tests: add partx regression tests
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2013-04-26 10:03:37 +02:00