lasso/tests/scripts/run_upstream_python_binding.sh
Tomas Halman c5d8760d42 Add upstream python binding tests
Related: rhbz#2117590
2022-11-09 14:36:54 +01:00

31 lines
633 B
Bash

#!/bin/bash
export TOP_SRCDIR="../source"
PB_DIR="bindings/python"
die () {
echo "$1" >&2
exit 1
}
# rename lasso.py to be sure that we test the installed one
find $TOP_SRCDIR/$PB_DIR -maxdepth 1 -name "*.py" -exec mv {} {}.backup \;
# run the tests
TESTS="tests/binding_tests.py tests/profiles_tests.py"
for t in $TESTS; do
echo -n "Test $t ... "
python3 "${TOP_SRCDIR}/${PB_DIR}/${t}" >"${TOP_SRCDIR}/${PB_DIR}/${t}.log" 2>&1
RET=$?
if [ $RET = 0 ]; then
echo "ok"
else
echo "failed"
cat "${TOP_SRCDIR}/${PB_DIR}/${t}.log"
die "Test ${t} failed"
fi
done
exit 0