From: Neha Ojha Date: Tue, 16 May 2017 18:57:10 +0000 (-0700) Subject: mon: add test for crush type down health warnings X-Git-Tag: v12.1.0~507^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6ecb03299a2991b1e84395906f8304213feeb995;p=ceph-ci.git mon: add test for crush type down health warnings Signed-off-by: Neha Ojha --- diff --git a/qa/suites/rados/singleton-nomsgr/all/health-warnings.yaml b/qa/suites/rados/singleton-nomsgr/all/health-warnings.yaml new file mode 100644 index 00000000000..eb121161729 --- /dev/null +++ b/qa/suites/rados/singleton-nomsgr/all/health-warnings.yaml @@ -0,0 +1,9 @@ +roles: +- [mon.a, mgr.x, osd.0, osd.1, osd.2, osd.3, osd.4, osd.5, osd.6, osd.7, osd.8, osd.9, client.0] +tasks: +- install: +- ceph: +- workunit: + clients: + all: + - rados/test_health_warnings.sh diff --git a/qa/workunits/rados/test_health_warnings.sh b/qa/workunits/rados/test_health_warnings.sh new file mode 100755 index 00000000000..d9ddbbe7f8c --- /dev/null +++ b/qa/workunits/rados/test_health_warnings.sh @@ -0,0 +1,36 @@ +#!/bin/bash -ex + +set -u + +# number of osds = 10 +crushtool -o crushmap --build --num_osds 10 host straw 2 rack straw 2 row straw 2 root straw 0 +ceph osd setcrushmap -i crushmap +ceph osd tree + +test_mark_two_osds_same_host_down() { + ceph osd down osd.0 osd.1 + ceph health detail + ceph health | grep "host" + ceph health detail | grep "osd.0" + ceph health detail | grep "osd.1" +} + +test_mark_two_osds_same_rack_down() { + ceph osd down osd.8 osd.9 + ceph health detail + ceph health | grep "rack" + ceph health detail | grep "osd.8" + ceph health detail | grep "osd.9" +} + +test_mark_all_osds_down() { + ceph osd down `ceph osd ls` + ceph health detail + ceph health | grep "row" +} + +test_mark_two_osds_same_host_down +test_mark_two_osds_same_rack_down +test_mark_all_osds_down + +exit 0 diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a4be13cc203..9253a58109b 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3540,7 +3540,7 @@ void OSDMonitor::get_health(list >& summary, ss << " (" << sum_down_osds << " osds) down\n"; } } - ss << down_in_osds.size() << " osds are down\n"; + ss << down_in_osds.size() << " osds down\n"; summary.push_back(make_pair(HEALTH_WARN, ss.str())); if (detail) {