From 103577ca74b69054d1b8e095511e4593d75339c1 Mon Sep 17 00:00:00 2001 From: "Chornyi, TarasX" Date: Mon, 31 Dec 2018 17:13:15 +0200 Subject: Add static ip mask support JIRA: YARDSTICK-1566 Change-Id: I6a826d5662a1dfc818c9f1ddf94b3f01c3d37d3b Signed-off-by: Chornyi, TarasX --- yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py | 4 ++-- .../tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py index 6645d45fe..d41dd028f 100644 --- a/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py +++ b/yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py @@ -1038,7 +1038,7 @@ class IxNextgen(object): # pragma: no cover return obj - def add_static_ipv4(self, iface, vport, start_ip, count): + def add_static_ipv4(self, iface, vport, start_ip, count, mask='24'): """Add static IP range to the interface""" log.debug("add_static_ipv4: start_ip:'%s', count:'%s'", start_ip, count) @@ -1046,5 +1046,5 @@ class IxNextgen(object): # pragma: no cover self.ixnet.setMultiAttribute(obj, '-protocolInterface', iface, '-ipStart', start_ip, '-count', count, - '-enabled', 'true') + '-mask', mask, '-enabled', 'true') self.ixnet.commit() diff --git a/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py b/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py index c1d902061..5b32a4297 100644 --- a/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py +++ b/yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py @@ -373,13 +373,15 @@ class TestIxNextgen(unittest.TestCase): self.ixnet_gen.add_static_ipv4(iface='iface', vport='vport', start_ip='10.0.0.0', - count='100') + count='100', + mask='32') self.ixnet_gen.ixnet.add.assert_called_once_with( 'vport/protocols/static', 'ip') self.ixnet_gen.ixnet.setMultiAttribute.assert_any_call( 'obj', '-protocolInterface', 'iface', '-ipStart', '10.0.0.0', '-count', '100', + '-mask', '32', '-enabled', 'true') @mock.patch.object(IxNetwork, 'IxNet') -- cgit 1.2.3-korg