aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_igmp.py
AgeCommit message (Collapse)AuthorFilesLines
2022-09-19igmp: validate ip router alert option lengthVladislav Grishenko1-15/+45
It's known there're one or more 32-bit increments in the ip header. So just check ip router alert option length with minimal performance impact, and don't care of the total options length. Type: fix Signed-off-by: Vladislav Grishenko <themiron@yandex-team.ru> Signed-off-by: Dmitry Valter <d-valter@yandex-team.ru> Change-Id: I46dd06516f793846b931a1dc8612f2735f8d24d3
2022-05-10tests: replace pycodestyle with blackKlement Sekera1-321/+477
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>
2022-02-17tests: make tests less make dependentKlement Sekera1-1/+1
Implement command line argument parsing instead of passing arguments via environment variables. Add script for running tests without having to invoke make. Deprecate running tests via make. Type: improvement Change-Id: I2e3054a61a2ae25d460e9be00be7d7705fbf943e Signed-off-by: Klement Sekera <ksekera@cisco.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2021-05-13tests: move test source to vpp/testDave Wallace1-0/+837
- Generate copyright year and version instead of using hard-coded data Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I6058f5025323b3aa483f5df4a2c4371e27b5914e
2019-08-22tests: move plugin tests to src/plugins/*/testDave Wallace1-834/+0
- Relocate plugin tests for 'make test' into src/plugins/*/test so that plugin test cases are co-located with the plugin source code. Type: refactor Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I503e6a43528e14981799b735fa65674155713f67 Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2019-07-31tests: disable pg capture before enabling itAndrew Yourtchenko1-0/+2
In a lot of places within the unit tests pg_start() starts the capture with an already existing capture running for the same test. If the pcap file already exists, then it is renamed and there is no problem. However, there is a potential for race if the previous pg_start() has enabled the capture, but the check for renaming it happened just slightly earlier than the first packet has arrived. Then a second call to pg_start() will hit a check that a file exists, and will cause an error. This is especially visible when running the tests in parallel due to increased load. Solution: disable the capture before enabling it. This will flush the aready running capture and eliminate the race. The additional delay that flushing of the pcap creates has exposed several other race conditions: NAT tests: Some of the NAT reassembly tests verify that the entries were added to the reassembly data structures, but do so by comparing the quantities of entries. With the default timeout being 2s, some of the entries might timeout, resulting in a bogus test failure. Solution: Bump the timeout to 20s for the affected tests. Punt tests: nr_packets == 3 makes test intermittently fail, nr_packets > 3 make it reliably fail, and nr_packets = 2 works Solution: set nr_packets == 2 for the time being IGMP tests: the leave-group calls get a spurious packet from the time the new groups were configured Solution: add 1 second delay before starting to delete the groups Type: test Change-Id: I931182a7b2860cf670e030ee7da8038f6e87356d Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2019-06-30igmp: accept packets that have more on the wire data than IGMP reports.Neale Ranns1-3/+19
IGMPv3 sends a variable length of sources in a query. Today if the amount of data on the wire does not exactly match that required for the number of sources the packet is dropped. Relax this check and instead accept the packet is the amount of wire data is equal or greater than the number of sources. Some devices on the wild internet pad small packets. Type: feature Change-Id: I102682814b38c0a0614d71816c9a286d90b834df Signed-off-by: Neale Ranns <nranns@cisco.com>
2019-04-10Tests Cleanup: Fix missing calls to setUpClass/tearDownClass.Paul Vinciguerra1-0/+8
Continuation/Part 2 of https://gerrit.fd.io/r/#/c/17092/ Change-Id: Id0122d84eaf2c05d29e5be63a594d5e528ee7c9a Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-28Typos. A bunch of typos I've been collecting.Paul Vinciguerra1-4/+4
Change-Id: I53ab8d17914e6563110354e4052109ac02bf8f3b Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2019-03-01Tests: Remove all wildcard imports.Paul Vinciguerra1-6/+6
They mask dependencies and confuse third party tools. Change-Id: I24ee16bfa0d746a8e8cb99891ba8b20523048b69 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
2018-11-06IGMP: Improved handling of (*,G) join and leaveNeale Ranns1-2/+67
Change-Id: I48a92035b58d83420eb3eed3f05a75ba283543c2 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-10-16IGMP: proxy deviceJakub Grajciar1-0/+87
Create 'proxy device' per VRF and add one upstream and one or many downstream interfaces. Change-Id: I1cef05fb01e73a5b483c7a2f4debaaeffe2c8155 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
2018-10-01IGMP: handle (*,G) report with no source addressesNeale Ranns1-0/+16
Change-Id: I363370b9d4a27b992bad55c48fc930a2fbea2165 Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-07-09IGMP improvementsNeale Ranns1-202/+530
- Enable/Disable an interface for IGMP - improve logging - refactor common code - no orphaned timers - IGMP state changes in main thread only - Large groups split over multiple state-change reports - SSM range configuration API. - more tests Change-Id: If5674f1044e7e97274a711f47807c9ba689d7b9a Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-06-29IP4 Router Alert option handling for IGMPNeale Ranns1-1/+5
and a new ip4-options node, inserted between ip4-input and ip4-punt, that checks for IP-router-alert option + IGMP combination and sends the packet to the ip4-local. This is required because some IGMP packets are sent to the group address and not the all-routers address. All IGMP packets are sent with the router alert option. Change-Id: I01f478d4d98ac9f806e0bcba0f6da6e4e7d26e2a Signed-off-by: Neale Ranns <nranns@cisco.com>
2018-03-23IGMP: coverity fixes and remove checks for scapy IGMPv3Neale Ranns1-16/+1
Change-Id: Ic2eddc803f9ba8215e37388a686004830211cf6f Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
2018-03-19IGMP pluginJakub Grajciar1-0/+323
- host mode: igmp_listen - API to signal that the host has joined an (S,G) - route mode: igmp_enable - API to enable the reception of host IGMP messages igmp_event - API to report the host join/leave from an (S,G) Change-Id: Id180ec27dee617d33ab3088f5dcf6125d3aa9c8f Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>