aboutsummaryrefslogtreecommitdiffstats
path: root/debian-repo-install-test
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2019-07-12 14:47:10 +0200
committerOliver Smith <osmith@sysmocom.de>2019-07-23 14:10:53 +0200
commit4345224fa0dbe6fdd31b9cfb54f005a1c4cee4f4 (patch)
treefbade057ca5f8b9d7e793b91de09c6466c5f92ac /debian-repo-install-test
parent29825bbc71a363b7de96b4c1de5bd9254ffc6f1d (diff)
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
Diffstat (limited to 'debian-repo-install-test')
-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 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