aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-07-12 14:47:10 +0200
committerOliver Smith <osmith@sysmocom.de>2019-07-16 11:11:25 +0200
commit31bd00fbd720de808bb00c793264672af32807dc (patch)
treec7eb6e8598e0cb56d4c6a6cceef2e64de45c7072
parentfe43e81c4b4578991c1ed6ddf7400e934074fcc5 (diff)
debian-repo-install-test: run systemd servicesosmith/repo-install-test
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
-rwxr-xr-xdebian-repo-install-test/jenkins.sh5
-rwxr-xr-xdebian-repo-install-test/testdata/repo-install-test.sh56
2 files changed, 60 insertions, 1 deletions
diff --git a/debian-repo-install-test/jenkins.sh b/debian-repo-install-test/jenkins.sh
index 268c0c3..90b1250 100755
--- a/debian-repo-install-test/jenkins.sh
+++ b/debian-repo-install-test/jenkins.sh
@@ -11,7 +11,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" \
@@ -22,6 +24,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 &
sleep 1
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