summaryrefslogtreecommitdiffstats
path: root/debian/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:32:39 +0000
commitb86b946791f8dcc23ed6c47d513e34ebb22c1610 (patch)
tree9893d33a249fbf175f69e9f18a7fa0b84718ec24 /debian/tests
parentAdding upstream version 2.14.2. (diff)
downloadicinga2-b86b946791f8dcc23ed6c47d513e34ebb22c1610.tar.xz
icinga2-b86b946791f8dcc23ed6c47d513e34ebb22c1610.zip
Adding debian version 2.14.2-1.debian/2.14.2-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/tests/control3
-rw-r--r--debian/tests/version18
2 files changed, 21 insertions, 0 deletions
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..4cb0e7a
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: version
+Restrictions: needs-root, superficial
+Depends: icinga2, icinga2-bin, icinga2-common
diff --git a/debian/tests/version b/debian/tests/version
new file mode 100644
index 0000000..67c93f2
--- /dev/null
+++ b/debian/tests/version
@@ -0,0 +1,18 @@
+#!/bin/bash
+#--------------------
+#Testing for correct version
+#--------------------
+
+set -e
+
+PACKAGE_VERSION="$(dpkg-parsechangelog -S Version |sed -ne 's/^\(\([0-9]\+\):\)\?\(.*\)-.*/\3/p' )"
+ICINGA_VERSION="$(icinga2 --version | grep version: | head -n1 | sed -e 's/.*version: r\([0-9.]\+\).*$/\1/')"
+
+if [ "$ICINGA_VERSION" = "$PACKAGE_VERSION" ]
+then
+ echo "OK: $ICINGA_VERSION is equal to $PACKAGE_VERSION"
+ exit 0
+else
+ echo "ERROR: $ICINGA_VERSION is not equal to $PACKAGE_VERSION"
+ exit 1
+fi