aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/tests')
-rw-r--r--yardstick/tests/unit/benchmark/contexts/standalone/test_ovs_dpdk.py3
-rw-r--r--yardstick/tests/unit/benchmark/contexts/standalone/test_sriov.py3
-rw-r--r--yardstick/tests/unit/benchmark/contexts/test_kubernetes.py3
-rw-r--r--yardstick/tests/unit/benchmark/core/test_task.py8
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py6
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py5
6 files changed, 17 insertions, 11 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/standalone/test_ovs_dpdk.py b/yardstick/tests/unit/benchmark/contexts/standalone/test_ovs_dpdk.py
index a4a8359d5..69779d3e0 100644
--- a/yardstick/tests/unit/benchmark/contexts/standalone/test_ovs_dpdk.py
+++ b/yardstick/tests/unit/benchmark/contexts/standalone/test_ovs_dpdk.py
@@ -19,6 +19,7 @@ import mock
import six
import unittest
+from yardstick.benchmark import contexts
from yardstick.benchmark.contexts import base
from yardstick.benchmark.contexts.standalone import model
from yardstick.benchmark.contexts.standalone import ovs_dpdk
@@ -82,7 +83,7 @@ class OvsDpdkContextTestCase(unittest.TestCase):
def test_init(self):
ATTRS = {
- 'name': 'StandaloneOvsDpdk',
+ 'name': contexts.CONTEXT_STANDALONEOVSDPDK,
'task_id': '1234567890',
'file': 'pod',
'flavor': {},
diff --git a/yardstick/tests/unit/benchmark/contexts/standalone/test_sriov.py b/yardstick/tests/unit/benchmark/contexts/standalone/test_sriov.py
index 169084607..74c31569c 100644
--- a/yardstick/tests/unit/benchmark/contexts/standalone/test_sriov.py
+++ b/yardstick/tests/unit/benchmark/contexts/standalone/test_sriov.py
@@ -18,6 +18,7 @@ import mock
import unittest
from yardstick import ssh
+from yardstick.benchmark import contexts
from yardstick.benchmark.contexts import base
from yardstick.benchmark.contexts.standalone import model
from yardstick.benchmark.contexts.standalone import sriov
@@ -30,7 +31,7 @@ class SriovContextTestCase(unittest.TestCase):
NODES_DUPLICATE_SAMPLE = "nodes_duplicate_sample.yaml"
ATTRS = {
- 'name': 'StandaloneSriov',
+ 'name': contexts.CONTEXT_STANDALONESRIOV,
'task_id': '1234567890',
'file': 'pod',
'flavor': {},
diff --git a/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py b/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py
index 3957aab91..941d50e82 100644
--- a/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py
+++ b/yardstick/tests/unit/benchmark/contexts/test_kubernetes.py
@@ -10,13 +10,14 @@
import mock
import unittest
+from yardstick.benchmark import contexts
from yardstick.benchmark.contexts import base
from yardstick.benchmark.contexts import kubernetes
from yardstick.orchestrator import kubernetes as orchestrator_kubernetes
CONTEXT_CFG = {
- 'type': 'Kubernetes',
+ 'type': contexts.CONTEXT_KUBERNETES,
'name': 'k8s',
'task_id': '1234567890',
'servers': {
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py
index 0424c77a3..35236637d 100644
--- a/yardstick/tests/unit/benchmark/core/test_task.py
+++ b/yardstick/tests/unit/benchmark/core/test_task.py
@@ -28,7 +28,7 @@ from yardstick.common import utils
class TaskTestCase(unittest.TestCase):
- @mock.patch.object(task, 'Context')
+ @mock.patch.object(base, 'Context')
def test_parse_nodes_with_context_same_context(self, mock_context):
scenario_cfg = {
"nodes": {
@@ -69,7 +69,7 @@ class TaskTestCase(unittest.TestCase):
dispatcher2])
self.assertIsNone(t._do_output(output_config, {}))
- @mock.patch.object(task, 'Context')
+ @mock.patch.object(base, 'Context')
def test_parse_networks_from_nodes(self, mock_context):
nodes = {
'node1': {
@@ -133,7 +133,7 @@ class TaskTestCase(unittest.TestCase):
self.assertEqual(mock_context.get_network.call_count, expected_get_network_calls)
self.assertDictEqual(networks, expected)
- @mock.patch.object(task, 'Context')
+ @mock.patch.object(base, 'Context')
@mock.patch.object(task, 'base_runner')
def test_run(self, mock_base_runner, *args):
scenario = {
@@ -156,7 +156,7 @@ class TaskTestCase(unittest.TestCase):
t._run([scenario], False, "yardstick.out")
runner.run.assert_called_once()
- @mock.patch.object(task, 'Context')
+ @mock.patch.object(base, 'Context')
@mock.patch.object(task, 'base_runner')
def test_run_ProxDuration(self, mock_base_runner, *args):
scenario = {
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
index 4ade157a3..f34faaec7 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
@@ -18,10 +18,11 @@ import mock
import six
import unittest
+from yardstick.benchmark import contexts
+from yardstick.benchmark.contexts import base as ctx_base
from yardstick.network_services.libs.ixia_libs.ixnet import ixnet_api
from yardstick.network_services.traffic_profile import base as tp_base
from yardstick.network_services.vnf_generic.vnf import tg_rfc2544_ixia
-from yardstick.benchmark.contexts import base as ctx_base
TEST_FILE_YAML = 'nsb_test_case.yaml'
@@ -162,7 +163,8 @@ class TestIXIATrafficGen(unittest.TestCase):
'nodes': {'tg__1': 'trafficgen_1.yardstick',
'vnf__1': 'vnf.yardstick'},
'topology': 'vpe_vnf_topology.yaml'}],
- 'context': {'nfvi_type': 'baremetal', 'type': 'Node',
+ 'context': {'nfvi_type': 'baremetal',
+ 'type': contexts.CONTEXT_NODE,
'name': 'yardstick',
'file': '/etc/yardstick/nodes/pod.yaml'},
'schema': 'yardstick:task:0.1'}
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
index 4d3e4ff0b..ba90dc94a 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_trex.py
@@ -15,10 +15,11 @@
import mock
import unittest
+from yardstick.benchmark import contexts
+from yardstick.benchmark.contexts import base as ctx_base
from yardstick.network_services.traffic_profile import base as tp_base
from yardstick.network_services.vnf_generic.vnf import sample_vnf
from yardstick.network_services.vnf_generic.vnf import tg_rfc2544_trex
-from yardstick.benchmark.contexts import base as ctx_base
class TestTrexRfcResouceHelper(unittest.TestCase):
@@ -206,7 +207,7 @@ class TestTrexTrafficGenRFC(unittest.TestCase):
],
'context': {
'nfvi_type': 'baremetal',
- 'type': 'Node',
+ 'type': contexts.CONTEXT_NODE,
'name': 'yardstick',
'file': '/etc/yardstick/nodes/pod.yaml',
},