Commit Graph

1013 Commits

Author SHA1 Message Date
Donald Sharp
42fc558ee3 zebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED
The flag ROUTE_ENTRY_NEXTHOPS_CHANGED is only ever set or unset.
Since this flag is not used for anything useful, remove from system.

By changing this flag we have re-ordered `internalStatus' of json
output of zebra rib routes.  Go through and fix up tetsts to
use the new values.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-29 14:53:58 -04:00
Rafael Zalamena
5d45cea234 topotest: fix bgp-path-attributes-topology
The first RIB check wants to assert that we don't have the r7's routes
in r1, so right after that code the routers r2 and r3 are configured
then `verify_rib` is called again to check for those routes.

This test never passed, but it didn't cause failures because of the
`try`/`except`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-26 17:35:45 -03:00
Donatas Abraitis
5bb05ccebb topotests: Check if set-comm-list is working under route-map scope
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-07-26 09:18:17 +03:00
Rafael Zalamena
91c939dc12 topotest: improve common_config.py
Don't wait for `True` results when the return type is a string.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:28:56 -03:00
Rafael Zalamena
a6fd124a2a topotest: add new run_and_expect variant
The new `run_and_expect` variant - called `run_and_expect_type` - tests
the return value type of the test function and optionally the return
value.

Now we can implement tests from test functions that return different
return types.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:28:56 -03:00
Rafael Zalamena
3857e52f12 topotest: improve reliability of verify_rib
Attempt to run the function multiple times to make sure we got the
result we expected. This is a middle ground between big sleeps and short
test intervals.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:28:56 -03:00
Rafael Zalamena
c50435c1c2 topotest/bgp_l3vpn_to_bgp_vrf: stabilize test
Increase wait times between commands execution to help avoid bogus test
failures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:28:56 -03:00
Rafael Zalamena
0f94985fdd topotest: adjust luCommand to accept wait_time
Allow users of `luCommand` to specify wait time between commands
execution and simplify the `wait` method implementation.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:28:20 -03:00
Rafael Zalamena
2a76b0a8e2 topotest: fix Lou's framework command wait
Fix two main issues:

  * Don't use float to figure out if we spent the time user asked;
  * Don't depend on system clock to find we reached the end of time;

The fix is basically pre caculating the amount of wait cycles we are
going to peform and use a counter.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-07-23 10:26:15 -03:00
Donald Sharp
44d2a6775b Test: Add back a bit more debugging to see what is going on
All debug logging has been thrown to the floor in this loop.
Add it back in and additionally add a bit more debugging to
know what is going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-18 07:50:10 -04:00
Mark Stapp
974c214ba9
Merge pull request #4680 from donaldsharp/test_longer
tests: Topotests are not giving sufficient time to propagate data
2019-07-17 13:34:51 -04:00
Mark Stapp
ad79beb1dd
Merge pull request #4687 from qlyoung/fix-test-ntop-strlen-assert
tests: remove strlen assert in inet_ntop tests
2019-07-15 15:25:09 -04:00
Quentin Young
2516237674 tests: remove strlen assert in inet_ntop tests
Some platform libc's like to render some v6 addresses as v4 mapped where
others render the same addresses as v6 with leading zeroes. Binary
equivalence checks pass but strlen checks sometimes fail here. Remove
assert causing the failure.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-15 17:19:14 +00:00
Renato Westphal
07a4ddf2b6
Merge pull request #4660 from manuhalo/label_manager_fixes
Label manager improvements + refactor
2019-07-12 17:09:33 -03:00
Donald Sharp
1d90adee9d tests: Topotests are not giving sufficient time to propagate data
A bunch of our current tests setup data and redistribute
it across some bgp connections and then test for it
being there.  A delay of 2 seconds that was initially
there to ensure that the data has propagated does not
actually work all the time when you have a loaded
virtualized environment.

Make the sleep 10 seconds.  I agree this is not the ideal
solution but I would rather get the damn tests up and running
again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-11 14:40:31 -04:00
Emanuele Di Pascale
0b0b502f08 tests: remove lm-proxy-topo1 topotest
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-10 15:50:22 +02:00
Emanuele Di Pascale
ff90cc95d5 tests: remove test_lblmgr.c
This is not part of the make check tests and it has been broken
for a while, apparently. The way the label manager is coded makes
it very hard to code unit tests, and testing the relay of requests
to an external label manager is probably better done through
a topotest, so remove this.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-10 15:20:27 +02:00
Emanuele Di Pascale
0e3b6a926a lib, zebra: support label chunk requests for SRGB
For SRGB, we need to support chunk requests starting at a
specific point in the label space, rather than just asking
for any sufficiently large chunk. To this purpose, we extend
the label manager api to request a chunk with a base value;
if the base is set to 0, the label manager will behave as it
currently does, i.e. fetching the first free chunk big enough
to satisfy the request.

update all the existing calls to get chunks from the label
manager so that they use MPLS_LABEL_BASE_ANY as the base
for the requested chunk

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-10 15:20:27 +02:00
Ashish Pant
870fc40f7a tests: Fix info messages print in std_error
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

frr-reolad.py invocation sends info message to stderror channel
Redirected stderror from frr-reload.py to stdout

Fixed verify_convergence when more than one link is present
2019-07-09 10:26:53 +05:30
Ashish Pant
6bb29e5ea9 tests: Fix logdir creation
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Creates logdir everytime in start_topology, removed stop_topoloy.
Using tgen.stop_topology in test case now.
2019-07-09 10:26:53 +05:30
Ashish Pant
66e98bc169 tests: Adding example cases for topojson
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Example JSON and test cases for 3 types being added:
1. Single link between routers
2. Multiple linke between routers.
3. BGP session over loopback interface
2019-07-09 10:26:53 +05:30
Ashish Pant
c557d0174e tests: Adding bgp path attribute tests
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding multiple test cases for bgp attributes.
Adding verfication APIs for them.
2019-07-09 10:26:53 +05:30
Ashish Pant
0c5c6e2e64 tests: Fixing ipv6 address generation
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
2019-07-09 10:26:53 +05:30
Ashish Pant
81e3d6095f tests: Adding bgp tests for prefix-lists
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adds mulitple test scenarios for prefix-lists in bgp. Verfication
API for prefix-lits

Also adds description for bgp-basic test suite
2019-07-09 10:26:53 +05:30
Ashish Pant
cb6b1d9058 tests: Adding 5 test cases to bgp-basic suite
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding test cases and verfication API for new test cases
2019-07-09 10:26:53 +05:30
Ashish Pant
77ef1af6e3 tests: Adding timers and bgp 4 bytes ASN test
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding verify and config apis for bgp timer testcase
Adding verify and config apis for changing ASN to 4 bytes
2019-07-09 10:26:53 +05:30
Ashish Pant
e6db2bb135 tests: Adding API for route-map
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding API for reading JSON data and configuring route-map on the
router
2019-07-09 10:26:53 +05:30
Ashish Pant
00db2a8978 tests: Adding API for prefix-list configuration
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding API for prefix-list that reads data from JSON and configures
on the router.
2019-07-09 10:26:53 +05:30
Ashish Pant
e466352711 tests: Adding API for static route
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding API for reading data from JSON and configuring static
routes on the router
2019-07-09 10:26:53 +05:30
Ashish Pant
7fa2079a03 tests: First test case and JSON
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adds verification API for bgp, first test case alongwith JSON file
2019-07-09 10:26:53 +05:30
Ashish Pant
3c19bc3134 tests: Adding api for BGP configuration
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding mulitple methods to form BGP configuration and other
helper methods.
If "bgp" is given in JSON the configuration will be created
2019-07-09 10:26:53 +05:30
Ashish Pant
7659b8d4e4 tests: Adds basic config load and interface API
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adds method to load configuration on the router. Save configuration
for resetting.
Adds method for configuring interfaces ip address on router.
Adds logdir and other pytest.ini option
2019-07-09 10:26:53 +05:30
Ashish Pant
27339562f8 tests: Adding start and stop topology
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding methods for staring and stopping routers in topology
2019-07-09 10:26:53 +05:30
Ashish Pant
2ad3d000f0 tests: Intial commit for topojson
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adding JSON parser for creating router and assinging ip addresses to
each interface
2019-07-09 10:26:53 +05:30
David Lamparter
1df0492687
Run-time log filtering via vtysh commands (#4524)
Run-time log filtering via vtysh commands
2019-07-03 14:39:59 +02:00
Lou Berger
d850e66733 topotest: reduce chattiness of lutil output
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-26 20:30:59 +00:00
Lou Berger
487921759c bgp_l3vpn_to_bgp_vrf: report zebra memory stats
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-26 17:54:20 +00:00
Lou Berger
26732abf54 bgp_l3vpn_to_bgp_vrf: refactor to try to avoid periodic failure, also collect more info
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-26 17:53:46 +00:00
Quentin Young
878918edaa
Merge pull request #4522 from LabNConsulting/working/master/issue4479
bgpd: address issue #4479 crash during instance removal
2019-06-25 11:45:19 -04:00
Sri Mohana Singamsetty
920c100807
Merge pull request #4549 from donaldsharp/multiple_instance
Multiple instance
2019-06-20 13:32:34 -07:00
Stephen Worley
4aaea8fb49 tests: Make checkRouterRunning() show logging
Adding in the command `show log-filter` made `show log`
ambiguous. Change the checkRouterRunning() test to do
full `show logging` so it works again.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-06-19 17:20:24 -04:00
Mark Stapp
e30f24fd8d topotest: configure l3mdev_accept for a range of kernels
Improve vrf support in the l3vpn topotest by configuring
l3mdev_accept for a range of kernels.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-06-19 14:55:48 -04:00
Donald Sharp
0c38bc3257 tests: Remove bgp multiple-instance command from topotests
The `bgp multiple-instance` command has been deprecated and
removed.  Finish off this by removing it from topotests too.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-18 09:32:18 -04:00
Lou Berger
5b5971483e tests/topotests: bgp_l3vpn_to_bgp_vrf double the amount of time to wait during scaling tests
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-18 11:54:57 +00:00
Lou Berger
90d5fc83c0 tests/topotests: add bgp_instance_del_test to test for crashes seen during bgp instance deletes
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-18 11:54:57 +00:00
Donald Sharp
7ec5e2bf70
Merge pull request #4514 from opensourcerouting/warnings-20190612
*: kill more warnings
2019-06-17 15:19:42 -04:00
David Lamparter
277aee6fc9
eliminate snprintf from AF_INET/AF_INET6 prefix2str, add prefix2str test (#4521)
eliminate snprintf from AF_INET/AF_INET6 prefix2str, add prefix2str test
2019-06-14 21:48:34 +02:00
Lou Berger
dc06452e68 tests/topotests: bgp_l3vpn_to_bgp_vrf double the amount of time to wait during scaling tests
Signed-off-by: Lou Berger <lberger@labn.net>
2019-06-13 21:01:30 +00:00
Quentin Young
42aac9b2ab
Merge pull request #4500 from opensourcerouting/clippy-improve
clippy: batch of improvements
2019-06-13 15:06:24 -04:00
Quentin Young
17bf75735c tests: add prefix2str test
Only tests IPv4 and IPv6 right now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-13 18:30:28 +00:00
Quentin Young
096873bd46
Merge pull request #4509 from opensourcerouting/spanish-intquisition
lib: make printfrr int64_t usable
2019-06-13 14:00:50 -04:00
Quentin Young
ec466f6546 lib: remove snprintf from prefix2str
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-06-13 17:08:05 +00:00
Donald Sharp
6a81b60a94
Merge pull request #4502 from opensourcerouting/topotest-backward-compat
topotests: backward compatibility fix
2019-06-13 09:19:02 -04:00
David Lamparter
2618a52ed3 *: config.h or zebra.h is the first #include
This is mostly relevant for Solaris, where config.h sets up some #define
that affect overall header behaviour, so it needs to be before anything
else.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-13 13:35:33 +02:00
David Lamparter
afb35622ef lib: make "%Ld" work for int64_t
... without compiler plugins.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:35:43 +02:00
David Lamparter
102f26e611 build: remove tests/Makefile.in
this was accidentally added in 370c8e07

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:22:59 +02:00
Rafael Zalamena
04ce2b970e topotests: backward compatibility fix
Allow old topologies to use default parameters from `pytest.ini`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-06-11 14:05:48 -03:00
David Lamparter
a7f20d4328 lib: const-unaware container_of for C++
This version of container_of() should work on C++, by ditching the
unavailable builtins (at the cost of no longer checking for "const"
violations.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-11 18:45:38 +02:00
Quentin Young
9f9307c953
Merge pull request #4480 from opensourcerouting/inet_ntop
inet_ntop but faster
2019-06-07 11:23:16 -04:00
Donald Sharp
3f759ec92f
Merge pull request #4449 from opensourcerouting/py-detect
build: refactor & revamp python autoconf logic
2019-06-07 07:19:35 -04:00
David Lamparter
874035be4e tests: exercise frr_inet_ntop()
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-06 20:59:54 +02:00
Rafael Zalamena
0b5cfde508
Merge pull request #4428 from mjstapp/topo_update_ospf6
topotests: migrate ospf6 test to topogen framework
2019-06-06 15:57:49 -03:00
Mark Stapp
e394d9aa5f tests: Add ip6_route_zebra lib function
Add a common function to retrieve and canonicalize
'show ipv6 route' output for use in topotests. Use that in
the test_ospf6_topo1 test; update the corresponding 'expected'
results files to match the lib function.

Replace some 'print' with 'logger' statements in that test also.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-06-06 13:22:04 -04:00
Donald Sharp
f7288f1515
Merge pull request #4370 from pguibert6WIND/fix_interface_rtadv2
Fix Router advertisements per VRF
2019-06-06 10:25:09 -04:00
Philippe Guibert
37ce18dcfc topotests: test bgp ipv6 vrf lite unnumbered with ipv6 rt advertisements
bgp ipv6 implies that routing advertisements be available for all vrf.
in the case of the vrf backend is network namespace, this should be
tested too. in addition to configure addresses per interface on a
separate vrf, the test also checks for BGP connectivity.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-04 18:33:57 +02:00
Philippe Guibert
689bb56613 topotests: test bgp ipv6 unnumbered with ipv6 rt advertisements
bgp ipv6 implies that routing advertisements be available for all vrf.
in the case of the vrf backend is network namespace, this should be
tested too. in addition to configure addresses per interface on a
separate vrf, the test also checks for BGP connectivity.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-04 18:33:57 +02:00
David Lamparter
45da32d7a4 build: refactor & revamp python autoconf logic
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-04 16:21:20 +02:00
David Lamparter
b9911c2e4e tests: exercise printfrr()
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-03 18:57:31 +02:00
Mark Stapp
92a9c7bd28 topotests: migrate ospf6 test to topogen framework
Migrate/upgrade the ospf6-topo1 topotest to the topogen
framework. The framework supports improved logging, among
other things. Also add a couple of zebra debugs.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-31 13:57:03 -04:00
Donald Sharp
2950f5da55 lib: Add '--command-log-always` to all daemons startup
Add 'no log commands' cli and at the same time add a
--command-log-always to the daemon startup cli.

If --command-log-always is specified then all commands are
auto-logged and the 'no log commands' form of the command
is now ignored.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-31 10:06:42 -04:00
Russ White
4c02c06489
Merge pull request #4377 from ton31337/feature/show_fqdn_in_show_ip_bgp
bgpd: Show FQDN in `show [ip] bgp` output
2019-05-28 07:53:20 -04:00
Renato Westphal
17c474562b tests: update list of headers in the cxx compat test
Now, whenever a new header is added to libfrr, this test needs to
be updated manually (unless we automate this somehow in the future).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-21 16:00:14 -03:00
Renato Westphal
81fddbe7ae *: rename new ForEach macros from the typesafe API
This is necessary to avoid a name collision with std::for_each
from C++.

Fixes the compilation of the gRPC northbound module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-05-21 15:59:08 -03:00
Donatas Abraitis
25b5da8d50 bgpd: Show FQDN in show [ip] bgp output
We already show this information in `show [ip] bgp <prefix`, thus why don't
show it in global output. It's very handy when using at scale and to see
the whole picture instead of resolving neighbor manually.

It will show FQDN only if `bgp default show-hostname` is toggled.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-05-21 11:28:20 +03:00
David Lamparter
d0a0e597c8 tests: more datastructure tests
A little something for everybody in here.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-05-21 05:42:13 +02:00
David Lamparter
8c3d03b3e4 tests: extend DECLARE_* tests
The unsorted datastructures (LIST, DLIST) had no test before this.  Also
add a hash check (mostly to make testing the unsorted lists easier.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-05-21 05:42:13 +02:00
David Lamparter
2214f160bf tests: test DECLARE_HASH with good and bad hashfn
The hash table test was previously (intentionally) using a bad hash
function to test the code in the face of hash collisions.  Add a test
with a good hash function to see some performance numbers.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-05-21 05:42:10 +02:00
Russ White
ace430f0db
Merge pull request #4144 from pguibert6WIND/bfd_cbit
BFD CBIT
2019-05-16 10:13:26 -04:00
Russ White
6f33cbff18
Merge pull request #4340 from qlyoung/hash-key-const
lib: hashing functions should take const arguments
2019-05-16 10:00:55 -04:00
Donald Sharp
07dfa57d9b
Merge pull request #4316 from LabNConsulting/working/master/tt-scale-vrfs
bgp_l3vpn_to_bgp_vrf: test adding/removing 50K*2CEs VRF routes
2019-05-16 09:53:12 -04:00
Lou Berger
1cba6d1210 bgp_l3vpn_to_bgp_vrf: test adding/removing 50K*2CEs VRF routes
Only runs when configured with --enable-sharpd

Signed-off-by: Lou Berger <lberger@labn.net>
2019-05-15 21:27:00 +00:00
Lou Berger
a330e8170d bgp_l3vpn_to_bgp_vrf: disable bgp debug logging
Signed-off-by: Lou Berger <lberger@labn.net>
2019-05-15 21:27:00 +00:00
Lou Berger
a38f008303 topotests/lib: support sharpd and other daemons in lutils
needs both <daemon>.conf and <daemon> to be present

Signed-off-by: Lou Berger <lberger@labn.net>
2019-05-15 21:26:13 +00:00
Quentin Young
d8b87afe7c lib: hashing functions should take const arguments
It doesn't make much sense for a hash function to modify its argument,
so const the hash input.

BGP does it in a couple places, those cast away the const. Not great but
not any worse than it was.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-14 21:23:08 +00:00
Philippe Guibert
a9179f571d bfd-bgp-cbit-topo3: add bfd bgp cbit topotest test
this test simulates the case where r1 keeps staled entries of r2,
because r2 is a 'non stop forwarding' device. For instance, r2 restarts
to be upgraded, then r1 keeps the entries, thus avoiding to flush
entries in the dataplane. Here, BFD is used, and the bgp
check-control-plane-failure command is used to inform BGP that if BFD
goes down, this may be because remote peer is restarting, and this may
be necessary to keep the entries of remote.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-14 16:49:49 +02:00
Rafael Zalamena
5fd270a114
Merge pull request #4112 from pguibert6WIND/bfd_vrf
support for BFD VRF
2019-05-14 10:24:56 -03:00
Donald Sharp
11056dd815
Merge pull request #4275 from ton31337/fix/move_outside_bgp_input_modifier
bgpd: Move inbound policy check outside bgp_input_modifier()
2019-05-10 11:34:40 -04:00
Donald Sharp
943142da34
Merge pull request #4272 from opensourcerouting/isis-prefix-sid-fix
isisd: fix display of the Extended IPv4 reachability TLV
2019-05-10 11:06:56 -04:00
Donatas Abraitis
ce1df88f8f topotests: Add test to check if eBGP required policy works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-05-10 17:01:24 +03:00
Christian Franke
bf555bf035 isisd: Don't set subtlv structure if we didn't unpack any subtlvs
This ensures deserialized and serialized TLV representation is
consistent.
2019-05-10 13:24:38 +02:00
Donald Sharp
c9d72a0b7f topotests: ifindex values are not guaranteed to be the same
Different versions of linux are assigned different interface
ifindexes.  Mask that cabbage out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-08 15:06:31 -04:00
Philippe Guibert
0e6c4a0e81 bfd-vrf_topo1: add bfd test on a vrf netns
some testing is available on testing bfd feature based on a bgp vrf
instance.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-05-07 15:54:30 +02:00
Donald Sharp
43932ad63c
Merge pull request #4247 from mjstapp/fix_topotest_topo_only
topotest: fix pytest deprecation warning
2019-05-02 18:48:28 -04:00
Mark Stapp
80cb48d2f4 topotest: fix pytest deprecation warning
As of pytest 4.something, a pattern we were using in conftest.py
was deprecated. Also make a new-ish test script executable (all
the rest appear to be?)

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-05-02 14:43:18 -04:00
Lou Berger
4cd0f3fed6 topotests/bgp_rfapi_basic_sanity: cleanup rfapi using non-debug command
Signed-off-by: Lou Berger <lberger@labn.net>
2019-05-01 21:16:14 +00:00
Donald Sharp
bcbce7b283
Merge pull request #4232 from mjstapp/fix_topotests_py3
topotest: fixes to support python3
2019-04-30 15:47:17 -04:00
Mark Stapp
a07e17d5e7 topotest: fixes to support python3
Make some small changes to support both python 2 and 3.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-30 11:31:02 -04:00
Lou Berger
31e944a8a7
Merge pull request #3045 from opensourcerouting/atoms
READY: lists/skiplists/rb-trees new API & sequence lock & atomic lists
2019-04-30 10:26:35 -04:00
David Lamparter
7629b6b79c Revert "lib: remove pqueue_*"
This reverts commit 798ac49d06.
2019-04-29 21:18:48 +02:00
David Lamparter
a297301e89 lib: remove fifo implementation 2019-04-27 19:33:45 +02:00
David Lamparter
4bef0ec4fb isisd: replace dict_* with DECLARE_RBTREE
Historically, isisd has been carrying around its own red-black tree to
manage its LSP DB in.  This replaces that with the newly-added
DECLARE_RBTREE_*.  This allows completely removing the dict_* code.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27 19:33:45 +02:00
David Lamparter
798ac49d06 lib: remove pqueue_*
All users of the pqueue_* implementations have been migrated to use
TYPEDSKIP_* skiplists.  Remove.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27 19:33:45 +02:00
David Lamparter
992f9967db tests: exercise the typesafe list wrappers
Since all of these list implementations provide almost the same API, we
can run and validate them against the same test code.  9 tests for the
price of one!

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-04-27 19:33:45 +02:00
David Lamparter
bcea0c0fde lib: atomlist & atomsort
These two are lock-free linked list implementations, the plain one is
primarily intended for queues while the sorted one is for general data
storage.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-04-27 19:33:39 +02:00
Russ White
798b3c3469
Merge pull request #4140 from ton31337/fix/do_not_send_notification_again_with_invalid_nlri
bgpd: Do not send UPDATE message with maximum-prefix
2019-04-25 18:43:10 -04:00
Donatas Abraitis
513386b57f bgpd: Do not send UPDATE message with maximum-prefix
When using maximum-prefix and count is overflow BGP
sends UPDATE message:

Apr 15 20:45:06 exit1-debian-9 bgpd[9818]: 192.168.0.2 [Error] Error parsing NLRI
Apr 15 20:45:06 exit1-debian-9 bgpd[9818]: %NOTIFICATION: sent to neighbor 192.168.0.2 3/10 (UPDATE Message Error/Invalid Network Field) 0 bytes

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-04-24 14:51:06 +03:00
Donald Sharp
73587535ff tests: bgp_l3vpn_to_bgp_vrf were bailing to quickly
The tests are not coming up consistently on my test box.  Add a bit of wait
time to test to allow normal bgp when the first attempt doesn't come up.
Especially since bgp timeouts are 120 seconds with non datacenter compiles.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18 14:14:26 -04:00
David Lamparter
440d5faa3a lib: add "seqlock" wait/broadcast primitive
Manually tested rather extensively in addition to included unit tests,
should work as intended.

NB: The OpenBSD futex() code is "future"; it's not actually in OpenBSD
(yet?) and thus untested.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-04-18 12:44:29 +02:00
Quentin Young
c8d8450442
Merge pull request #3779 from opensourcerouting/fix-mpls-label-topotests
tests: Remove some inconsistent local labels in check in test_ldp_vpls_topo1
2019-04-09 11:25:40 -04:00
Martin Winter
97ec2683d4 tests: test_ldp_vpls_topo1 Remove some inconsistent labels in check
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-04-04 18:44:13 -03:00
Lou Berger
04ca9856ba
Merge pull request #3899 from ton31337/fix/remove_private_as_with_local_as
bgpd: Remove private AS numbers if local-as is defined
2019-04-04 16:08:42 -04:00
Quentin Young
fe7f26ce76 lib: remove event_counter.[ch]
goodbye spooky code

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-03 20:18:08 +00:00
Mark Stapp
0931097954
Merge pull request #4015 from opensourcerouting/topotests-fixes
topotests: fix missing log file and duplicated output folder
2019-03-28 11:07:31 -04:00
Donald Sharp
9c463972e7 topotests: Add a bit more useful debugging to ldp-vpls-topo1
When something goes wrong with this test, having these turned
on will help us debug zebra processing a bit better in the
future without having to modify anything else.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-27 16:13:58 -04:00
Donatas Abraitis
6b5a72a326 bgpd: Remove private AS numbers if local-as is defined
When using remove-private-AS together with local-as
aspath_remove_private_asns() is called before bgp_packet_attribute().

In this case, private AS will always appear in front of change_local_as.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-03-26 19:03:07 +02:00
Rafael Zalamena
87ba6e1e3a topotests/lib: fix router specific log output
Change the router log output to the previous folder so it doesn't get
erased when starting the old API (unbreaks command/output logging on
Topogen).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-03-25 15:16:12 -03:00
Rafael Zalamena
0d5e41c628 topotests/lib: fallback topology logdir if none was configured
`param.get` always evaluates the second argument and it was causing
two log directories being created for topologies using Topogen.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-03-25 14:46:16 -03:00
Rafael Zalamena
79d70a4c1b topotests: pim-basic: fix some rough edges
Move daemon configuration to appropriated files and use `json_cmp` to
assert the values we expect.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-03-20 14:03:57 -03:00
Donald Sharp
86439e8d5f Add code to test some very basic pim functionality
Add code to send a S,G stream and make sure the RP see's it.
Add code to send a *,G report and make sure the RP see's it.

This is just some *very* basic functionality testing to
ensure that we don't break anything basic.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-20 13:41:44 -03:00
Quentin Young
2e73695a3c tests: point topotests docker img to new location
The topotests docker image has moved from frrouting/frr to
frrouting/topotests. Update accordingly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-03-19 20:18:49 +00:00
Donald Sharp
86dd09667a
Merge pull request #3920 from AkhileshSamineni/show_bgp_ipv6_summary_fix_master
bgpd: Incorrect number of peers count in "show bgp ipv6 summary" output
2019-03-15 08:54:03 -04:00
Rafael Zalamena
812f5a3d3b topotests: add new bfd topology with IPv6
New BFD topology using IPv6 and multi hop peer to cover more daemon
features. This topology also tests BFD integration with BGP, OSPF and
OSPF6.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-03-11 22:07:42 -03:00
Akhilesh Samineni
210ec2a0d6 bgpd: Incorrect number of peers count in "show bgp ipv6 summary output
The "show bgp ipv6 summary" output displays incorrect number of peers count.

sonic# show bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.1, local AS number 65100 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 5, using 103 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2003::1 4 65099 0 0 0 0 0 never Active
2088::1 4 65100 0 0 0 0 0 never Active
3021::2 4 65100 0 0 0 0 0 never Active

Total number of neighbors 3
sonic#
In the above output, the peers count displays as 5 but the actual peer count is 3, i.e.. 3 neighbors are activated in ipv6 unicast address family.
Displayed peer count (5) is the number of the neighbors activated in a BGP instance.

Fix : Now the peers count displays the number of neighbors activated per afi/safi.
After Fix:
sonic# show bgp ipv6 summary

IPv6 Unicast Summary:
BGP router identifier 10.1.0.1, local AS number 65100 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 3, using 62 KiB of memory
Peer groups 1, using 64 bytes of memory

Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
2003::1 4 65099 0 0 0 0 0 never Active
2088::1 4 65100 0 0 0 0 0 never Active
3021::2 4 65100 0 0 0 0 0 never Active

Total number of neighbors 3
sonic#

Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
2019-03-07 13:17:25 +05:30
Quentin Young
97b5d752d7 *: use array_size instead of raw division
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:16 +00:00
Quentin Young
b08047f82d *: return bool from boolean functions
Not 1 or 0.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:16 +00:00
Tim Bray
e3b78da875 *: Rename backet to bucket
Presume typo from original author

Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-25 16:22:36 +00:00
David Lamparter
50734c950d
Merge pull request #3777 from donaldsharp/topotest_all_routes
topotests: Add code to ensure routes are as expected
2019-02-18 13:41:44 +01:00
Donald Sharp
cfef27e56e
Merge pull request #3622 from mjstapp/fix_cpp_compile
libs, daemons: changes to permit c++ compilation
2019-02-13 12:47:23 -05:00
Donald Sharp
01490ba25d
Merge pull request #3753 from LabNConsulting/working/master/topotest-l3mdev=1
topotest: bgp_l3vpn_to_bgp_vrf: fix setting of TCP l3mdev
2019-02-13 09:32:43 -05:00
David Lamparter
8ed561e1f1 tests: add C++ header compatibility smoke test
Compiling an empty C file with most headers included and -Wc++-compat
gives us a build error if we introduce some stupid C++-incompatible
change.

While this won't catch everything, it's a good start.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-02-11 22:34:12 -02:00
Donald Sharp
556f76e18f topotests: Add code to ensure routes are as expected
This code just ensures that v4 and v6 routes are as expected
in the rib.  While this test addition is not that complicated it would
have caught some issues while I was attempting to handle the
switchover to a different style of rib processing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11 12:54:31 -05:00
Donald Sharp
84b5e534e6 eigrpd: Do not redelete the eigrp interface data structure
On interface down do not delete the eigrp interface data
structure.  Ensure that the address that we have setup the
eigrp data structure ontop of is what we are deleting.

Additionally add a test to show that this is no-longer
crashing eigrp.  Future commits will further modify
this test to actually ensure that the eigrp topo is
updated correctly and the rib has the correct data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-11 07:23:23 -05:00
Donald Sharp
494247b58c zebra: Update zserv debug messages to give a bit more useful info
When we schedule a packet for future handling, list the packet
type so that we can see what we are getting with debugs.

Also note which client and how many packets we received from that
client.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-10 11:48:14 -05:00
Lou Berger
8d56886e6c bgp_l3vpn_to_bgp_vrf: verify TCP l3mdev set as expected
Signed-off-by: Lou Berger <lberger@labn.net>
2019-02-07 16:20:10 -05:00
Lou Berger
0c55dcbdf4 bgp_l3vpn_to_bgp_vrf: fix setting of TCP l3mdev
Signed-off-by: Lou Berger <lberger@labn.net>
2019-02-07 16:20:10 -05:00
Quentin Young
370c8e079f doc: move topotests docs to developers guide
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-05 19:25:16 +00:00
Donald Sharp
0f9bc49647 eigrpd: Modify code to pass down metric to zebra
Modify EIGRP code to pass its used metric down to zebra.
Additionally update topotests to pass with these changes.

Fixes: #3703
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-03 17:45:08 -05:00
David Lamparter
fdbd8086b1 build: fix a whole bunch of *FLAGS
- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-01-30 19:13:51 +01:00
Donald Sharp
dc2f50f378 bgpd: interface based peers should automatically override it's peer group
When a interface based peer is setup and if it is part of a peer
group we should ignore this and just use the PEER_FLAG_CAPABILITY_ENHE
no matter what.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-25 20:40:05 -05:00
Ruben Kerkhof
4d762f2607 Treewide: use ANSI function definitions
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2019-01-24 11:21:59 +01:00
Donald Sharp
848b4fc33b topotests: Modify bgp convergence to be more than 120 seconds
Waiting 10 seconds for bgp convergence makes no sense, especially
if the test system is under load and a node is started up before
the node it is connecting to is up. We should wait for the full
default of 120 seconds, plus a little time to ensure nothing is
screwed up too much.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-22 20:03:36 -05:00
Lou Berger
e3d16a4fc8 bgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr
Signed-off-by: Lou Berger <lberger@labn.net>
2019-01-07 22:16:37 +00:00
Lou Berger
ef9aee1457 bgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr
Signed-off-by: Lou Berger <lberger@labn.net>
2019-01-07 20:00:34 +00:00
Rafael Zalamena
f6913418f3
Merge pull request #3499 from donaldsharp/topotest_inheritance
Topotest inheritance
2018-12-20 15:52:03 -02:00
Martin Winter
f26be30a4b
Merge pull request #3279 from adharkar/frr-default_local
bgpd: Display default local preference and local AS for BGP show commands
2018-12-18 10:46:58 +01:00
Donald Sharp
4b1d6d4db5 topotests: add FreeBSDRouter abstraction
Start the addition of FreeBSDRouter class that inherits from
class Router.  At this point we do not do a whole lot.  We
just come up on FreeBSD, lots of stuff that still needs to
be fixed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-17 10:43:27 -05:00
Donald Sharp
d29fb5bd52 topotests: Move linux specific config into Linux config section
As part of the class rework, move the linux specific config
into the LinuxRouter.config section instead of being in the
Router class.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-17 10:38:02 -05:00
Donald Sharp
7cc96035a7 topotests: Make 'LinuxRouter' a class of 'Router'
Modify the LinuxRouter code such that it inherits from the
Router class.  This is setup work for (a) pulling out linux
specific config from class Router and (b) creating a FreebsdRouter
that inherits from class 'Router'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-17 10:33:37 -05:00
Donald Sharp
849d1ed9af topotests: Allow sharpd to be used in topotests
The sharp daemon did not have any ability to be used in
topotests.  Add some code to allow this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-16 20:47:30 -05:00
Donald Sharp
28440fd9f8 topotests: module_present should return a True/False
The recent change to module_present accidently didn't return anything.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-16 20:47:30 -05:00