diff options
author | Rex Lee <limingjiang@huawei.com> | 2018-05-17 02:25:29 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-05-17 02:25:29 +0000 |
commit | 5a05730af35e6dfa5e623e3fa0a29c23ed704d71 (patch) | |
tree | 82b0a911d87e988a1210fdaf3c9f3b841177ca32 | |
parent | c8d64fa99dc51f5914bcbeb01a39eee5df7b4576 (diff) | |
parent | ce1ea0325aa0ea67e4d9fa00ec81f352ee8f2be8 (diff) |
Merge "Remove unused methods in SampleVNF" into stable/fraser
-rw-r--r-- | tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py | 46 | ||||
-rw-r--r-- | yardstick/network_services/vnf_generic/vnf/sample_vnf.py | 44 |
2 files changed, 0 insertions, 90 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py index 26bd1dadd..eb59c2837 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py @@ -1661,42 +1661,6 @@ class TestSampleVnf(unittest.TestCase): # test the default resource helper is MyResourceHelper, not subclass self.assertEqual(type(sample_vnf.resource_helper), MyResourceHelper) - def test__get_port0localip6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '0064:ff9b:0:0:0:0:9810:6414' - result = sample_vnf._get_port0localip6() - self.assertEqual(result, expected) - - def test__get_port1localip6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '0064:ff9b:0:0:0:0:9810:2814' - result = sample_vnf._get_port1localip6() - self.assertEqual(result, expected) - - def test__get_port0prefixip6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '112' - result = sample_vnf._get_port0prefixlen6() - self.assertEqual(result, expected) - - def test__get_port1prefixip6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '112' - result = sample_vnf._get_port1prefixlen6() - self.assertEqual(result, expected) - - def test__get_port0gateway6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '0064:ff9b:0:0:0:0:9810:6414' - result = sample_vnf._get_port0gateway6() - self.assertEqual(result, expected) - - def test__get_port1gateway6(self): - sample_vnf = SampleVNF('vnf1', self.VNFD_0) - expected = '0064:ff9b:0:0:0:0:9810:2814' - result = sample_vnf._get_port1gateway6() - self.assertEqual(result, expected) - @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.Process') def test__start_vnf(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -1785,16 +1749,6 @@ class TestSampleVnf(unittest.TestCase): self.assertEqual(sample_vnf.wait_for_instantiate(), 0) - def test__build_ports(self): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - sample_vnf = SampleVNF('vnf1', vnfd) - - self.assertIsNone(sample_vnf._build_ports()) - self.assertIsNotNone(sample_vnf.networks) - self.assertIsNotNone(sample_vnf.uplink_ports) - self.assertIsNotNone(sample_vnf.downlink_ports) - self.assertIsNotNone(sample_vnf.my_ports) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") def test_vnf_execute_with_queue_data(self, *args): queue_size_list = [ diff --git a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py index 77488c479..d8b9625fb 100644 --- a/yardstick/network_services/vnf_generic/vnf/sample_vnf.py +++ b/yardstick/network_services/vnf_generic/vnf/sample_vnf.py @@ -35,7 +35,6 @@ from yardstick.common import utils from yardstick.network_services import constants from yardstick.network_services.helpers.dpdkbindnic_helper import DpdkBindHelper, DpdkNode from yardstick.network_services.helpers.samplevnf_helper import MultiPortConfig -from yardstick.network_services.helpers.samplevnf_helper import PortPairs from yardstick.network_services.nfvi.resource import ResourceProfile from yardstick.network_services.utils import get_nsb_option from yardstick.network_services.vnf_generic.vnf.base import GenericTrafficGen @@ -657,49 +656,6 @@ class SampleVNF(GenericVNF): self.vnf_port_pairs = None self._vnf_process = None - def _build_ports(self): - self._port_pairs = PortPairs(self.vnfd_helper.interfaces) - self.networks = self._port_pairs.networks - self.uplink_ports = self.vnfd_helper.port_nums(self._port_pairs.uplink_ports) - self.downlink_ports = self.vnfd_helper.port_nums(self._port_pairs.downlink_ports) - self.my_ports = self.vnfd_helper.port_nums(self._port_pairs.all_ports) - - def _get_route_data(self, route_index, route_type): - route_iter = iter(self.vnfd_helper.vdu0.get('nd_route_tbl', [])) - for _ in range(route_index): - next(route_iter, '') - return next(route_iter, {}).get(route_type, '') - - def _get_port0localip6(self): - return_value = self._get_route_data(0, 'network') - LOG.info("_get_port0localip6 : %s", return_value) - return return_value - - def _get_port1localip6(self): - return_value = self._get_route_data(1, 'network') - LOG.info("_get_port1localip6 : %s", return_value) - return return_value - - def _get_port0prefixlen6(self): - return_value = self._get_route_data(0, 'netmask') - LOG.info("_get_port0prefixlen6 : %s", return_value) - return return_value - - def _get_port1prefixlen6(self): - return_value = self._get_route_data(1, 'netmask') - LOG.info("_get_port1prefixlen6 : %s", return_value) - return return_value - - def _get_port0gateway6(self): - return_value = self._get_route_data(0, 'network') - LOG.info("_get_port0gateway6 : %s", return_value) - return return_value - - def _get_port1gateway6(self): - return_value = self._get_route_data(1, 'network') - LOG.info("_get_port1gateway6 : %s", return_value) - return return_value - def _start_vnf(self): self.queue_wrapper = QueueFileWrapper(self.q_in, self.q_out, self.VNF_PROMPT) name = "{}-{}-{}".format(self.name, self.APP_NAME, os.getpid()) |