aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/network_services/vnf_generic
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-05 15:38:52 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-27 03:15:00 +0000
commitbd11ffdec1f18785696b5c4872e5bd5e1012249c (patch)
treed3f739d4f2f694c6f798bae3babf4341b783fd86 /tests/unit/network_services/vnf_generic
parentc56ca9c1dccaa11a2ff3af588b45d85207fb1e40 (diff)
collectd: write config file from Jinja2 template
We have the collectd.conf inside the python package so instead of copying it from various places, write the template directly to the remote system. collectd: read collect.conf template with pkgresources read the collectd.conf file as a string directly and upload without creating temp file use Jinja2 template, disable failing plugins use proper Jinja2 template, disable the plugins that were failing to load and blocking startup add support for per-testcase collectd.conf config using YAML add support for custom interval, default is 25 seconds Change-Id: Id904f7b7c9f41a9dd7adf5dfa06c064d65c25d2d Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/network_services/vnf_generic')
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_sample_vnf.py10
1 files changed, 8 insertions, 2 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 4b9f4172e..d0c4b6f42 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
@@ -723,8 +723,9 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
result = dpdk_setup_helper._validate_cpu_cfg()
self.assertEqual(result, expected)
+ @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
@mock.patch('yardstick.ssh.SSH')
- def test_setup_vnf_environment(self, _):
+ def test_setup_vnf_environment(self, _, mock_time):
def execute(cmd, *args, **kwargs):
if cmd.startswith('which '):
return exec_failure
@@ -782,6 +783,8 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
+ dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
+ vnfd_helper.interfaces]
result = dpdk_setup_helper._setup_resources()
self.assertIsInstance(result, ResourceProfile)
self.assertEqual(dpdk_setup_helper.socket, 0)
@@ -796,11 +799,14 @@ class TestDpdkVnfSetupEnvHelper(unittest.TestCase):
dpdk_setup_helper = DpdkVnfSetupEnvHelper(vnfd_helper, ssh_helper, scenario_helper)
dpdk_setup_helper._validate_cpu_cfg = mock.Mock()
+ dpdk_setup_helper.bound_pci = [v['virtual-interface']["vpci"] for v in
+ vnfd_helper.interfaces]
result = dpdk_setup_helper._setup_resources()
self.assertIsInstance(result, ResourceProfile)
self.assertEqual(dpdk_setup_helper.socket, 1)
- def test__detect_and_bind_drivers(self):
+ @mock.patch('yardstick.network_services.vnf_generic.vnf.sample_vnf.time')
+ def test__detect_and_bind_drivers(self, mock_time):
vnfd_helper = VnfdHelper(deepcopy(self.VNFD_0))
ssh_helper = mock.Mock()
# ssh_helper.execute = mock.Mock(return_value = (0, 'text', ''))