]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add version number sanity singleton to rados suite 26281/head
authorNathan Cutler <ncutler@suse.com>
Wed, 6 Feb 2019 11:31:27 +0000 (12:31 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 8 May 2019 09:31:34 +0000 (11:31 +0200)
Signed-off-by: Nathan Cutler <ncutler@suse.com>
qa/suites/rados/singleton-nomsgr/all/version-number-sanity.yaml [new file with mode: 0644]
qa/workunits/rados/version_number_sanity.sh [new file with mode: 0755]

diff --git a/qa/suites/rados/singleton-nomsgr/all/version-number-sanity.yaml b/qa/suites/rados/singleton-nomsgr/all/version-number-sanity.yaml
new file mode 100644 (file)
index 0000000..a35dc45
--- /dev/null
@@ -0,0 +1,13 @@
+roles:
+- [mon.a, mds.a, mgr.x, osd.0, osd.1, client.0]
+overrides:
+  ceph:
+    log-whitelist:
+      - \(POOL_APP_NOT_ENABLED\)
+tasks:
+- install:
+- ceph:
+- workunit:
+    clients:
+      all:
+        - rados/version_number_sanity.sh
diff --git a/qa/workunits/rados/version_number_sanity.sh b/qa/workunits/rados/version_number_sanity.sh
new file mode 100755 (executable)
index 0000000..e7eb9be
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash -ex
+#
+# test that ceph RPM/DEB package version matches "ceph --version"
+# (for a loose definition of "matches")
+#
+source /etc/os-release
+case $ID in
+debian|ubuntu)
+    RPMDEB='DEB'
+    dpkg-query --show ceph-common
+    PKG_NAME_AND_VERSION=$(dpkg-query --show ceph-common)
+    ;;
+centos|fedora|rhel|opensuse*|suse|sles)
+    RPMDEB='RPM'
+    rpm -q ceph
+    PKG_NAME_AND_VERSION=$(rpm -q ceph)
+    ;;
+*)
+    echo "Unsupported distro ->$ID<-! Bailing out."
+    exit 1
+esac
+PKG_CEPH_VERSION=$(perl -e '"'"$PKG_NAME_AND_VERSION"'" =~ m/(\d+(\.\d+)+)/; print "$1\n";')
+echo "According to $RPMDEB package, the ceph version under test is ->$PKG_CEPH_VERSION<-"
+test -n "$PKG_CEPH_VERSION"
+ceph --version
+BUFFER=$(ceph --version)
+CEPH_CEPH_VERSION=$(perl -e '"'"$BUFFER"'" =~ m/ceph version (\d+(\.\d+)+)/; print "$1\n";')
+echo "According to \"ceph --version\", the ceph version under test is ->$CEPH_CEPH_VERSION<-"
+test -n "$CEPH_CEPH_VERSION"
+test "$PKG_CEPH_VERSION" = "$CEPH_CEPH_VERSION"