aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_bfd.py
AgeCommit message (Collapse)AuthorFilesLines
2018-04-17Add logging supportDamjan Marion1-2/+6
Change-Id: Ieac9cf50156dbbb4962411e900d59256441915ef Signed-off-by: Damjan Marion <damarion@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-10-21test bfd - DPO_PROTO_IP6 is part of DpoProtoGabriel Ganne1-2/+2
Change-Id: I63d336a1ba366a60a2a8f1124e3f37f742cccb65 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2017-08-08L2 over MPLSNeale Ranns1-3/+3
[support for VPWS/VPLS] - switch to using dpo_proto_t rather than fib_protocol_t in fib_paths so that we can describe L2 paths - VLIB nodes to handle pop/push of MPLS labels to L2 Change-Id: Id050d06a11fd2c9c1c81ce5a0654e6c5ae6afa6e Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-05-02BFD: don't crash if interface is deletedKlement Sekera1-0/+30
Instead, drop the BFD session associated with it.. Change-Id: Ie09877d5c94844be2e833900d9dde7f23edaf8cd Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-04-24make test: mark all BFD tests as extendedKlement Sekera1-0/+5
Change-Id: Iaed59cca1c9fd69eadb86c15be6417a956cb9d5a Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-04-20make test: improve bfd reliabilityKlement Sekera1-18/+30
Change-Id: Iaf446a2d7d8e595c3379fb9ed61a954351c17b90 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-04-06BFD-FIB interactionsNeale Ranns1-1/+103
- single-hop BFD: attach a delegate to the appropriate adjacency - multi-hop BFD [not supported yet]: attach a delegate to the FIB entry. adjacency/fib_entry state tracks the BFD session state. when the state is down the object does not contribute forwarding hence and hence dependent objects will not use it. For example, if a route is ECMP via two adjacencies and one of them is BFD down, then only the other is used to forward (i.e. we don't drop half the traffic). Change-Id: I0ef53e20e73b067001a132cd0a3045408811a822 Signed-off-by: Neale Ranns <nranns@cisco.com>
2017-04-03make test: relax BFD time intervalsKlement Sekera1-7/+9
Increased time intervals mean longer test runs, but also reduce the chance of getting annoying (especially in gerrit) random failures. Now that tests are split into `basic' and `all', the increased runtime of BFD tests (of which majority doesn't run in basic case) doesn't matter too much.. Change-Id: I4a15bb4facad634f123bc9cc6f45eddbf4976fd1 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-03-13Add MAC address check in ethernet-input node if interface in L3 modeJohn Lo1-1/+10
Interface can be in promiscuous mode if more than one of its sub- interface is in L2 mode. In promiscuous mode, L3 interface need to verify DMAC of packet to match that of the interface and drop if not. This check was done on sub-interface only and now also added to main interface path. Fix incorrect MAC addresses in the flow-per-pkt plugin test, which caused it to fail. Fix MAC address usage in BFD tests. Change-Id: I12a17ec05c7ab298ad10d400c90d082c97eca521 Signed-off-by: John Lo <loj@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-03-08make test: split into basic and extended testsKlement Sekera1-2/+33
Implement plumbing to allow decorating tests as extended, e.g.: @unittest.skipUnless(running_extended_tests(), "part of extended tests") both methods and classes can be decorated this way. Change make test and make test-debug to run only non-extended tests. Introduce make test-all and make test-all-debug to run the full suite. Run full suite as part of make verify. Decorate most BFD tests as extended. Change-Id: I3bc64f59e9fe238f7f767d7e043dc165d03e9dfa Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-03-02BFD: command line interfaceKlement Sekera1-20/+559
Implement command line interface to the BFD binary APIs. Add corresponding unit tests. Change-Id: Ia0542d0bc4c8d78e6f7b777a08fd94ebfe4d524f Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-26BFD: echo functionKlement Sekera1-48/+429
Change-Id: Ib1e301d62b687d4e42434239e7cd412065c28da0 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-17BFD: put session admin-up/admin-downKlement Sekera1-8/+36
Change-Id: I7d8889dce8495607106593ad83320c9af0f2fa07 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-15BFD: loop back echo packetsKlement Sekera1-19/+103
Change-Id: I772b63ac25ebfccaff9ab9d8d0b1445e85f21df7 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-14BFD: respect remote demand modeKlement Sekera1-328/+509
Change-Id: I5063d31f5305c848043afb32fcacff6e61aed79f Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-08make test: BFD tests speedupKlement Sekera1-2/+4
Change-Id: I0b3064a311f28ebf7cd9db0a59cb04c7c25c9d58 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-08BFD: modify session parametersKlement Sekera1-13/+151
Change-Id: I666e5c0cc71a3693640960c93cdd1907f84fbe23 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-02-02BFD: SHA1 authenticationKlement Sekera1-37/+696
Add authentication support to BFD feature. Out of three existing authentication types, implement SHA1 (sole RFC requirement). Simple password is insecure and MD5 is discouraged by the RFC, so ignore those. Add/change APIs to allow configuring BFD authentication keys and their usage with BFD sessions. Change-Id: Ifb0fb5b19c2e72196d84c1cde919bd4c074ea415 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-25make test: elegantly handle expected API failuresKlement Sekera1-6/+3
Allow writing simple code to expect API failure when needed: with self.vapi.expect_negative_api_retval(): do_api_call() # expected to return negative retval in response Change-Id: Id58d91d9ce38d20ad6ff7a43a6897e79ffbd23bf Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-17BFD: IPv6 supportKlement Sekera1-79/+142
Change-Id: Iaa9538c7cca500c04cf2704e5bf87480543cfcdf Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-17make test: add checkstyle targetKlement Sekera1-2/+0
Change-Id: I59d3c3bc77474c96e1d6fa51811c1b13fb9a6c5b Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-11BFD: fix bfd_udp_add APIKlement Sekera1-8/+25
Fix reporting of bs_index in the return message. Enhance test suite to cover this case. Change-Id: I37d35b850818bc1a05abe67ca919c22aeac978b6 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2017-01-03BFD: immediately honor reduced remote_min_rx intervalKlement Sekera1-24/+62
Change-Id: I7f09b45c926557d2ad0e2706b38fa56ff8194a3d Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-23make test: improve handling of packet capturesKlement Sekera1-4/+4
Perform accounting of expected packets based on created packet infos. Use this accounting info to automatically expect (and verify) the correct number of packets to be captured. Automatically retry the read of the capture file if scapy raises an exception while doing so to handle rare cases when capture file is read while only partially written during busy wait. Don't fail assert_nothing_captured if only junk packets arrived. Change-Id: I16ec2e9410ef510d313ec16b7e13c57d0b2a63f5 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-19make test: work around timing issue in bfd testKlement Sekera1-1/+1
Change-Id: I3f70091950b9288670969e54eadd35ac733905e4 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-16make test: improve robustness and performanceKlement Sekera1-1/+1
Introduce an API which asserts empty capture for interface. Throw exception in old API if the capture does not exist, thus making it clear if the test expects packets to arrive or not. Improve performance by not doing sleeps after starting the packet generator, rather lazily deleting captures when needed. Fix wrong usage of packet.show() in various tests. Change-Id: I456cb23316eef99b3f35f80344fe595c4db9a21c Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-09BFD: handle timing wheel prematurely firing eventsKlement Sekera1-3/+3
Improve handling of timeouts. Add a workaround for when timing wheel fires an event a tiny amount of time before it should actually be fired. Don't delete unneeded events at all from timing wheel, instead ignoring unexpected events. Enable the skipped BFD test, which passes now. Change-Id: I6ffd4fc0ba7a049ffe63bb0e5290641a7300dd6f Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-09BFD: fix timing in the main loopKlement Sekera1-34/+35
Properly wakeup the main process loop only when necessary to avoid missed events. Improve BFD unit test reliability and speed. Add timestamps to logs and replace Queue with more efficient deque. Change-Id: I01255a02057d3146917b43b669ccdc74f31ef0c8 Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-08BFD: improve ip header handling, fix assertKlement Sekera1-0/+1
Instead of storing a pointer, store an offset within vlib_buffer marking the start of the ip header (similar to storing start of ethernet header). Handle negative timeout in the bfd process main loop. Change-Id: I05a1ff3ac41da5bdc3b2ac6f9e03b3241994688b Signed-off-by: Klement Sekera <ksekera@cisco.com>
2016-12-07BFD: basic asynchronous session up/downKlement Sekera1-0/+273
This is a work-in-progress basic BFD session handling. Only asynchronous mode is supported at the moment. Setting the session flags doesn't work. Change-Id: Idba27f721b5c35be5a66a6d202a63d23ff7ecf6f Signed-off-by: Klement Sekera <ksekera@cisco.com>