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