X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Ftests%2Funit%2Fnetwork_services%2Fvnf_generic%2Fvnf%2Ftest_vfw_vnf.py;h=b67a3cdee7ddcf69d2121d4d8118d6e6535fc879;hb=e783dbb8efa370578b5b1a135a980c2603d27881;hp=a0a0794ea85753e68fdaea09ab9956b0f560bcc2;hpb=c9b1716fd37284d09b4c327b65fd5d7c8769fc7f;p=yardstick.git diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py index a0a0794ea..b67a3cdee 100644 --- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py +++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py @@ -21,7 +21,7 @@ from yardstick.tests import STL_MOCKS from yardstick.tests.unit.network_services.vnf_generic.vnf.test_base import mock_ssh from yardstick.common import utils - +from yardstick.benchmark.contexts import base as ctx_base STLClient = mock.MagicMock() stl_patch = mock.patch.dict("sys.modules", STL_MOCKS) @@ -259,12 +259,15 @@ pipeline> """ # noqa @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") + @mock.patch.object(ctx_base.Context, 'get_physical_node_from_server', return_value='mock_node') @mock.patch(SSH_HELPER) def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] vfw_approx_vnf = FWApproxVnf(name, vnfd) + vfw_approx_vnf.scenario_helper.scenario_cfg = { + 'nodes': {vfw_approx_vnf.name: "mock"} + } vfw_approx_vnf.q_in = mock.MagicMock() vfw_approx_vnf.q_out = mock.MagicMock() vfw_approx_vnf.q_out.qsize = mock.Mock(return_value=0) @@ -273,6 +276,7 @@ pipeline> **{'collect_kpi.return_value': {"core": {}}}) vfw_approx_vnf.vnf_execute = mock.Mock(return_value=self.STATS) result = { + 'physical_node': 'mock_node', 'packets_dropped': 0, 'packets_fwd': 6007180, 'packets_in': 6007180, @@ -334,7 +338,7 @@ pipeline> vfw_approx_vnf.ssh_helper.run.assert_called_once() @mock.patch.object(utils, 'find_relative_file') - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") + @mock.patch.object(ctx_base.Context, 'get_context_from_server') @mock.patch(SSH_HELPER) def test_instantiate(self, ssh, *args): mock_ssh(ssh)