Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Enable iommu support in grub"
[yardstick.git]
/
tests
/
unit
/
network_services
/
vnf_generic
/
vnf
/
test_vfw_vnf.py
diff --git
a/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py
b/tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py
index
958099a
..
d128db0
100644
(file)
--- a/
tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py
+++ b/
tests/unit/network_services/vnf_generic/vnf/test_vfw_vnf.py
@@
-15,8
+15,6
@@
# limitations under the License.
#
# limitations under the License.
#
-from __future__ import absolute_import
-
import unittest
import mock
import os
import unittest
import mock
import os
@@
-32,10
+30,10
@@
if stl_patch:
from yardstick.network_services.vnf_generic.vnf.vfw_vnf import FWApproxVnf
from yardstick.network_services.nfvi.resource import ResourceProfile
from yardstick.network_services.vnf_generic.vnf.vfw_vnf import FWApproxVnf
from yardstick.network_services.nfvi.resource import ResourceProfile
+
TEST_FILE_YAML = 'nsb_test_case.yaml'
SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper'
TEST_FILE_YAML = 'nsb_test_case.yaml'
SSH_HELPER = 'yardstick.network_services.vnf_generic.vnf.sample_vnf.VnfSshHelper'
-
name = 'vnf__1'
name = 'vnf__1'
@@
-239,7
+237,7
@@
class TestFWApproxVnf(unittest.TestCase):
'password': 'r00t',
'VNF model': 'vfw_vnf.yaml'}}}
'password': 'r00t',
'VNF model': 'vfw_vnf.yaml'}}}
- def test___init__(self,
mock_proces
s):
+ def test___init__(self,
*arg
s):
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
vfw_approx_vnf = FWApproxVnf(name, vnfd)
self.assertIsNone(vfw_approx_vnf._vnf_process)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
vfw_approx_vnf = FWApproxVnf(name, vnfd)
self.assertIsNone(vfw_approx_vnf._vnf_process)
@@
-260,7
+258,7
@@
pipeline>
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time")
@mock.patch(SSH_HELPER)
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time")
@mock.patch(SSH_HELPER)
- def test_collect_kpi(self, ssh,
mock_time, mock_proces
s):
+ def test_collect_kpi(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-282,7
+280,7
@@
pipeline>
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time")
@mock.patch(SSH_HELPER)
@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_proces
s):
+ def test_vnf_execute_command(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-294,7
+292,7
@@
pipeline>
self.assertEqual(vfw_approx_vnf.vnf_execute(cmd), "")
@mock.patch(SSH_HELPER)
self.assertEqual(vfw_approx_vnf.vnf_execute(cmd), "")
@mock.patch(SSH_HELPER)
- def test_get_stats(self, ssh,
mock_proces
s):
+ def test_get_stats(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-314,7
+312,7
@@
pipeline>
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.eval")
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.open")
@mock.patch(SSH_HELPER)
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.eval")
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.open")
@mock.patch(SSH_HELPER)
- def test_run_vfw(self, ssh,
mock_open, mock_eval, mock_hex, mock_proces
s):
+ def test_run_vfw(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-337,7
+335,7
@@
pipeline>
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.YangModel")
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.Context")
@mock.patch(SSH_HELPER)
@mock.patch("yardstick.network_services.vnf_generic.vnf.vfw_vnf.YangModel")
@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_proces
s):
+ def test_instantiate(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-351,16
+349,9
@@
pipeline>
self.scenario_cfg.update({"nodes": {"vnf__1": ""}})
self.assertIsNone(vfw_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg))
self.scenario_cfg.update({"nodes": {"vnf__1": ""}})
self.assertIsNone(vfw_approx_vnf.instantiate(self.scenario_cfg, self.context_cfg))
- def test_scale(self, mock_process):
- vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
- vfw_approx_vnf = FWApproxVnf(name, vnfd)
- flavor = ""
- with self.assertRaises(NotImplementedError):
- vfw_approx_vnf.scale(flavor)
-
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time")
@mock.patch(SSH_HELPER)
@mock.patch("yardstick.network_services.vnf_generic.vnf.sample_vnf.time")
@mock.patch(SSH_HELPER)
- def test_terminate(self, ssh,
mock_time, mock_proces
s):
+ def test_terminate(self, ssh,
*arg
s):
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
mock_ssh(ssh)
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
@@
-372,6
+363,3
@@
pipeline>
vfw_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py"
vfw_approx_vnf._resource_collect_stop = mock.Mock()
self.assertIsNone(vfw_approx_vnf.terminate())
vfw_approx_vnf.dpdk_nic_bind = "dpdk_nic_bind.py"
vfw_approx_vnf._resource_collect_stop = mock.Mock()
self.assertIsNone(vfw_approx_vnf.terminate())
-
-if __name__ == '__main__':
- unittest.main()