Change in docker-playground[master]: debian-repo-install-test: new binary package test

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
Mon Sep 10 12:44:05 UTC 2018


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/10862


Change subject: debian-repo-install-test: new binary package test
......................................................................

debian-repo-install-test: new binary package test

Installs all packages from the Debian repository into a plain
debian:stretch container. The list of packages is automatically
generated with aptitude, so the job does not need to be changed
for every new package.

The feed ("latest", "nightly") can be specified with the FEED
environment variable in the jenkins.sh (defaults to nightly).

Change-Id: I0f0a8b4f0ccd706cd1af98fe25accd6fd410e007
Relates: OS#3176
---
A debian-repo-install-test/jenkins.sh
A debian-repo-install-test/testdata/Release.key
A debian-repo-install-test/testdata/repo-install-test.sh
3 files changed, 90 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground refs/changes/62/10862/1

diff --git a/debian-repo-install-test/jenkins.sh b/debian-repo-install-test/jenkins.sh
new file mode 100755
index 0000000..8c497bf
--- /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" \
+		--entrypoint "/testdata/repo-install-test.sh" \
+		--name "${BUILD_TAG}" \
+		-e FEED="$FEED" \
+		$extra_args \
+		debian:stretch
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 (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o-install-test/testdata/repo-install-test.sh
new file mode 100755
index 0000000..b1585db
--- /dev/null
+++ b/debian-repo-install-test/testdata/repo-install-test.sh
@@ -0,0 +1,52 @@
+#!/bin/sh -e
+
+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_all_repo_packages() {
+	echo "Installing all repository packages"
+
+	# Reference for aptitude search patterns:
+	# https://www.debian.org/doc/manuals/aptitude/ch02s04s05.en.html
+	aptitude search -F%p \
+		"?origin($OBS) ?architecture(native)" > /data/osmocom_packages.txt
+
+	apt install -y $(cat /data/osmocom_packages.txt)
+}
+
+finish() {
+	echo "Test finished successfully!"
+	if [ -t 0 ]; then
+		echo "Dropping to interactive shell"
+		bash
+	fi
+}
+
+check_env
+install_depends
+configure_osmocom_repo
+install_all_repo_packages
+finish

-- 
To view, visit https://gerrit.osmocom.org/10862
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f0a8b4f0ccd706cd1af98fe25accd6fd410e007
Gerrit-Change-Number: 10862
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180910/7d00beea/attachment.htm>


More information about the gerrit-log mailing list