tests: remove bond, pipe, session and api_namespace from vpp_papi_provider

Type: refactor

Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Change-Id: I5052fc1fd82b5d17c1ed66fee5185addf60b9eb6
This commit is contained in:
Jakub Grajciar 2020-11-24 11:22:01 +01:00
parent 473556dcf1
commit 6a2794ea2b
6 changed files with 17 additions and 66 deletions

View File

@ -80,10 +80,10 @@ class VCLTestCase(VppTestCase):
super(VCLTestCase, self).setUp()
def cut_thru_setup(self):
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
def cut_thru_tear_down(self):
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
def cut_thru_test(self, server_app, server_args, client_app, client_args):
self.env = {'VCL_VPP_API_SOCKET': self.api_sock,
@ -103,7 +103,7 @@ class VCLTestCase(VppTestCase):
self.sleep(self.post_test_sleep)
def thru_host_stack_setup(self):
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 1
@ -145,7 +145,7 @@ class VCLTestCase(VppTestCase):
i.admin_down()
def thru_host_stack_ipv6_setup(self):
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 1
@ -186,7 +186,7 @@ class VCLTestCase(VppTestCase):
i.set_table_ip6(0)
i.admin_down()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
@unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
def thru_host_stack_test(self, server_app, server_args,

View File

@ -20,7 +20,7 @@ class TestSession(VppTestCase):
def setUp(self):
super(TestSession, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 0
@ -49,7 +49,7 @@ class TestSession(VppTestCase):
i.admin_down()
super(TestSession, self).tearDown()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
def test_segment_manager_alloc(self):
""" Session Segment Manager Multiple Segment Allocation """
@ -102,7 +102,7 @@ class TestSessionUnitTests(VppTestCase):
def setUp(self):
super(TestSessionUnitTests, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
def test_session(self):
""" Session Unit Tests """
@ -114,7 +114,7 @@ class TestSessionUnitTests(VppTestCase):
def tearDown(self):
super(TestSessionUnitTests, self).tearDown()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
class TestSvmFifoUnitTests(VppTestCase):

View File

@ -19,7 +19,7 @@ class TestTCP(VppTestCase):
def setUp(self):
super(TestTCP, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 0
@ -46,7 +46,7 @@ class TestTCP(VppTestCase):
i.unconfig_ip4()
i.set_table_ip4(0)
i.admin_down()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
super(TestTCP, self).tearDown()
def test_tcp_transfer(self):
@ -97,11 +97,11 @@ class TestTCPUnitTests(VppTestCase):
def setUp(self):
super(TestTCPUnitTests, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
def tearDown(self):
super(TestTCPUnitTests, self).tearDown()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
def test_tcp_unittest(self):
""" TCP Unit Tests """

View File

@ -65,7 +65,7 @@ class TestTLS(VppTestCase):
def setUp(self):
super(TestTLS, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 0
@ -92,7 +92,7 @@ class TestTLS(VppTestCase):
i.unconfig_ip4()
i.set_table_ip4(0)
i.admin_down()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
super(TestTLS, self).tearDown()
@unittest.skipUnless(checkAll(),

View File

@ -260,7 +260,7 @@ class TestUDP(VppTestCase):
def setUp(self):
super(TestUDP, self).setUp()
self.vapi.session_enable_disable(is_enabled=1)
self.vapi.session_enable_disable(is_enable=1)
self.create_loopback_interfaces(2)
table_id = 0
@ -287,7 +287,7 @@ class TestUDP(VppTestCase):
i.unconfig_ip4()
i.set_table_ip4(0)
i.admin_down()
self.vapi.session_enable_disable(is_enabled=0)
self.vapi.session_enable_disable(is_enable=0)
super(TestUDP, self).tearDown()
def test_udp_transfer(self):

View File

@ -861,11 +861,6 @@ class VppPapiProvider(object):
self.papi.bier_disp_entry_dump,
{'bde_tbl_id': bdti})
def session_enable_disable(self, is_enabled):
return self.api(
self.papi.session_enable_disable,
{'is_enable': is_enabled})
def ipsec_spd_add_del(self, spd_id, is_add=1):
""" SPD add/del - Wrapper to add or del ipsec SPD
Sample CLI : 'ipsec spd add 1'
@ -1008,20 +1003,6 @@ class VppPapiProvider(object):
def ipsec_backend_dump(self):
return self.api(self.papi.ipsec_backend_dump, {})
def app_namespace_add_del(self,
namespace_id,
ip4_fib_id=0,
ip6_fib_id=0,
sw_if_index=0xFFFFFFFF,
secret=0):
return self.api(
self.papi.app_namespace_add_del,
{'secret': secret,
'sw_if_index': sw_if_index,
'ip4_fib_id': ip4_fib_id,
'ip6_fib_id': ip6_fib_id,
'namespace_id': namespace_id})
def punt_socket_register(self, reg, pathname,
header_version=1):
""" Register punt socket """
@ -1246,33 +1227,3 @@ class VppPapiProvider(object):
def want_igmp_events(self, enable=1):
return self.api(self.papi.want_igmp_events, {'enable': enable,
'pid': os.getpid()})
def bond_create(
self,
mode,
lb,
numa_only,
use_custom_mac,
mac_address='',
interface_id=0xFFFFFFFF):
"""
:param mode: mode
:param lb: load balance
:param numa_only: tx on local numa node for lacp mode
:param use_custom_mac: use custom mac
:param mac_address: mac address
:param interface_id: custom interface ID
"""
return self.api(
self.papi.bond_create,
{'mode': mode,
'lb': lb,
'numa_only': numa_only,
'use_custom_mac': use_custom_mac,
'mac_address': mac_address,
'id': interface_id
})
def pipe_delete(self, parent_sw_if_index):
return self.api(self.papi.pipe_delete,
{'parent_sw_if_index': parent_sw_if_index})