diff options
author | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2017-11-23 09:08:14 +0000 |
---|---|---|
committer | Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> | 2018-01-03 23:48:31 +0000 |
commit | 67bd29933789e7f31c52290fdd43835e54f89eaf (patch) | |
tree | 409fad301d97e6b1f2588925cfd52cd2051cbb4e /tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py | |
parent | fa3a7b8d6cadbb2d5e9311cb2da040003f9b9140 (diff) |
Make GenericVNF an abstract class
GenericVNF class is now an abstract class. Only optional methods are
implemented. Mandatory methods:
- instantiate
- wait_for_instantiate
- terminate
- scale
- collect_kpi.
JIRA: YARDSTICK-866
Change-Id: Ia8766f9f98816e11894d1e72b0f3bd573d091d99
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py')
-rw-r--r-- | tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py b/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py index e9444b493..2a2647a91 100644 --- a/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py +++ b/tests/unit/network_services/vnf_generic/vnf/test_acl_vnf.py @@ -15,8 +15,6 @@ # limitations under the License. # -from __future__ import absolute_import - import unittest import mock import os @@ -241,14 +239,14 @@ class TestAclApproxVnf(unittest.TestCase): 'password': 'r00t', 'VNF model': 'acl_vnf.yaml'}}} - def test___init__(self, mock_process): + def test___init__(self, *args): vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] acl_approx_vnf = AclApproxVnf(name, vnfd) self.assertIsNone(acl_approx_vnf._vnf_process) @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_collect_kpi(self, ssh, mock_time, mock_process): + def test_collect_kpi(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -263,7 +261,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_vnf_execute_command(self, ssh, mock_time, mock_process): + def test_vnf_execute_command(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -275,7 +273,7 @@ class TestAclApproxVnf(unittest.TestCase): self.assertEqual("", acl_approx_vnf.vnf_execute(cmd)) @mock.patch(SSH_HELPER) - def test_get_stats(self, ssh, mock_process): + def test_get_stats(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -296,7 +294,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.acl_vnf.eval") @mock.patch('yardstick.network_services.vnf_generic.vnf.acl_vnf.open') @mock.patch(SSH_HELPER) - def test_run_acl(self, ssh, mock_open, mock_eval, mock_hex, mock_process): + def test_run_acl(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -317,7 +315,7 @@ class TestAclApproxVnf(unittest.TestCase): @mock.patch("yardstick.network_services.vnf_generic.vnf.acl_vnf.find_relative_file") @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context") @mock.patch(SSH_HELPER) - def test_instantiate(self, ssh, mock_context, mock_yang, mock_find, mock_process): + def test_instantiate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -333,16 +331,9 @@ class TestAclApproxVnf(unittest.TestCase): self.assertIsNone(acl_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg)) - def test_scale(self, mock_process): - vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] - acl_approx_vnf = AclApproxVnf(name, vnfd) - flavor = "" - with self.assertRaises(NotImplementedError): - acl_approx_vnf.scale(flavor) - @mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time") @mock.patch(SSH_HELPER) - def test_terminate(self, ssh, mock_time, mock_process): + def test_terminate(self, ssh, *args): mock_ssh(ssh) vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0] @@ -355,6 +346,3 @@ class TestAclApproxVnf(unittest.TestCase): acl_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py" acl_approx_vnf._resource_collect_stop = mock.Mock() self.assertEqual(None, acl_approx_vnf.terminate()) - -if __name__ == '__main__': - unittest.main() |