diff options
author | Oliver Smith <osmith@sysmocom.de> | 2018-09-10 11:13:46 +0200 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2018-09-19 16:08:51 +0200 |
commit | 8b5ad120bbeb61abad4a1df646dc8deef2c8fb4e (patch) | |
tree | a5fb114ff1ef2560bcce10487dbe2dd7a910be9d | |
parent | 9a80e4f09574bc21cb08585710865258255963f4 (diff) |
debian-repo-install-test: new binary package test
Installs most packages from the Osmocom Debian repository into a plain
debian:stretch container and call the osmo-* binaries with --version
(or -h).
The list of packages is automatically generated with aptitude, so the
job does not need to be changed for every new package. There's also a
new blacklist.txt file with a list of packages, that will not be
installed in this test. Currently, this is filled with all packages
built from the legacy openbsc.git project (some of them are
conflicting with newer repositories) and the soapysdr packages (see
OS#3541).
The feed ("latest", "nightly") can be specified with the FEED
environment variable, it gets read by jenkins.sh (defaults to nightly).
Change-Id: I0f0a8b4f0ccd706cd1af98fe25accd6fd410e007
Relates: OS#3176
-rwxr-xr-x | debian-repo-install-test/jenkins.sh | 18 | ||||
-rw-r--r-- | debian-repo-install-test/testdata/Release.key | 20 | ||||
-rw-r--r-- | debian-repo-install-test/testdata/blacklist.txt | 25 | ||||
-rwxr-xr-x | debian-repo-install-test/testdata/repo-install-test.sh | 85 |
4 files changed, 148 insertions, 0 deletions
diff --git a/debian-repo-install-test/jenkins.sh b/debian-repo-install-test/jenkins.sh new file mode 100755 index 0000000..9dd4565 --- /dev/null +++ b/debian-repo-install-test/jenkins.sh @@ -0,0 +1,18 @@ +#!/bin/sh +. ../jenkins-common.sh + +# Configuration +[ -z "$FEED" ] && FEED="nightly" +interactive="false" + +# Run the container +extra_args="" +[ "$interactive" = "true" ] && extra_args="-it" +docker run --rm \ + -v "$PWD/testdata:/testdata:ro" \ + -v "$VOL_BASE_DIR:/data" \ + --name "${BUILD_TAG}" \ + -e FEED="$FEED" \ + $extra_args \ + debian:stretch \ + "/testdata/repo-install-test.sh" diff --git a/debian-repo-install-test/testdata/Release.key b/debian-repo-install-test/testdata/Release.key new file mode 100644 index 0000000..e656238 --- /dev/null +++ b/debian-repo-install-test/testdata/Release.key @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQENBFJBt/wBCADAht3d/ilNuyzaXYw/QwTRvmjyoDvfXw+H/3Fvk1zlDZoiKPPc +a1wCVBINUZl7vYM2OXqbJwYa++JP2Q48xKSvC6thbRc/YLievkbcvTemf7IaREfl +CTjoYpoqXHa9kHMw1aALDm8CNU88jZmnV7v9L6hKkbYDxie+jpoj7D6B9JlxgNJ4 +5dQyRNsFGVcIl4Vplt1HyGc5Q5nQI/VgS2rlF/IOXmhRQBc4LEDdU8R2IKnkU4ee +S7TWanAigGAQhxGuCkS39/CWzc1DhLhjlNhBl/+RTPejkqJtAy00ZLps3+RqUN1Y +CU/Fsr7aRlYVGqQ/BlptwV0XQ2VVYJX2oEBBABEBAAG0MG5ldHdvcmsgT0JTIFBy +b2plY3QgPG5ldHdvcmtAYnVpbGQub3BlbnN1c2Uub3JnPokBPAQTAQIAJgUCWmMc +aQIbAwUJDEAUbQYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEGLrGgkXKA3fjsoI +ALSXmXzFCpTxg8a6tvXkqddY/qAmeBMNUf7hslI9wN3leNmCrnuHS8TbHWYJZgtw +8M5fKL3aRQYaIiqqm1XOUF0OqwYNDj5V3y38mM68NYOkzgSP7foMwZp9Y0TlGhtI +L8weA+2RUjB4hwwGMAYMqkRZyKW3NhPqdlGGoXac1ilwEyGXFHdOLbkhtyS+P2yb +/EvaKIN5cMLzRZKeYgdp9WuAirV+yV/SDbgvabW098lrWhGLltlRRDQgMV883p8I +ERMI1wlLFZGnHL3mfBWGeQ24M/DaBOdXQDtfBLCJ9nGztmDBUb8i6GFWU7nD2TGi +8mYUsED1ZDwO/0jdvJ4gSluIRgQTEQIABgUCUkG3/AAKCRA7MBG3a51lIzhdAJ9v +d6XPffMZRcCGgDEY5OaTn/MsCQCgrXbeZpFJgnirSrc8rRonvzYFiF4= +=Gvly +-----END PGP PUBLIC KEY BLOCK----- diff --git a/debian-repo-install-test/testdata/blacklist.txt b/debian-repo-install-test/testdata/blacklist.txt new file mode 100644 index 0000000..4d3f7ed --- /dev/null +++ b/debian-repo-install-test/testdata/blacklist.txt @@ -0,0 +1,25 @@ +# These packages will not get explicitly installed in this test. +# Package lines must have nothing but the package (no comment, +# no additional space etc). + +# OpenBSC +# This is legacy, we aren't really interested in testing openbsc.git +# derived packages. Packages are found in openbsc/debian/control. +openbsc-dev +osmo-bsc-mgcp +osmo-bsc-mgcp-dbg +osmocom-bs11-utils +osmocom-bs11-utils-dbg +osmocom-bsc-nat +osmocom-bsc-nat-dbg +osmocom-bsc-sccplite +osmocom-bsc-sccplite-dbg +osmocom-ipaccess-utils +osmocom-ipaccess-utils-dbg +osmocom-nitb +osmocom-nitb-dbg + +# SoapySDR is not used anymore (see OS#3542) +soapysdr-module-lms7 +soapysdr0.6-module-lms7 +soapysdr0.6-module-lms7-dbgsym diff --git a/debian-repo-install-test/testdata/repo-install-test.sh b/debian-repo-install-test/testdata/repo-install-test.sh new file mode 100755 index 0000000..ea1c5fb --- /dev/null +++ b/debian-repo-install-test/testdata/repo-install-test.sh @@ -0,0 +1,85 @@ +#!/bin/sh -ex + +HTTP="http://download.opensuse.org/repositories/network:/osmocom:/$FEED/Debian_9.0/" +OBS="obs://build.opensuse.org/network:osmocom:$FEED/Debian_9.0" + +check_env() { + if [ -n "$FEED" ]; then + echo "Checking feed: $FEED" + else + echo "ERROR: missing environment variable \$FEED!" + exit 1 + fi +} + +install_depends() { + echo "Installing dependencies" + apt-get update + apt-get install -y gnupg aptitude +} + +configure_osmocom_repo() { + echo "Configuring Osmocom repository" + apt-key add /testdata/Release.key + echo "deb $HTTP ./" \ + > /etc/apt/sources.list.d/osmocom-latest.list + apt-get update +} + +install_repo_packages() { + echo "Installing all repository packages" + + # Get a list of all packages from the repository. Reference: + # https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html + aptitude search -F%p \ + "?origin($OBS) ?architecture(native)" | sort \ + > /data/osmocom_packages_all.txt + + # Remove comments from blacklist.txt (and sort it) + grep -v "^#" /testdata/blacklist.txt | sort -u > /data/blacklist.txt + + # Install all repo packages which are not on the blacklist + comm -23 /data/osmocom_packages_all.txt \ + /data/blacklist.txt > /data/osmocom_packages.txt + apt install -y $(cat /data/osmocom_packages.txt) +} + +test_binaries() { + # Make sure the binaries are not broken (run -h or --version) + osmo-bsc --version + osmo-bts-trx --version + osmo-bts-virtual --version + osmo-gbproxy --version + osmo-ggsn --version + osmo-gtphub -h + osmo-hlr --version + osmo-hlr-db-tool --version + osmo-hnbgw --version + osmo-mgw --version + osmo-msc --version + osmo-pcu --version + osmo-sgsn --version + osmo-sip-connector -h + osmo-stp --version + osmo-trx-uhd -h + osmo-trx-usrp1 -h +} + +finish() { + echo "Test finished successfully!" + + # When docker-run is called with "-it", then stdin and a tty are available. + # The container will still exit when the entrypoint script (this file) is + # through, so in order to be able to type in commands, we execute a bash shell. + if [ -t 0 ]; then + echo "Dropping to interactive shell" + bash + fi +} + +check_env +install_depends +configure_osmocom_repo +install_repo_packages +test_binaries +finish |