Commit 0e594722 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Test parallel instance query operations



For each created instance, a `gnt-instance info` is issued. In addition,
`gnt-instance list` is issued as often as well.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarHrvoje Ribicic <riba@google.com>
parent f9e16ba1
......@@ -794,6 +794,7 @@ def RunPerformanceTests():
RunTest(qa_performance.TestParallelModify, instances)
RunTest(qa_performance.TestParallelInstanceOperations, instances)
RunTest(qa_performance.TestParallelInstanceQueries, instances)
qa_performance.RemoveAllInstances(instances)
......
......@@ -33,6 +33,7 @@ import qa_config
import qa_error
from qa_instance_utils import GetGenericAddParameters
import qa_job_utils
import qa_utils
class _JobQueueDriver(object):
......@@ -382,3 +383,27 @@ def TestParallelInstanceOperations(instances):
_SubmitNextOperation(instance, start % len(OPS), 0, job_driver, None)
job_driver.WaitForCompletion()
def TestParallelInstanceQueries(instances):
"""PERFORMANCE: Parallel instance queries.
@type instances: list of L{qa_config._QaInstance}
@param instances: list of instances to issue queries against
"""
threads = []
for instance in instances:
cmd = ["gnt-instance", "info", instance.name]
info_thread = qa_job_utils.QAThread(qa_utils.AssertCommand, [cmd], {})
info_thread.start()
threads.append(info_thread)
cmd = ["gnt-instance", "list"]
list_thread = qa_job_utils.QAThread(qa_utils.AssertCommand, [cmd], {})
list_thread.start()
threads.append(list_thread)
for thread in threads:
thread.join()
thread.reraise()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment