diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2018-03-01 21:17:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-01 21:17:05 +0000 |
commit | 3536e57cbbe7e84461d50a87fb87b4e99b4cd20a (patch) | |
tree | f54b56b274c2f5bb65fb5af3d531f48a755b10cb /yardstick/tests/unit/benchmark/core/test_task.py | |
parent | 6f7dd8ff0e6358ef958426a6baeae5deee1a57d8 (diff) | |
parent | f8c32c5df789ab9dd698b247740cd72049e1bf65 (diff) |
Merge "Add ability to reuse existing OpenStack set-up"
Diffstat (limited to 'yardstick/tests/unit/benchmark/core/test_task.py')
-rw-r--r-- | yardstick/tests/unit/benchmark/core/test_task.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py index 25a7a64b3..77e95bbec 100644 --- a/yardstick/tests/unit/benchmark/core/test_task.py +++ b/yardstick/tests/unit/benchmark/core/test_task.py @@ -259,6 +259,38 @@ class TaskTestCase(unittest.TestCase): actual_result = t._parse_options(options) self.assertEqual(expected_result, actual_result) + def test_parse_options_no_teardown(self): + options = { + 'openstack': { + 'EXTERNAL_NETWORK': '$network' + }, + 'nodes': ['node1', '$node'], + 'host': '$host', + 'contexts' : {'name': "my-context", + 'no_teardown': True} + } + + t = task.Task() + t.outputs = { + 'network': 'ext-net', + 'node': 'node2', + 'host': 'server.yardstick' + } + + expected_result = { + 'openstack': { + 'EXTERNAL_NETWORK': 'ext-net' + }, + 'nodes': ['node1', 'node2'], + 'host': 'server.yardstick', + 'contexts': {'name': 'my-context', + 'no_teardown': True, + } + } + + actual_result = t._parse_options(options) + self.assertEqual(expected_result, actual_result) + @mock.patch('six.moves.builtins.open', side_effect=mock.mock_open()) @mock.patch.object(task, 'utils') @mock.patch('logging.root') |