summaryrefslogtreecommitdiffstats
path: root/tests/ts
Commit message (Collapse)AuthorAgeFilesLines
* tests: use subtests for mountpoint(1)Karel Zak2019-08-071-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mountpoint: add --nofollow optionSami Kerola2019-08-021-0/+27
| | | | | | | | | | The no follow option will allow user to distinct mount points from symbolic links pointing to them. Arguably this is pretty pedantic option, mounting a device or bind mount to a directory via symlink does not have or cause any issues. Addresses: https://github.com/karelzak/util-linux/issues/832 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* column: fix outputing empty column at the end of lineYousong Zhou2019-07-291-0/+8
| | | | | | | | | | | | | The following commands manifests the problem. In old versions before commit 4762ae9d60 ("column: use libsmartcols for --table"), both of them should output with 2 "|" echo '||' | column -o '|' -s '|' -t echo '|| ' | column -o '|' -s '|' -t Fixes: 4762ae9d60 ("column: use libsmartcols for --table") Signed-off-by: Yousong Zhou <zhouyousong@yunionyun.com> Reviewed-by: Sami Kerola <kerolasa@iki.fi>
* tests: (libsmartcols) add padding testsKarel Zak2019-07-232-0/+56
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: (libmount) make X-* and x-* more robustKarel Zak2019-07-151-3/+4
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/818 Signed-off-by: Karel Zak <kzak@redhat.com>
* lscpu: fix floating point exceptionSami Kerola2019-05-181-0/+0
| | | | | | | | | | | | | As the title tells this change indeed fixes floating point exception, but post processing as value overwrite feels a wrong. Possibly something in input is making cpu set count to go wrong, but I could not get my head around what could it be. Anyway avoiding division by zero seems better than crashing so lets do this atleast for now. Caused-by: e5f721132ec8b8c933a396d8dcb3efcb67854f13 Addresses: https://github.com/karelzak/util-linux/issues/788 Reported-by: Lars Wendler <polynomial-c@gentoo.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: fix TS_ENABLE_ASAN usageKarel Zak2019-04-172-2/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use TS_ENABLE_ASAN in tests to detect ASANKarel Zak2019-04-172-2/+2
| | | | | | It seems better to not use any random ASAN variable. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: ignore errors with enabled ASAN in python bindingsKarel Zak2019-04-155-3/+11
| | | | | | | temporary solution... as it ends with undefined symbol: __asan_option_detect_stack_use_after_return Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add /mnt/test/foo^Mbar to mountinfo testsKarel Zak2019-04-081-0/+1
| | | | | Addresses: https://github.com/karelzak/util-linux/issues/780 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add missing ts_check_test_command callKarel Zak2019-03-051-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add missing TS_CMD_UMOUNT checkKarel Zak2019-03-041-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: (kill) do not use shell build-inKarel Zak2019-03-045-0/+25
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add missing ts_check_test_command callsKarel Zak2019-03-049-0/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'evelu-epyc' of https://github.com/ErwanAliasr1/util-linuxKarel Zak2019-03-041-0/+0
|\ | | | | | | | | * 'evelu-epyc' of https://github.com/ErwanAliasr1/util-linux: test: Adding AMD EPYC 7451 24-Core Processor
| * test: Adding AMD EPYC 7451 24-Core ProcessorErwan Velu2019-02-271-0/+0
| | | | | | | | | | | | | | This cpu is massively numa and have interesting cache organization. This will be useful to test & implement issue #663 Signed-off-by: Erwan Velu <e.velu@criteo.com>
* | tests: make sure TS_HELPER_MBSENCODE compiledKarel Zak2019-03-011-0/+2
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: use subtests in fdisk/mbr-nondos-modeKarel Zak2019-02-271-18/+39
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add fdisk (dos) first sector dialog testKarel Zak2019-02-271-0/+18
|/ | | | | | | The test verifies that the "First sector" dialog offers relevant range in the begin of the device if the end of the device is already used. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_{find,insert,move}_fs()Karel Zak2019-02-211-0/+5
| | | | | | | | Add functions to insert FS into table to specified position and to move FS between two tables. Co-Author: Tim Hildering <hilderingt@posteo.net> Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'hardlink' of https://github.com/rudimeier/util-linux into hardlinkKarel Zak2019-02-062-0/+78
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'hardlink' of https://github.com/rudimeier/util-linux: (25 commits) hardlink: add first simple tests hardlink: util-linux usage hardlink: fix compiler warnings hardlink: style indentations and license header hardlink: enable build with and without pcre2 fixes for the fixes temporal fix before re-patch (updates from Fedora repo) Update hardlink.1 Fixed version number, added changelog about Todd Lewis' patch exclude files via pcre Fixed 32 bit build with gcc7 (RH Bugzilla ID 1422989) spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); update FSF address at .c source file Revert "spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file" spec file reflects the atomic hardlinking patch; removed cleaning buildroot (redundant); current FSF address at .c source file Mention -f option in the man page do not allow to hardlink files across filesystems by default (#786719) (use -f option to override) fix possible buffer overflows, integer overflows, update man page fix URL and remove mmap() (#676962, #672917) - update docs to describe highest verbosity -vv option (#210816) - use dist Resolves: 210816 mostly spec cleanup ...
| * hardlink: add first simple testsRuediger Meier2018-11-152-0/+78
| | | | | | | | | | | | | | 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>
* | Added BlueStore test imageKenneth Van Alstyne2018-12-171-0/+0
| |
* | tests: check for tar and {b,g}zipKarel Zak2018-12-112-0/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: make lsns-netnsid portableKarel Zak2018-11-301-1/+25
| | | | | | | | | | | | | | | | | | It seems ip(8) link-show command does not provide link-netnsid in all cases (versions ?). Let's try to use "ip netns list-id" as fallback. This commit also add possibility to debug the script by $LOG variable. Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: enlarge backing file for fstab-btrfsKarel Zak2018-11-301-1/+1
| | | | | | | | | | | | It seems the new limit for Btrfs is 47MiB. Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add test images for drbd v08/v09Roland Kammerer2018-11-292-0/+0
| | | | | | | | | | | | | | This adds DRBD meta data images for DRBD versions 8 and 9, as well as the according expected output. Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
* | tests: run oids test only when uuidgen tool was builtThomas Deutschmann2018-11-111-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | oids test did not check if uuidgen was available. oids test was also calling uuidgen from PATH which could result in wrong results if uuidgen from a previous util-linux installation was used. With this commit we will check if uuidgen was built and make sure that we only call the uuidgen binary we just built. If uuidgen is not available we will skip this test.
* | tests: add column --table-empty-lines testKarel Zak2018-08-232-0/+14
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add cal --span testsKarel Zak2018-08-071-1/+6
| | | | | | | | | | 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: add mountinfo with empty sourceKarel Zak2018-07-102-0/+12
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add simple LVM lsblk dumpKarel Zak2018-06-211-0/+0
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: add simple ATA and NVME lsblk dumpKarel Zak2018-06-211-0/+0
| | | | | | | | 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-041-0/+4
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | libblkid: udf: Fix reporting UDF 2.60 revisionPali Rohár2018-05-251-0/+0
|/ | | | | | | | | | | | | 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: 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-142-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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: remove namei(1) failed lstat testKarel Zak2018-03-271-1/+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-2718-0/+0
|\ | | | | | | | | | | | | * '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-2518-0/+0
| | | | | | | | | | | | | | | | | | | | 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>
* | column: fix leading space characters bugKarel Zak2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add /proc/swaps libmount parser testKarel Zak2018-03-202-0/+9
| | | | | | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: consolidate ts_device_has UUID or LABELRuediger Meier2018-03-1914-43/+25Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1911-24/+24
| | | | | | | | | | | | | | | | | | | | 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: 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: 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>