aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api
AgeCommit message (Expand)AuthorFilesLines
2019-01-17cmake: initial cross-compilation supportDamjan Marion1-1/+0
2019-01-06vpp-api: Add context to VPPStatsIOError.Paul Vinciguerra2-7/+29
2018-12-28vpp_papi: MACAddress equals fails in unittest.Paul Vinciguerra2-0/+21
2018-12-18VAPI/VOM: Removing legacy stats tests, add string type.Ole Troan2-0/+2
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan4-3/+67
2018-12-13API: Use string type instead of u8.Ole Troan3-17/+80
2018-12-13vapi: code cleanupKlement Sekera1-5/+4
2018-12-12PAPI: Allow ipaddress object as argument and return values from API callsOle Troan4-220/+266
2018-12-10Python API: Use services to determine stream RPCOle Troan1-4/+11
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-2/+7
2018-12-06stat_client: Fix the type castingMohsin Kazmi2-7/+10
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan4-20/+39
2018-12-05stat-client: pass names as const stringsNeale Ranns2-4/+4
2018-11-29vpp_papi: Add custom exceptions.Paul Vinciguerra6-54/+121
2018-11-29vpp_papi: Fix: raise NotImplemented.Paul Vinciguerra1-1/+1
2018-11-29API: Add support for type aliasesOle Troan5-23/+87
2018-11-29VPP-1508: vpp_transport_socket.py fix importPaul Vinciguerra1-1/+4
2018-11-28vpp_papi: Reserved keywords.Paul Vinciguerra2-3/+3
2018-11-28vpp_papi: Use new style classes.Paul Vinciguerra6-13/+13
2018-11-26stats: Remove unneeded dependencies in stat_clientOle Troan2-7/+21
2018-11-26vapi: break if parsing progress cannot be madeKlement Sekera1-0/+1
2018-11-22stat_client issues while running parallel tests.Paul Vinciguerra4-52/+162
2018-11-07Unresolved symbols in libvapiclientNeale Ranns1-0/+1
2018-11-05Provide return value for PAPI disconnect()Igor Mikhailov (imichail)2-1/+3
2018-11-05Alter logging semantics for VPP PAPI objectIgor Mikhailov (imichail)1-1/+1
2018-10-23c11 safe string handling supportDave Barach4-13/+14
2018-10-22PAPI: Add support for format/unformat functions.Ole Troan5-12/+247
2018-10-22stats: Add wrapper for vec_freeOle Troan3-0/+8
2018-10-18PAPI: Expose API enums to tests / applicationsOle Troan2-16/+43
2018-10-16PAPI: Add bool type support in vppapigen.Ole Troan1-0/+2
2018-10-16PAPI: Add timeout support for socket transportOle Troan1-3/+6
2018-10-09API: Spurious timeouts from timeout thread.Ole Troan1-13/+27
2018-10-03stat_client.c coverity error.Ole Troan1-2/+0
2018-10-02VPP-1440: clean up coverity warningsDave Barach1-0/+4
2018-10-02Stats: vpp_prometheus_export fixes.Ole Troan1-0/+4
2018-10-02PAPI: Use UNIX domain sockets instead of shared memoryOle Troan5-111/+332
2018-09-27Trivial: Cleanup some typos.Paul Vinciguerra1-1/+1
2018-09-27IPIP and IPv6 fragmentationOle Troan1-1/+2
2018-09-18STATS: Optimistic concurrency handling in Python library.Ole Troan1-4/+24
2018-09-18STATS: Add Python 3 support to vpp_stats.py.Ole Troan2-4/+4
2018-09-17STATS: Dynamically mapped shared memory segmentOle Troan5-264/+270
2018-09-11vapi: support VLAs in typedefsKlement Sekera2-28/+96
2018-09-07cmake: set packaging component for different filesDamjan Marion1-2/+11
2018-09-07VPP-API: Cancel timeout thread without sending READ_TIMEOUT message.Ole Troan1-8/+6
2018-09-07PAPI: Unpack embedded types with variable length arrays.Ole Troan3-36/+97
2018-09-03vapi: init clib mem heap on connect if neededKlement Sekera1-0/+4
2018-09-02STATS: Python binding to access VPP statistics and counters.Ole Troan4-8/+187
2018-09-02Switch to cmakeDamjan Marion2-97/+0
2018-08-30cmake: missing dependenciesDamjan Marion1-2/+2
2018-08-30cmake: a bit of packaging workDamjan Marion1-0/+1
="p">) bond1.add_member_vpp_bond_interface(sw_if_index=memif11.sw_if_index) # wait for memif protocol exchange and hardware carrier to come up self.assertEqual(memif1.wait_for_link_up(10), True) self.assertEqual(memif11.wait_for_link_up(10), True) # verify memif1 in bond0 intfs = self.vapi.sw_member_interface_dump( sw_if_index=bond0.sw_if_index) for intf in intfs: self.assertEqual(intf.sw_if_index, memif1.sw_if_index) # verify memif11 in bond1 intfs = self.vapi.sw_member_interface_dump( sw_if_index=bond1.sw_if_index) for intf in intfs: self.assertEqual(intf.sw_if_index, memif11.sw_if_index) self.vapi.ppcli("trace add memif-input 100") # create marker request marker = (Ether(src=bond_mac, dst=lacp_dst_mac) / SlowProtocol() / MarkerProtocol(marker_type=1, requester_port=1, requester_system=bond_mac, requester_transaction_id=1)) bond1.add_member_vpp_bond_interface(sw_if_index=self.pg0.sw_if_index) self.pg0.add_stream(marker) self.pg_enable_capture(self.pg_interfaces) self.pg_start() show_trace = self.vapi.ppcli("show trace max 100") self.assertIn("Marker Information TLV:", show_trace) bond0.remove_vpp_config() bond1.remove_vpp_config() class TestLACP(VppTestCase): """LACP Test Case """ @classmethod def setUpClass(cls): super().setUpClass() @classmethod def tearDownClass(cls): super().tearDownClass() def setUp(self): super().setUp() def tearDown(self): super().tearDown() def show_commands_at_teardown(self): self.logger.info(self.vapi.ppcli("show interface")) def wait_for_lacp_connect(self, timeout, step=1): while 1: intfs = self.vapi.sw_interface_lacp_dump() all_good = 1 for intf in intfs: if ((intf.actor_state != LACP_COLLECTION_AND_DISTRIBUTION_STATE) or (intf.partner_state != LACP_COLLECTION_AND_DISTRIBUTION_STATE)): all_good = 0 if (all_good == 1): return 1 self.sleep(step) timeout -= step if timeout <= 0: return 0 def wait_for_member_detach(self, bond, timeout, count, step=1): while 1: intfs = self.vapi.sw_bond_interface_dump( sw_if_index=bond.sw_if_index) for intf in intfs: if ((intf.members == count) and (intf.active_members == count)): return 1 else: self.sleep(1) timeout -= step if (timeouut <= 0): return 0 def test_lacp_connect(self): """ LACP protocol connect test """ # topology # # +-+ +-+ # memif1 -----|B| |B|---- memif11 # |o| |o| # |n|------|n| # |d| |d| # memif2 -----|0| |1|---- memif12 # +-+ +-+ socket1 = VppSocketFilename( self, socket_id=1, socket_filename="%s/memif.sock1" % self.tempdir) socket1.add_vpp_config() socket11 = VppSocketFilename( self, socket_id=2, socket_filename="%s/memif.sock1" % self.tempdir) socket11.add_vpp_config() socket2 = VppSocketFilename( self, socket_id=3, socket_filename="%s/memif.sock2" % self.tempdir) socket2.add_vpp_config() socket22 = VppSocketFilename( self, socket_id=4, socket_filename="%s/memif.sock2" % self.tempdir) socket22.add_vpp_config() memif1 = VppMemif( self, role=VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_MASTER, mode=VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET, socket_id=1) memif1.add_vpp_config() memif1.admin_up() memif11 = VppMemif( self, role=VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_SLAVE, mode=VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET, socket_id=2) memif11.add_vpp_config() memif11.admin_up() memif2 = VppMemif( self, role=VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_MASTER, mode=VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET, socket_id=3) memif2.add_vpp_config() memif2.admin_up() memif12 = VppMemif( self, role=VppEnum.vl_api_memif_role_t.MEMIF_ROLE_API_SLAVE, mode=VppEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET, socket_id=4) memif12.add_vpp_config() memif12.admin_up() self.logger.info(self.vapi.ppcli("debug lacp on")) bond0 = VppBondInterface( self, mode=VppEnum.vl_api_bond_mode_t.BOND_API_MODE_LACP, use_custom_mac=1, mac_address=bond_mac) bond0.add_vpp_config() bond0.admin_up() bond1 = VppBondInterface( self, mode=VppEnum.vl_api_bond_mode_t.BOND_API_MODE_LACP) bond1.add_vpp_config() bond1.admin_up() # add member memif1 and memif2 to bond0 bond0.add_member_vpp_bond_interface(sw_if_index=memif1.sw_if_index) bond0.add_member_vpp_bond_interface(sw_if_index=memif2.sw_if_index) # add member memif11 and memif12 to bond1 bond1.add_member_vpp_bond_interface(sw_if_index=memif11.sw_if_index) bond1.add_member_vpp_bond_interface(sw_if_index=memif12.sw_if_index) # wait for memif protocol exchange and hardware carrier to come up self.assertEqual(memif1.wait_for_link_up(10), True) self.assertEqual(memif2.wait_for_link_up(10), True) self.assertEqual(memif11.wait_for_link_up(10), True) self.assertEqual(memif12.wait_for_link_up(10), True) # verify memif1 and memif2 in bond0 intfs = self.vapi.sw_member_interface_dump( sw_if_index=bond0.sw_if_index) for intf in intfs: self.assertIn( intf.sw_if_index, (memif1.sw_if_index, memif2.sw_if_index)) # verify memif11 and memif12 in bond1 intfs = self.vapi.sw_member_interface_dump( sw_if_index=bond1.sw_if_index) for intf in intfs: self.assertIn( intf.sw_if_index, (memif11.sw_if_index, memif12.sw_if_index)) self.assertEqual(intf.is_long_timeout, 0) self.assertEqual(intf.is_passive, 0) # Let LACP create the bundle self.wait_for_lacp_connect(30) intfs = self.vapi.sw_interface_lacp_dump() for intf in intfs: self.assertEqual( intf.actor_state, LACP_COLLECTION_AND_DISTRIBUTION_STATE) self.assertEqual( intf.partner_state, LACP_COLLECTION_AND_DISTRIBUTION_STATE) intfs = self.vapi.sw_bond_interface_dump(sw_if_index=0xFFFFFFFF) for intf in intfs: self.assertEqual(intf.members, 2) self.assertEqual(intf.active_members, 2) self.assertEqual( intf.mode, VppEnum.vl_api_bond_mode_t.BOND_API_MODE_LACP) self.logger.info(self.vapi.ppcli("show lacp")) self.logger.info(self.vapi.ppcli("show lacp details")) # detach member memif1 bond0.detach_vpp_bond_interface(sw_if_index=memif1.sw_if_index) self.wait_for_member_detach(bond0, timeout=10, count=1) intfs = self.vapi.sw_bond_interface_dump( sw_if_index=bond0.sw_if_index) for intf in intfs: self.assertEqual(intf.members, 1) self.assertEqual(intf.active_members, 1) self.assertEqual( intf.mode, VppEnum.vl_api_bond_mode_t.BOND_API_MODE_LACP) # detach member memif2 bond0.detach_vpp_bond_interface(sw_if_index=memif2.sw_if_index) self.wait_for_member_detach(bond0, timeout=10, count=0) intfs = self.vapi.sw_bond_interface_dump( sw_if_index=bond0.sw_if_index) for intf in intfs: self.assertEqual(intf.members, 0) self.assertEqual(intf.active_members, 0) bond0.remove_vpp_config() bond1.remove_vpp_config() if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)