aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChornyi, TarasX <tarasx.chornyi@intel.com>2018-12-31 17:13:15 +0200
committerChornyi, TarasX <tarasx.chornyi@intel.com>2018-12-31 17:13:15 +0200
commit103577ca74b69054d1b8e095511e4593d75339c1 (patch)
treea74a8c12521386fc0efaf25f1bc28d773b052e21
parent3d96c4a4ca8ed8ea2d769a150f99632343179e31 (diff)
Add static ip mask support
JIRA: YARDSTICK-1566 Change-Id: I6a826d5662a1dfc818c9f1ddf94b3f01c3d37d3b Signed-off-by: Chornyi, TarasX <tarasx.chornyi@intel.com>
-rw-r--r--yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py4
-rw-r--r--yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py4
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')