From ac430bd7cfdbdb88bfe4e80d87b5ee2782446f99 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Sun, 20 Oct 2019 22:33:46 +0300 Subject: [PATCH] build/CI/packaging: use python2, if python is not available. This is required to fix cram tests on RHEL 8. --- tests/test_run.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_run.sh b/tests/test_run.sh index a90f533..11de298 100755 --- a/tests/test_run.sh +++ b/tests/test_run.sh @@ -83,4 +83,15 @@ export LUA_PATH . $SBTEST_CONFIG -cram --shell=/bin/bash --verbose $tests +if $(which python >/dev/null 2>&1) +then + PYTHON=python +elif $(which python2 >/dev/null 2&1) +then + PYTHON=python2 +else + echo "Cannot find python interpreter in PATH" + exit 1 +fi + +$PYTHON cram --shell=/bin/bash --verbose $tests