]> git.proxmox.com Git - ceph.git/blame - ceph/qa/workunits/ceph-disk/ceph-disk.sh
update sources to v12.1.3
[ceph.git] / ceph / qa / workunits / ceph-disk / ceph-disk.sh
CommitLineData
7c673cae 1#!/bin/bash
d2e6a577
FG
2if [ -f $(dirname $0)/../ceph-helpers-root.sh ]; then
3 source $(dirname $0)/../ceph-helpers-root.sh
7c673cae 4else
d2e6a577 5 echo "$(dirname $0)/../ceph-helpers-root.sh does not exist."
7c673cae
FG
6 exit 1
7fi
8
9install python-pytest || true
10install pytest || true
11
12# complete the cluster setup done by the teuthology ceph task
13sudo chown $(id -u) /etc/ceph/ceph.conf
14if ! test -f /etc/ceph/ceph.client.admin.keyring ; then
15 sudo cp /etc/ceph/ceph.keyring /etc/ceph/ceph.client.admin.keyring
16fi
17if ! sudo test -f /var/lib/ceph/bootstrap-osd/ceph.keyring ; then
18 sudo ceph-create-keys --id a
19fi
20sudo ceph osd crush rm osd.0 || true
21sudo ceph osd crush rm osd.1 || true
22
23sudo cp $(dirname $0)/60-ceph-by-partuuid.rules /lib/udev/rules.d
24sudo udevadm control --reload
25
26perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/ceph/ceph.conf
27
28PATH=$(dirname $0):$(dirname $0)/..:$PATH
29
30: ${PYTHON:=python}
31PY_VERSION=$($PYTHON --version 2>&1)
32
33if ! ${PYTHON} -m pytest --version > /dev/null 2>&1; then
34 echo "py.test not installed for ${PY_VERSION}"
35 exit 1
36fi
37
38sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH ${PYTHON} -m pytest -s -v $(dirname $0)/ceph-disk-test.py
39result=$?
40
41sudo rm -f /lib/udev/rules.d/60-ceph-by-partuuid.rules
42# own whatever was created as a side effect of the py.test run
43# so that it can successfully be removed later on by a non privileged
44# process
45sudo chown -R $(id -u) $(dirname $0)
46exit $result