summaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/benchmark/scenarios/lib/test_create_keypair.py11
-rw-r--r--tests/unit/network_services/nfvi/test_resource.py5
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py2
3 files changed, 12 insertions, 6 deletions
diff --git a/tests/unit/benchmark/scenarios/lib/test_create_keypair.py b/tests/unit/benchmark/scenarios/lib/test_create_keypair.py
index 99e6b9afa..4b9b72013 100644
--- a/tests/unit/benchmark/scenarios/lib/test_create_keypair.py
+++ b/tests/unit/benchmark/scenarios/lib/test_create_keypair.py
@@ -8,15 +8,16 @@
##############################################################################
import unittest
import mock
-import paramiko
from yardstick.benchmark.scenarios.lib.create_keypair import CreateKeypair
+PREFIX = "yardstick.benchmark.scenarios.lib.create_keypair"
-class CreateKeypairTestCase(unittest.TestCase):
- @mock.patch('yardstick.common.openstack_utils.create_keypair')
- def test_create_keypair(self, mock_create_keypair):
+class CreateKeypairTestCase(unittest.TestCase):
+ @mock.patch('{}.paramiko'.format(PREFIX))
+ @mock.patch('{}.op_utils'.format(PREFIX))
+ def test_create_keypair(self, mock_op_utils, mock_paramiko):
options = {
'key_name': 'yardstick_key',
'key_path': '/tmp/yardstick_key'
@@ -24,7 +25,7 @@ class CreateKeypairTestCase(unittest.TestCase):
args = {"options": options}
obj = CreateKeypair(args, {})
obj.run({})
- self.assertTrue(mock_create_keypair.called)
+ self.assertTrue(mock_op_utils.create_keypair.called)
def main():
diff --git a/tests/unit/network_services/nfvi/test_resource.py b/tests/unit/network_services/nfvi/test_resource.py
index 072f06edf..21beba882 100644
--- a/tests/unit/network_services/nfvi/test_resource.py
+++ b/tests/unit/network_services/nfvi/test_resource.py
@@ -274,6 +274,7 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result({}, [0, 1, 2])
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
+ 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -286,6 +287,7 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2])
expected_result = {'cpu': {1: {'ipc': '1234'}}, 'dpdkstat': {}, 'hugepages': {},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
+ 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -294,6 +296,7 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2])
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {},
'memory': {'bw': '101'}, 'ovs_stats': {}, 'timestamp': '',
+ 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -305,6 +308,7 @@ class TestResourceProfile(unittest.TestCase):
expected_result = {'cpu': {}, 'dpdkstat': {}, 'hugepages': {'free':
'101'},
'memory': {}, 'ovs_stats': {}, 'timestamp': '',
+ 'intel_pmu': {},
'virt': {}}
self.assertDictEqual(res, expected_result)
@@ -321,6 +325,7 @@ class TestResourceProfile(unittest.TestCase):
res = self.resource_profile.parse_collectd_result(metric, [0, 1, 2])
expected_result = {'cpu': {}, 'dpdkstat': {'tx': '101'}, 'hugepages': {},
'memory': {}, 'ovs_stats': {'tx': '101'}, 'timestamp': '',
+ 'intel_pmu': {},
'virt': {'memory': '101'}}
self.assertDictEqual(res, expected_result)
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py
index db128a15c..c65c0ab0a 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py
@@ -123,7 +123,7 @@ class TestIxLoadTrafficGen(unittest.TestCase):
ssh.from_node.return_value = ssh_mock
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
ixload_traffic_gen = IxLoadTrafficGen(NAME, vnfd)
- self.assertIsNone(ixload_traffic_gen.data)
+ self.assertIsNone(ixload_traffic_gen.resource_helper.data)
def test_collect_kpi(self):
with mock.patch("yardstick.ssh.SSH") as ssh: