summaryrefslogtreecommitdiffstats
path: root/tests/ts/mount
Commit message (Collapse)AuthorAgeFilesLines
* 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: consolidate ts_device_has UUID or LABELRuediger Meier2018-03-1910-30/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-2/+2
| | | | | | | | | | 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-073-1/+4
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* 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: use flock to modify fstabKarel Zak2017-12-064-15/+26
| | | | | | | Note that for btrfs test we need to use low-level ts_fstab_addline, because we add multiple lines there. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: consolidate rmmod scsi_debugRuediger Meier2016-10-212-8/+0Star
| | | | | | | | | - auto cleanup on test exit - Add smart timeout: Newer openSUSE systems on OBS failed to rmmod almost always. udevadm settle does not seem to have any affect. - now tests will fail if rmmod fails Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: call umount --fake for tmpfs testsKarel Zak2016-10-202-2/+15
| | | | | | | | | | On old systems (e.g. RHEL6) with /sbin/mount.tmpfs the mtab file is modified although our in-tree mount does not support mtab file. We need to call umount --fake to be sure that we remove unwanted lines from the test. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: make tests more portable due to mtabKarel Zak2016-04-154-7/+25
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: don't depend on GNU md5sumRuediger Meier2016-04-131-1/+2
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: improve skipping of old btrfs-toolsRuediger Meier2016-03-131-3/+5
| | | | | | | | | | | | | | | | | Older Linux distributions came with differently incomplete btrfs-tools 0.19+git versions (2009-2013). Old mkfs.btrfs needs minimum device size 256M. Note the most simple way to skip btrfs-tools < 3.14 would be btrfs property --help 2>&1 || ts_skip "btrfs too old" but I want to include 3.12 because of Ubuntu Trusty on travis. This patch partly reverts/rewrites the following commits: 7e604f3c - tests: don't skip case "output undefined" 076153f8 - tests: don't compare btrfs mount options 370d31f7 - tests: skip btrfs tests if version too old Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: skip btrfs tests if version too oldRuediger Meier2016-03-091-0/+4
| | | | | | | | Noticed on Debian 7 (Wheezy), btrfs-tools 0.19: btrfs inspect-internal: unknown token 'rootid' CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: don't use mkfs.btrfs option -fRuediger Meier2016-03-091-1/+1
| | | | | | | | btrfs-tools 0.19 does not have option -f but looks like we don't need it in this test. CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: mkfs.ext3 image-file needs option -FRuediger Meier2016-02-121-1/+1
| | | | | | | Maybe on newer systems it's not needed anymore. CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add test for loop option in fstabStanislav Brabec2016-02-121-0/+51
| | | | | | | | | | Add a new fstab tests which check loop mount of the same source multiple times in multiple steps. The test is currently failing, but it should not fail once the triggering bug will be fixed. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* tests: fix redirectionStanislav Brabec2016-02-1217-46/+46
| | | | | | | | | | | | | | | | | | | 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: add btrfs mount testsStanislav Brabec2016-02-121-0/+128
| | | | | | | | | | | | | btrfs needs a special support in mount. Add a testcase for btrfs specific problems. Coverage: 352740e8: bind mounts pointing to btrfs 2cd28fc8: mounting default subvolume d2f82678: use of "auto" 618a8814: use of "subvolid" Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* tests: skip nonroot before checking for progs in PATHRuediger Meier2015-12-1020-20/+20
| | | | | | | | | | The least annoying and most useful order is this one: 1. check for compiled UL commands 2. check for root 3. check for loop support 4. check for external progs Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: never use -o pipefailRuediger Meier2015-04-2118-36/+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-1417-92/+92
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: introduce TS_LOOP_DEVS for cleanupRuediger Meier2015-04-1417-58/+34Star
| | | | | | | | | | | | | | 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: mount/rlimit tries to restore mtabRuediger Meier2015-04-021-2/+11
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix, don't call ts_die from subshellRuediger Meier2015-04-021-3/+1Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: remove private2 dir from mount/moveKarel Zak2015-03-201-8/+5Star
| | | | | | | The directory is unnecessary, all we need is to create from "private" directory a mount point (so "--bind $DIR_PRIVATE $DIR_PRIVATE"). Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: some more mount error handlingRuediger Meier2015-03-193-0/+6
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: more error handling in mount/move (refactor)Ruediger Meier2015-03-191-22/+28
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: mount/move also tests findmnt vs. mountpointRuediger Meier2015-03-191-0/+15
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* findmnt: add --mountpoint command line optionKarel Zak2015-03-195-15/+15
| | | | | | | | | The current --target <path> implementation check the <path> elements in reverse order to get the mountpoint. The feature may be inwanted in some cases when we really want to check for mountpoint specified by the <path>. The new option "--mountpoint <path>" allows to be strict. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add mount -t testKarel Zak2014-07-251-0/+97
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove deprecated mount testsRuediger Meier2014-06-032-74/+0Star
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: skip umount-alltargets on regular mtabKarel Zak2014-05-261-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: check for mkfs.ext{2,3,4}Ruediger Meier2014-05-1519-0/+19
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: ts_scsi_debug_init must not run in a subshellRuediger Meier2014-05-132-24/+26
| | | | | | | | | | | ts_skip and ts_die won't work from subshell. Now we simply use TS_DEVICE which is globally set in that function. I've made sure that we never change TS_DEVICE variable after we've got it. So we could use it again for cleanup on exit in ts_{finalize,die,skip} functions. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: some more tests need loop supportRuediger Meier2014-05-131-0/+1
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: ts_device_init requires loop supportRuediger Meier2014-05-1316-0/+16
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: check commands needed for running a test existSami Kerola2014-03-0725-0/+103
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: remove deprecated-mount/Karel Zak2014-03-051-19/+13Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: avoid executing dirname(1) commandSami Kerola2014-02-1725-25/+25
| | | | | | Bash parameter expansion does the same thing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: make mount tests backwardly compatible with deprecated-mount/Karel Zak2013-04-253-14/+25
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: consolidate scsi_debug usageKarel Zak2013-04-122-29/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use udevadm settle rather than sleepKarel Zak2013-04-122-2/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add umount --all-targets testsKarel Zak2013-02-261-0/+121
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add/improve mount shared-subtree testsKarel Zak2013-01-151-19/+42
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add shared subtrees to umount --recursive testKarel Zak2012-11-151-1/+10
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add umount --recursive testKarel Zak2012-11-151-0/+90
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix mount move test to work with shared mountMilan Broz2012-10-091-3/+16
| | | | | | | | | | | If parent mount for test directory is mounted with shared flag, move mount test fails because kernel rejects mount move operation. Use another directory level and explicitly make parent mount private. (All "modern" systems using system have mounts shared for some reason.) Signed-off-by: Milan Broz <mbroz@redhat.com>
* tests: remove encryption loopdev testKarel Zak2012-09-121-64/+0Star
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use ts_is_mounted in mount/regfileBernhard Voelker2012-07-301-2/+2
| | | | | | | If the test directory is on a symlink, then mount/regfile failed because it did not search for the mount point in /proc/mounts canonicalized. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* build-sys: convert tests/ to moduleKarel Zak2012-06-261-54/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add losetup/mount encryption testKarel Zak2012-05-281-0/+64
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>