2017-07-20 22:26:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2015-09-20 22:23:26 +00:00
|
|
|
if [ -f $(dirname $0)/../ceph-helpers-root.sh ]; then
|
|
|
|
source $(dirname $0)/../ceph-helpers-root.sh
|
|
|
|
else
|
|
|
|
echo "$(dirname $0)/../ceph-helpers-root.sh does not exist."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
install python-pytest || true
|
|
|
|
install pytest || true
|
|
|
|
|
2015-10-21 23:48:31 +00:00
|
|
|
# complete the cluster setup done by the teuthology ceph task
|
|
|
|
sudo chown $(id -u) /etc/ceph/ceph.conf
|
|
|
|
if ! test -f /etc/ceph/ceph.client.admin.keyring ; then
|
|
|
|
sudo cp /etc/ceph/ceph.keyring /etc/ceph/ceph.client.admin.keyring
|
|
|
|
fi
|
|
|
|
if ! sudo test -f /var/lib/ceph/bootstrap-osd/ceph.keyring ; then
|
|
|
|
sudo ceph-create-keys --id a
|
|
|
|
fi
|
|
|
|
sudo ceph osd crush rm osd.0 || true
|
|
|
|
sudo ceph osd crush rm osd.1 || true
|
|
|
|
|
2016-08-23 10:17:00 +00:00
|
|
|
sudo cp $(dirname $0)/60-ceph-by-partuuid.rules /lib/udev/rules.d
|
|
|
|
sudo udevadm control --reload
|
|
|
|
|
2016-01-28 04:43:22 +00:00
|
|
|
perl -pi -e 's|pid file.*|pid file = /var/run/ceph/\$cluster-\$name.pid|' /etc/ceph/ceph.conf
|
|
|
|
|
2016-02-26 12:00:17 +00:00
|
|
|
PATH=$(dirname $0):$(dirname $0)/..:$PATH
|
2015-09-20 22:23:26 +00:00
|
|
|
|
2016-08-19 06:45:49 +00:00
|
|
|
: ${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}"
|
2015-09-20 22:23:26 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2015-08-27 20:17:21 +00:00
|
|
|
|
2017-11-21 13:47:30 +00:00
|
|
|
sudo env PATH=$(dirname $0):$(dirname $0)/..:$PATH PYTHONWARNINGS=ignore ${PYTHON} -m pytest -s -v $(dirname $0)/ceph-disk-test.py
|
2015-09-20 22:23:26 +00:00
|
|
|
result=$?
|
|
|
|
|
2016-08-23 10:17:00 +00:00
|
|
|
sudo rm -f /lib/udev/rules.d/60-ceph-by-partuuid.rules
|
2015-08-27 20:17:21 +00:00
|
|
|
# own whatever was created as a side effect of the py.test run
|
2016-08-19 06:45:49 +00:00
|
|
|
# so that it can successfully be removed later on by a non privileged
|
2015-08-27 20:17:21 +00:00
|
|
|
# process
|
|
|
|
sudo chown -R $(id -u) $(dirname $0)
|
2015-09-20 22:23:26 +00:00
|
|
|
exit $result
|