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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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.
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
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
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
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
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Different versions of linux are assigned different interface
ifindexes. Mask that cabbage out.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
Move daemon configuration to appropriated files and use `json_cmp` to
assert the values we expect.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
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>
The topotests docker image has moved from frrouting/frr to
frrouting/topotests. Update accordingly.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>