]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephadm: add test that deploys raw OSDs 56794/head
authorAdam King <adking@redhat.com>
Tue, 9 Apr 2024 18:01:23 +0000 (14:01 -0400)
committerAdam King <adking@redhat.com>
Tue, 9 Apr 2024 18:32:07 +0000 (14:32 -0400)
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 <adking@redhat.com>
qa/suites/orch/cephadm/osds/2-ops/deploy-raw.yaml [new file with mode: 0644]

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 (file)
index 0000000..36cd859
--- /dev/null
@@ -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