]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
internal: check syslog for errors
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 7 Dec 2011 23:20:33 +0000 (15:20 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Wed, 7 Dec 2011 23:20:33 +0000 (15:20 -0800)
This should catch lockdep warnings and mark tests with them as failed.

teuthology/task/internal.py

index 58e7f14e8a38fd70f899abeca7c881e8f7d0c264..62709a1d8a70e104dcea5925d2b8e1d248edd187 100644 (file)
@@ -355,6 +355,27 @@ kern.* -/tmp/cephtest/archive/syslog/kern.log;RSYSLOG_FileFormat
         # race condition: nothing actually says rsyslog had time to
         # flush the file fully. oh well.
 
+        log.info('Checking logs for errors...')
+        for remote in ctx.cluster.remotes.iterkeys():
+            log.debug('Checking %s', remote.name)
+            r = remote.run(
+                args=[
+                    'egrep',
+                    'BUG|INFO|DEADLOCK',
+                    run.Raw('/tmp/cephtest/archive/syslog/*.log'),
+                    run.Raw('|'),
+                    'head', '-n', '1',
+                    ],
+                stdout=StringIO(),
+                )
+            stdout = r.stdout.getvalue()
+            if stdout != '':
+                log.error('Error in syslog on %s: %s', remote.name, stdout)
+                ctx.summary['success'] = False
+                if 'failure_reason' not in ctx.summary:
+                    ctx.summary['failure_reason'] = \
+                        "'{error}' in syslog".format(error=stdout)
+
         log.info('Compressing syslogs...')
         run.wait(
             ctx.cluster.run(