]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rados/test_health_warning: misc fixes
authorKefu Chai <kchai@redhat.com>
Sat, 3 Jun 2017 18:13:02 +0000 (02:13 +0800)
committerSage Weil <sage@redhat.com>
Sun, 4 Jun 2017 18:35:15 +0000 (14:35 -0400)
* do not let osd shutdown itself by enlarge osd_max_markdown_count and
  shorten osd_max_markdown_period
* do not shutdown all osds in the last test. if all osds are shutdown at
  the same time. none of them will get updated osdmap after noup is
  unset. we should leave at least one of them, so the gossip protocol
  can kick in, and populate the news to all osds.

Fixes: http://tracker.ceph.com/issues/20174
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/workunits/rados/test_health_warnings.sh

index 4159863767520289fde327ec1d757791b9385adb..252fa34433d2e1cbfd1e4761b466993388d28950 100755 (executable)
@@ -6,6 +6,7 @@ set -u
 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
+ceph tell osd.* injectargs --osd_max_markdown_count 1024 --osd_max_markdown_period 1
 
 wait_for_healthy() {
   while ceph health | grep down
@@ -40,20 +41,20 @@ test_mark_two_osds_same_rack_down() {
   wait_for_healthy
 }
 
-test_mark_all_osds_down() {
+test_mark_all_but_last_osds_down() {
   ceph osd set noup
-  ceph osd down `ceph osd ls`
+  ceph osd down $(ceph osd ls | sed \$d)
   ceph health detail
-  ceph health | grep "2 rows"
-  ceph health | grep "3 racks"
-  ceph health | grep "5 hosts"
-  ceph health | grep "10 osds"
+  ceph health | grep "1 row"
+  ceph health | grep "2 racks"
+  ceph health | grep "4 hosts"
+  ceph health | grep "9 osds"
   ceph osd unset noup
   wait_for_healthy
 }
 
 test_mark_two_osds_same_host_down
 test_mark_two_osds_same_rack_down
-test_mark_all_osds_down
+test_mark_all_but_last_osds_down
 
 exit 0