Add upstream python binding tests

Related: rhbz#2117590
This commit is contained in:
Tomas Halman 2022-11-09 14:36:54 +01:00
parent bd40fa9563
commit c5d8760d42
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,30 @@
#!/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

View File

@ -1,5 +1,9 @@
- hosts: localhost - hosts: localhost
roles: roles:
- role: standard-test-source
tags:
- always
- role: standard-test-basic - role: standard-test-basic
tags: tags:
- classic - classic
@ -7,6 +11,10 @@
- mod_auth_mellon: - mod_auth_mellon:
dir: scripts dir: scripts
run: ./run_tests.sh run: ./run_tests.sh
- python_binding_tests:
dir: scripts
run: ./run_upstream_python_binding.sh
save-files: ["../source/bindings/python/tests/*.log"]
required_packages: required_packages:
- git - git
- python3-lasso