aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/network_services/vnf_generic/vnf
diff options
context:
space:
mode:
authorMaciej Skrocki <maciej.skrocki@intel.com>2017-08-28 17:24:05 -0700
committerMaciej Skrocki <maciej.skrocki@intel.com>2017-08-31 17:26:59 -0700
commit378171687bda92d031437b0d8cc90968c1655b9d (patch)
treea7d1c948d5514e94ef66aa1dd6068c960fcfbd31 /tests/unit/network_services/vnf_generic/vnf
parent57b17a2223d8751f2c5eae660b706e2fc736a47c (diff)
Added TC for vFW in heat context with ixia TG
- added common method to get relative paths - added 'Ixia' APP_NAME Change-Id: I7966798bab71af66d3efbeb1e13b07e8fbb41e88 Signed-off-by: Maciej Skrocki <maciej.skrocki@intel.com>
Diffstat (limited to 'tests/unit/network_services/vnf_generic/vnf')
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_ixload.py8
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py9
2 files changed, 11 insertions, 6 deletions
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 5c81aa886..db128a15c 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
@@ -161,7 +161,8 @@ class TestIxLoadTrafficGen(unittest.TestCase):
vnfd = self.VNFD['vnfd:vnfd-catalog']['vnfd'][0]
ixload_traffic_gen = IxLoadTrafficGen(NAME, vnfd)
scenario_cfg = {'tc': "nsb_test_case",
- 'ixia_profile': "ixload.cfg"}
+ 'ixia_profile': "ixload.cfg",
+ 'task_path': "/path/to/task"}
ixload_traffic_gen.RESULTS_MOUNT = "/tmp/result"
shutil.copy = mock.Mock()
scenario_cfg.update({'options': {'packetsize': 64, 'traffic_type': 4,
@@ -173,8 +174,9 @@ class TestIxLoadTrafficGen(unittest.TestCase):
'1C/1T',
'worker_threads': 1}}
}})
- self.assertRaises(IOError,
- ixload_traffic_gen.instantiate(scenario_cfg, {}))
+ with mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) as mock_open:
+ mock_open.return_value = mock.MagicMock()
+ ixload_traffic_gen.instantiate(scenario_cfg, {})
@mock.patch("yardstick.network_services.vnf_generic.vnf.tg_ixload.call")
@mock.patch("yardstick.network_services.vnf_generic.vnf.tg_ixload.shutil")
diff --git a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
index ca8150cb2..661e885ca 100644
--- a/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
+++ b/tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py
@@ -343,8 +343,11 @@ class TestIXIATrafficGen(unittest.TestCase):
},
},
},
- 'ixia_profile': {}
+ 'ixia_profile': '/path/to/profile',
+ 'task_path': '/path/to/task'
}
- result = sut._traffic_runner(mock_traffic_profile)
- self.assertIsNone(result)
+ with mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True) as mock_open:
+ mock_open.return_value = mock.MagicMock()
+ result = sut._traffic_runner(mock_traffic_profile)
+ self.assertIsNone(result)