From 8ed5ed4cc64692234e8e0613baee5b21eecd0951 Mon Sep 17 00:00:00 2001 From: Adam King Date: Tue, 9 Apr 2024 14:01:23 -0400 Subject: [PATCH] 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 --- .../orch/cephadm/osds/2-ops/deploy-raw.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 qa/suites/orch/cephadm/osds/2-ops/deploy-raw.yaml 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 -- 2.39.5