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:
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
- 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
- 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
- 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'
exit 0
fi
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)'
exit 0
fi
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)'
exit 0
fi
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
- 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
- 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
- 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'
if ! modprobe loop; then
echo 'Unable to load loopback module; skipping dependent tests.' 1>&2
- exit 0
+ exit 0 # FIXME: allow intermixed WVSKIPs
fi
testfs="$(WVPASS wvmkmountpt)" || exit $?
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 $?
if [ "$pwd_top" = "$tmp_top" ]; then
echo "(running from within /$tmp_top; skipping test)" 1>&2
- exit 0
+ exit 0 # FIXME: allow intermixed WVSKIPs
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.
- # FIXME: add WVSKIP
+ # FIXME: allow intermixed WVSKIPs
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
- WVSTART "no sparse support detected -- skipping tests"
+ WVSKIP "no sparse support detected -- skipping tests"
exit 0
fi
WVPASS cd "$tmpdir"
-# FIXME: add WVSKIP
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
- 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
- WVSTART 'unable to import tornado; skipping test'
+ WVSKIP 'unable to import tornado; skipping test'
exit 0
fi
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
- 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
- WVSTART 'not Linux: skipping tests'
- exit 0 # FIXME: add WVSKIP.
+ WVSKIP 'not Linux: skipping tests'
+ exit 0
fi
top="$(WVPASS pwd)" || exit $?