X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FTestConfig.py;h=5c441df09e397f1622fdefe85cfb724f8500c24b;hb=f88a3d9178dfbd73d0479f9aa2f5224e0c89ca1f;hp=1f8af5d457bdbb50b763f84275cf1cd49f3d1b58;hpb=dbe149c85501bc15dde1496a722e2b9dce86ee92;p=csit.git diff --git a/resources/libraries/python/TestConfig.py b/resources/libraries/python/TestConfig.py index 1f8af5d457..5c441df09e 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 @@ -132,11 +132,11 @@ class TestConfig(object): ip=src_ip, ip_len=128 if src_ip.version == 6 else 32)) commands.append( - 'vxlan_add_del_tunnel src {src_ip} dst {dst_ip} vni {vni}\n' - .format(src_ip=src_ip, dst_ip=dst_ip, + 'vxlan_add_del_tunnel src {srcip} dst {dstip} vni {vni}\n'\ + .format(srcip=src_ip, dstip=dst_ip, vni=vni_start + i)) commands.append( - 'create_vlan_subif sw_if_index {sw_idx} vlan {vlan}\n' + 'create_vlan_subif sw_if_index {sw_idx} vlan {vlan}\n'\ .format(sw_idx=Topology.get_interface_sw_index( node, node_vlan_if), vlan=i + 1)) VatExecutor().write_and_execute_script(node, tmp_fn, commands) @@ -169,7 +169,7 @@ class TestConfig(object): 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 @@ -189,9 +189,8 @@ class TestConfig(object): 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).verify_replies( - err_msg=err_msg) - papi_exec.get_replies().verify_replies() + papi_exec.get_replies(err_msg) + papi_exec.get_replies() return vxlan_count @@ -262,7 +261,7 @@ class TestConfig(object): 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) @@ -298,10 +297,9 @@ class TestConfig(object): 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).verify_replies( - err_msg=err_msg) + papi_exec.get_replies(err_msg) papi_exec.add(cmd, **args1).add(cmd, **args2) - papi_exec.get_replies().verify_replies() + papi_exec.get_replies() @staticmethod def vpp_put_vxlan_and_vlan_interfaces_to_bridge_domain( @@ -403,7 +401,7 @@ class TestConfig(object): 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) @@ -423,6 +421,5 @@ class TestConfig(object): 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).verify_replies( - err_msg=err_msg) - papi_exec.get_replies().verify_replies() + papi_exec.get_replies(err_msg) + papi_exec.get_replies()