aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/runner/test_base.py
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-06-05 01:20:33 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-05 01:20:33 +0000
commit0e1b3483f1514177b61a645abda906b68b13bd36 (patch)
tree970946925fc14ba0ac36bccf9fd816ebc5e39fcd /tests/unit/benchmark/runner/test_base.py
parent28a97ee05186295b7d71f449ac703bf78e5fd358 (diff)
parentfc6eddef3d27cf51b3f6da3a523080e55c6bfb70 (diff)
Merge "Pass parameters between scenarios"
Diffstat (limited to 'tests/unit/benchmark/runner/test_base.py')
-rw-r--r--tests/unit/benchmark/runner/test_base.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/unit/benchmark/runner/test_base.py b/tests/unit/benchmark/runner/test_base.py
new file mode 100644
index 000000000..7880fe5a5
--- /dev/null
+++ b/tests/unit/benchmark/runner/test_base.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+##############################################################################
+# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+from __future__ import print_function
+from __future__ import absolute_import
+
+import unittest
+import multiprocessing
+import time
+
+from yardstick.benchmark.runners.iteration import IterationRunner
+
+
+class RunnerTestCase(unittest.TestCase):
+
+ def test_get_output(self):
+ queue = multiprocessing.Queue()
+ runner = IterationRunner({}, queue)
+ runner.output_queue.put({'case': 'opnfv_yardstick_tc002'})
+ runner.output_queue.put({'criteria': 'PASS'})
+
+ idle_result = {
+ 'case': 'opnfv_yardstick_tc002',
+ 'criteria': 'PASS'
+ }
+
+ time.sleep(1)
+ actual_result = runner.get_output()
+ self.assertEqual(idle_result, actual_result)
+
+
+def main():
+ unittest.main()
+
+
+if __name__ == '__main__':
+ main()