From: Adam King Date: Tue, 9 Apr 2024 18:01:23 +0000 (-0400) Subject: qa/cephadm: add test that deploys raw OSDs X-Git-Tag: v20.0.0~2175^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F56794%2Fhead;p=ceph.git qa/cephadm: add test that deploys raw OSDs The test relies on the fact that 'ceph-volume lvm list' returns a nonzero rc when there are no lvm OSDs present ``` root@smithi156:/# ceph-volume lvm list No valid Ceph lvm devices found root@smithi156:/# echo $? 1 ``` with lvm OSDs present, it will instead reports on the lvs and give a zero rc ``` root@smithi097:/# ceph-volume lvm list ====== osd.0 ======= [block] /dev/ceph-ffeadaf4-... ... root@smithi097:/# echo $? 0 ``` Assuming the override this test has works properly and all the OSDs we see are raw, we can use the nonzero rc to confirm the OSDs ar raw Signed-off-by: Adam King --- diff --git a/qa/suites/orch/cephadm/osds/2-ops/deploy-raw.yaml b/qa/suites/orch/cephadm/osds/2-ops/deploy-raw.yaml new file mode 100644 index 0000000000000..36cd859d3e02d --- /dev/null +++ b/qa/suites/orch/cephadm/osds/2-ops/deploy-raw.yaml @@ -0,0 +1,30 @@ +overrides: + cephadm: + raw-osds: True +tasks: +- cephadm.shell: + host.a: + - | + set -e + set -x + ceph orch ps + ceph orch device ls + ceph osd tree + ORCH_PS=$(ceph orch ps) + if grep -q "No daemons" <<< "$ORCH_PS"; then + echo "No OSDs were deployed" + exit 1 + fi + ceph orch ps | grep -q "running" + if grep -q "failed" <<< "$ORCH_PS"; then + echo "At least one raw OSD deployed is failed" + exit 1 + fi + if grep -q "stopped" <<< "$ORCH_PS"; then + echo "At least one raw OSD deployed is stopped" + exit 1 + fi + if ceph-volume lvm list; then + echo "ceph-volume lvm list was expected to give non-zero rc with all raw OSDs" + exit 1 + fi