Commit Graph

835 Commits

Author SHA1 Message Date
Vojtěch Eichler 635fd4af54 tests: use subtests 2021-09-13 10:59:59 +02:00
Vojtěch Eichler 99120a8bde tests: make use of subtests 2021-09-08 12:36:19 +02:00
Karel Zak e46f9fce30 tests: use sub-tests for dm-verity
* write error to the test log file rather than on stdout
* use sub-tests to get more info on output
* don't use ts_die in sub-tests to make sure we call final dmsetup remove

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-31 11:57:30 +02:00
Vojtěch Eichler 8edd055f41 tests: add tests for dm-verity support in mount 2021-08-31 11:24:59 +02:00
Karel Zak e5041e76f8 tests: add rv64 lscpu test
References: https://github.com/karelzak/util-linux/issues/1401
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-30 15:32:24 +02:00
Anatoly Pugachev 627216cf43 tests: fix fdisk/bsd on big endian systems (tested on sparc64 and ppc64)
Fixes: 5d0f0ca56
Closes #1392

Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
2021-07-27 19:33:03 +03:00
Karel Zak 082b79ff8e Merge branch 'rename-all' of https://github.com/utoddl/util-linux
* 'rename-all' of https://github.com/utoddl/util-linux:
  rename: size_t, mutually exclusive parameters
  rename: stop after count changes
  rename: add --all and --last parameters
2021-07-27 14:14:51 +02:00
Pali Rohár 5d0f0ca563 tests: fdisk: Update CHS values in MBR partitions
It looks like that old CHS values prior this change in test data are
incorrect. Possible explanation why CHS values are incorrect is in commit
message 9cade4fbf8 ("libfdisk: (dos) Fix determining number of heads and
sectors per track from MBR").

This change updates test data to pass test suite after applying mentioned
commit.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2021-07-16 22:26:38 +02:00
Karel Zak 5b65b68cd8 Merge branch 'fdisk-tests-more-details' of https://github.com/pali/util-linux
* 'fdisk-tests-more-details' of https://github.com/pali/util-linux:
  tests: fdisk: Layout with more details
2021-07-15 10:20:09 +02:00
Todd Lewis a2b23d3a91 rename: add --all and --last parameters
Renaming files with rename often involves multiple passes in order
to, say, replace all spaces with underscores because traditionally
rename only replaces the first occurrence of the expression. The
--all parameter makes this task simple.

With the addition of --last, rename becomes much safer to use when
replacing file extensions, whereas before it would mangle a file
which had its extension also embedded elsewhere in its name.

The implied --first, together with --all and --last, round out the
common cases for renaming files.
2021-07-15 00:15:55 -04:00
Karel Zak 50a3c3bd28 tests: update sfdisk reorder test
References: commit f05a5bb2c2
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-07-14 16:23:00 +02:00
Pali Rohár 88c197c690 tests: fdisk: Layout with more details
Use fdisk -x instead of fdisk -l for printing layout in fdisk tests. This
can help debugging why some fdisk tests fail.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2021-07-07 00:56:21 +02:00
Karel Zak 96476550db tests: update lscpu outputs 2021-05-25 13:30:28 +02:00
Karel Zak afa7e09e4b tests: update lscpu output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-24 13:43:02 +02:00
Karel Zak c916e84380 tests: update build tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-10 12:13:09 +02:00
Karel Zak fe58418e9d tests: update libfdisk JSON outputs
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-06 17:02:40 +02:00
Karel Zak 62009e0d2f tests: update sparc lscpu tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-05-03 20:30:42 +02:00
Karel Zak 1c75a85101 libfdisk: use open(O_EXCL) to detect if device is used
It's seems detection by BLKRRPART is broken in recent kernels
(probably regression), and it's also overkill to force kernel re-read
all and generate all the events. It seems more elegant to use O_EXCL.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-15 15:14:52 +02:00
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
Karel Zak 6b160f5acd tests: update fdisk dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-08 12:46:47 +02:00
Karel Zak ba3b935259 tests: update lscpu output
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-04-01 12:30:25 +02:00
Karel Zak d246854aa8 tests: update build test results
Update as usually before release to see differences (on Fedora 33).

- static programs are not enabled by tools/config-gen.d/all.conf
  anymore (see 63f4e19928)
- add new uclampset
- libdl and libpython3 seems unnecessary
- fdformat disabled by default
- new hardlink uses libpcre2-posix

Signed-off-by: Karel Zak <kzak@redhat.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-17 14:58:26 +01:00
Karel Zak 70a7b61a84 tests: update mountpoint tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-11 10:52:11 +01:00
Karel Zak 4bf9ebca2b tests: update hardlink tests
The important is result, not summary or verbose output.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-17 11:50:21 +01:00
Karel Zak 15a37d00e5 tests: don't reply on scsi_debug partitions
The disk layout as created by scsi_debug depends on kernel version.
Let's make the partition sizes hardcoded in our tests than rely on
kernel.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-02-11 12:44:44 +01:00
Karel Zak 1161323b5a tests: update swaplabel.err
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-06 11:13:15 +01:00
Karel Zak 61c49a6ed5 tests: update blkid output for iso/udf
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-14 13:42:01 +01:00
Karel Zak 150394604d blkid: encode all udf and iso IDs in udev output
We encode to "safe" strings almost all variables for 'blkid -o udev'
and we need it also for SYSTEM_ID, PUBLISHER_ID, APPLICATION_ID,
BOOT_SYSTEM_ID and recently added VOLUME_SET_ID and DATA_PREPARER_ID.

This change makes blkid from util-linux more compatible with built-in
udevd blkid.

Addresses: https://github.com/karelzak/util-linux/pull/1215 (commit 5cbffdb74f)
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-10 12:10:06 +01:00
Pali Rohár eb6a4cc2e1 libblkid: iso9660: add new test images
Image iso-different-iso-joliet-label contains different identifiers in ISO
and Joliet locations. Identifiers are prefixed with "ISO" or "Joliet"
string to verify that UNICODE Joliet has preference over ASCII ISO.

Image iso-unicode-long-label contains very long identifiers in ISO location
which do not fit into the Joliet location. In ISO location is UNICODE
character 'ï' replaced by '_' and unrepresentable spaces also by '_'.
This test verifies that libblkid can use first half of identifiers from
Joliet (which contains UNICODE) and second half from ISO which is just
uppercase and only small subset of ASCII. This image was generated by Nero
Linux software and basically this truncate and '_' replacement is done by
default for any long or UNICODE label.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2020-12-10 02:38:06 +01:00
Karel Zak 5bc0378bfa tests: (blkid) add erofs image
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-12-08 10:52:20 +01:00
Pali Rohár b6168ae9cf libblkid: udf: update test output for APPLICATION_ID and PUBLISHER_ID
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
2020-12-05 21:10:23 +01:00
Sami Kerola 14a36f96ee
col: make input to tolerate invalid wide characters
The getwchar(3) will choke and exit if invalid character is encountered.
This change will make col(1) to print broken multibyte characters as
\x{hex} string.

Reported-by: Vitaly Lipatov <lav@etersoft.ru>
Addresses: https://github.com/karelzak/util-linux/issues/1198
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-12-02 22:12:32 +00:00
Karel Zak abd7815501 tests: (blkid) add support for multisession images
This commit adds support for multisession filesystem images to
standard low-probe blkid tests. The expected image name is

 <name>-multi-<offset>[-<offset> ...][-<something>].img

For example:
  iso-multi-0-174-348-genisoimage.img.xz

triggers three sub-tests:
  : iso-multi-genisoimage-0     ... OK
  : iso-multi-genisoimage-174   ... OK
  : iso-multi-genisoimage-348   ... OK

Addresses: https://github.com/karelzak/util-linux/issues/1161
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-30 10:33:20 +01:00
Karel Zak 3e35c90170 lscpu: update tests
* cpu MHz is per-CPU value and not printed in summary anymore
* topology is reordered
* number of NUMA nodes is moved to NUMA section
* parsable output uses cache ID from kernel if avalable

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-13 09:19:02 +01:00
Karel Zak ff3c6fd66f tests: update JSON outputs
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-12 11:40:22 +01:00
Karel Zak ab5d18e973 tests: (ul) remove another 'dim' input
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-10 13:36:32 +01:00
Karel Zak e34abedb6e tests: remove ul(1) 'dim' input
It's not supported by all terminals.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-11-09 16:41:46 +01:00
Sami Kerola bd66eb2e43 tests: move misc/ul to ul/ directory
Reference: https://github.com/karelzak/util-linux/pull/1165#issuecomment-715173662
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-11-09 16:31:59 +01:00
Karel Zak de9cbcdcef Merge branch 'whereis' of https://github.com/ferivoz/util-linux
* 'whereis' of https://github.com/ferivoz/util-linux:
  whereis: extend test case
  whereis: filter bin, man and src differently
  whereis: do not strip suffixes
  whereis: do not ignore trailing numbers
  whereis: add --disable-whereis to configure
  whereis: add lib32 directories
  whereis: support zst compressed man pages
  whereis: fix out of boundary read
2020-11-06 09:44:52 +01:00
Samanta Navarro 062e6a3945 whereis: extend test case
Previous commits are covered with these test cases.

Removed dependency on system layout.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:43:09 +00:00
Samanta Navarro cb77628876 misc: fix typos [codespell]
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
2020-11-04 11:42:25 +00:00
Sami Kerola aa439c6035
ul: add basic tests
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-10-20 20:29:20 +01:00
Karel Zak 2ceccca901 tests: update sfdisk wipe tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-16 10:59:17 +02:00
Karel Zak 017c0308c7 tests: update atari partx tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-13 18:34:39 +02:00
Karel Zak 0d061b6e68 tests: update atari blkid tests
The old images of the atari label are truncated and in-table stored
sizes do not match with real images sizes -- libblkid checks it now.

I have no idea how to generate ICD format, let's ignore it in tests
for now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-13 16:29:19 +02:00
Karel Zak 18b96d7102 Merge branch 'col-refactor' of https://github.com/kerolasa/util-linux
* 'col-refactor' of https://github.com/kerolasa/util-linux:
  col: replace LINE and CHAR typedefs with structs
  col: free memory before exit [LeakSanitizer]
  col: tidy up sources a little bit
  col: add defaults to switch case clauses
  col: flip all comparisions to numerical order
  col: use size_t when dealing with numbers that buffer sizes
  col: add structure to hold line variables
  col: add update_cur_line() function
  col: add handle_not_graphic() function
  col: initialize variables when they are declared
  col: move option handling to separate function
  col: move global variables to a control structure
  col: use inline function rather than function like define
  col: use typedef and enum to clarify struct
  col: remove function prototypes
  col: add more tests
2020-09-29 13:41:00 +02:00
Karel Zak c8baef03c6 tests: update script(1) return code
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-21 13:34:06 +02:00
Sami Kerola b97981a707
col: add more tests
With these tests coverage is about 89%.

The ts_run is added to ensure ASAN_OPTIONS and UBSAN_OPTIONS are set
correctly when the tests run.

Reference: https://github.com/karelzak/util-linux/pull/1115#issuecomment-670140224
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-09-11 20:55:01 +01:00
Karel Zak dc4816142c tests: add sfdisk test for 4fe7f9b614
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-08-10 12:00:17 +02:00
Chris Hofstaedtler dcd77a69da fdisk: fix expected test output on alpha
The last test output update inadvertedly replaced "ext2" with "MS-DOS"
in the alpha-specific data.

Fixes: 3c36438f0
Broken build log: https://buildd.debian.org/status/fetch.php?pkg=util-linux&arch=alpha&ver=2.36-1&stamp=1595550493&raw=0
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2020-07-24 09:09:43 +02:00