ceph/src/test/run-cli-tests

23 lines
560 B
Plaintext
Raw Normal View History

#!/bin/sh
set -e
if ! command -v pip >/dev/null; then
echo "$0: PIP not installed, skipping python-using tests." 1>&2
exit 1
fi
SRCDIR="$(dirname "$0")"
VENV="$SRCDIR/virtualenv"
CRAM_BIN="$VENV/bin/cram"
if [ ! -e "$CRAM_BIN" ]; then
pip -E "$VENV" install "$SRCDIR/downloads/cram-0.5.tar.gz"
fi
SRCDIR_ABS="$(readlink -f "$SRCDIR")"
# cram doesn't like seeing the same foo.t basename twice on the same
# run, so run it once per directory
for tool in "$SRCDIR"/cli/*; do
PATH="$SRCDIR_ABS/..:$PATH" "$CRAM_BIN" -v "$@" -- "$tool"/*.t
done