summaryrefslogtreecommitdiffstats
path: root/tests/ts/libmount
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* tests: fix TS_ENABLE_ASAN usageKarel Zak2019-04-171-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use TS_ENABLE_ASAN in tests to detect ASANKarel Zak2019-04-171-1/+1
| | | | | | 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_CMD_UMOUNT checkKarel Zak2019-03-041-0/+1
| | | | 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>
* tests: add mountinfo with empty sourceKarel Zak2018-07-102-0/+12
| | | | 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-192-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-194-16/+16
| | | | | | | | | | 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: 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>
* misc: fix typos using codespellRuediger Meier2018-02-161-1/+1
| | | | | | Some more funny typos, please review carefully. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: don't call tests with races in --parallelKarel Zak2017-12-071-28/+43
| | | | | | Some of the tests have a race by design (=wanted). Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: rename ts_valgrind to ts_runKarel Zak2017-11-2310-110/+110
| | | | | | | Let's make our tests more generic, so we can later hide more stuff into ts_run call. Signed-off-by: Karel Zak <kzak@redhat.com>
* misc: POSIX usage dd, regarding unit suffixesRuediger Meier2017-06-141-1/+1
| | | | | | | | | In POSIX we have only 'b' and 'k' (case-sensitive). In the real work, OSX was the only system I've found which does not understand capital 'K'. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: make /proc optionalKarel Zak2017-05-301-4/+12
| | | | | Reported-by: Assaf Gordon <assafgordon@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update libmount outputsKarel Zak2017-04-282-7/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add --mountpoint to findmnt callsKarel Zak2017-03-313-5/+5
| | | | | | ... if necessary to make things more robust. Signed-off-by: Karel Zak <kzak@redhat.com>
* test: fix mountpoint device check in libmount/loopRuediger Meier2017-03-311-12/+15
| | | | | | | | This test could fail if the build directory is somehow exoticly mounted (shared bind mounts, symlinks). CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: Introduce libmount/loopStanislav Brabec2017-01-161-0/+133
| | | | | | Add libmount/loop test that tests various loop mount options. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* libmount: revert X-* and x-* meaningKarel Zak2016-12-091-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's hope this is last change necessary to cleanup x-* usage: x-* persistent option, stored in utab, available for umount, etc. X-* fstab comment only mount(8) supports x-mount.mkdir= as well as newly recommended X-mount.mkdir= Advantages: * less invasive * does not require exception for x-systemd * does not require rename x-initrd to X-initrd The systemd and dracut users will get the new (=fixed) functionality without a change in fstab configuration. This is the primary goal. Disadvantages: * not 100% compatible libmount behavior, x-* options have not been previously stored in utab. The API is the same, options will be still available, but on x-* libmount will write to /run/mount/utab. For now it seems only systemd uses x-*, and they like this behavior, so... Addresses: https://github.com/systemd/systemd/pull/4515 Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: consolidate rmmod scsi_debugRuediger Meier2016-10-216-12/+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>
* libmount: Preserve empty string value in optstr parsingFilipe Brandenburger2016-08-101-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent mount (since the switch to libmount in v2.22) drops the '=' in mount options that are set to an empty value. For example, the command line below will be affected: # mount -o rw,myopt='' -t tmpfs tmpfs /mnt/tmp Fix that by preserving an empty string in the options passed to the mount(2) syscall when they are present on the command line. Add test cases to ensure empty string handling is working as expected and in order to prevent regressions in the future. Also tested manually by stracing mount commands (on a kernel which accepts a special extra option, for testing purposes.) Before this commit: # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myarg") = -1 EINVAL (Invalid argument) After this commit: # strace -e mount ./mount -t tmpfs -o rw,myopt='' tmpfs /mnt/tmp mount("tmpfs", "/mnt/tmp", "tmpfs", MS_MGC_VAL, "myopt=") = 0 All test cases pass, including newly added test cases. Also checked them with valgrind using: $ tests/run.sh --memcheck libmount/optstr Fixes #332. Signed-off-by: Filipe Brandenburger <filbranden@google.com>
* tests: fix loop-overlay testKarel Zak2016-08-041-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix libmount loop-overlay testKarel Zak2016-08-041-5/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: Add loop-overlay testStanislav Brabec2016-08-031-0/+64
| | | | | | | The test will check proper loop device reuse and error in case of overlapping loop device. Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
* tests: make tests more portable due to mtabKarel Zak2016-04-153-34/+38
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove USE_LIBMOUNT_FORCE_MOUNTINFOKarel Zak2016-04-152-4/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Merge branch 'travis-osx' of https://github.com/rudimeier/util-linuxKarel Zak2016-03-145-71/+76
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'travis-osx' of https://github.com/rudimeier/util-linux: travis: add OSX build travis: switch to Ubuntu 14.04 Trusty build-sys: improve uuidd and script build conditions build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms build-sys: add missing "not found" strings build-sys: fix again UL_SCANF_TYPE_MODIFIER tests: don't use system's mount commands tests: improve skipping of old btrfs-tools tests: remove invalid argument in libmount/debug tests: skip old socat silently misc: fix icc/clang compiler warnings misc: fix printf i386 compiler warnings
| * tests: don't use system's mount commandsRuediger Meier2016-03-134-6/+10
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: improve skipping of old btrfs-toolsRuediger Meier2016-03-132-67/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: remove invalid argument in libmount/debugRuediger Meier2016-03-131-2/+2
| | | | | | | | | | | | | | | | This was usually no problem because of unsafe strtoul(3) usage in test prog libmount/src/init.c. But musl's strtoul sets errno if no digit was found in the argument. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: make libmount/lock optionalKarel Zak2016-03-141-0/+2
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: don't compare btrfs mount optionsKarel Zak2016-03-082-6/+15
| | | | | | | | | | | | We don't control mount options in the mountinfo file and the options depend on kernel version. It does not make sense to hardcode the options in the expected outputs. Note that libmount should be portable enough to be able to work with all kernel versions. It seems better to check libmount functionality than kernel mount options formatting. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: don't skip case "output undefined"Ruediger Meier2016-03-072-53/+52Star
| | | | | | | | | | | | | | | | | | | | | | | | Treat missing expected files as empty and let the test fail if there is non-empty output. Expected output may be missing in these cases: 1. forgot to commit the file after changing/adding a (sub)test 2. a bug in a test where we do tricks with TS_EXPECTED 3. and most notable if ts_die() is called before a subtest is initialized, e.g. in ts_scsi_debug_init() I always wondered why we don't treat this as FAILED. Now we do so, ts_finalize and ts_gen_diff looks much cleaner now. The change discovers that tests with subtest were ignoring the "non-sub" expected files which had to be fixed. BTW we removed any zero sized files. Moreover now we respect diff's return value. In past all test succeeded when diff was not able to write to diffdir, e.g. when running tests as normal user after they run as root. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: no more sleep, udevadm settle onlyRuediger Meier2016-01-054-4/+0Star
| | | | | | This seems to work nowadays and saves 37s. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: skip nonroot before checking for progs in PATHRuediger Meier2015-12-106-6/+12
| | | | | | | | | | 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: add very long mount line to libmount mtabKees Cook2015-08-271-0/+1
| | | | | | | | Very long mount lines from the kernel (either from escaping or from giant option lists) could exceed BUFSIZ, leading to parsing failures. This adds a test for the condition. Signed-off-by: Kees Cook <keescook@chromium.org>
* Merge branch 'tests-refactor-loop-cleanup' of ↵Karel Zak2015-04-224-6/+6
|\ | | | | | | | | | | | | | | | | | | | | https://github.com/rudimeier/util-linux * 'tests-refactor-loop-cleanup' of https://github.com/rudimeier/util-linux: tests: never use -o pipefail tests: loop tests, don't call ts_die() with DEVICE parameter tests: scsi_debug tests, don't call ts_die() with DEVICE parameter tests: introduce TS_LOOP_DEVS for cleanup tests: introduce ts_cleanup_on_exit()
| * tests: scsi_debug tests, don't call ts_die() with DEVICE parameterRuediger Meier2015-04-144-6/+6
| | | | | | | | | | | | This was almost useless anyway. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: config.h lives in build directoryRuediger Meier2015-04-222-2/+2
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: make libmount python context tests sensitive to ↵Karel Zak2015-04-141-21/+29
| | | | | | | | | | | | USE_LIBMOUNT_FORCE_MOUNTINFO Signed-off-by: Karel Zak <kzak@redhat.com>
* | tests: make libmount context tests sensitive to USE_LIBMOUNT_FORCE_MOUNTINFOKarel Zak2015-04-141-21/+29
|/ | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: avoid &>> for bash compatibilityRuediger Meier2015-03-261-5/+5
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* libmount: cleanup fs root detection codeKarel Zak2015-03-101-12/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: mark python libmount tests known to fail with AddressSanitizerSami Kerola2014-11-184-1/+17
| | | | | | | | | | | | | | | The tests fail with an error similar to this. Traceback (most recent call last): File "/home/src/util-linux/libmount/python/test_mount_tab_update.py", line 7, in <module> import pylibmount as mnt ImportError: /home/src/util-linux/.libs/libuuid.so.1: undefined symbol: __asan_option_detect_stack_use_after_return It might be possible to build ASAN-DSO and set LD_PRELOAD, but this solution is not officially supported. See the reference for details. Reference: https://code.google.com/p/address-sanitizer/wiki/AsanAsDso Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: add debug testsOndrej Oprala2014-08-131-0/+30
| | | | | Signed-off-by: Karel Zak <kzak@redhat.com> Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* tests: fix python tests for dist and out-of-tree buildsRuediger Meier2014-06-045-2/+7
| | | | | | | | | - add python helper scripts to the dist - helper scripts are always in srcdir - python libs are in builddir - abort tests if helpers are missing Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>