Change in osmo-ci[master]: repo-install-test: add TESTS variable

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Wed Jan 20 13:32:29 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/22334 )


Change subject: repo-install-test: add TESTS variable
......................................................................

repo-install-test: add TESTS variable

Allow to enable only certain tests during development.

Related: OS#4733
Change-Id: I8d817f47d790e4cdc25c5182a0e91b66a00fbf52
---
M scripts/repo-install-test.sh
M scripts/repo-install-test/run-inside-docker.sh
2 files changed, 42 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/34/22334/1

diff --git a/scripts/repo-install-test.sh b/scripts/repo-install-test.sh
index a785b74..71e55d7 100755
--- a/scripts/repo-install-test.sh
+++ b/scripts/repo-install-test.sh
@@ -4,6 +4,7 @@
 # * FEED: binary package feed (e.g. "latest", "nightly")
 # * PROJ: OBS project namespace (e.g. "network:osmocom:latest")
 # * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
+# * TESTS: which tests to run (all by default, see below for possible values)
 . "$(dirname "$0")/common.sh"
 
 # Show usage
@@ -20,6 +21,14 @@
 PROJ="${PROJ:-network:osmocom:$FEED}"
 CONTAINER="$DISTRO-repo-install-test-$FEED"
 
+if [ -z "$TESTS" ]; then
+	TESTS="
+		install_repo_packages
+		test_binaries
+		services_check
+	"
+fi
+
 # Try to run "systemctl status" 10 times, kill the container on failure
 check_if_systemd_is_running() {
 	for i in $(seq 1 10); do
@@ -58,6 +67,7 @@
 		-e FEED="$FEED" \
 		-e PROJ="$PROJ" \
 		-e DISTRO="$DISTRO" \
+		-e TESTS="$TESTS" \
 		-e container=docker \
 		--tmpfs /run \
 		--tmpfs /run/lock \
diff --git a/scripts/repo-install-test/run-inside-docker.sh b/scripts/repo-install-test/run-inside-docker.sh
index b10c97d..79dd3cf 100755
--- a/scripts/repo-install-test/run-inside-docker.sh
+++ b/scripts/repo-install-test/run-inside-docker.sh
@@ -4,6 +4,7 @@
 # * PROJ: OBS project namespace (e.g. "network:osmocom:latest")
 # * KEEP_CACHE: set to 1 to keep downloaded binary packages (for development)
 # * DISTRO: linux distribution  name (e.g. "debian", "centos")
+# * TESTS: which tests to run (see repo-install-test.sh)
 
 # Systemd services that must start up successfully after installing all packages (OS#3369)
 # Disabled services:
@@ -64,6 +65,11 @@
 		echo "ERROR: missing environment variable \$DISTRO!"
 		exit 1
 	fi
+	if [ -n "$TESTS" ]; then
+		echo "Enabled tests: $TESTS"
+	else
+		echo "ERROR: missing environment variable \$TESTS!"
+	fi
 }
 
 # $1: OBS project (e.g. "network:osmocom:nightly")
@@ -244,6 +250,29 @@
 check_env
 configure_keep_cache_${DISTRO}
 configure_osmocom_repo_${DISTRO} "$PROJ"
-install_repo_packages_${DISTRO}
-test_binaries
-services_check
+
+for test in $TESTS; do
+	set +x
+	echo
+	echo "### Running test: $test ###"
+	echo
+	set -x
+
+	case "$test" in
+		install_repo_packages)
+			install_repo_packages_${DISTRO}
+			;;
+		test_binaries)
+			# install_repo_packages must run first!
+			test_binaries
+			;;
+		services_check)
+			# install_repo_packages must run first!
+			services_check
+			;;
+		*)
+			echo "ERROR: unknown test: $test"
+			exit 1
+			;;
+	esac
+done

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/22334
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I8d817f47d790e4cdc25c5182a0e91b66a00fbf52
Gerrit-Change-Number: 22334
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210120/5268e912/attachment.htm>


More information about the gerrit-log mailing list