aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_interface.py
AgeCommit message (Collapse)AuthorFilesLines
2023-11-03tests: refactor asf framework codeDave Wallace1-4/+4
- Make framework.py classes a subset of asfframework.py classes - Remove all packet related code from asfframework.py - Add test class and test case set up debug output to log - Repatriate packet tests from asf to test directory - Remove non-packet related code from framework.py and inherit them from asfframework.py classes - Clean up unused import variables - Re-enable BFD tests on Ubuntu 22.04 and fix intermittent test failures in echo_looped_back testcases (where # control packets verified but not guaranteed to be received during test) - Re-enable Wireguard tests on Ubuntu 22.04 and fix intermittent test failures in handshake ratelimiting testcases and event testcase - Run Wiregard testcase suites solo - Improve debug output in log.txt - Increase VCL/LDP post sleep timeout to allow iperf server to finish cleanly. - Fix pcap history files to be sorted by suite and testcase and ensure order/timestamp is correct based on creation in the testcase. - Decode pcap files for each suite and testcase for all errors or if configured via comandline option / env var - Improve vpp corefile detection to allow complete corefile generation - Disable vm vpp interfaces testcases on debian11 - Clean up failed unittest dir when retrying failed testcases and unify testname directory and failed linknames into framwork functions Type: test Change-Id: I0764f79ea5bb639d278bf635ed2408d4d5220e1e Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-83/+77
Drop pycodestyle for code style checking in favor of black. Black is much faster, stable PEP8 compliant code style checker offering also automatic formatting. It aims to be very stable and produce smallest diffs. It's used by many small and big projects. Running checkstyle with black takes a few seconds with a terse output. Thus, test-checkstyle-diff is no longer necessary. Expand scope of checkstyle to all python files in the repo, replacing test-checkstyle with checkstyle-python. Also, fixstyle-python is now available for automatic style formatting. Note: python virtualenv has been consolidated in test/Makefile, test/requirements*.txt which will eventually be moved to a central location. This is required to simply the automated generation of docker executor images in the CI. Type: improvement Change-Id: I022a326603485f58585e879ac0f697fceefbc9c8 Signed-off-by: Klement Sekera <klement.sekera@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-03-25stats: python vpp_stats rewrite to access stat segment directlyOle Troan1-4/+4
This module implement Python access to the VPP statistics segment. It accesses the data structures directly in shared memory. VPP uses optimistic locking, so data structures may change underneath us while we are reading. Data is copied out and it's important to spend as little time as possible "holding the lock". Counters are stored in VPP as a two dimensional array. Index by thread and index (typically sw_if_index). Simple counters count only packets, Combined counters count packets and octets. Counters can be accessed in either dimension. stat['/if/rx'] - returns 2D lists stat['/if/rx'][0] - returns counters for all interfaces for thread 0 stat['/if/rx'][0][1] - returns counter for interface 1 on thread 0 stat['/if/rx'][0][1]['packets'] - returns the packet counter for interface 1 on thread 0 stat['/if/rx'][:, 1] - returns the counters for interface 1 on all threads stat['/if/rx'][:, 1].packets() - returns the packet counters for interface 1 on all threads stat['/if/rx'][:, 1].sum_packets() - returns the sum of packet counters for interface 1 on all threads stat['/if/rx-miss'][:, 1].sum() - returns the sum of packet counters for interface 1 on all threads for simple counters Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I1fe7f7c7d11378d06be8276db5e1900ecdb8f515 Signed-off-by: Ole Troan <ot@cisco.com>
2021-01-20ip: add API to retrieve IPv6 link-layer addressBenoît Ganne1-2/+5
Type: feature Change-Id: I5739869490155b0b9674b4faf61882d97e66a4ed Signed-off-by: Benoît Ganne <bganne@cisco.com>
2020-12-03tests: remove py2/py3 six compatability libraryPaul Vinciguerra1-5/+1
Type: test Change-Id: Idb6b8169845e0239e639429ccfd02a683212b7e6 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2020-11-24tests: remove svs, proxy_arp and gso from vpp_papi_providerOle Troan1-2/+2
Type: refactor Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I916a386af48fd558b4749e206b2bc4b82a888512 Signed-off-by: Ole Troan <ot@cisco.com>
2020-05-03tests: vpp_interface remove deprecated packed propertiesPaul Vinciguerra1-36/+0
The api no longer requires packed ip addresses. Type: test Change-Id: If67365d86b7c3189f871a58234e99f9c8f875371 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-12-04tests: add interface function chainingPaul Vinciguerra1-0/+26
Type: test Change-Id: I24e740aa87a8a4061fa98740f2d636997e18f08d Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-12-03tests: vpp_interface fix ip6 setterPaul Vinciguerra1-1/+1
Type: fix Fixes: efd7bc2b1c8db160933ed3e9ab3cde0d07aaf863 Change-Id: I254f9fe44189f88621b9b0ff3f869efb9966ada5 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-12-02tests: raise exception in vpp_interface for invalid sw_if_indexPaul Vinciguerra1-0/+3
Type: test Change-Id: I34058f2bd20f61a8f8355299a8df95f2948c25eb Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-11-15tests: Remove the unrequired VPP IP address/prefix class wrappersNeale Ranns1-24/+25
Type: refactor Change-Id: I204f3f8eebc5f5d5a377e91262f91c615fd00168 Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-11-11ip: functional interface to ip fragmentationOle Troan1-0/+12
This provides a functional interface to IP fragmentation. Allowing external features to fragment. Supports arbitrary encap size, for e.g. MPLS or inner fragmentation of tunnels. This also removed dual loop in MAP that was fundamentally broken. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ia89ecec8ee3cbe2416edbe87630fdb714898c2a8 Signed-off-by: Ole Troan <ot@cisco.com>
2019-10-16tests: cli wrapper should return stringOle Troan1-4/+3
Python3 fixes. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I648b2142d45dfab9146a02eeb1b12de11103ff9f Signed-off-by: Ole Troan <ot@cisco.com>
2019-08-20api: Cleanup APIs interface.apiJakub Grajciar1-56/+72
Use of consistent API types for interface.api Type: fix Change-Id: I88206d7d0907cffd564031f73c9a996df2e5e21a Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-06-26api: refactor format_vl_api_prefix_t return keysPaul Vinciguerra1-5/+7
format_vl_api_prefix_t returns a dict with keys 'address' and 'address_length', but other format_vl_api_prefix functions return a dict with 'prefix', and 'len'. Refactor all format_vl_api_prefix_t to return consistent keys 'address' and 'len'. Type: refactor Change-Id: I5f9558fc2da8742a303266e011102f5b2db80aad Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-06-18fib: fib api updatesNeale Ranns1-3/+10
Enhance the route add/del APIs to take a set of paths rather than just one. Most unicast routing protocols calcualte all the available paths in one run of the algorithm so updating all the paths at once is beneficial for the client. two knobs control the behaviour: is_multipath - if set the the set of paths passed will be added to those that already exist, otherwise the set will replace them. is_add - add or remove the set is_add=0, is_multipath=1 and an empty set, results in deleting the route. It is also considerably faster to add multiple paths at once, than one at a time: vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.11 100000 routes in .572240 secs, 174751.80 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.12 100000 routes in .528383 secs, 189256.54 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.13 100000 routes in .757131 secs, 132077.52 routes/sec vat# ip_add_del_route 1.1.1.1/32 count 100000 multipath via 10.10.10.14 100000 routes in .878317 secs, 113854.12 routes/sec vat# ip_route_add_del 1.1.1.1/32 count 100000 multipath via 10.10.10.11 via 10.10.10.12 via 10.10.10.13 via 10.10.10.14 100000 routes in .900212 secs, 111084.93 routes/sec Change-Id: I416b93f7684745099c1adb0b33edac58c9339c1a Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-06-12tests: filter sw_interface_dump in tests.Paul Vinciguerra1-2/+2
Type: test Change-Id: I92921444ef6b0e574701398cf57971c9ecc1cc91 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-21IPSEC: Mutli-tunnel testsNeale Ranns1-0/+8
Change-Id: I46f1db6579835c6613fdbb2b726246cc62b135fe Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-15Revert "API: Cleanup APIs interface.api"Ole Trøan1-56/+56
This reverts commit e63325e3ca03c847963863446345e6c80a2c0cfd. Allow time for CSIT to accommodate. Change-Id: I59435e4ab5e05e36a2796c3bf44889b5d4823cc2 Signed-off-by: ot@cisco.com
2019-03-15API: Cleanup APIs interface.apiJakub Grajciar1-56/+56
Use of consistent API types for interface.api Change-Id: Ieb54cebb4ac96b432a3f0b41596718aa2f34885b Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2019-03-14TEST: link-state up/down notifications on FIB forwardingNeale Ranns1-0/+8
Change-Id: I478c4e5feb9603b7443efdf2967f98f9bde7ea0f Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-03-11vpp_papi_provider: Remove more wrapper functions.Ole Troan1-7/+7
Split this work up into pieces. Please don't add new wrappers to vpp_papi_provider.py. Change-Id: I0f8f2afc4cd2bba07ea70ddecea2d7319f7b2e10 Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-06test framework: vpp_papi_provider.py - further cleanupOle Troan1-25/+18
Part of further cleanups of this file. Removed most wrappers that don't have conflicting signature with message API. Change-Id: I6acd93d20291feb7731eb35ab2eb8c9f22f4632c Signed-off-by: Ole Troan <ot@cisco.com>
2019-03-04test framework: Fix wrapper functions to match API message names.Ole Troan1-16/+20
In preparation to remove the wrappers in vpp_papi_provider.py, ensure names used in tests match the actual API message names. Change-Id: I230ca4eb75aa727ff68d702e085a2edbbc6b6d19 Signed-off-by: Ole Troan <ot@cisco.com>
2019-02-26VPP-1508 Python3 abstract classesPaul Vinciguerra1-3/+4
Update the syntax to support abstract classes in python 2 and python 3. Depends on: new style classes -- https://gerrit.fd.io/r/16166 Change-Id: Iad2c1240149f38b3faca1b37ab95d3d210e1daee Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-01-30Use IP and MAC API types for neighborsNeale Ranns1-9/+7
use address_t and mac_address_t for IPv6 and ARP entries and all other API calls in ip.api aprat from the route ones, that will follow in a separate commit Change-Id: I67161737c2184d3f8fc1e79ebd2b55121c5b0191 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-12-18PAPI: Add MACAddress object wrapper for vl_api_mac_address_tOle Troan1-8/+7
Change the definition of vl_api_mac_address_t to an aliased type. Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134 Signed-off-by: Ole Troan <ot@cisco.com>
2018-12-10Test framework: StringIO fixes for Python3Ole Troan1-7/+7
Add 2/3 support to binarytomac and mactobinary and move to vpp_mac.py Change-Id: I3dc7e4a24486aee22140c781aae7e44e58935877 Signed-off-by: Ole Troan <ot@cisco.com>
2018-11-27VPP-1508 python3 tests: .encode('hex')Paul Vinciguerra1-1/+2
Change to binascii.hexlify() for consistent bahavior. Change-Id: Ie430cdd1ffeb6510db4aa037546e42d85992093b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-27VPP-1508 Fix for bug introduced in tests on use of repr.Paul Vinciguerra1-2/+2
This fixes the change from https://gerrit.fd.io/r/#/c/16175/ ... ====== Totals ====== Ran: 856 tests in 2123.0000 sec. - Passed: 667 - Skipped: 157 - Expected Fail: 0 - Unexpected Success: 0 - Failed: 32 Sum of execute time for each test: 1641.0832 sec. ============== Worker Balance ============== - Worker 0 (416 tests) => 0:35:06.788054 - Worker 1 (440 tests) => 0:31:13.814911 Test id Runtime (s) -------------------------------------------------------------------------------------- ----------- test.test_vcl.VCLCutThruTestCase.test_ldp_cut_thru_bi_dir_nsock 120.382 test.test_vcl.VCLThruHostStackGroupBTestCase.test_ldp_thru_host_stack_bi_dir_nsock 60.368 test.test_vcl.VCLIpv6ThruHostStackGroupBTestCase.test_ldp_thru_host_stack_bi_dir_nsock 60.356 test.test_igmp.TestIgmp.test_igmp_host 47.411 test.test_reassembly.TestFIFReassembly.test_fif6 38.561 test.test_reassembly.TestFIFReassembly.test_fif4 37.045 test.test_gbp.TestGBP.test_gbp 30.041 test.test_dhcp.TestDHCP.test_dhcp_proxy 29.339 test.test_vcl.VCLCutThruTestCase.test_ldp_cut_thru_iperf3 20.489 test.test_neighbor.ARPTestCase.test_arp 19.004 Change-Id: Ic1565f14962f157d5041230de3aeeab0b85f21e1 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-25VPP-1508 python3 tests: python3 repr.Paul Vinciguerra1-2/+4
Use six.reprlib. Uses repr for python 2 and reprlib for python 3. Change-Id: Ia343a492d533bd511ed57166381e10a37e452d36 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-07GBP Endpoint LearningNeale Ranns1-0/+3
Learning GBP endpoints over vxlan-gbp tunnels Change-Id: I1db9fda5a16802d9ad8b4efd4e475614f3b21502 Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-10-05vhost_user: Add test for interface states and eventsJuraj Sloboda1-3/+24
Change-Id: I2c330945bb0b07f649f574a055bfbea455e5d0b3 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-10-03ipsec: add missing ipv6 ah code & ipv6 testsKlement Sekera1-1/+26
Change-Id: I89e90193ded1beb6cb0950c15737f9467efac1c3 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-09-08L2 BVI/FIB: Update L2 FIB table when BVI's MAC changesNeale Ranns1-1/+8
also some moving of l2 headers to reduce dependencies Change-Id: I7a700a411a91451ef13fd65f9c90de2432b793bb Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-24Revert "Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums""Klement Sekera1-1/+3
This reverts commit e0d2bd6bd7fc59c0c6ac48195d7f825dc99bfd91. Change-Id: If491e16f9ea66b2493a6a7c7f3c684ed585f8f51 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-06-22Revert "ipsec: VPP-1316 calculate IP/TCP/UDP inner checksums"Ole Troan1-3/+1
This reverts commit a98346f664aae148d26a8e158008b773d73db96f. Change-Id: Iee5b3a5ddff0e8fd3a30fe5973cee24de434fe12 Signed-off-by: Ole Troan <ot@cisco.com>
2018-06-21ipsec: VPP-1316 calculate IP/TCP/UDP inner checksumsKlement Sekera1-1/+3
Calculate IP/TCP/UDP checksums in software before adding authentication. Change-Id: I3e121cb00aeba667764f39ade8d62170f18f8b6b Signed-off-by: Klement Sekera <ksekera@cisco.com>
2018-03-16IPv6 ND Router discovery control plane (VPP-1095)Juraj Sloboda1-7/+22
Change-Id: I4b5b60e7c6f618bb935eab1e96a2e79bbb14f58f Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
2018-02-01IPv4/6 reassemblyKlement Sekera1-0/+12
Change-Id: Ic5dcadd13c88b8a5e7896dab82404509c081614a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-08-15Support proxy ARP on mirrored TAP interfacesNeale Ranns1-0/+6
When VPP has an interface whose address is also applied to a TAP interface on the host, then VPP's TAP interface will be unnumbered to the 'real' interface and do proxy ARP from the host. the curious aspect of this setup is that ARP requests from the host will come from the VPP's own address. Change-Id: Ia238790e1034ba3cd3facdab29387b65a31525f2 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-04-19Learn IP6 link-local ND entries from NSs sourced from link-local addressNeale Ranns1-2/+16
Change-Id: I4c3ce4d58df7977490fc94991291422ea1e31ee3 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-17Fix IP feature ordering.Neale Ranns1-0/+5
Drop comes before lookup when enabled. is_first_or_last is not required when setting a feature, the anchor is added in find_config_with_features(). Don't make the PG interfaces automatically L3 enabled, this way we can have tests that check the L3 protocol disbaled behaviour. Change-Id: Icef22a920b27ff9cec6ab2da6b05f05c532cb60f Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-17Attached hostsNeale Ranns1-1/+1
allow this config to function: set int ip address loop0 169.254.1.1/32 (the default GW address for attached hosts) set int unnumbered af_packet0 use loop0 ('enable' IP on the host interface) ip route add 192.168.1.1/32 via af_packet0 (where to find the host) repeat for each host and host interface. Inter-host communication is throught the /32 routes. To allow this: 1 - attached host routes have the ATTACHED flag set, so the ARP code accepts then as legitimate sources 2 - unnumbered interfaces inherit the source address from the IP interface Change-Id: Ib66c5f0e848c528f79372813adc3a0c11b50717f Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-09Tests to target holes in adjacency and DPO test coverageNeale Ranns1-0/+7
Change-Id: Ic6ac7e441a7b75baa02f03c1585d1ae00903a399 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-03IPv6 RA improvementsNeale Ranns1-0/+11
1) tests for RA options 2) memleaks deleteing a ip6_radv_info_t 3) MLD prefix code refactoring Change-Id: I34db103994bd8fbdbbec50b202d72770dd145681 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-03-02Remove the unused VRF ID parameter from the IP neighbour Add/Del APINeale Ranns1-4/+4
Change-Id: Icf0d72f6af1f98c86f78e586c354515ac69804aa Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-02-27[Proxy] ARP testsNeale Ranns1-0/+13
Change-Id: I40d6d763b55a26cdee0afef85d1acdd19dd10dd6 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-02-21test: ip6 vrf instances multi-context test (CSIT-497)Jan Gelety1-3/+7
- add/delete IPv6 VRF instances and verify results by parsing output of ip6_fib_dump API command and by traffic - small changes in assert_nothing_captured and get_capture to get logged unexpected packets Change-Id: I32207447be2df942e335aa9890ff52fb88e46597 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-01-27IP Multicast FIB (mfib)Neale Ranns1-1/+2
- IPv[46] mfib tables with support for (*,G/m), (*,G) and (S,G) exact and longest prefix match - Replication represented via a new replicate DPO. - RPF configuration and data-plane checking - data-plane signals sent to listening control planes. The functions of multicast forwarding entries differ from their unicast conterparts, so we introduce a new mfib_table_t and mfib_entry_t objects. However, we re-use the fib_path_list to resolve and build the entry's output list. the fib_path_list provides the service to construct a replicate DPO for multicast. 'make tests' is added to with two new suites; TEST=mfib, this is invocation of the CLI command 'test mfib' which deals with many path add/remove, flag set/unset scenarios, TEST=ip-mcast, data-plane forwarding tests. Updated applications to use the new MIFB functions; - IPv6 NS/RA. - DHCPv6 unit tests for these are undated accordingly. Change-Id: I49ec37b01f1b170335a5697541c8fd30e6d3a961 Signed-off-by: Neale Ranns <nranns@cisco.com>