Commit graph

83 commits

Author SHA1 Message Date
Ruediger Meier
15b2606c4f tests: fix python tests for dist and out-of-tree builds
- 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>
2014-06-04 10:14:24 +02:00
Ruediger Meier
f80c0d38b9 tests: ts_scsi_debug_init skip instead of die
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>
2014-05-27 00:06:43 +02:00
Karel Zak
1efded63df Merge branch 'tests-mount' of https://github.com/rudimeier/util-linux
* '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
2014-05-16 14:30:05 +02:00
Ruediger Meier
d2cc2ba722 tests: ts_mount knows which fs is expected
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-16 12:07:26 +02:00
Ruediger Meier
a23c435ea2 tests: ts_mount validates error message
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>
2014-05-16 12:07:03 +02:00
Ruediger Meier
2f95494707 tests, add function ts_mount
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>
2014-05-16 12:06:00 +02:00
Ruediger Meier
d1962aaec6 tests: add function ts_check_prog
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-15 12:00:59 +02:00
Karel Zak
37bc9a51c8 Merge branch 'travis-root-checks-v2' of https://github.com/rudimeier/util-linux
* '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
2014-05-14 14:15:58 +02:00
Ruediger Meier
07d9ed0a40 tests, don't write TS_DEVICE to stdout anymore 2014-05-13 17:38:41 +02:00
Ruediger Meier
dd761f7924 tests: cleanup ts_scsi_debug_init
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>
2014-05-13 17:37:28 +02:00
Ruediger Meier
5ec15aefbb tests: add function ts_check_losetup
Unfortunately losetup -f does not return an error nowadays.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-13 17:36:51 +02:00
Ruediger Meier
733094a851 tests: fix "KNOWN FAILED" for subtests
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>
2014-05-13 15:39:25 +02:00
Ruediger Meier
b5eb509709 tests: ts_device_init remove useless error handling
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>
2014-05-12 16:25:16 +02:00
Ruediger Meier
7641ccec60 tests: add exit case "KNOWN FAILED"
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>
2014-05-12 09:56:08 +02:00
Ruediger Meier
c08863ff72 tests: fix var names
Translate "." and "-" to "_". We assume that nobody will add
completely stupid test file names.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-10 09:08:31 +02:00
Ruediger Meier
eac40eb009 tests: allow test options to be overridden by env
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>
2014-05-10 05:56:43 +02:00
Ruediger Meier
d9a9ff09b8 tests: call ts_init_env as early as possible
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>
2014-05-10 04:59:34 +02:00
Sami Kerola
2f79154639 tests: check commands needed for running a test exist
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-07 11:52:57 +01:00
Sami Kerola
40e6f7a063 tests: make tests to run parallel
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>
2014-02-17 15:01:02 +01:00
Sami Kerola
e130ce53ce tests: avoid executing dirname(1) command
Bash parameter expansion does the same thing.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-17 13:55:41 +01:00
Karel Zak
f48145b500 testsL fix py<libname> check
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-03 16:20:38 +02:00
Ondrej Oprala
464074532c pylibmount: rewrite to be py2/py3 universal
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-20 12:48:53 +02:00
Karel Zak
e1fe1815da tests: refresh fdisk tests 2013-09-18 15:38:33 +02:00
Karel Zak
ef2c9e3f5e tests: minor changes to make tests more portable
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-26 13:48:40 +02:00
Karel Zak
a731b5413b tests: consolidate Py tests initialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 15:35:52 +02:00
Karel Zak
618ec053fe tests: consolidate scsi_debug usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-12 16:36:33 +02:00
Karel Zak
1b03e2cd33 tests: make compatible with autotools
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>
2012-08-03 21:24:51 +02:00
Bernhard Voelker
a6eb85b237 tests: cleanup ts_is_mounted
* 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>
2012-07-31 20:02:05 +02:00
Karel Zak
46949388c6 tests: remove lt- prefixes
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-30 17:43:10 +02:00
Karel Zak
6dfe6f0e82 tests: more robust symlinks usage
Reported-by: Bernhard Voelker <mail@bernhard-voelker.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-30 17:10:38 +02:00
Bernhard Voelker
ee9c04f48c tests: search mount point in canonicalized form in /proc/mounts
* 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>
2012-07-30 15:58:23 +02:00
Karel Zak
f947ae75b6 tests: remove LD_LIBRARY_PATH from swapon tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-18 13:05:55 +02:00
Karel Zak
4210c47adc tests: make output and diff dirs usage more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-28 14:37:45 +01:00
Karel Zak
495674f88d tests: add infrastructure for valgrind
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-26 13:51:38 +01:00
Karel Zak
adc8c80f42 tests: add build-sys regression test
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-04 20:58:21 +01:00
Karel Zak
949cf64bbc tests: fix options evaluation, add support for optional tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-11-03 13:20:24 +01:00
Francesco Cosoleto
41fc17521d tests: update fdisk and blkid MD tests
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-08-30 10:55:13 +02:00
Francesco Cosoleto
d0bcd9b322 tests: add ts_fdisk_clean function to make fdisk output comparable
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2011-08-30 10:54:37 +02:00
Karel Zak
64a2331f6d tests: improve libmount context mount and umount test
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:46 +01:00
Karel Zak
db17c74bc4 tests: improve subtests initialization
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03 12:28:45 +01:00
Karel Zak
601d12fb10 rename util-linux-ng back to util-linux
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-30 11:41:59 +01:00
Karel Zak
e2f092d334 tests: add blkid tests for RAID1
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-03 11:25:20 +02:00
Yann Droneaud
08b825dbea tests: use POSIX locale
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>
2010-03-31 17:02:28 +02:00
Karel Zak
5792255b54 tests: add fdisk alignment tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-02-09 15:47:32 +01:00
Karel Zak
283a8c1598 tests: remove vol_id from tests
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-12-04 20:30:16 +01:00
Karel Zak
d4e0f2f2ad tests: swapon workaround for libtool wrapper
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>
2009-10-13 15:37:49 +02:00
Karel Zak
b8ab374488 tests: don't run some mount tests for non-root users
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-27 15:20:01 +02:00
Karel Zak
35c636e13b tests: add functions for work withdisk images
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-05-19 16:13:09 +02:00
Karel Zak
25c03e5b46 tests: remove unexpected exit from *_subtest functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-11 23:35:22 +01:00
Karel Zak
425ca40aa2 tests: fix the final message for subtests
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-11 23:35:22 +01:00