The commit `bfdd: simplify and remove duplicated code` fixed a problem
that was causing the protocol configuration to override the user
configuration.
In this test case: the peer was configured to be disabled (default is
`shutdown`) and the test was expecting it to get activated (`no shutdown`)
when the protocol converged. I changed the peer default state to
`no shutdown`, however another way to get the same effect is to
configure the protocol to use a profile or don't configure a peer at all
(and use the defaults).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Since the values of ifindices cannot be relied upon across
distributions, simpy remove them from the VNI JSON being compared.
Signed-off-by: Pat Ruddy <pat@voltanet.io>
add tests to check IP address/MAC address associations are learned
from netlink NEWNEIGH messages and are propagated to the remote PE
Signed-off-by: Pat Ruddy <pat@voltanet.io>
With these changes the IS-IS SR topotest should run to completion
about twice as fast compared to before (4 -> 2 minutes on my
machine).
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
For the sake of Segment Routing (SR) and Traffic Engineering (TE)
Policies there's a need for additional infrastructure within zebra.
The infrastructure in this PR is supposed to manage such policies
in terms of installing binding SIDs and LSPs. Also it is capable of
managing MPLS labels using the label manager, keeping track of
nexthops (for resolving labels) and notifying interested parties about
changes of a policy/LSP state. Further it enables a route map mechanism
for BGP and SR-TE colors such that learned BGP routes can be mapped
onto SR-TE Policies.
This PR does not introduce any usable features by now, it is just
infrastructure for other upcoming PRs which will introduce 'pathd',
a new SR-TE daemon.
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
The vxlan `ip... ` command is failing because we are passing in
`no learning` and that is failing.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add a bit of a clue to the test_evpn_type5_topo1.py script
to what dut is failing, when things go south.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When the topotest mem-leak reporting is enabled, use the same
two-step daemon stop procedure that's used in
the topogen.stop_topology path.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
The base topology is a two level CLOS with two racks. There are
two PEs/TORs in each rack that provide active-active redundancy to
two dual-attached servers in the rack. And EVPN-PIM is used for
flooded traffic.
Reference: evpn-mh-topo-tests.pdf
Tests have been added for the following functionality -
1. ES management
2. EAD/Type-1 route handling
3. Type-2 route with non-zero ESI
4. MAC sync and remote MAC (with remote-ES destination) handling
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
When you make a change to a route-map or a prefix-list it depends on, note
that the route-map needs to be reprocessed for the change.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
`sharpd` doesn't handle any route map commands and neither should show
up in route map commands. This makes the CI pass again after not sending
route map commands to it again.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Address-sanitizer runs in the CI appear to require more
memory than is available (at present), so skip the top
x32 route_scale testcase when running with <4G of ram.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Make some changes to the route-scale topotest, in view of
issue #6734. Table-drive the test to eliminate some
repeated code. Assert and fail if a step in the progression
of scale fails. Wait a little longer between checking the show
output - it's costly to generate that output at scale. Add a
memleak testcase.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
1. evpn_type5_test_topo1 tests started failing in CI for all Ubuntu 18.04 machine,
which are having kernel version: 5.4.0-42-generic
2. We will enable these tests once issue is found and fixed.
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
The `log monitor' command is a no-op and actually
outputs a `this doesn't do anything` warning. Let's remove
this cli line from our tests as that don't do anything and
people will look at these configs for guidance.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
add thread info, use "bt full" to get variables and add a bit of
disassembly for good measure.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
1. Increasing BGP convergence wait time to overcome Ubuntu 16.04 arm8 box, as
bgp neighorship is taking more time in this particular testbed.
2. Debugged bgp-ecmp-topo2 failures and here also it seems to be bgp convergence
issue, doing some enhancement in scripts to handle it
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Remove mid-string line breaks, cf. workflow doc:
.. [#tool_style_conflicts] For example, lines over 80 characters are allowed
for text strings to make it possible to search the code for them: please
see `Linux kernel style (breaking long lines and strings)
<https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_
and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_.
Scripted commit, idempotent to running:
```
python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'`
```
Signed-off-by: David Lamparter <equinox@diac24.net>
Stop printing hard-coded 30 seconds in a couple of places in
bgp.py in the topojson infra - print the actual time
spent waiting.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Remove a special-case clause for static routes - it was the same
as the clause for other recursive routes. Have staticd just tell
zebra that recursion is allowed. Update topotest that was aware
of this 'internal' flag.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
1. It will generate support bundle/sump data on test failures
2. It used /usr/lib/frr/generate_support_bundle.py utility to dump the data
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Another short timeout for bgp - make the
verify_bgp_convergence_from_running_config() api use the same
generous timeout as verify_bgp_convergence()
Signed-off-by: Mark Stapp <mjs@voltanet.io>
There exists the possiblity that the hello timer printed would
show a time to expiration in this format:
Hello due in 350 usecs
The tests are looking for:
Hello due in 5.430s
Just notice that we may have gotten usecs and act accordingly
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. Added 7 test cases to verify bgp recursive nexthop and ebgp multi-hop functionality
2. Added framework support to automate these test cases
3. Total execution time is ~5 mins
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Use the right list of daemons to avoid trying to start zebra twice.
Change a zebra log message to INFO level to avoid stderr check
failure.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Add a few retries during router shutdown before killing a daemon. Also
work harder to start only a single instance of daemons, esp. zebra.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
The tests work with the default settings of BFD meaning that bfdd is
able to recognize a 'down' link after ~900ms so a route recovery should
be visible in the RIB after 1 second.
In the current state only IPv4 is used (when using IPv6
autoconfiguration) within BFD, even though the recovery also affects
IPv6 routes. This is different to the current state of ospfd/ospf6d in
combination with BFD since both IPv4 and IPv6 sessions are used there.
The following topology is used:
+---------+
| |
eth-rt2 (.1) | RT1 | eth-rt3 (.1)
+----------+ 1.1.1.1 +----------+
| | | |
| +---------+ |
| |
| 10.0.2.0/24 |
| |
| eth-rt1 | (.2)
| 10.0.1.0/24 +----+----+
| | |
| | RT3 |
| | 3.3.3.3 |
| | |
(.2) | eth-rt1 +----+----+
+----+----+ eth-rt4 | (.1)
| | |
| RT2 | |
| 2.2.2.2 | 10.0.4.0/24 |
| | |
+----+----+ |
(.1) | eth-rt5 eth-rt3 | (.2)
| +----+----+
| | |
| | RT4 |
| | 4.4.4.4 |
| | |
| +----+----+
| 10.0.3.0/24 eth-rt5 | (.1)
| |
| |
| 10.0.5.0/24 |
| |
| +---------+ |
| | | |
+----------+ RT5 +----------+
eth-rt2 (.2) | 5.5.5.5 | eth-rt4 (.2)
| |
+---------+
Route recovery is tested on RT1. The focus here lies on the two
different routes to RT5. Link failures are generated by taking
down interfaces via the mininet Python interface on RT2 and RT3.
Hence routes are supposed to be adjusted to use RT3 when a link
failure happens on RT2 or vice versa.
Note that only failure recognition and recovery is "fast". BFD
does not monitor a link becoming available again.
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Instead of waiting for daemons start with `sleep`, start them with the
`-d` parameter so they can release the terminal themselves when ready.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Start logging early everything (including debug) to
`/tmp/topotest/<test>/<node>/<daemon>.{out,err}`.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Handle the duplicated code with a simple conditional: if called from
specialized API use provided daemons configuration, otherwise fallback
to old `Router` own daemon settings.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Just disable pbr tests on anything less than 4.10.
This has to do with the fact that the arm platform
is not allowing us to install a route into a
non default table using a interface associated
with a vrf.
ip route add default 4.5.6.7 via swp39 table 10000
When swp39 is in a vrf other than default
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
From last addition we can tell that the nexthop-group C is
installed but pbr does not think it is. This failure
has been consistent the last 4-5 runs in master. Lets
add a bit more data gathering to figure out what is going on.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Include vrf name with interface name when topojson framework
generates interface configuration. This matches the output of
'show runn', and makes config reset less disruptive. Also
stop removing configured debugs and log output when re-generating
config.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
This may be expanded in the future as we figure out more things
to gather when the test has gone south.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This is the bulk part extracted from "bgpd: Convert from `struct
bgp_node` to `struct bgp_dest`". It should not result in any functional
change.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Under heavy load some systems may still be processing. Let's give
the system some time to figure out what is going wrong.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Announcements that are marked as invalid were previously not revalidated.
This was fixed by replacing the range lookup with a subtree lookup.
Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
Import a topology with some protocols that integrate with BFD. As other
daemons get the new BFD profile support we can update the test to cover
them.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Error Message seen:
2020-06-11 14:00:35,288 ERROR: assert failed at "test_ebgp_ecmp_topo2/test_ecmp_after_clear_bgp[redist_static]": Testcase test_ecmp_after_clear_bgp[redist_static] : Failed
Error: TIMEOUT!! BGP is not converged in 30 seconds for router r3
assert 'TIMEOUT!! BGP is not converged in 30 seconds for router r3' is True
if a retry for a failed connection is 120 seconds we should wait slightly
longer than a retry session, which this clear test was not doing.
Especially since we know our topotests are lossy on data under load.
Apparently I changed this earlier to 90 seconds, but a retry window
is 120. Not sure wtf I was thinking
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add some basic route scale tests to ensure that we can
install a large number of routes. Also grab some timings
so that we can keep track and see if anything substantially
changes over time.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The convergence timeout in lib/bgp.py was something like 40 secs;
that's not really long enough for the CI. Raise the timeout to
40 x 3 secs.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Use `json_cmp` instead of raw text comparison. It should fix some of the
ordering problems we are seeing in CI runs.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Update OSPF Segment Routing topotest in conformity to ECMP
- Add one more interface between r1 and r2 for ECMP
- Anonymize Adjacency SID
- Update expected json output
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
The bgp_as_wide_bgp_identifier test can time out after
30 seconds waiting for convergence. This is of course
a problem in our test setup where we know that convergence
can fail on first startup due to load issues in the
topology. Additionally we also know that our default time
for bgp sessions is 120 seconds to retry. Give things
a bit longer than 120 seconds to actually fail
instead of 30 seconds
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Just add a basic test for pbr. This code
does not actually test installation in the kernel at this
point in time.
What we do do is make sure pbr is in a sane state after
some very basic configuration.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Just a simple setup for pbr to prove it starts. Once the json
code for pbr gets in we can add more.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Issue number #6291 describes how OSPFd crashes after being deleted and then
added again with configuration when segment routing is used.
The problem occurs in ospf_ri.c because the OspfRI structures retains
the reference to the old area pointer which is mofified when ospfd is
reactivated by configuration. When segment routing is activated, the LSA Router
Information is sent with reference to the old area pointer, instead the new one,
which causes the crash. The same problem is also present in ospf_ext.c with
OspfEXT structure and Extended Link/Prefix structure.
This commit introduces Extended Link/Prefix and Router Information LSAs flusing
when OSPFd is stopped when configuration is removed and adds the correct
initialization to the area pointer in OspfRI and Extended Link/Prefix structure
when OSPFd is re-enabled with the configuration. Area pointer has been removed
from the OspfEXT structure as it is never used with this commit.
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Changes:
- Renamed file so we don't get confused when it fails.
- Use `json_cmp` instead of direct key access.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
The involved piece of code is supposed to find a 'closest' match for two
JSON structures using another JSON diff. However, it can happen that
during that new diff the JSON structures are altered (elements from a
list are deleted when 'found'). This is in general ok when the deleted
element is part of the JSON structure which 'matches', but when it later
turns out that some other element of the structure doesn't fit, then the
whole structure should be recovered. This is now realized by using a
deepcopy for the besaid new JSON diff such that the original is only
altered (e.g. deleted) when the diff is clean.
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
1. Adding 4 testcases to this testsuite to verify BGP multi-vrf functionality
2. Adding supporting JSON file to create topology and base config
3. Execution time is ~3 mins
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Adding 22 testcases to this testsuite to verify BGP multi-vrf functionality
2. Adding supporting JSON file to create topology and base config
3. Execution time is ~7 mins.
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Now that the "frr-interface" list has a "state" container, move the
IS-IS interface state nodes underneath it using a new augmentation.
Also, update the IS-IS SR topotest to account for this change. Make
use of symlinks where possible to avoid having multiple files with
the same content.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Based on work originally by Mark Stapp <mjs@voltanet.io>.
Make it possible to iterate the typesafe lists in a const
context, as well as find items from them.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
[above signoff was for the original version before modification]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
1. Test suite has 17 test cases to verify BGP-graceful-restart functionality
2. Execution time is ~20 Mins
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Test suite has 25 test cases to verify BGP-graceful-restart functionality
2. Execution time is ~21 Mins
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Adding APIs to common_config.py to support BGP-Graceful-Restart automation
2. Adding APIs to create BGP-GR config to bgp.py
3. Adding verification API for BGP-GR functionality
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
This commit introduces a comprehensive test for IS-IS Segment
Routing. It features the following network topology:
+---------+
| |
| RT1 |
| 1.1.1.1 |
| |
+---------+
|eth-sw1
|
|
|
+---------+ | +---------+
| | | | |
| RT2 |eth-sw1 | eth-sw1| RT3 |
| 2.2.2.2 +----------+----------+ 3.3.3.3 |
| | 10.0.1.0/24 | |
+---------+ +---------+
eth-rt4-1| |eth-rt4-2 eth-rt5-1| |eth-rt5-2
| | | |
10.0.2.0/24| |10.0.3.0/24 10.0.4.0/24| |10.0.5.0/24
| | | |
eth-rt2-1| |eth-rt2-2 eth-rt3-1| |eth-rt3-2
+---------+ +---------+
| | | |
| RT4 | 10.0.6.0/24 | RT5 |
| 4.4.4.4 +---------------------+ 5.5.5.5 |
| |eth-rt5 eth-rt4| |
+---------+ +---------+
eth-rt6| |eth-rt6
| |
10.0.7.0/24| |10.0.8.0/24
| +---------+ |
| | | |
| | RT6 | |
+----------+ 6.6.6.6 +-----------+
eth-rt4| |eth-rt5
+---------+
Each router has both an IPv4 and an IPv6 loopback address, each of
which has a corresponding Prefix-SID configured.
Basic SR functionality is tested. First, the topotest ensures that
all expected Prefix-SIDs and Adj-SIDs are flooded and installed
correctly in all routers of the network. Later, network failures
are simulated and configuration changes are performed in several
different routers. The topotest then checks if IS-IS has converged
as expected in the network according to the network failures and
configuration changes that happened.
The topotest comprises 11 different steps, each with four individual
tests (for a total of 44 tests). A summary of what each step does
is provided below:
---
STEP 1:
-Initial network convergence
---
Step 2:
Action(s):
-Disable IS-IS on the eth-rt5 interface on rt4
Expected changes:
-rt4 should uninstall the Adj-SIDs pointing to rt5
-rt5 should uninstall the Adj-SIDs pointing to rt4
-rt2 should reinstall rt5's Prefix-SIDs (2 nexthops deleted)
-rt3 should reinstall rt4's Prefix-SIDs (2 nexthops deleted)
-rt4 should reinstall rt3's Prefix-SIDs (1 nexthop deleted)
-rt4 should reinstall rt5's Prefix-SIDs (1 nexthop changed)
-rt5 should reinstall rt2's Prefix-SIDs (1 nexthop deleted)
-rt5 should reinstall rt4's Prefix-SIDs (1 nexthop changed)
---
Step 3:
Action(s):
-Shut down the eth-rt4 interface on rt6
-Shut down the eth-rt5 interface on rt6
Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 and rt5 should uninstall the Adj-SIDs pointing to rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt2 using ECMP
-rt5 should reconverge rt4's Prefix-SIDs through rt3 using ECMP
-rt6 should uninstall all its IS-IS routes, Prefix-SIDs and Adj-SIDs
---
Step 4:
Action(s):
-Bring up the eth-rt4 interface on rt6
-Bring up the eth-rt5 interface on rt6
-Change rt6's SRGB
Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 and rt5 should install Adj-SIDs for rt6
-rt4 should reconverge rt5's Prefix-SIDs through rt6 using the new SRGB
-rt5 should reconverge rt4's Prefix-SIDs through rt6 using the new SRGB
-rt6 should reinstall all IS-IS routes and Prefix-SIDs from the network,
and Adj-SIDs for rt4 and rt5
---
Step 5:
Action(s):
-Disable SR on rt6
Expected changes:
-All routers should uninstall rt6's Prefix-SIDs
-rt4 should uninstall rt5's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt5 should uninstall rt4's Prefix-SIDs since the nexthop router hasn't
SR enabled anymore
-rt6 should uninstall all Prefix-SIDs from the network, and the Adj-SIDs
for rt4 and rt5
---
Step 6:
Action(s):
-Enable SR on rt6
Expected changes:
-All routers should install rt6's Prefix-SIDs
-rt4 should install rt5's Prefix-SIDs through rt6
-rt5 should install rt4's Prefix-SIDs through rt6
-rt6 should install all Prefix-SIDs from the network, and Adj-SIDs for
rt4 and rt5
---
Step 7:
Action(s):
-Delete rt1's Prefix-SIDs
Expected changes:
-All routers should uninstall rt1's Prefix-SIDs
---
Step 8:
Action(s):
-Re-add rt1's Prefix-SIDs
Expected changes:
-All routers should install rt1's Prefix-SIDs
---
Step 9:
Action(s):
-Change rt1's Prefix-SIDs to use the no-php option
-Change rt6's Prefix-SIDs to stop using the explicit-null option
Expected changes:
-rt2 and rt3 should reinstall rt1's Prefix-SIDs accordingly
-rt4 and rt5 should reinstall rt6's Prefix-SIDs accordingly
---
Step 10:
Action(s):
-Remove the IPv4 address from rt4's eth-rt2-1 interface
Expected changes:
-rt2 should uninstall the IPv4 Adj-SIDs attached to the eth-rt4-1
interface
-rt2 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt4
(ECMP shouldn't be used anymore)
-rt4 should reinstall all IPv4 Prefix-SIDs whose nexthop router is rt2
(ECMP shouldn't be used anymore)
---
Step 11:
Action(s):
-Restore the original network setup
Expected changes:
-All routes, Prefix-SIDs and Adj-SIDs should be the same as they were
after the initial network convergence (step 1)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diff'ing JSON objects is a crucial operation in the topotests for
comparing e.g. vtysh output (formatted as JSON) with a file which
covers the expectation of the tests. The current diff functionality
is 'self-written' and intended to test a JSON object d2 on being a
subset of another JSON object d1. For mismatches a diff is generated
based on a normalized textual representation of the JSON objects.
This approach has several disadvantages:
* the human provided JSON text might not be normalized, hence
a diff with line numbers might be worthless since it provides
close to zero orientation what the problem is
* the diff contains changes like commatas which are meaningless
* the diff might contain a lot of changes about meaningless
content which is present in d1 but not in d2
* there is no proper functionality to test for 'equality' of
d1 and d2
* it is not possible to test for order, e.g. JSON arrays are
just tested with respect to being a subset of another array
* it is not possible to check if a key exists without also
checking the value of that particular key
This commit attempts to solve these issues. An error report is
generated which includes the "JSON Path" to the problematic JSON
elements and also hints on what the actual problem is (e.g. missing
key, mismatch in dict values etc.).
A special parameter 'exact' was introduced such that equality can be
tested. Also there was a convention that absence of keys can be
tested using the key in question with value 'None'. This convention
is still honored such that full backwards compatiiblity is in
place.
Further order can be tested using the new tag '__ordered__' in
lists (as first element). Example:
d1 = [1, 2, 3]
d2 = ['__ordered__', 1, 3, 2]
Tesing d1 and d2 this way will now result in an error.
Key existence can now be tested using an asterisk '*'. Example:
d1 = [1, 2, 3]
d2 = [1, '*', 3]
d1 = {'a': 1, 'b': 2}
d2 = {'a': '*'}
Both cases will result now in a clean diff for d1 and d2.
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
Modify the import-check command to require the underlying prefix
to exist in the rib. General consensus is that this is the correct
behavior.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The question here isn't "why does it break on PowerPC?", but rather "why
doesn't it break on x86_64 or ARM?"
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
These are easy to get subtly wrong, and doing so can cause
nondeterministic failures when racing in parallel builds.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Having a fixed set of parameters for each northbound callback isn't a
good idea since it makes it difficult to add new parameters whenever
that becomes necessary, as several hundreds or thousands of existing
callbacks need to be updated accordingly.
To remediate this issue, this commit changes the signature of all
northbound callbacks to have a single parameter: a pointer to a
'nb_cb_x_args' structure (where x is different for each type
of callback). These structures encapsulate all real parameters
(both input and output) the callbacks need to have access to. And
adding a new parameter to a given callback is as simple as adding
a new field to the corresponding 'nb_cb_x_args' structure, without
needing to update any instance of that callback in any daemon.
This commit includes a .cocci semantic patch that can be used to
update old code to the new format automatically.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Replace sprintf with snprintf where straightforward to do so.
- sprintf's into local scope buffers of known size are replaced with the
equivalent snprintf call
- snprintf's into local scope buffers of known size that use the buffer
size expression now use sizeof(buffer)
- sprintf(buf + strlen(buf), ...) replaced with snprintf() into temp
buffer followed by strlcat
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Replace all `random()` calls with a function called `frr_weak_random()`
and make it clear that it is only supposed to be used for weak random
applications.
Use the annotation described by the Coverity Scan documentation to
ignore `random()` call warnings.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Add some more NHG topotests using connected, recursive, duplicate
and higher ecmp nexthops as well as route maps.
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
The bgp configuration for the vxlan topotest mixed
and matched some configuration that does not belong
for an IBGP setup.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
And again for the name. Why on earth would we centralize this, just so
people can forget to update it?
Signed-off-by: David Lamparter <equinox@diac24.net>
Same as before, instead of shoving this into a big central list we can
just put the parent node in cmd_node.
Signed-off-by: David Lamparter <equinox@diac24.net>
There is really no reason to not put this in the cmd_node.
And while we're add it, rename from pointless ".func" to ".config_write".
[v2: fix forgotten ldpd config_write]
Signed-off-by: David Lamparter <equinox@diac24.net>
1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Added 5 test cases to verify BGP AS-allow-in behavior in FRR
2. Enhanced framework to support BGP AS-allow-in config(lib/bgp.py)
3. Added API in bgp.py to verify BGP RIB table(lib/bgp.py)
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
If we're building with a separate build directory, these two build
targets can fail in case their output directory hasn't been created by
some other target that may or may not have run earlier.
Signed-off-by: David Lamparter <equinox@diac24.net>
Add some basic tests to show that network and passive-interface
commands work with interface names in rip and ripngd.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add a couple more tests to static route installation
Do some very very basic work to make sure that they are working
the way we want.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
1. Added 1 test case to verify NO-ADVERTISE Community functionality
2. Enhanced bgp.py to exclude routers from verification, if doesn't have bgp config
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Added 2 new test cases to bgp-basic-functionality-topo1
2. Enhanced 2 tests to run for both static routes and network advvertise command
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
1. Added 5 test cases to verify BGP AS-allow-in behavior in FRR
2. Enhanced framework to support BGP AS-allow-in config(lib/bgp.py)
3. Added API in bgp.py to verify BGP RIB table(lib/bgp.py)
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
This test creates a 5 box setup with 2 hosts, 2 PEs and a P router
it checks for
1. VNI VTEPs being communicated between zebra from PE1 to PE2
and vice versa.
2. MAC addresses from host 1 being learned by PE1 and signalled
to PE2 over BGP
Signed-off-by: Pat Ruddy <pat@voltanet.io>
Our two northbound tools don't have embedded YANG modules like the
other FRR binaries. As such, ly_ctx_set_module_imp_clb() shouldn't be
called when the YANG subsystem it being initialized by a northbound
tool. To make that possible, add a new "embedded_modules" parameter
to the yang_init() function to control whether libyang should look
for embedded modules or not.
With this fix, "gen_northbound_callbacks" and "gen_yang_deviations"
won't emit "YANG model X not embedded, trying external file"
warnings anymore.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This is a full rewrite of the "back end" logging code. It now uses a
lock-free list to iterate over logging targets, and the targets
themselves are as lock-free as possible. (syslog() may have a hidden
internal mutex in the C library; the file/fd targets use a single
write() call which should ensure atomicity kernel-side.)
Note that some functionality is lost in this patch:
- Solaris printstack() backtraces are ditched (unlikely to come back)
- the `log-filter` machinery is gone (re-added in followup commit)
- `terminal monitor` is temporarily stubbed out. The old code had a
race condition with VTYs going away. It'll likely come back rewritten
and with vtysh support.
- The `zebra_ext_log` hook is gone. Instead, it's now much easier to
add a "proper" logging target.
v2: TLS buffer to get some actual performance
Signed-off-by: David Lamparter <equinox@diac24.net>
We are still seeing cbit test failures in the ci system. I am
gonna try extending the timeout a bit more as that 8 seconds
doesn't seem to be long enough.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Implement tests to verify BGP link-bandwidth and weighted ECMP
functionality. These tests validate one of the primary use cases for
weighted ECMP (a.k.a. Unequal cost multipath) using BGP link-bandwidth:
https://tools.ietf.org/html/draft-mohanty-bess-ebgp-dmz
The included tests are:
Test #1: Test BGP link-bandwidth advertisement based on number of multipaths
Test #2: Test cumulative link-bandwidth propagation
Test #3: Test weighted ECMP - multipath with next hop weights
Test #4: Test weighted ECMP rebalancing upon change (link flap)
Test #5: Test weighted ECMP for a second anycast IP
Test #6: Test paths with and without link-bandwidth - receiver should resort to regular ECMP
Test #7: Test different options for processing link-bandwidth on the receiver
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Just a small hack to use printfrr() in tests, since otherwise the
redefined PRId64 trips some warnings.
Signed-off-by: David Lamparter <equinox@diac24.net>
Fixup this basically unused test to ensure that a RR server
passes the nexthop through correctly.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Add new function `bgp_node_get_prefix()` and modify
the bgp code base to use it.
This is prep work for the struct bgp_dest rework.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
The old version was creating a multi-line log message, which we can't
properly handle right now.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
"sort" as used in all-protocol-startup used sort which causes
different sort order based on locale settings. Specify the
correct one to make output matching our expected result
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
LDP now advertises routes it learns over an interface not configured
with LDP. If the route, which is learned over a non-LDP configured
interface, has no other NHs learned over an interface running LDP,
the router will act as a LDP egress router.
Modifying ldp-topo1/r1/ip_mpls_route.ref to include an extra newline.
Without this newline, the ldp-topo1 was failing.
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
The bfd-bgp-cbit-topo3 test is testing bfd timers
with some timers that only wait 4 seconds. The CI
system is failing in various places due to bfd
not converging properly. Upon logging into a
CI system and running tests with intensive disk i/o
I was able to make the tests fail repeatedly in
a couple of different places. Add some additional
time to allow the system to converge on our CI
systems that are running in vm's and may not
always have complete control of cpu's.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>