summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: consolidate ts_device_has UUID or LABELRuediger Meier2018-03-1915-59/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | Regarding parallel root checks ... - fix: add a few missing "udevadm settle" where we are using LABELs or UUIDs - introduce ts_udevadm_settle(): * Still trivial implementation. The idea is to use it in future for all tests instead of directly calling "udevadm settle". So we could add debug messages, wait for specific events, add code for non-udev systems or even use "udevadm --{start,stop}-exec-queue" to be really sure what we are doing and why using udevadm at all. * The currently unused args may be used in future and show the code reader already now why we are calling "udevadm settle" at all. * So far this patch only affects swapon/, mount/, libmount/ tests, and is only about UUIDs and LABELs, but may be continued later for "partitions", "md devices", whatever. * We are calling ts_udevadm_settle() right *before* we need a LABEL or UUID, not just *after* we created one. This may be a bit better for speed and shows the code reader which command would fail without settle. - function ts_device_has_uuid() is unused now, we trust blkid(1). Renamed to ts_is_uuid() in case we would need it again. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix grep expressions for devicesRuediger Meier2018-03-1912-26/+26
| | | | | | | | | | ts_is_mounted "/dev/loop1" returned true if /dev/loop17 was mounted. A very annoying source of sporadic failures since many years. This issue became more visible since running the checks in parallel, which increases the probability to get bigger loop device numbers. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: handle xargs errors and invalid argsRuediger Meier2018-03-191-2/+12
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add ipcslimits lockRuediger Meier2018-03-092-0/+4
| | | | | | | These two tests conflict. Interestingly, this is our first lock for a non-root check. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix losetup raceRuediger Meier2018-03-092-32/+19Star
| | | | | | Also avoid some "no-reentrant" tests. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: re-introduce bash 3 compatibility (OSX)Ruediger Meier2018-03-081-17/+20
| | | | | | | | | | | | | | | | | Bash 4 is now almost 10 years old and it seemed to be fine in 613a337e to use associative arrays. Unfortunately OSX will probably never update to 4 because of GPLv3. We don't want to lose our travis OSX build and use plain arrays again. BTW remove that "informative warnings" about unlocked resources. They were only silent so far because of a bug. Any system where scsi_debug is broken would print a lot of these warnings. This also tells us that we could even stop calling ts_unlock() explicitly. Just exiting the tests would be good enough. Note that currently flock(1) is not available on our OSX build anyways. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* travis: use parallel root checksRuediger Meier2018-03-071-2/+15
| | | | | | Also improve CPU count detection for tests. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: dont't timeout flockRuediger Meier2018-03-071-1/+1
| | | | | | | | | | | | The only situation where we would block endless is if another parallel test has the lock and hangs for another reason. This means that the other test would still keep hanging even if we timeout here. The user would have to interrupt the other test or the whole test-suite anyways. Note that we would certainly run into any timeout when using --parallel=200, so that all scsi tests start the same time. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: don't use unlocked resourcesRuediger Meier2018-03-071-0/+20
| | | | | | | | The test-suite did not survive when flock timeouts after 30s because then ts_cleanup_on_exit() may use resources (e.g. rmmod scsi_debug) while not having the lock. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: don't lock fd 1 (stdout), don't use /proc/$$/fdRuediger Meier2018-03-071-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On debian-kfreebsd we've locked stdout which messed up our test logs. Using /proc/*/fd/ is not portable. Even ts_init's test for "/proc/self/fd" does not help because /proc/*/fd behaves strange here: $ ls -l /proc/$$/fd lr--r--r-- 1 rudi user 0 Mar 6 23:11 /proc/2194/fd -> unknown $ file /proc/$$/fd /proc/2194/fd: broken symbolic link to `unknown' ## wtf? $ test -d /proc/$$/fd; echo $? 0 $ ls -l /proc/$$/fd/ ls: cannot access /proc/2194/fd/: No such file or directory ## but $ ls -l /proc/self/fd/ total 0 cr-xr-xr-x 1 root root 0, 3 Mar 6 19:39 0 cr-xr-xr-x 1 root root 0, 4 Mar 6 19:39 1 cr-xr-xr-x 1 root root 0, 5 Mar 6 19:39 2 cr-xr-xr-x 1 root root 0, 6 Mar 6 19:39 3 This is how this patch changes the test output: [...] blkid: partitions probing: [06] sgi ... OK blkid: partitions probing: [07] sun ... OK blkid: partitions probing ... OK (all 7 sub-tests PASSED) -ls: cannot access /proc/66215/fd/: No such file or directory + blkid: mbr-wholedisk ... SKIPPED (missing scsi_debug module (dry-run)) blkid: MD raid0 (whole-disks) ... SKIPPED (losetup not found) blkid: MD raid1 (last partition) ... SKIPPED (missing in PATH: mdadm) blkid: MD raid1 (whole-disks) ... SKIPPED (losetup not found) @@ -343,11 +343,11 @@ dmesg: facilities ... SKIPPED (test_dmesg not found) dmesg: indentation ... SKIPPED (test_dmesg not found) eject: umount ... SKIPPED (eject not found) -ls: cannot access /proc/69561/fd/: No such file or directory -ls: cannot access /proc/69609/fd/: No such file or directory + fdisk: align 512/4K ... SKIPPED (missing scsi_debug module (dry-run)) + fdisk: align 512/4K +alignment_offset ... SKIPPED (missing scsi_debug module (dry-run)) fdisk: align 512/4K +MD ... SKIPPED (missing in PATH: mdadm) fdisk: align 512/512 ... SKIPPED (losetup not found) [...] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add wierd sleep for libmount/contextRuediger Meier2018-03-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I still don't understand why this helps to fix these tests on my system. udevadm settle had no positive effect. Adding the sleeps before "is_mounted" also didn't fixed that, that's amazing!? Below the test log, very often seen on my system since a long time: -------------------- util-linux regression tests -------------------- For development purpose only. Don't execute on production system! kernel: 4.4.104-39-default libmount: context: [01] mount-by-devname ... OK libmount: context: [02] umount-by-devname ... OK libmount: context: [03] mount-by-label ... OK libmount: context: [04] umount-by-mountpoint ... OK libmount: context: [05] mount-by-uuid ... FAILED (libmount/context-mount-by-uuid) libmount: context: [06] mount-flags ... FAILED (libmount/context-mount-flags) libmount: context: [07] mount-loopdev ... OK libmount: context: [08] x-mount.mkdir ... OK libmount: context: [09] X-mount.mkdir ... OK libmount: context ... FAILED (2 from 9 sub-tests) --------------------------------------------------------------------- 1 tests of 17 FAILED --------------------------------------------------------------------- rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-by-uuid --- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-by-uuid 2017-07-03 12:20:24.144845538 +0200 +++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-by-uuid 2018-01-24 00:42:18.549444408 +0100 @@ -1,2 +1,3 @@ successfully mounted -successfully umounted +failed to umount +FAILED [rc=16]/dev/sdb1 still mounted rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-flags --- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-flags 2017-07-03 12:20:24.148845497 +0200 +++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-flags 2018-01-24 00:42:18.725442931 +0100 @@ -1,5 +1,5 @@ +test_mount_context: failed to mount: Device or resource busy +FAILED [rc=16]rw,relatime successfully mounted -ro,nosuid,noexec -successfully mounted -rw,nosuid,noexec +rw,relatime successfully umounted Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add some more udevadm settleRuediger Meier2018-03-075-1/+7
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* uuidd: don't truncate long socket pathsRuediger Meier2018-03-071-1/+2
| | | | | | | | | | | | | This was the error uuidd: couldn't bind unix socket /var/tmp/portage/sys-apps/util-linux-2.31.1/work/util-linux-2.31.1-abi_x86_64.amd64/tests/output/uuid/uuiddkOcTUuoZ7kaP3: Address already in use because the socket path was truncated to 108 chars which was luckily an existing directory. Now we abort early with "uuidd: socket name too long: ... " Reported-by: Thomas Deutschmann <whissi@gentoo.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: use pgrep instead of ps --ppid ...Ruediger Meier2018-02-161-5/+2Star
| | | | | | | The usage looks a bit cleaner, and I guess that pgrep(1) is available on the same machines where "ps --ppid" would work (procps-ng). Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* misc: fix typos using codespellRuediger Meier2018-02-163-3/+3
| | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add udevadm settle to sfdisk/resizeRuediger Meier2018-02-151-0/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: update build-sys testsKarel Zak2018-02-1316-16/+14Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: column(1) test for space-char separatorKarel Zak2018-02-123-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: column(1) test non-space separator at begin of lineKarel Zak2018-02-122-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add mpool blkid test imageKarel Zak2018-02-052-0/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: rewrite cal(1) bigyear testKarel Zak2018-02-0228-384/+269Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use TS_HELPER_CALKarel Zak2018-02-023-4/+11
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update setarch testKarel Zak2018-02-011-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'libblkid-atari' of https://github.com/yontalcar/util-linuxKarel Zak2018-01-316-0/+30
|\ | | | | | | | | | | | | | | | | | | | | * 'libblkid-atari' of https://github.com/yontalcar/util-linux: libblkid: atari - reject devices with blocksize != 512 libblkid: atari - don't add duplicate entries libblkid: atari - test if any partition fits disk size tests: added missing expected outputs for partx (atari) libblkid: atari - fix bad variable name tests: added test for libblkid atari pt libblkid: Support for Atari partitioning scheme
| * tests: added missing expected outputs for partx (atari)Vaclav Dolezal2018-01-242-0/+14
| | | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
| * tests: added test for libblkid atari ptVaclav Dolezal2018-01-234-0/+16
| | | | | | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* | tests: update cal(1) testsKarel Zak2018-01-3080-2668/+1784Star
| | | | | | | | | | | | | | | | | | | | | | | | | | * remove extra space after year output f066c107ce6b76b4b11b239b9ab77561d4e0b84e * don't print blank space behind last char on row 8315a2ff1507571ef14d77beac867b34a7d5e6da * print just specified number of month for -1, -3 and -n 2bcf8f7934649a5ee7925cdfdb12ca5abbf59b38 Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: fix fincore/count KNOWN_FAILRuediger Meier2018-01-241-4/+3Star
| | | | | | | | | | | | It has to be set after calling ts_init. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: suppress warning for old sync(1)root2018-01-241-2/+2
| | | | | | | | | | | | | | | | | | Old sync(1) prints a warning which looks ugly among our test output: "sync: ignoring all arguments" Seen on travis, Ubuntu <= 14.04 (Trusty). Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: rewrite fsck-bad-headerRuediger Meier2018-01-248-6/+243
| | | | | | | | | | | | | | Fix test for systems with pagesize != 4096 Loop over many combinations of sizes, endianness and blocksizes. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | fsck.cramfs: fix crash when superblock size is too smallRuediger Meier2018-01-242-3/+2Star
|/ | | | | | | | | | | This hopefully fixes the original problem addressed by the reverted patch 7cb962c7. The bug was introduced by myself in f991dbd3 "fsck.cramfs: allow smaller superblock sizes" CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: use subtests for weeknum cal(1) testsKarel Zak2018-01-2210-1540/+1459Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use subtests for weekarg cal(1) testsKarel Zak2018-01-2219-262/+202Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* test: use subtests for jan1753 cal(1) testKarel Zak2018-01-224-33/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: merge year cal(1) testsKarel Zak2018-01-2212-442/+374Star
| | | | | | | * merge tests * use subtests for cal(1) calls Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: merge 1m and 3m cal(1) testsKarel Zak2018-01-2225-388/+208Star
| | | | | | | * merge tests * use subtests for cal(1) calls Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: merge sep1752 cal(1) testsKarel Zak2018-01-2228-392/+295Star
| | | | | | | * merge tests * use subtests for cal(1) calls Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use subtests for sep1752w testKarel Zak2018-01-2215-264/+275
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: simplify cal(1) sep1752w testKarel Zak2018-01-221-70/+35Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add cal(1) --week=40 1752Karel Zak2018-01-222-0/+15
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: Decode ARM CPUsRiku Voipio2018-01-191-0/+3
| | | | | | | | Since the kernel developers have refused to make /proc/cpuinfo user understandable, implement mapping in userspace. lscpu is available for most users via util-linux, so store the information here. Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
* tests: mark fincore/count as KNOWN_FAILKarel Zak2018-01-171-0/+4
| | | | | | | The test (or our expectations about Direct-IO) seems not robust enough. I guess this is not fincore problem. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: mark mbsencode as KNOWN_FAILVaclav Dolezal2018-01-111-0/+3
| | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* tests: mbsencode - test for HAVE_WIDECHARVaclav Dolezal2018-01-111-8/+26
| | | | | | Test only safe-ascii as it should behave in the same way. Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* tests: mbsencode - removed emoji, added control unicode characterVaclav Dolezal2018-01-115-5/+5
| | | | | | | Emojis are apparently too recent to be reliably recognised as printable on test machines. Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* tests: add tests for encode functions from lib/mbsalign.cVaclav Dolezal2018-01-108-0/+158
| | | | Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
* tests: don't use mount.<type> helpers in mount-by-pattern testsKarel Zak2017-12-191-2/+2
| | | | | | | | | | | | The test behavior is fragile if depends on external helpers. Let's keep it based on mount(2) only. The test will be faster too. Note that "mount -t <pattern>" does not behaviour as expected with helpers. We need to try another helper if the current one ends with status=1 (waitpid()). Now it returns status from the first helper. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update libsmartcols/titleKarel Zak2017-12-131-0/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-6/+6
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* test_sha1: update helperKarel Zak2017-12-121-6/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>