Add test to make sure filename's work with with grenade

Grenade screen logs are stored in logs/new/ and logs/old/ instead of
just logs, so add a check to make sure no queries use
'filename:"logs/screen-' they should instead use 'filename:logs*screen-'

Change-Id: I27916dc193fd0478091540f4b5088593a2d4624b
This commit is contained in:
Joe Gordon 2014-02-14 19:00:04 -08:00
parent a751a52891
commit cd7f0d0a14
4 changed files with 14 additions and 3 deletions

View File

@ -30,6 +30,17 @@ class TestLoadQueries(tests.TestCase):
self.assertIsNotNone(q['bug'])
self.assertIsNotNone(q['query'])
def test_grenade_compat(self):
# grenade logs are in logs/new/ and logs/old, while devstack is in
# logs/. To make sure queries will work with both, one should use
# filename:logs*screen... (no quotes)
queries = loader.load("queries")
for q in queries:
# Use assertTrue because you can specify a custom message
self.assertTrue("filename:\"logs/screen-" not in q['query'],
msg=("for bug %s" % q['bug']))
def test_load_queries_all(self):
queries = loader.load("queries", skip_resolved=False)

View File

@ -1,6 +1,6 @@
query: >
message:"Network filter not found"
AND message:"libvirt"
AND filename:"logs/screen-n-cpu.txt"
AND filename:logs*screen-n-cpu.txt
AND module:"nova.compute.manager"

View File

@ -1,4 +1,4 @@
query: >
message:"remove_iscsi_target"
AND message:"os.unlink"
AND filename:"logs/screen-c-vol.txt"
AND filename:logs*screen-c-vol.txt

View File

@ -1,4 +1,4 @@
query: >
message:"Backend storage for image"
AND message:"disconnected after writing only"
AND filename:"logs/screen-g-api.txt"
AND filename:logs*screen-g-api.txt