aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2018-03-01 15:11:31 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-01 15:11:31 +0000
commit6289ae851034b987bf5b69a4e38a5027d358e9d8 (patch)
treedf17cac5fc405202e19bc1253fb78edd66a43bb3 /yardstick/tests/unit
parentec243be6d3f3dc3e811e9217209a8c692e3f9c64 (diff)
parentc66c157da4a31248c39fda2b4d70d86ac159637c (diff)
Merge "vFW scale-up template."
Diffstat (limited to 'yardstick/tests/unit')
-rw-r--r--yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py
index 022e66ff1..83db6ae01 100644
--- a/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py
+++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_vnf_generic.py
@@ -645,6 +645,29 @@ class TestNetworkServiceTestCase(unittest.TestCase):
)
mock_tprofile_get.assert_called_once_with(fake_vnfd)
+ @mock.patch.object(utils, 'open_relative_file')
+ def test__get_topology(self, mock_open_path):
+ self.s.scenario_cfg['topology'] = 'fake_topology'
+ self.s.scenario_cfg['task_path'] = 'fake_path'
+ mock_open_path.side_effect = mock.mock_open(read_data='fake_data')
+ self.assertEqual('fake_data', self.s._get_topology())
+ mock_open_path.assert_called_once_with('fake_topology', 'fake_path')
+
+ @mock.patch.object(vnfdgen, 'generate_vnfd')
+ def test__render_topology(self, mock_generate):
+ fake_topology = 'fake_topology'
+ mock_generate.return_value = {'nsd:nsd-catalog': {'nsd': ['fake_nsd']}}
+ with mock.patch.object(self.s, '_get_topology',
+ return_value=fake_topology) as mock_get_topology:
+ self.s._render_topology()
+ mock_get_topology.assert_called_once()
+
+ mock_generate.assert_called_once_with(
+ fake_topology,
+ {'extra_args': {'arg1': 'value1', 'arg2': 'value2'}}
+ )
+ self.assertEqual(self.s.topology, 'fake_nsd')
+
def test_teardown(self):
vnf = mock.Mock(autospec=GenericVNF)
vnf.terminate = mock.Mock(return_value=True)