summaryrefslogtreecommitdiffstats
path: root/tests/unit/network_services/vnf_generic/vnf
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-21 15:00:30 -0700
committerRoss Brattain <ross.b.brattain@intel.com>2017-09-22 14:00:22 -0700
commitfe3d086141f85d4fa6ed7cbaca70222e223c3323 (patch)
tree3401d5c962a00ff903fac62e8d08062d31e41540 /tests/unit/network_services/vnf_generic/vnf
parent4529399c79b1e61ea37cb79e790adc130c98cf45 (diff)
tg_rfc2544_ixia: log exceptions and fix list iter
Change-Id: Ia9722604b7c8ae23e784e780f113d012de544d4b Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
Diffstat (limited to 'tests/unit/network_services/vnf_generic/vnf')
-rw-r--r--tests/unit/network_services/vnf_generic/vnf/test_tg_rfc2544_ixia.py18
1 files changed, 11 insertions, 7 deletions
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 0c3520c44..f62a0fb3b 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
@@ -252,7 +252,8 @@ class TestIXIATrafficGen(unittest.TestCase):
mock_traffic_profile = mock.Mock(autospec=TrafficProfile)
mock_traffic_profile.get_traffic_definition.return_value = "64"
mock_traffic_profile.params = self.TRAFFIC_PROFILE
- mock_traffic_profile.ports = ["xe0", "xe1"]
+ # traffic_profile.ports is standardized on port_num
+ mock_traffic_profile.ports = [0, 1]
mock_ssh_instance = mock.Mock(autospec=mock_ssh.SSH)
mock_ssh_instance.execute.return_value = 0, "", ""
@@ -346,9 +347,12 @@ class TestIXIATrafficGen(unittest.TestCase):
'task_path': '/path/to/task'
}
- with mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open',
- create=True) as mock_open:
- with mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.open',
- create=True) as mock_ixia_open:
- result = sut._traffic_runner(mock_traffic_profile)
- self.assertIsNone(result)
+ @mock.patch('yardstick.benchmark.scenarios.networking.vnf_generic.open', create=True)
+ @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.open',
+ mock.mock_open(), create=True)
+ @mock.patch('yardstick.network_services.vnf_generic.vnf.tg_rfc2544_ixia.LOG.exception')
+ def _traffic_runner(*args):
+ result = sut._traffic_runner(mock_traffic_profile)
+ self.assertIsNone(result)
+
+ _traffic_runner()