- 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>
Use the shell special variable "$@" instead of the inferior $* to
execute the test command in ts_valgrind. The expansion of "$@" respects
proper word splitting and makes it possible to pass the command empty
arguments. It might also prevent surprises with quoting in corner
cases.
Tested that `make check` passes.
Valgrind run with `make check TS_OPTS='--nonroot --memcheck'` passes.
Signed-off-by: Filipe Brandenburger <filbranden@google.com>
We don't sleep anymore since 01b38917. This does not work
on Debian 7 (wheezy)/linux-3.2. Is it the kernel's or udev's
fault?
We simmply add a better sleep again plus some todos for later
improvements.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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>
This is to force the one-line results also for non-parallel case.
We are using it for travis auto-build and on other build farms.
Moreover you can set this (and any other) option globally by env
which is the only way to pass it to make distcheck.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Like in non-parallel case we are printing only one line per
(sub)test now. The output lines must contain the full test name
to be useful.
This patch does not change anything for the non-parallel output
format except a bit code cleanup.
BTW changed blkid/low-probe test description to have shorter
lines.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
These two problems should be fixed now:
- BSD awk only accepts 1-char field seperator
- ts_has_option() did not returned "yes" if an option was given
multiple times
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
It's a pity a pity that we have to remove it. In past our test suite
could discover a kernel bug (4.4). But now they've changed optimal
iosizes on purpose.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Since we have dropped some more hardcoded search paths we should
make sure that our tested binaries would use the right helpers
from our build directory.
See 07b51567 and follow-up commits.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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>
ts_cleanup_on_exit() is always called on exit, e.g. after ts_skip,
ts_die, ts_finalize ...
A first usage example is the cleanup of TS_SUID_PROGS which is now also done
on ts_skip. Later we want to fix some left loop devices.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* 'tests-logger' of https://github.com/rudimeier/util-linux:
travis: install socat >= 1.7.2
tests: add subtests for invalid logger devive
tests: logger/errors does not use --no-act
tests: logger, validate written socket data
tests: logger with socat device
tests: simplify common logger options
logger: --stderr and --no-act turn "auto-errors" on
It can be hard to check for loop support (e.g. on LXC containers). Let
the user skip it manually by env:
TS_OPT_FEAT_SKIP_LOOP="yes"
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
For one, replace the puzzlingly stern imperative "IGNORE" with
the simple and light-hearted and descriptive "SKIPPED".
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
LD_LIBRARY_PATH must be preserved like it's done in libtool's
temporary wrapper scripts.
This problem was noticed when building with Intel's icc (15.0.0):
$ make check TS_OPTS="libmount"
$ tail tests/diff/libmount/tabfiles-py-parse-mtab
[...]
+Traceback (most recent call last):
+ File "/tmp/util-linux/libmount/python/test_mount_tab.py", line 8, in <module>
+ import pylibmount as mnt
+ImportError: libimf.so: cannot open shared object file: No such file or directory
... although libimf.so was in LD_LIBRARY_PATH.
NOTE 1:
When running root checks "sudo -E" is not enough to preserve
LD_LIBRARY_PATH because glibc already removes is. This would work:
$ sudo -E env LD_LIBRARY_PATH=$LD_LIBRARY_PATH make check TS_OPTS="--parallel=1"
NOTE 2:
We also preserve PYTHONPATH which could bring us similar problems if
the user has a customized python installation.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
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 a98de9696e
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>
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>
- 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>
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>
* '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
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>
* '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
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>
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>
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>
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>