X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FTestConfig.py;h=5887c11a9f8277fc4b77219f52638f4219bc0f36;hb=545216fdee77b0b9ddc8d5e8c0f2e5662cacea76;hp=284b2e8cf44440bec491b3a83064c1d4e457bc48;hpb=33fb34665214bbbd0a4b3154169b21c2da01f69b;p=csit.git diff --git a/resources/libraries/python/TestConfig.py b/resources/libraries/python/TestConfig.py index 284b2e8cf4..5887c11a9f 100644 --- a/resources/libraries/python/TestConfig.py +++ b/resources/libraries/python/TestConfig.py @@ -19,7 +19,7 @@ from robot.api import logger from resources.libraries.python.Constants import Constants from resources.libraries.python.InterfaceUtil import InterfaceUtil from resources.libraries.python.IPUtil import IPUtil -from resources.libraries.python.PapiExecutor import PapiExecutor +from resources.libraries.python.PapiExecutor import PapiSocketExecutor from resources.libraries.python.topology import Topology from resources.libraries.python.VatExecutor import VatExecutor @@ -166,10 +166,8 @@ class TestConfig(object): sw_if_index=InterfaceUtil.get_interface_index( node, node_vlan_if), vlan_id=None) - err_msg = 'Failed to create VXLAN and VLAN interfaces on host {host}'.\ - format(host=node['host']) - with PapiExecutor(node) as papi_exec: + with PapiSocketExecutor(node) as papi_exec: for i in xrange(0, vxlan_count): try: src_ip = src_ip_addr_start + i * ip_step @@ -179,17 +177,15 @@ class TestConfig(object): "has been reached.") vxlan_count = i break - args1['address'] = src_ip.packed - args2['src_address'] = src_ip.packed - args2['dst_address'] = dst_ip.packed + args1['address'] = getattr(src_ip, 'packed') + args2['src_address'] = getattr(src_ip, 'packed') + args2['dst_address'] = getattr(dst_ip, 'packed') args2['vni'] = int(vni_start) + i args3['vlan_id'] = i + 1 history = False if 1 < i < vxlan_count else True papi_exec.add(cmd1, history=history, **args1).\ add(cmd2, history=history, **args2).\ add(cmd3, history=history, **args3) - if i > 0 and i % (Constants.PAPI_MAX_API_BULK / 3) == 0: - papi_exec.get_replies(err_msg) papi_exec.get_replies() return vxlan_count @@ -258,10 +254,8 @@ class TestConfig(object): args2 = dict( sw_if_index=None, admin_up_down=1) - err_msg = 'Failed to put VXLAN and VLAN interfaces up on host {host}'. \ - format(host=node['host']) - with PapiExecutor(node) as papi_exec: + with PapiSocketExecutor(node) as papi_exec: for i in xrange(0, vxlan_count): vxlan_subif_key = Topology.add_new_port(node, 'vxlan_tunnel') vxlan_subif_name = 'vxlan_tunnel{nr}'.format(nr=i) @@ -296,8 +290,6 @@ class TestConfig(object): history = False if 1 < i < vxlan_count else True papi_exec.add(cmd, history=history, **args1). \ add(cmd, history=history, **args2) - if i > 0 and i % (Constants.PAPI_MAX_API_BULK / 2) == 0: - papi_exec.get_replies(err_msg) papi_exec.add(cmd, **args1).add(cmd, **args2) papi_exec.get_replies() @@ -398,10 +390,8 @@ class TestConfig(object): shg=0, port_type=0, enable=1) - err_msg = 'Failed to put VXLAN and VLAN interfaces to bridge domain ' \ - 'on host {host}'.format(host=node['host']) - with PapiExecutor(node) as papi_exec: + with PapiSocketExecutor(node) as papi_exec: for i in xrange(0, vxlan_count): dst_ip = dst_ip_addr_start + i * ip_step args1['neighbor']['ip_address'] = str(dst_ip) @@ -420,6 +410,4 @@ class TestConfig(object): add(cmd2, history=history, **args2). \ add(cmd3, history=history, **args3). \ add(cmd3, history=history, **args4) - if i > 0 and i % (Constants.PAPI_MAX_API_BULK / 4) == 0: - papi_exec.get_replies(err_msg) papi_exec.get_replies()