From 85cc96c11a403ab08b3c9a1280d5717aec237325 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 28 Feb 2012 13:55:46 -0800 Subject: [PATCH] dump_stuck: verify that 'ceph health' mentions the right number of inactive/unclean/stale pgs --- teuthology/task/dump_stuck.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/teuthology/task/dump_stuck.py b/teuthology/task/dump_stuck.py index 8f7d1cc969b74..c482be017d769 100644 --- a/teuthology/task/dump_stuck.py +++ b/teuthology/task/dump_stuck.py @@ -1,4 +1,5 @@ import logging +import re import time import ceph_manager @@ -15,6 +16,19 @@ def check_stuck(manager, num_inactive, num_unclean, num_stale, timeout=10): stale = manager.get_stuck_pgs('stale', timeout) assert len(stale) == num_stale + # check health output as well + health = manager.raw_cluster_cmd('health') + log.debug('ceph health is: %s', health) + if num_inactive > 0: + m = re.search('(\d+) pgs stuck inactive', health) + assert int(m.group(1)) == num_inactive + if num_unclean > 0: + m = re.search('(\d+) pgs stuck unclean', health) + assert int(m.group(1)) == num_unclean + if num_stale > 0: + m = re.search('(\d+) pgs stuck stale', health) + assert int(m.group(1)) == num_stale + def task(ctx, config): """ Test the dump_stuck command. @@ -34,7 +48,10 @@ def task(ctx, config): logger=log.getChild('ceph_manager'), ) + manager.raw_cluster_cmd('tell', 'osd.0', 'flush_pg_stats') + manager.raw_cluster_cmd('tell', 'osd.1', 'flush_pg_stats') manager.wait_for_clean(timeout) + check_stuck( manager, num_inactive=0, -- 2.39.5