]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mimic: qa/ceph-disk: fixes for OVH and add ceph-detect-init subsuite 23337/head
authorNathan Cutler <ncutler@suse.com>
Sun, 29 Jul 2018 16:24:48 +0000 (18:24 +0200)
committerNathan Cutler <ncutler@suse.com>
Wed, 1 Aug 2018 08:34:34 +0000 (10:34 +0200)
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 <ncutler@suse.com>
qa/suites/ceph-disk/basic/distros
qa/suites/ceph-disk/basic/tasks/ceph-detect-init.yaml [new file with mode: 0644]
qa/suites/ceph-disk/basic/tasks/ceph-disk.yaml
qa/workunits/ceph-disk/ceph-disk.sh

index c5d59352cb5eaf1e9403efad18de673a1bf55583..23d9e9be86f0d518b9a966f6439948c11c1b4b42 120000 (symlink)
@@ -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 (file)
index 0000000..f464ff8
--- /dev/null
@@ -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"
index b08199b2c7cc878bbcf1970ea23166f0532b6f97..c61c376aaa35c7a96f5e978c5ec3400aa1ba0629 100644 (file)
@@ -1,6 +1,3 @@
-overrides:
-  ansible.cephlab:
-    skip_tags: entitlements,packages,repos
 roles:
 - - mon.a
   - mgr.x
index 8a22279a697ab05ab5b39ca4783a070a4909edb4..6daecf4fad668b8f5de2dfcad0f5303cd18f0697 100755 (executable)
@@ -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