From 6bbeb4496e310a4974ddee21b37119979f8e61c2 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Sun, 29 Jul 2018 18:24:48 +0200 Subject: [PATCH] mimic: qa/ceph-disk: fixes for OVH and add ceph-detect-init subsuite With the move to OVH and the addition of RHEL as a supported distro, the ceph-disk/basic suite was no longer green. This commit brings it back into a green state. Also, although ceph-disk/basic presumably exercises ceph-detect-init, it seemed prudent to add a test case that runs it explicitly. Can not be cherry-picked because ceph-disk and ceph-detect-init are no longer present in master. Reverts: 230c030fad091ae9c136a421e6206d3e8c9378f8 Fixes: https://tracker.ceph.com/issues/25031 Signed-off-by: Nathan Cutler --- qa/suites/ceph-disk/basic/distros | 2 +- .../basic/tasks/ceph-detect-init.yaml | 11 ++++++ .../ceph-disk/basic/tasks/ceph-disk.yaml | 3 -- qa/workunits/ceph-disk/ceph-disk.sh | 39 ++++++++++--------- 4 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 qa/suites/ceph-disk/basic/tasks/ceph-detect-init.yaml diff --git a/qa/suites/ceph-disk/basic/distros b/qa/suites/ceph-disk/basic/distros index c5d59352cb5ea..23d9e9be86f0d 120000 --- a/qa/suites/ceph-disk/basic/distros +++ b/qa/suites/ceph-disk/basic/distros @@ -1 +1 @@ -../../../distros/supported \ No newline at end of file +.qa/distros/supported \ No newline at end of file diff --git a/qa/suites/ceph-disk/basic/tasks/ceph-detect-init.yaml b/qa/suites/ceph-disk/basic/tasks/ceph-detect-init.yaml new file mode 100644 index 0000000000000..f464ff8c388a5 --- /dev/null +++ b/qa/suites/ceph-disk/basic/tasks/ceph-detect-init.yaml @@ -0,0 +1,11 @@ +openstack: +- volumes: # attached to each instance + count: 0 +roles: +- [client.0] +tasks: +- install: +- exec: + client.0: + - ceph-detect-init + - test "$(ceph-detect-init)" = "systemd" diff --git a/qa/suites/ceph-disk/basic/tasks/ceph-disk.yaml b/qa/suites/ceph-disk/basic/tasks/ceph-disk.yaml index b08199b2c7cc8..c61c376aaa35c 100644 --- a/qa/suites/ceph-disk/basic/tasks/ceph-disk.yaml +++ b/qa/suites/ceph-disk/basic/tasks/ceph-disk.yaml @@ -1,6 +1,3 @@ -overrides: - ansible.cephlab: - skip_tags: entitlements,packages,repos roles: - - mon.a - mgr.x diff --git a/qa/workunits/ceph-disk/ceph-disk.sh b/qa/workunits/ceph-disk/ceph-disk.sh index 8a22279a697ab..6daecf4fad668 100755 --- a/qa/workunits/ceph-disk/ceph-disk.sh +++ b/qa/workunits/ceph-disk/ceph-disk.sh @@ -1,13 +1,23 @@ #!/usr/bin/env bash -if [ -f $(dirname $0)/../ceph-helpers-root.sh ]; then - source $(dirname $0)/../ceph-helpers-root.sh +BASEDIR=$(dirname $0) +if [ -f $BASEDIR/../ceph-helpers-root.sh ]; then + source $BASEDIR/../ceph-helpers-root.sh else - echo "$(dirname $0)/../ceph-helpers-root.sh does not exist." + echo "$BASEDIR/../ceph-helpers-root.sh does not exist." exit 1 fi -install python-pytest || true -install pytest || true +PATH=$BASEDIR:$BASEDIR/..:$PATH + +: ${PYTHON:=python} +$PYTHON --version + +type pip + +# newer versions of pytest (e.g. 3.7.0) seem to work fine with Python 2.7, +# so just grab the latest version +sudo -H pip install pytest +$PYTHON -m pytest --version # complete the cluster setup done by the teuthology ceph task sudo chown $(id -u) /etc/ceph/ceph.conf @@ -20,27 +30,18 @@ fi sudo ceph osd crush rm osd.0 || true sudo ceph osd crush rm osd.1 || true -sudo cp $(dirname $0)/60-ceph-by-partuuid.rules /lib/udev/rules.d +sudo cp $BASEDIR/60-ceph-by-partuuid.rules /lib/udev/rules.d sudo udevadm control --reload -perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/ceph/ceph.conf - -PATH=$(dirname $0):$(dirname $0)/..:$PATH - -: ${PYTHON:=python} -PY_VERSION=$($PYTHON --version 2>&1) - -if ! ${PYTHON} -m pytest --version > /dev/null 2>&1; then - echo "py.test not installed for ${PY_VERSION}" - exit 1 -fi +sudo perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/ceph/ceph.conf -sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH PYTHONWARNINGS=ignore ${PYTHON} -m pytest -s -v $(dirname $0)/ceph-disk-test.py +sudo env PATH=$PATH PYTHONWARNINGS=ignore ${PYTHON} -m pytest -s -v --rootdir=$BASEDIR $BASEDIR/ceph-disk-test.py result=$? +sudo rm -rf $BASEDIR/.pytest_cache sudo rm -f /lib/udev/rules.d/60-ceph-by-partuuid.rules # own whatever was created as a side effect of the py.test run # so that it can successfully be removed later on by a non privileged # process -sudo chown -R $(id -u) $(dirname $0) +sudo chown -R $(id -u) $BASEDIR exit $result -- 2.39.5