summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
401bbf4)
Have pytest scan the wvtest output for skip messages, and for now,
treat the whole test as skipped if we find any. This means that
for now WVSKIP can only be used as an up-front guard, but that's all
we need in most cases.
This should help make it more likely that we'll notice when tests are
unexpectedly skipped.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
12 files changed:
out = p.communicate()[0]
sys.stdout.flush()
byte_stream(sys.stdout).write(out)
out = p.communicate()[0]
sys.stdout.flush()
byte_stream(sys.stdout).write(out)
- failures = [line for line in out.splitlines()
+ lines = out.splitlines()
+ for line in lines:
+ if line.startswith(b'!') and line.lower().endswith(b' skip ok'):
+ pytest.skip(line.decode('ascii'))
+ return
+ failures = [line for line in lines
if (line.startswith(b'!')
and line.lower().endswith(b' failed'))]
if failures or p.returncode != 0:
if (line.startswith(b'!')
and line.lower().endswith(b' failed'))]
if failures or p.returncode != 0:
root_status="$(dev/root-status)" || exit $?
if ! bup-python -c 'import fuse' 2> /dev/null; then
root_status="$(dev/root-status)" || exit $?
if ! bup-python -c 'import fuse' 2> /dev/null; then
- WVSTART 'unable to import fuse; skipping test'
+ WVSKIP 'unable to import fuse; skipping test'
exit 0
fi
if test -n "$(type -p modprobe)" && ! modprobe fuse; then
exit 0
fi
if test -n "$(type -p modprobe)" && ! modprobe fuse; then
- echo 'Unable to load fuse module; skipping dependent tests.' 1>&2
+ WVSKIP 'Unable to load fuse module; skipping dependent tests.'
exit 0
fi
if ! fusermount -V; then
exit 0
fi
if ! fusermount -V; then
- echo 'skipping FUSE tests: fusermount does not appear to work'
+ WVSKIP 'skipping FUSE tests: fusermount does not appear to work'
exit 0
fi
if ! groups | grep -q fuse && test "$root_status" != root; then
exit 0
fi
if ! groups | grep -q fuse && test "$root_status" != root; then
- echo 'skipping FUSE tests: you are not root and not in the fuse group'
+ WVSKIP 'skipping FUSE tests: you are not root and not in the fuse group'
set -o pipefail
if ! [ "$(type -p duplicity)" != "" ]; then
set -o pipefail
if ! [ "$(type -p duplicity)" != "" ]; then
- # FIXME: add WVSKIP.
- echo "Cannot find duplicity; skipping test)" 1>&2
+ WVSKIP 'Cannot find duplicity; skipping test)'
bup() { "$top/bup" "$@"; }
if ! [ "$(type -p rdiff-backup)" != "" ]; then
bup() { "$top/bup" "$@"; }
if ! [ "$(type -p rdiff-backup)" != "" ]; then
- # FIXME: add WVSKIP.
- echo "Cannot find rdiff-backup; skipping test)" 1>&2
+ WVSKIP 'Cannot find rdiff-backup; skipping test)'
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
- echo 'Not root: skipping --check-device tests.'
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'Not root: skipping --check-device tests.'
+ exit 0
fi
if test -n "$(type -p modprobe)" && ! modprobe loop; then
fi
if test -n "$(type -p modprobe)" && ! modprobe loop; then
- echo 'Unable to load loopback module; skipping --check-device test.' 1>&2
+ WVSKIP 'Unable to load loopback module; skipping --check-device test.'
exit 0
fi
if test -z "$(type -p losetup)"; then
exit 0
fi
if test -z "$(type -p losetup)"; then
- echo 'Unable to find losetup: skipping --check-device tests.' 1>&2
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'Unable to find losetup: skipping --check-device tests.'
+ exit 0
fi
if test -z "$(type -p mke2fs)"; then
fi
if test -z "$(type -p mke2fs)"; then
- echo 'Unable to find mke2fs: skipping --check-device tests.' 1>&2
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'Unable to find mke2fs: skipping --check-device tests.'
+ exit 0
fi
WVSTART '--check-device'
fi
WVSTART '--check-device'
if ! modprobe loop; then
echo 'Unable to load loopback module; skipping dependent tests.' 1>&2
if ! modprobe loop; then
echo 'Unable to load loopback module; skipping dependent tests.' 1>&2
+ exit 0 # FIXME: allow intermixed WVSKIPs
fi
testfs="$(WVPASS wvmkmountpt)" || exit $?
fi
testfs="$(WVPASS wvmkmountpt)" || exit $?
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
- echo 'Not root: skipping restore --map-* tests.'
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'Not root: skipping restore --map-* tests.'
+ exit 0
fi
top="$(WVPASS pwd)" || exit $?
fi
top="$(WVPASS pwd)" || exit $?
if [ "$pwd_top" = "$tmp_top" ]; then
echo "(running from within /$tmp_top; skipping test)" 1>&2
if [ "$pwd_top" = "$tmp_top" ]; then
echo "(running from within /$tmp_top; skipping test)" 1>&2
+ exit 0 # FIXME: allow intermixed WVSKIPs
fi
D=bupdata.tmp
WVPASS force-delete $D
fi
D=bupdata.tmp
WVPASS force-delete $D
# current filesystem may fail -- i.e. running from
# /foo/ext4/bar/btrfs will fail when bup tries to restore linux
# attrs above btrfs to the restore tree *inside* btrfs.
# current filesystem may fail -- i.e. running from
# /foo/ext4/bar/btrfs will fail when bup tries to restore linux
# attrs above btrfs to the restore tree *inside* btrfs.
+ # FIXME: allow intermixed WVSKIPs
echo "(running from tree with mixed filesystems; skipping test)" 1>&2
exit 0
else
echo "(running from tree with mixed filesystems; skipping test)" 1>&2
exit 0
else
WVPASS dd if=/dev/zero of=test-sparse-probe seek="$data_size" bs=1 count=1
probe_size=$(WVPASS du -k -s test-sparse-probe | WVPASS cut -f1) || exit $?
if [ "$probe_size" -ge "$((data_size / 1024))" ]; then
WVPASS dd if=/dev/zero of=test-sparse-probe seek="$data_size" bs=1 count=1
probe_size=$(WVPASS du -k -s test-sparse-probe | WVPASS cut -f1) || exit $?
if [ "$probe_size" -ge "$((data_size / 1024))" ]; then
- WVSTART "no sparse support detected -- skipping tests"
+ WVSKIP "no sparse support detected -- skipping tests"
if test -z "$(type -p curl)"; then
if test -z "$(type -p curl)"; then
- WVSTART 'curl does not appear to be installed; skipping test'
+ WVSKIP 'curl does not appear to be installed; skipping test'
exit 0
fi
WVPASS bup-cfg-py -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
curl -s --unix-socket ./socket http://localhost/foo
if test $? -ne 7; then
exit 0
fi
WVPASS bup-cfg-py -c "import socket as s; s.socket(s.AF_UNIX).bind('socket')"
curl -s --unix-socket ./socket http://localhost/foo
if test $? -ne 7; then
- WVSTART 'curl does not appear to support --unix-socket; skipping test'
+ WVSKIP 'curl does not appear to support --unix-socket; skipping test'
exit 0
fi
if ! bup-python -c 'import tornado' 2> /dev/null; then
exit 0
fi
if ! bup-python -c 'import tornado' 2> /dev/null; then
- WVSTART 'unable to import tornado; skipping test'
+ WVSKIP 'unable to import tornado; skipping test'
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
root_status="$(dev/root-status)" || exit $?
if [ "$root_status" != root ]; then
- WVSTART 'not root: skipping tests'
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'not root: skipping tests'
+ exit 0
fi
if ! modprobe loop; then
fi
if ! modprobe loop; then
- WVSTART 'unable to load loopback module; skipping tests' 1>&2
+ WVSKIP 'unable to load loopback module; skipping tests'
exit 0
fi
# These tests are only likely to work under Linux for now
# (patches welcome).
if ! [[ $(uname) =~ Linux ]]; then
exit 0
fi
# These tests are only likely to work under Linux for now
# (patches welcome).
if ! [[ $(uname) =~ Linux ]]; then
- WVSTART 'not Linux: skipping tests'
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'not Linux: skipping tests'
+ exit 0
fi
top="$(WVPASS pwd)" || exit $?
fi
top="$(WVPASS pwd)" || exit $?