lorax/tests/test_cli.sh
Alexander Todorov 8e0b7ba2ca Execute bash tests for composer-cli
these are built on top of beakerlib and we use its internal
protocol to figure out the result without relying on the full
test runner that is tipically used inside of a RHEL environment!

Includes a disabled test snippet for Issue #460
2018-09-20 16:07:57 +03:00

28 lines
750 B
Bash
Executable File

#!/bin/bash
# Note: execute this file from the project root directory
# setup
export TESTRESULT_BEAKERLIB_DIR=`mktemp -d /var/tmp/beakerlib-composer-XXXXXX`
export top_srcdir=`pwd`
. ./tests/testenv.sh
# start the lorax-composer daemon
./src/sbin/lorax-composer ./tests/pylorax/blueprints/ &
# wait for the backend to become ready
until curl --unix-socket /run/weldr/api.socket http://localhost:4000/api/status | grep '"db_supported":true'; do
sleep 2
echo "DEBUG: Waiting for backend API to become ready before testing ..."
done;
# invoke cli/ tests
./tests/cli/test_blueprints_sanity.sh
# look for failures
grep RESULT_STRING $TESTRESULT_BEAKERLIB_DIR/TestResults | grep -v PASS && exit 1
# explicit return code for Makefile
exit 0