summaryrefslogtreecommitdiffstats
path: root/tests/ts/swapon
Commit message (Collapse)AuthorAgeFilesLines
* tests: consolidate ts_device_has UUID or LABELRuediger Meier2018-03-192-7/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-195-5/+5
| | | | | | | | | | 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 some more udevadm settleRuediger Meier2018-03-071-0/+2
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: check for TS_HELPER_SYSINFO in swap testsKarel Zak2016-03-182-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: ignore swapon warningsRuediger Meier2016-03-094-0/+12
| | | | | | | | | | | swapon/mkswap warns if system sets different permissions for loop devices. I saw this on Debian 7 (wheezy)/linux-3.2: mkswap: /dev/loop0: insecure permissions 1660, 0660 suggested. swapon: /dev/loop0: insecure permissions 1660, 0660 suggested. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix redirectionStanislav Brabec2016-02-123-3/+3
| | | | | | | | | | | | | | | | | | | Many tests do. 2>&1 >> $TS_OUTPUT It redirects stdout to $TS_OUTPUT and stderr to stdout. It could cause unintended ignoring of errors on strerr and false positive result of the test. Use >> $TS_OUTPUT 2>&1 instead to redirect both stdout and stderr to $TS_OUTPUT. Automatically created by: cd tests/ts sed -i 's:2>\&1 >> \$TS_OUTPUT:>> $TS_OUTPUT 2>\&1:g' $(fgrep -rl '2>&1 >> $TS_OUTPUT' .) Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* tests: never use -o pipefailRuediger Meier2015-04-215-10/+0Star
| | | | | | | | | | | | | | | | | | | It was hard to find out that pipefail was the reason why our test-suite could have random failures for aribtrary tests, for example the ones which are using ts_device_has_uuid() or ts_mount(). Bash's pipefall option is evil! It may return error for such a simple line like this one $ echo -e "xxx\nyyy" | grep -q "xxx" because the left echo command will get SIGPIPE when grep exits after the first match. So the command line above could return an error eventhough it does exactly what we want. This patch removes any pipefail from our tests. The funny thing is that I couldn't find any case where we relied on this feature anyway. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: loop tests, don't call ts_die() with DEVICE parameterRuediger Meier2015-04-145-16/+16
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: introduce TS_LOOP_DEVS for cleanupRuediger Meier2015-04-145-14/+10Star
| | | | | | | | | | | | | | We are maintaining an array TS_LOOP_DEVS to de-initialize devices always on exit. Until now there was no cleanup in ts_skip(). The downside is that we can't execute ts_device_init() in a subshell anymore. The device is returned via global variable TS_LODEV, similar like we do already in ts_scsi_debug_init(). Tests which don't use ts_device_init() to create loop devices may use ts_register_loop_device() to get them cleaned up later. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: ts_device_init requires loop supportRuediger Meier2014-05-135-0/+5
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: check commands needed for running a test existSami Kerola2014-03-075-0/+25
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: avoid executing dirname(1) commandSami Kerola2014-02-175-5/+5
| | | | | | Bash parameter expansion does the same thing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: remove LD_LIBRARY_PATH from swapon testsKarel Zak2012-04-185-15/+10Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add swapon tests for --fixpgsz and fix signatureKarel Zak2012-03-272-0/+92
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: grammar fixesDavidlohr Bueso2011-08-173-6/+6
| | | | | | Trivial change, "Cannot found" to "Cannot find". Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-303-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove vol_id from testsKarel Zak2009-12-042-4/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: swapon workaround for libtool wrapperKarel Zak2009-10-133-3/+6
| | | | | | | | | | The swapon command behaviour depends on program name (argv[0] = swapon | swapoff). It means we cannot use the libtool wrapper script in our regression tests. It seems better to call the binaries directly with proper LD_LIBRARY_PATH. This is probably less portable, but good enough for our tests. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: cleanup ts/swaponKarel Zak2009-02-113-16/+9Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: create subdirs for test scriptsKarel Zak2009-02-113-0/+147
Signed-off-by: Karel Zak <kzak@redhat.com>