From b3ec7af1d12bf8300d9978a28cd1355e391eaa56 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Wed, 22 Jul 2020 15:43:16 +0300 Subject: [PATCH] Set BACKEND=osbuild-composer if running that test scenario - this will execute cli sanity tests in parallel with the other - make sure to pass BACKED to vm.install too - more checks in lib.sh Cherry-picked from cc29b996591d74e05c31a9b28febbef75713055e Related: rhbz#1825190 --- Makefile | 2 +- test/run | 18 +++++++++++------- tests/cli/lib/lib.sh | 4 ++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 5620f405..d529f9b7 100644 --- a/Makefile +++ b/Makefile @@ -125,7 +125,7 @@ $(VM_IMAGE): srpm bots --upload $(CURDIR)/test/vm.install:/var/tmp/vm.install \ --upload $(realpath tests):/ \ --run-command "chmod +x /var/tmp/vm.install" \ - --run-command "cd /var/tmp; /var/tmp/vm.install $$srpm" \ + --run-command "cd /var/tmp; BACKEND=$(BACKEND) /var/tmp/vm.install $$srpm" \ $(TEST_OS) [ -f ~/.config/lorax-test-env ] && bots/image-customize \ --upload ~/.config/lorax-test-env:/var/tmp/lorax-test-env \ diff --git a/test/run b/test/run index f66bdf2c..d2b4d6e2 100755 --- a/test/run +++ b/test/run @@ -4,12 +4,16 @@ export BACKEND="${BACKEND:-lorax-composer}" -make vm - -if [ -n "$TEST_SCENARIO" ]; then - if [ "$TEST_SCENARIO" == "ci" ]; then - test/check-cli TestPylint - fi +if [ "$BACKEND" == "osbuild-composer" ] || [ "$TEST_SCENARIO" == "osbuild-composer" ]; then + rm -rf ./test/images/* + export BACKEND="osbuild-composer" + make BACKEND=osbuild-composer vm else - test/check-cli TestImages + make vm +fi + +if [ "$TEST_SCENARIO" == "ci" ]; then + test/check-cli TestPylint +else + test/check-cli TestImages fi diff --git a/tests/cli/lib/lib.sh b/tests/cli/lib/lib.sh index 474cde61..4afee7a1 100755 --- a/tests/cli/lib/lib.sh +++ b/tests/cli/lib/lib.sh @@ -93,9 +93,9 @@ composer_start() { local rc local params="$@" - if [[ -z "$CLI" || "$CLI" == "./src/bin/composer-cli" ]]; then + if [ "$BACKEND" == "lorax-composer" ] && [[ -z "$CLI" || "$CLI" == "./src/bin/composer-cli" ]]; then ./src/sbin/lorax-composer $params --sharedir $SHARE_DIR $BLUEPRINTS_DIR & - elif [ -n "$params" ]; then + elif [ "$BACKEND" == "lorax-composer" ] && [ -n "$params" ]; then /usr/sbin/lorax-composer $params /var/lib/lorax/composer/blueprints & else # socket stop/start seems to be necessary for a proper service restart