From 3a3c859f5bc8691891ff8a0f67a960a0d538083e Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 29 Aug 2011 13:58:09 -0700 Subject: [PATCH] valgrind: scan logs for bad results It's not sophisticated but it will warn you about a node if at least one node has issues. Signed-off-by: Greg Farnum --- teuthology/task/ceph.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/teuthology/task/ceph.py b/teuthology/task/ceph.py index a213abab6f03b..7b61c5686f371 100644 --- a/teuthology/task/ceph.py +++ b/teuthology/task/ceph.py @@ -220,6 +220,34 @@ def get_first_mon(ctx, config): assert firstmon return firstmon +@contextlib.contextmanager +def valgrind_post(ctx, config): + try: + yield + finally: + lookup_procs = list() + val_path = '/tmp/cephtest/archive/log/{val_dir}/*'.format(val_dir=config.get('valgrind').get('logs', "valgrind")) + for remote in ctx.cluster.remotes.iterkeys(): + #look at valgrind logs for each node + proc = remote.run( + args=[ + 'grep', "", run.Raw(val_path), run.Raw('|'), + 'grep', '-v', '-q', "PossiblyLost"], + wait = False, + check_status=False + ) + lookup_procs.append((proc, remote)) + + valgrind_exception = None + for (proc, remote) in lookup_procs: + result = proc.exitstatus.get() + if result is not 1: + valgrind_exception = Exception("saw valgrind issues in {node}".format(node=remote.name)) + + if valgrind_exception is not None: + raise valgrind_exception + + @contextlib.contextmanager def cluster(ctx, config): log.info('Creating ceph cluster...') @@ -808,6 +836,8 @@ def task(ctx, config): valgrind: mds.1: --tool=memcheck osd.1: --tool=memcheck + Those nodes which are using memcheck or helgrind will get + checked for bad results. To adjust or modify config options, use:: @@ -887,6 +917,7 @@ def task(ctx, config): path=config.get('path'), flavor=flavor, )), + lambda: valgrind_post(ctx=ctx, config=config), lambda: cluster(ctx=ctx, config=dict( conf=config.get('conf', {}) )), -- 2.39.5