aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TestConfig.py
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-08-07 21:07:26 +0200
committerJan Gelety <jgelety@cisco.com>2019-08-20 08:53:04 +0000
commita46ab8cc305fe9d7e96d321ae8cd0ac7a6fc1e24 (patch)
tree5cd94586f5f44605b99d4655fa5211dabf9386ad /resources/libraries/python/TestConfig.py
parent329e0acee1cf31c6524883e15560993af76f0fad (diff)
Interface API cleanup
CSIT code alignment with API changes in VPP introduced by patch https://gerrit.fd.io/r/c/vpp/+/18361 Change-Id: Ib0357bba79f55d297ef1086fbf3b760caca16cdb Signed-off-by: Jan Gelety <jgelety@cisco.com> Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/TestConfig.py')
-rw-r--r--resources/libraries/python/TestConfig.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/resources/libraries/python/TestConfig.py b/resources/libraries/python/TestConfig.py
index 5887c11a9f..48f67e5a0f 100644
--- a/resources/libraries/python/TestConfig.py
+++ b/resources/libraries/python/TestConfig.py
@@ -17,7 +17,8 @@ from ipaddress import ip_address, AddressValueError
from robot.api import logger
from resources.libraries.python.Constants import Constants
-from resources.libraries.python.InterfaceUtil import InterfaceUtil
+from resources.libraries.python.InterfaceUtil import InterfaceUtil, \
+ InterfaceStatusFlags
from resources.libraries.python.IPUtil import IPUtil
from resources.libraries.python.PapiExecutor import PapiSocketExecutor
from resources.libraries.python.topology import Topology
@@ -145,11 +146,10 @@ class TestConfig(object):
cmd1 = 'sw_interface_add_del_address'
args1 = dict(
sw_if_index=InterfaceUtil.get_interface_index(node, node_vxlan_if),
- is_add=1,
- is_ipv6=1 if src_ip_addr_start.version == 6 else 0,
- del_all=0,
- address_length=128 if src_ip_addr_start.version == 6 else 32,
- address=None)
+ is_add=True,
+ del_all=False,
+ prefix=None
+ )
cmd2 = 'vxlan_add_del_tunnel'
args2 = dict(
is_add=1,
@@ -160,12 +160,14 @@ class TestConfig(object):
mcast_sw_if_index=Constants.BITWISE_NON_ZERO,
encap_vrf_id=0,
decap_next_index=Constants.BITWISE_NON_ZERO,
- vni=None)
+ vni=None
+ )
cmd3 = 'create_vlan_subif'
args3 = dict(
sw_if_index=InterfaceUtil.get_interface_index(
node, node_vlan_if),
- vlan_id=None)
+ vlan_id=None
+ )
with PapiSocketExecutor(node) as papi_exec:
for i in xrange(0, vxlan_count):
@@ -177,7 +179,8 @@ class TestConfig(object):
"has been reached.")
vxlan_count = i
break
- args1['address'] = getattr(src_ip, 'packed')
+ args1['prefix'] = IPUtil.create_prefix_object(
+ src_ip, 128 if src_ip_addr_start.version == 6 else 32)
args2['src_address'] = getattr(src_ip, 'packed')
args2['dst_address'] = getattr(dst_ip, 'packed')
args2['vni'] = int(vni_start) + i
@@ -250,10 +253,12 @@ class TestConfig(object):
cmd = 'sw_interface_set_flags'
args1 = dict(
sw_if_index=None,
- admin_up_down=1)
+ flags=InterfaceStatusFlags.IF_STATUS_API_FLAG_ADMIN_UP.value
+ )
args2 = dict(
sw_if_index=None,
- admin_up_down=1)
+ flags=InterfaceStatusFlags.IF_STATUS_API_FLAG_ADMIN_UP.value
+ )
with PapiSocketExecutor(node) as papi_exec:
for i in xrange(0, vxlan_count):