aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-05-04 14:54:16 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-05-04 14:54:16 +0000
commitbeca893904ff893d2fc944eb475d045cbe22c39b (patch)
treede0e432322188925ab0360d91c4f43655814b070 /yardstick/tests/unit/benchmark
parent3cc4c5f8171f54232b40e393eea5873af78d302b (diff)
parent9ae331e1aa1081c3e821512d1940846dfb4063ec (diff)
Merge "Add "os_cloud_config" as a new context flag parameter"
Diffstat (limited to 'yardstick/tests/unit/benchmark')
-rw-r--r--yardstick/tests/unit/benchmark/contexts/test_base.py7
-rw-r--r--yardstick/tests/unit/benchmark/contexts/test_heat.py9
2 files changed, 10 insertions, 6 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/test_base.py b/yardstick/tests/unit/benchmark/contexts/test_base.py
index 153c6a527..b19883479 100644
--- a/yardstick/tests/unit/benchmark/contexts/test_base.py
+++ b/yardstick/tests/unit/benchmark/contexts/test_base.py
@@ -25,6 +25,7 @@ class FlagsTestCase(unittest.TestCase):
def test___init__(self):
self.assertFalse(self.flags.no_setup)
self.assertFalse(self.flags.no_teardown)
+ self.assertEqual({'verify': False}, self.flags.os_cloud_config)
def test___init__with_flags(self):
flags = base.Flags(no_setup=True)
@@ -32,10 +33,12 @@ class FlagsTestCase(unittest.TestCase):
self.assertFalse(flags.no_teardown)
def test_parse(self):
- self.flags.parse(no_setup=True, no_teardown="False")
+ self.flags.parse(no_setup=True, no_teardown='False',
+ os_cloud_config={'verify': True})
self.assertTrue(self.flags.no_setup)
- self.assertEqual(self.flags.no_teardown, "False")
+ self.assertEqual('False', self.flags.no_teardown)
+ self.assertEqual({'verify': True}, self.flags.os_cloud_config)
def test_parse_forbidden_flags(self):
self.flags.parse(foo=42)
diff --git a/yardstick/tests/unit/benchmark/contexts/test_heat.py b/yardstick/tests/unit/benchmark/contexts/test_heat.py
index 1d491fe60..ebb1d69ba 100644
--- a/yardstick/tests/unit/benchmark/contexts/test_heat.py
+++ b/yardstick/tests/unit/benchmark/contexts/test_heat.py
@@ -234,7 +234,7 @@ class HeatContextTestCase(unittest.TestCase):
@mock.patch.object(os.path, 'exists', return_value=False)
@mock.patch.object(ssh.SSH, 'gen_keys')
- @mock.patch('yardstick.benchmark.contexts.heat.HeatTemplate')
+ @mock.patch.object(heat, 'HeatTemplate')
def test_deploy(self, mock_template, mock_genkeys, mock_path_exists):
self.test_context._name = 'foo'
self.test_context._task_id = '1234567890'
@@ -245,9 +245,10 @@ class HeatContextTestCase(unittest.TestCase):
self.test_context.get_neutron_info = mock.MagicMock()
self.test_context.deploy()
- mock_template.assert_called_with('foo-12345678',
- '/bar/baz/some-heat-file',
- {'image': 'cirros'})
+ mock_template.assert_called_with(
+ 'foo-12345678', template_file='/bar/baz/some-heat-file',
+ heat_parameters={'image': 'cirros'},
+ os_cloud_config=self.test_context._flags.os_cloud_config)
self.assertIsNotNone(self.test_context.stack)
key_filename = ''.join(
[consts.YARDSTICK_ROOT_PATH,