2015-09-20 22:23:26 +00:00
|
|
|
#!/bin/bash
|
|
|
|
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
|
|
|
|
|
2015-09-20 22:23:26 +00:00
|
|
|
PATH=$(dirname $0)/..:$PATH
|
|
|
|
|
|
|
|
if ! which py.test > /dev/null; then
|
|
|
|
echo "py.test not installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-08-27 20:17:21 +00:00
|
|
|
|
|
|
|
sudo env PATH=$(dirname $0)/..:$PATH py.test -v $(dirname $0)/ceph-disk-test.py
|
2015-09-20 22:23:26 +00:00
|
|
|
result=$?
|
|
|
|
|
2015-08-27 20:17:21 +00:00
|
|
|
# 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)
|
2015-09-20 22:23:26 +00:00
|
|
|
exit $result
|