From f9f824448a5033f2f1febec9fe2867c0c2d18aff Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Wed, 6 Feb 2019 12:31:27 +0100 Subject: [PATCH] qa: add version number sanity singleton to rados suite Signed-off-by: Nathan Cutler --- .../all/version-number-sanity.yaml | 13 ++++++++ qa/workunits/rados/version_number_sanity.sh | 30 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 qa/suites/rados/singleton-nomsgr/all/version-number-sanity.yaml create mode 100755 qa/workunits/rados/version_number_sanity.sh 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 index 000000000000..a35dc459998d --- /dev/null +++ b/qa/suites/rados/singleton-nomsgr/all/version-number-sanity.yaml @@ -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 index 000000000000..e7eb9be649c5 --- /dev/null +++ b/qa/workunits/rados/version_number_sanity.sh @@ -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" -- 2.47.3