Add static ip mask support 25/66125/1
authorChornyi, TarasX <tarasx.chornyi@intel.com>
Mon, 31 Dec 2018 15:13:15 +0000 (17:13 +0200)
committerChornyi, TarasX <tarasx.chornyi@intel.com>
Mon, 31 Dec 2018 15:13:15 +0000 (17:13 +0200)
JIRA: YARDSTICK-1566

Change-Id: I6a826d5662a1dfc818c9f1ddf94b3f01c3d37d3b
Signed-off-by: Chornyi, TarasX <tarasx.chornyi@intel.com>
yardstick/network_services/libs/ixia_libs/ixnet/ixnet_api.py
yardstick/tests/unit/network_services/libs/ixia_libs/test_ixnet_api.py

index 6645d45..d41dd02 100644 (file)
@@ -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()
index c1d9020..5b32a42 100644 (file)
@@ -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')