Skip to content

Commit 8ed5ed4

Browse files
committed
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 <[email protected]>
1 parent 78ca123 commit 8ed5ed4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
overrides:
2+
cephadm:
3+
raw-osds: True
4+
tasks:
5+
- cephadm.shell:
6+
host.a:
7+
- |
8+
set -e
9+
set -x
10+
ceph orch ps
11+
ceph orch device ls
12+
ceph osd tree
13+
ORCH_PS=$(ceph orch ps)
14+
if grep -q "No daemons" <<< "$ORCH_PS"; then
15+
echo "No OSDs were deployed"
16+
exit 1
17+
fi
18+
ceph orch ps | grep -q "running"
19+
if grep -q "failed" <<< "$ORCH_PS"; then
20+
echo "At least one raw OSD deployed is failed"
21+
exit 1
22+
fi
23+
if grep -q "stopped" <<< "$ORCH_PS"; then
24+
echo "At least one raw OSD deployed is stopped"
25+
exit 1
26+
fi
27+
if ceph-volume lvm list; then
28+
echo "ceph-volume lvm list was expected to give non-zero rc with all raw OSDs"
29+
exit 1
30+
fi

0 commit comments

Comments
 (0)