diff options
author | Qiaowei Ren <qiaowei.ren@intel.com> | 2018-01-04 13:43:33 +0800 |
---|---|---|
committer | Qiaowei Ren <qiaowei.ren@intel.com> | 2018-01-05 11:59:39 +0800 |
commit | 812ff6ca9fcd3e629e49d4328905f33eee8ca3f5 (patch) | |
tree | 04ece7b4da00d9d2f98093774594f4057ae561d4 /src/ceph/qa/workunits/ceph-disk/ceph-disk.sh | |
parent | 15280273faafb77777eab341909a3f495cf248d9 (diff) |
initial code repo
This patch creates initial code repo.
For ceph, luminous stable release will be used for base code,
and next changes and optimization for ceph will be added to it.
For opensds, currently any changes can be upstreamed into original
opensds repo (https://github.com/opensds/opensds), and so stor4nfv
will directly clone opensds code to deploy stor4nfv environment.
And the scripts for deployment based on ceph and opensds will be
put into 'ci' directory.
Change-Id: I46a32218884c75dda2936337604ff03c554648e4
Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
Diffstat (limited to 'src/ceph/qa/workunits/ceph-disk/ceph-disk.sh')
-rwxr-xr-x | src/ceph/qa/workunits/ceph-disk/ceph-disk.sh | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/ceph/qa/workunits/ceph-disk/ceph-disk.sh b/src/ceph/qa/workunits/ceph-disk/ceph-disk.sh new file mode 100755 index 0000000..7102efb --- /dev/null +++ b/src/ceph/qa/workunits/ceph-disk/ceph-disk.sh @@ -0,0 +1,46 @@ +#!/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 + +# 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 + +sudo cp $(dirname $0)/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 env PATH=$(dirname $0):$(dirname $0)/..:$PATH PYTHONWARNINGS=ignore ${PYTHON} -m pytest -s -v $(dirname $0)/ceph-disk-test.py +result=$? + +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) +exit $result |