osmith has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11041 )

Change subject: debian-repo-install-test: UNKNOWN in --version?
......................................................................

debian-repo-install-test: UNKNOWN in --version?

With this patch, the debian-repo-install-test script checks if
the Osmocom programs as installed from the Debian repository have
"UNKNOWN" in their --version output.

Relates: OS#3555
Change-Id: I46f18dc86d3e257c772a6db8539027aad26e24a8
---
M debian-repo-install-test/testdata/repo-install-test.sh
1 file changed, 36 insertions(+), 13 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  osmith: Verified



diff --git a/debian-repo-install-test/testdata/repo-install-test.sh 
b/debian-repo-install-test/testdata/repo-install-test.sh
index ea1c5fb..3ef88e8 100755
--- a/debian-repo-install-test/testdata/repo-install-test.sh
+++ b/debian-repo-install-test/testdata/repo-install-test.sh
@@ -44,25 +44,48 @@
        apt install -y $(cat /data/osmocom_packages.txt)
 }

+test_binaries_version() {
+       # Make sure --version runs and does not output UNKNOWN
+       failed=""
+       for program in $@; do
+               # Make sure it runs at all
+               $program --version
+
+               # Check for UNKNOWN
+               if $program --version | grep -q UNKNOWN; then
+                       failed="$failed $program"
+                       echo "ERROR: this program prints UNKNOWN in --version!"
+               fi
+       done
+
+       if [ -n "$failed" ]; then
+               echo "ERROR: the following program(s) print UNKNOWN in 
--version:"
+               echo "$failed"
+               return 1
+       fi
+}
+
 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
+
+       test_binaries_version \
+               osmo-bsc \
+               osmo-bts-trx \
+               osmo-bts-virtual \
+               osmo-gbproxy \
+               osmo-ggsn \
+               osmo-hlr \
+               osmo-hlr-db-tool \
+               osmo-hnbgw \
+               osmo-mgw \
+               osmo-msc \
+               osmo-pcu \
+               osmo-sgsn \
+               osmo-stp
 }

 finish() {

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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I46f18dc86d3e257c772a6db8539027aad26e24a8
Gerrit-Change-Number: 11041
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: osmith <osm...@sysmocom.de>

Reply via email to