From: Adam King Date: Fri, 29 Sep 2023 20:52:37 +0000 (-0400) Subject: qa/cephadm: test --rm-crush-entry host rm flag in host drain test X-Git-Tag: v18.2.4~182^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=72c1a99511a49f5c0bf124b1f0b2f4da78a18e6f;p=ceph.git qa/cephadm: test --rm-crush-entry host rm flag in host drain test Signed-off-by: Adam King (cherry picked from commit 7870538dc1e19760cd96a3d343ae3d3235f71eb2) --- diff --git a/qa/suites/orch/cephadm/workunits/task/test_host_drain.yaml b/qa/suites/orch/cephadm/workunits/task/test_host_drain.yaml index c73d2cdb2788d..83173c9f8b22e 100644 --- a/qa/suites/orch/cephadm/workunits/task/test_host_drain.yaml +++ b/qa/suites/orch/cephadm/workunits/task/test_host_drain.yaml @@ -36,11 +36,27 @@ tasks: sleep 15 HOST_C_DAEMONS=$(ceph orch ps --hostname $HOST_C) done + # we want to check the ability to remove the host from + # the CRUSH map, so we should first verify the host is in + # the CRUSH map. + ceph osd getcrushmap -o compiled-crushmap + crushtool -d compiled-crushmap -o crushmap.txt + CRUSH_MAP=$(cat crushmap.txt) + if ! grep -q "$HOST_C" <<< "$CRUSH_MAP"; then + printf "Expected to see $HOST_C in CRUSH map. Saw:\n\n$CRUSH_MAP" + exit 1 + fi # If the drain was successful, we should be able to remove the # host without force with no issues. If there are still daemons # we will get a response telling us to drain the host and a # non-zero return code - ceph orch host rm $HOST_C - - - + ceph orch host rm $HOST_C --rm-crush-entry + # verify we've successfully removed the host from the CRUSH map + sleep 30 + ceph osd getcrushmap -o compiled-crushmap + crushtool -d compiled-crushmap -o crushmap.txt + CRUSH_MAP=$(cat crushmap.txt) + if grep -q "$HOST_C" <<< "$CRUSH_MAP"; then + printf "Saw $HOST_C in CRUSH map after it should have been removed.\n\n$CRUSH_MAP" + exit 1 + fi