summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* | tests: add choom to build-sys testKarel Zak2018-09-2418-0/+18
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update sfdisk resizeKarel Zak2018-09-171-1/+1
| | | | | | | | | | | | due to 2f35c1ead621f42f32f7777232568cb03185b473 Signed-off-by: Karel Zak <kzak@redhat.com>
* | test: update UUID v5 testsKarel Zak2018-08-311-1/+1
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update fdisk outputKarel Zak2018-08-3066-0/+75
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add column --table-empty-lines testKarel Zak2018-08-234-0/+24
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add cal --span testsKarel Zak2018-08-075-1/+746
| | | | | | | | | | Addresses: https://github.com/karelzak/util-linux/issues/677 Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: check for test_calKarel Zak2018-08-073-3/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update lscpu testsKarel Zak2018-08-013-0/+3
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update fdisk dialogsKarel Zak2018-07-3110-40/+40
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add mountinfo with empty sourceKarel Zak2018-07-103-0/+90
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add simple LVM lsblk dumpKarel Zak2018-06-218-0/+154
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add simple ATA and NVME lsblk dumpKarel Zak2018-06-218-0/+98
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add lsblk test scriptKarel Zak2018-06-213-6/+92
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add simple & stupid script to generate lsblk /sys and /proc dumpKarel Zak2018-06-211-0/+98
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add empty column testKarel Zak2018-06-042-0/+5
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: move stderr redirection out from test expressionSami Kerola2018-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix shellcheck error. if ! [ "$paraller_jobs" -ge 0 2>/dev/null ]; then ^-- SC1009: The mentioned parser error was in this if expression. ^-- SC1073: Couldn't parse this test expression. ^-- SC1072: Expected test to end here (don't wrap commands in []/[[]]). Fix any mentioned problems and try again. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | libblkid: udf: Fix reporting UDF 2.60 revisionPali Rohár2018-05-252-0/+10
|/ | | | | | | | | | | | | According to the UDF 2.60 specification, the Minimum UDF Read Revision value shall be at most #0250 for all media with a UDF 2.60 file system. So in this case use Minimum UDF Write Revision as ID_FS_VERSION to distinguish between UDF 2.50 and UDF 2.60 discs. This commit also adds a testing Blu-Ray Recordable image with UDF revision 2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* tests: update script done messagesKarel Zak2018-05-145-12/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update script headersKarel Zak2018-05-145-12/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove debug stuff from ts/script/optionsKarel Zak2018-05-141-1/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* script: add the -o/--output-limit option. Fix race test.Fred Mora2018-05-143-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | When script is used on a host with a relatively small free disk space, it is sometimes desirable to limit the size of the captured output. This can now be enforced with the --output-limit option. The --output-limit option lets the user specify a maximum size. The program uses the size parsing from strutils and thus supports the usual multiplicative suffixes (kiB, KB, MiB, MB, etc.). After the specified number of bytes have been written to the output file, the script program will terminate the child process. Due to buffering, the size of the output file might exceed the specified limit. This limit also does not include the start and done messages. The race test was throwing an error dur to a variable being "" in some cases. Quoting the variable in the equal test took care of that test. [kzak@redhat.com: - use done() to stop script - count also timing file - remove unnamed member initialization in ctl struct - add to bash-completion] Signed-off-by: Fred Mora <fmora@datto.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update sfdisk JSON outputKarel Zak2018-04-062-20/+20
| | | | | References: d881b773318dbd3f5ceb58a1e9a560fe0d1ac90a Signed-off-by: Karel Zak <kzak@redhat.com>
* lsmem: improve JSON outputKarel Zak2018-04-052-53/+53
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update JSON outputsKarel Zak2018-04-043-50/+50
| | | | | | It does not contains extra space after ":" separator anymore. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove namei(1) failed lstat testKarel Zak2018-03-272-6/+0Star
| | | | | | | | The strerror() output is is nothing stable and may be different on another systems. It would be possible to use sed(1) to unify the output, but it seems overkill in this case. Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'master' of https://github.com/pali/util-linuxKarel Zak2018-03-2739-0/+134
|\ | | | | | | | | | | | | * 'master' of https://github.com/pali/util-linux: tests: Add tests for FAT32 labels blkid: Encode any field which starts with LABEL in same way as LABEL field libblkid: vfat: Change parsing label in special cases
| * tests: Add tests for FAT32 labelsPali Rohár2017-11-2539-0/+134
| | | | | | | | | | | | | | | | | | | | These FAT32 images were generated for FAT label test suite in October 2017. Now blkid reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10. For more information about test result see email: https://www.spinics.net/lists/kernel/msg2640891.html Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* | tests: update column(1) space-separator testKarel Zak2018-03-271-6/+6
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | column: fix leading space characters bugKarel Zak2018-03-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug has been introduced during column(1) rewrite. The function read_input() need to skip leading space only temporary to detect empty lines, but the rest of the code has to use the original buffer (line). I've tried to fix one of the symptoms by 5c7b67fbbf41c973ca8d49b1e8bdba22dbb917aa (alter), but this solution is unnecessary and too complex. Changes: * don't ignore leading space * remove unnecessary stuff introduced by 5c7b67fbbf41c973ca8d49b1e8bdba22dbb917aa * fix regression test with incorrect separator Addresses: https://github.com/karelzak/util-linux/issues/575 Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1560283 Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: use libtool to execute with valgrindKarel Zak2018-03-211-0/+1
| | | | | | | | | | | | | | | | The libtool based build system uses scripts rather than real binaries in $top_builddir. It's necessary to use libtool --mode=execute to call valgrind for the real binary (from .libs/). Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: update lsmemKarel Zak2018-03-201-2/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add /proc/swaps libmount parser testKarel Zak2018-03-203-0/+31
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | 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>