From 4345224fa0dbe6fdd31b9cfb54f005a1c4cee4f4 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 12 Jul 2019 14:47:10 +0200 Subject: debian-repo-install-test: run systemd services Run systemd services of Osmocom programs, to check if any are not starting properly. Use a whitelist to determine which services must start up, because some are currently broken. Modify the docker run command to support changing the CPU scheduling policy/priority in systemd service files (used by osmo-bts). Related: OS#3369 Change-Id: Ie6385f85560fefa7e7c9dca72cb5e2e914d4507a --- debian-repo-install-test/jenkins.sh | 5 +- .../testdata/repo-install-test.sh | 56 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/debian-repo-install-test/jenkins.sh b/debian-repo-install-test/jenkins.sh index fbae4b9..c0c38c5 100755 --- a/debian-repo-install-test/jenkins.sh +++ b/debian-repo-install-test/jenkins.sh @@ -26,7 +26,9 @@ if [ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER" 2> /dev/null)" = "tr fi # Run the container -# Note that this does not output anything. For debugging, add -it and remove &. +# * This does not output anything, for debugging add -it and remove &. +# * /run, /tmp, cgroups, SYS_ADMIN: needed for systemd +# * SYS_NICE: needed for changing CPUScheduling{Policy,Priority} (osmo-bts systemd service files) docker run --rm \ -v "$PWD/testdata:/testdata:ro" \ -v "$VOL_BASE_DIR:/data" \ @@ -37,6 +39,7 @@ docker run --rm \ --tmpfs /tmp \ -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ --cap-add SYS_ADMIN \ + --cap-add SYS_NICE \ "$REPO_USER/debian-repo-install-test" \ /lib/systemd/systemd & check_if_systemd_is_running diff --git a/debian-repo-install-test/testdata/repo-install-test.sh b/debian-repo-install-test/testdata/repo-install-test.sh index 38a982f..e2cedd2 100755 --- a/debian-repo-install-test/testdata/repo-install-test.sh +++ b/debian-repo-install-test/testdata/repo-install-test.sh @@ -1,5 +1,31 @@ #!/bin/sh -ex +# Systemd services that must start up successfully after installing all packages (OS#3369) +# Disabled services: +# * osmo-ctrl2cgi (missing config: /etc/osmocom/ctrl2cgi.ini) +# * osmo-trap2cgi (missing config: /etc/osmocom/%N.ini) +# * osmo-sgsn (port 2123 already used by osmo-ggsn) +# * osmo-pcu (expects missing /tmp/pcu_bts socket) +# * osmo-hnbgw (tries to listen on 10.23.24.1) +# * osmo-bts-virtual (unit_id is not matching osmo-bsc's config) +SERVICES=" + osmo-bsc + osmo-gbproxy + osmo-ggsn + osmo-gtphub + osmo-hlr + osmo-mgw + osmo-msc + osmo-pcap-client + osmo-sip-connector + osmo-stp +" +# Services working in nightly, but not yet in latest +# * osmo-pcap-server: service not included in osmo-pcap 0.0.11 +SERVICES_NIGHTLY=" + osmo-pcap-server +" + HTTP="http://download.opensuse.org/repositories/network:/osmocom:/$FEED/Debian_9.0/" OBS="obs://build.opensuse.org/network:osmocom:$FEED/Debian_9.0" @@ -80,7 +106,37 @@ test_binaries() { osmo-trx-usrp1 } +services_check() { + local service + local services_feed="$SERVICES" + local failed="" + + if [ "$FEED" = "nightly" ]; then + services_feed="$services_feed $SERVICES_NIGHTLY" + fi + + systemctl start $services_feed + sleep 2 + + for service in $services_feed; do + if ! systemctl --no-pager -l status $service; then + failed="$failed $service" + fi + done + + systemctl stop $services_feed + + if [ -n "$failed" ]; then + set +x + echo + echo "ERROR: services failed to start: $failed" + echo + exit 1 + fi +} + check_env configure_osmocom_repo install_repo_packages test_binaries +services_check -- cgit v1.2.3