summaryrefslogtreecommitdiffstats
path: root/tests/functions.sh
Commit message (Collapse)AuthorAgeFilesLines
...
* docs: Spelling fixesVille Skyttä2014-11-181-1/+1
| | | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: Fall back on host/getent in ts_resolve_hostAndreas Henriksson2014-07-281-0/+6
| | | | | | | | | | | | | | | | | | | Neither dig or nslookup would be my first option for resolving, so add the host utility of ISC/bind fame and the (slow) getent utility shipped with libc. This extends the conditions introduced in ... commit a98de9696e1a898f925c9154e5693e73aec0779d Author: Ruediger Meier <ruediger.meier@ga-group.nl> Date: Wed Jun 11 19:28:20 2014 +0200 tests: skip some last tests if no dns support ... and should help us not skip certain tests when we have network connection but none of dig or nslookup available. Signed-off-by: Andreas Henriksson <andreas@fatal.se>
* tests: add function to change directory reliable waySami Kerola2014-07-181-0/+14
| | | | | | | | | Without arguments bash cd will move to $HOME. Ensure also that when directory is assumed to be changed the current directory and intented destination are the same location. Reference: http://www.spinics.net/lists/util-linux-ng/msg09509.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tests: skip some last tests if no dns supportRuediger Meier2014-06-121-0/+17
| | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix python tests for dist and out-of-tree buildsRuediger Meier2014-06-041-3/+3
| | | | | | | | | - 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>
* tests: ts_scsi_debug_init skip instead of dieRuediger Meier2014-05-271-6/+14
| | | | | | | | | | | | | | | If any of these modprobe commands fails then it's not a broken test. ALso ts_die often does not work correctly from subtests which should be fixed someday too. BTW modprobe dry-run (even the real modprobe) is not reliable. Moreover now we respect blacklisted modules (-b). This error handling is not only useful to let the test-suite succeed on broken systems but also to not fail all "scsi_debug tests" after just one of them failed to umount something. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Merge branch 'tests-mount' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-161-0/+24
|\ | | | | | | | | | | | | | | * 'tests-mount' of https://github.com/rudimeier/util-linux: tests: use ts_mount for cramfs tests: ts_mount knows which fs is expected tests: ts_mount validates error message tests, add function ts_mount
| * tests: ts_mount knows which fs is expectedRuediger Meier2014-05-161-1/+3
| | | | | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: ts_mount validates error messageRuediger Meier2014-05-161-3/+9
| | | | | | | | | | | | | | Skip only if mount reports a non-empty fs which is not available in /proc/filesystems. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests, add function ts_mountRuediger Meier2014-05-161-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to generalize mounts similar to how we do it already in minix/mkfs. Currently most of our other checks just fail if "fs not supported". Note that the new function checks a bit stronger than before in minix/mkfs. It respects mount's return value and stderr goes to $TS_OUTPUT too. It's a bit ugly that we write to $TS_OUTPUT from inside of the function. But if the caller would do it then we couldn't ts_skip and the whole function would be pointless. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: add function ts_check_progRuediger Meier2014-05-151-0/+5
|/ | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* Merge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linuxKarel Zak2014-05-141-13/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux: travis-ci: enable root checks travis-ci: minor cleanup and speedup tests: introduce TS_CMD_UUIDGEN (never use installed one) tests, don't write TS_DEVICE to stdout anymore tests: ts_scsi_debug_init must not run in a subshell tests: cleanup ts_scsi_debug_init tests: some more tests need loop support tests: ts_device_init requires loop support tests: use ts_check_losetup in losetup test tests: add function ts_check_losetup tests: ts_device_init remove useless error handling
| * tests, don't write TS_DEVICE to stdout anymoreRuediger Meier2014-05-131-1/+0Star
| |
| * tests: cleanup ts_scsi_debug_initRuediger Meier2014-05-131-6/+7
| | | | | | | | | | | | | | | | Sort out global and local vars. Now we set TS_DEVICE globally to be use later. Skip really quiet if modprobe fails. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: add function ts_check_losetupRuediger Meier2014-05-131-0/+12
| | | | | | | | | | | | Unfortunately losetup -f does not return an error nowadays. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
| * tests: ts_device_init remove useless error handlingRuediger Meier2014-05-121-7/+4Star
| | | | | | | | | | | | | | Don't know why we should deinit the empty string. This patch prepares further refactoring or error handling. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* | tests: fix "KNOWN FAILED" for subtestsRuediger Meier2014-05-131-15/+12Star
|/ | | | | | | | | It didn't worked for tests with subtests. Here we consolidate both cases which fixes the issue by the way. This is basically a rewrite of 7641ccec. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: add exit case "KNOWN FAILED"Ruediger Meier2014-05-121-0/+13
| | | | | | | | | | | Now we can mark tests as known to be broken without bothering users with exit failure. In the build log this "KNOWN FAILED" may be interpreted as TODO ;) The main advantage of "known-fail" instead of just skipping is that we will still find the test diff. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: fix var namesRuediger Meier2014-05-101-2/+5
| | | | | | | Translate "." and "-" to "_". We assume that nobody will add completely stupid test file names. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: allow test options to be overridden by envRuediger Meier2014-05-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | Specially for automated builds the user may want to have some fine granulated influence like export TS_OPT_libmount_verbose="yes" export TS_OPT_ipcs_fake="yes" export TS_OPT_ipcs_limits2_fake="no" if <big endian> then export TS_OPT_hexdump_fake="yes" fi make check Even for interactive developers this could be useful for example to debug just one particuar test while having a regular run with stress: TS_OPT_script_verbose="yes" \ TS_OPT_script_memcheck="yes" \ ../tests/run.sh --parallel=256 --srcdir=.. --builddir=. --nonroot Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: call ts_init_env as early as possibleRuediger Meier2014-05-101-7/+8
| | | | | | | Soon we want to use some env vars within ts_has_option(). That's why we move some lines to make this possible. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* tests: check commands needed for running a test existSami Kerola2014-03-071-2/+7
| | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: make tests to run parallelSami Kerola2014-02-171-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Unarguably this change makes test output to be more messy, but when I compare run time tells with clear numbers parallel is quicker. For me the quickness is important factor. Running test suite always after a change is preferrably quick, and if something is indicated to be broken it is ok to spend time in drilling down what happen. $ time ./tests/run.sh --parallel=5 [...] real 1m48.037s Same without parallelization. $ time ./tests/run.sh real 3m16.687s The default is changed to be parallel, where job count is same as number of CPUs. [kzak@redhat.com: - propagate --parallel into function.sh - don't use extra title for non-parallel execution - disable by default] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: avoid executing dirname(1) commandSami Kerola2014-02-171-1/+1
| | | | | | Bash parameter expansion does the same thing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* testsL fix py<libname> checkKarel Zak2013-10-031-1/+1
| | | | | Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* pylibmount: rewrite to be py2/py3 universalOndrej Oprala2013-09-201-0/+5
| | | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: refresh fdisk testsKarel Zak2013-09-181-5/+8
|
* tests: minor changes to make tests more portableKarel Zak2013-08-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: consolidate Py tests initializationKarel Zak2013-08-191-0/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: consolidate scsi_debug usageKarel Zak2013-04-121-1/+26
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: make compatible with autotoolsKarel Zak2012-08-031-4/+26
| | | | | | | | | | | | | | | | The command 'make check' is called from 'make distcheck' (which is used to generate official util-linux tarballs). It means that tests/ stuff has to be compatible with autotools and differentiate between source and build directories. * remove run-nonroot.sh (merged into run.sh * remove commands.sh.in * all tests and top level run.sh accept --builddir and --srcdir command line options * functions.sh modified to use $top_builddir/tests for output files Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: cleanup ts_is_mountedBernhard Voelker2012-07-311-3/+0Star
| | | | | | | * tests/functions.sh (ts_is_mounted): Remove check for canonicalization failure again, because it is now done by ts_canonicalize. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* tests: remove lt- prefixesKarel Zak2012-07-301-0/+3
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: more robust symlinks usageKarel Zak2012-07-301-1/+14
| | | | | Reported-by: Bernhard Voelker <mail@bernhard-voelker.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: search mount point in canonicalized form in /proc/mountsBernhard Voelker2012-07-301-1/+4
| | | | | | | | | | | | * tests/functions.sh (ts_is_mounted): Enhance to resolve symlinks in given mount point before grep'ing in /proc/mount. If the test directory is on a symlink, then e.g. tests/ts/cramfs/doubles failed because the kernel keeps the mount entry in a canonicalized form in /proc/mounts while this function searched for it with the original path name. Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
* tests: remove LD_LIBRARY_PATH from swapon testsKarel Zak2012-04-181-15/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: make output and diff dirs usage more robustKarel Zak2012-02-281-3/+12
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add infrastructure for valgrindKarel Zak2012-01-261-3/+34
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add build-sys regression testKarel Zak2011-11-041-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: fix options evaluation, add support for optional testsKarel Zak2011-11-031-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: update fdisk and blkid MD testsFrancesco Cosoleto2011-08-301-0/+1
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* tests: add ts_fdisk_clean function to make fdisk output comparableFrancesco Cosoleto2011-08-301-0/+7
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* tests: improve libmount context mount and umount testKarel Zak2011-01-031-3/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: improve subtests initializationKarel Zak2011-01-031-9/+23
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-301-4/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add blkid tests for RAID1Karel Zak2010-05-031-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use POSIX localeYann Droneaud2010-03-311-1/+6
| | | | | | | Since not everyone have en_US.UTF-8 locale, default to POSIX locale. This changes default sort order, so some expected results were updated. Signed-off-by: Yann Droneaud <yann@droneaud.fr>
* tests: add fdisk alignment testsKarel Zak2010-02-091-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: remove vol_id from testsKarel Zak2009-12-041-37/+3Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: swapon workaround for libtool wrapperKarel Zak2009-10-131-1/+2
| | | | | | | | | | 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>