Commit Graph

1400 Commits

Author SHA1 Message Date
Kuldeep Kashyap
6fef4969ef tests: Add bgp_recursive_route_ebgp_multi_hop test suite
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>
2020-07-06 10:05:53 +00:00
Mark Stapp
cb3e512d97 tests,zebra: fix more startup topotest issues
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>
2020-07-04 12:25:10 -04:00
Mark Stapp
cf865d1b7c tests: wait longer when shutting down in topotests
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>
2020-07-03 13:22:42 -04:00
GalaxyGorilla
a01cb26cae tests: Introduce BFD IS-IS topotests
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>
2020-07-03 08:42:34 +00:00
Rafael Zalamena
9ce4f4b86b topotests: remove daemons start up sleep
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>
2020-07-02 14:52:46 -03:00
Rafael Zalamena
1455684740 topotests: start logging early
Start logging early everything (including debug) to
`/tmp/topotest/<test>/<node>/<daemon>.{out,err}`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-07-02 14:52:46 -03:00
Rafael Zalamena
aa5261bf7d topotests: remove duplicated code
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>
2020-07-02 14:52:42 -03:00
Donald Sharp
7799deeed6
Merge pull request #6437 from opensourcerouting/bfd-profiles-bgp
bfdd,bgpd: profiles integration support
2020-07-02 12:22:44 -04:00
Donald Sharp
272ed0af32 tests: pbr is not working properly on arm 4.9 kernels
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>
2020-06-30 15:10:20 -04:00
Donatas Abraitis
f48e3fa9e5
Merge pull request #6643 from mjstapp/fix_typos_bgp_multivrf1
test: fix some typos in bgp_multi_vrf_topo1
2020-06-27 18:41:20 +03:00
Donald Sharp
2cb8bfb247 tests: Add some more data gathering
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>
2020-06-26 07:10:08 -04:00
Mark Stapp
8171368be7 test: fix some typos in bgp_multi_vrf_topo1
Noticed a few text things in this topotest.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-25 13:43:37 -04:00
Donald Sharp
0ce2d6ba13
Merge pull request #6630 from opensourcerouting/bgp-node-dest-rename
bgp: rename bgp_node to bgp_dest
2020-06-25 09:14:18 -04:00
Mark Stapp
c4f9205763 tests: fix interface and debug config diff in topojson framework
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>
2020-06-24 11:27:15 -04:00
Donald Sharp
d9a34de19f tests: the pbr topo1 test is failing gather data to help debug
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>
2020-06-23 13:18:35 -04:00
Donald Sharp
9bcb3eef54 bgp: rename bgp_node to bgp_dest
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>
2020-06-23 17:32:52 +02:00
Rafael Zalamena
65e3e8484b topotests: bump BFD test convergence time
Lets make the test more resilient to failures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-06-18 08:42:11 -03:00
Rafael Zalamena
0a901ebcb6 topotests: remove old FRR version support
Removes a few lines of code.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-06-18 08:02:34 -03:00
Philippe Guibert
9b222c1f1a
Merge pull request #6577 from rtrlib/2020-06-12-master-fixes
bgpd: rpki fixes (master)
2020-06-17 09:09:02 +02:00
Donald Sharp
36952a8218 tests: Modify pbr test to give a reasonable amount of time to succeed
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>
2020-06-15 16:59:38 -04:00
Marcel Röthke
bac31cb885 bgpd: fix rpki revalidation for invalid announcements
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>
2020-06-15 18:22:37 +02:00
Rafael Zalamena
a1e0142dce topotest: add tests for BFD profiles
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>
2020-06-12 14:25:53 -03:00
Donatas Abraitis
f8e30433f6
Merge pull request #6563 from donaldsharp/scale_tests
tests: Add some scale tests to ensure things work
2020-06-12 09:11:09 +03:00
Donald Sharp
6a6f3d5a60 tests: After clear give it more than 90 seconds to come up
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>
2020-06-11 09:53:05 -04:00
Donald Sharp
bbbd12f197 tests: Add some scale tests to ensure things work
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>
2020-06-10 23:12:34 -04:00
Donald Sharp
05e0e7dddc
Merge pull request #6555 from mjstapp/fix_ebgp_policy_topo_timeout
tests: raise convergence timeout in bgp_ebgp_requires_policy
2020-06-10 13:56:38 -04:00
Mark Stapp
8e0991305d tests: raise convergence timeout in bgp_ebgp_requires_policy
Timeout was 30 seconds, raise it to 130.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10 11:01:47 -04:00
Jakub Urbańczyk
9b7decf28e topotest: add pbr test suite
Add some basic tests for installing PBR rules into the kernel.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-06-10 16:29:14 +02:00
Donald Sharp
71af56b190
Merge pull request #6544 from mjstapp/fix_topo_lib_bgp_timeout
tests: include lib/bgp.py convergence timeout to 130
2020-06-10 09:19:26 -04:00
Mark Stapp
6bb1a16f83
Merge pull request #6532 from wesleycoakley/pbrd-moretopo
tests: Expand pbrd topology tests
2020-06-10 08:14:39 -04:00
Mark Stapp
bfab324148 tests: include lib/bgp.py convergence timeout to 130
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>
2020-06-10 08:14:08 -04:00
Rafael Zalamena
7f3197922e topotests: MPLS table output is not ordered
Don't expect ordered output from `show mpls table json`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-06-09 18:45:29 -03:00
Mark Stapp
fe171b4e1a
Merge pull request #6510 from donaldsharp/useful_timings
tests: Allow a useful amount of time for bgp to converge
2020-06-09 15:15:04 -04:00
Rafael Zalamena
19d4fe6566 topotests: stabilize ospf-sr-topo1 run
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>
2020-06-08 16:14:41 -03:00
Rafael Zalamena
c2088e52fc topotests: remove old FRR version check
Topotest is now part of FRR repo and the code is versioned with the
tests.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-06-08 16:13:25 -03:00
Wesley Coakley
11e33e0075 tests: pbr topotest verifying vrf functionality
Creates a VRF in the kernel and tests areas of pbrd not covered before

Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
2020-06-08 14:27:29 -04:00
Wesley Coakley
b046dc8716 tests: pbr topotest flaps ifaces, maps, nh-groups
Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
2020-06-08 14:27:21 -04:00
Wesley Coakley
38b5ed4b42 tests: pbr topotests variety of maps and nh-groups
Signed-off-by: Wesley Coakley <wcoakley@cumulusnetworks.com>
2020-06-08 14:12:46 -04:00
Olivier Dugeon
008bcff499 ospfd: OSPF Segment Routing topostest update
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>
2020-06-03 19:35:47 +02:00
Donald Sharp
9ccb078de1 tests: Allow a useful amount of time for bgp to converge
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>
2020-06-02 22:16:54 -04:00
Russ White
b12b5d2097
Merge pull request #6442 from wesleycoakley/pbrd-showjson
pbrd: Optional JSON output for all `show pbr` directives
2020-06-01 07:44:36 -04:00
Donald Sharp
b1ab2bd2df tests: Add a basic test for pbr
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>
2020-05-29 16:56:20 -04:00
Donald Sharp
223f87f4db tests: Setup very basic pbr tests for our topology tests
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>
2020-05-29 16:56:14 -04:00
Renato Westphal
ca4f4a3660
Merge pull request #6416 from Orange-OpenSource/master
ospfd: Solve crash after removing and adding conf.
2020-05-28 20:03:43 -03:00
Donald Sharp
2011994ee6
Merge pull request #6447 from opensourcerouting/rename-bgp-vrf-leak
topotest: refactory BGP VRF leak basic test
2020-05-27 10:34:13 -04:00
Olivier Dugeon
731271b0bd ospfd: Solve crash after removing and adding conf.
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>
2020-05-26 11:57:04 +02:00
Rafael Zalamena
8df8e15665 topotest: refactory BGP VRF leak basic test
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>
2020-05-24 17:54:00 -03:00
Donald Sharp
a0764a368f tests: Turn on nhrpd and babeld as part of all-protocol-startup
Turn on a few more daemons to run during this test.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-23 19:44:04 -04:00
GalaxyGorilla
b3100f6ce7 tests: Fix JSON diff for nested lists
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>
2020-05-22 22:29:35 +00:00
Donald Sharp
6109dd7e22
Merge pull request #6293 from GalaxyGorilla/json_diff
tests: introduce a proper JSON diff for topotests
2020-05-21 14:19:44 -04:00
Donald Sharp
bda6d3729f
Merge pull request #6398 from kuldeepkash/bgp_multi_vrf
tests: Add bgp-multi-vrf test suites
2020-05-21 07:40:17 -04:00
Donald Sharp
edb2c56c19
Merge pull request #6425 from opensourcerouting/nb-state-cbs-fixes
northbound state callbacks fixes
2020-05-20 19:27:41 -04:00
Kuldeep Kashyap
1f88794b84 tests: Enhance bgp-ecmp-topo2 script as per latest framework changes
1. Few tests are enhanced as per latest framework changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-20 04:48:47 +00:00
Kuldeep Kashyap
055e5d896e tests: Add bgp-multi-vrf-topo2 testsuite
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>
2020-05-20 04:48:47 +00:00
Kuldeep Kashyap
52c2f28cad tests: Add bgp-multi-vrf-topo1 testsuite
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>
2020-05-20 04:48:47 +00:00
Kuldeep Kashyap
f8d572e88f tests: Framework support for BGP Multi-VRF automation
1. Added/Enhanced APIs to created bgp multi-vrf config and to
verify config/functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-20 04:48:47 +00:00
Mark Stapp
3f2e6c01fa
Merge pull request #6339 from opensourcerouting/ds-const-redux
redux lists/datastructure const
2020-05-19 13:27:47 -04:00
Renato Westphal
2717192853 isisd, yang: move IS-IS interface state data to the appropriate place
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>
2020-05-15 23:47:43 -03:00
Donald Sharp
36caef199a
Merge pull request #6404 from FRRouting/dev_isis_sr
isisd: IS-IS Segment Routing support
2020-05-15 08:38:06 -04:00
Martin Winter
38ac57f9b5
Merge pull request #6220 from kuldeepkash/bgp_graceful_restart
tests: Add bgp-graceful-restart test suites
2020-05-13 15:09:08 +02:00
Mark Stapp
fa6e939421 tests: remove unused ref files from ldp topotest
Remove a couple of a couple of mis-named reference output files
from the ldp-topo1 suite.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-05-06 09:31:21 -04:00
David Lamparter
daf3441d2b lib: add const iteration & find to typesafe lists
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>
2020-05-04 22:13:28 +02:00
Kuldeep Kashyap
51582ed8c5 tests: Adding test suite bgp_gr_functionality_topo2
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>
2020-05-04 18:52:58 +00:00
Kuldeep Kashyap
35ba1e3db8 tests: Adding test suite bgp_gr_functionality_topo1
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>
2020-05-04 18:52:50 +00:00
Kuldeep Kashyap
a5a52d6608 tests: Add library support for BGP-Graceful-Restart automation
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>
2020-05-04 17:15:55 +00:00
Kuldeep Kashyap
c65a7e26dc tests: Enhance topotests scripts to kill/start specific Daemons
1. Added APIs to topogen.py and topotest.py to kill/start specific Daemons,
   ex - bgpd, staticd

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-05-04 17:15:55 +00:00
Renato Westphal
591373bdd7 tests: add topotest for IS-IS SR
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>
2020-04-30 12:15:47 +02:00
GalaxyGorilla
849224d4ed tests: introduce a proper JSON diff for topotests
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>
2020-04-30 09:33:32 +00:00
Donald Sharp
62282e8379 bgpd,tests: Modify import-check to require underlying prefixes to exist
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>
2020-04-28 15:57:53 -04:00
Lou Berger
3b548ddc33
Merge pull request #6295 from ton31337/feature/show_bgp_afi_safi_sntpfx
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-28 11:34:13 -04:00
David Lamparter
de1a641de4 tests: fix size confusion
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>
2020-04-28 11:11:46 +02:00
David Lamparter
94cfb0692e build: make clippy Makefile rules nicer
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>
2020-04-27 09:52:41 +02:00
Donatas Abraitis
9188c32faa tests: Adopt some tests to PfxSnt counter
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-24 15:35:24 +03:00
Donald Sharp
967ebd2431
Merge pull request #6279 from opensourcerouting/nb-cb-args
*: change the signature of the northbound callbacks to be  more flexible
2020-04-24 08:09:16 -04:00
Donatas Abraitis
3525e23388 Revert "tests: Adopt some tests to PfxSnt counter"
This reverts commit 6e0f90413e.
2020-04-24 10:00:17 +03:00
Sri Mohana Singamsetty
7a54a2caf7
Merge pull request #6277 from ton31337/feature/show_bgp_afi_safi_sndpfx
bgpd: Show PfxSnt for `show bgp <afi> <safi>` command
2020-04-23 20:20:07 -07:00
David Lamparter
c334a16ef1
Merge pull request #6262 from qlyoung/remove-sprintf 2020-04-23 20:27:26 +02:00
Renato Westphal
60ee8be107 *: change the signature of the northbound callbacks to be more flexible
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>
2020-04-23 10:14:32 -03:00
Donatas Abraitis
6e0f90413e tests: Adopt some tests to PfxSnt counter
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-23 13:35:26 +03:00
Quentin Young
772270f3b6 *: sprintf -> snprintf
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>
2020-04-20 19:14:33 -04:00
Donald Sharp
2d3d652178
Merge pull request #6251 from opensourcerouting/cs-ignore
*: make coverity scan ignore random() calls
2020-04-20 16:08:37 -04:00
Mark Stapp
e4195c02a7
Merge pull request #6245 from sworleys/NHG-More-Topo
tests: add connected/recursive/duplicte/route-map NHG tests
2020-04-20 13:28:14 -04:00
Donald Sharp
8b1e4f30ba
Merge pull request #6164 from ton31337/feature/rfc8212_enabled_traditional_profile
bgpd: Enable rfc8212 by default except datacenter profile
2020-04-18 15:06:04 -04:00
Rafael Zalamena
5920b3eb38 *: replace all random() calls
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>
2020-04-17 20:57:43 -03:00
Donald Sharp
2ff99507ad
Merge pull request #6135 from opensourcerouting/cli-node-cleanup
*: clean up the mess that is CLI command nodes
2020-04-16 19:24:56 -04:00
Stephen Worley
887a232c3b tests: add connected/recursive/duplicte/route-map NHG tests
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>
2020-04-16 11:49:50 -04:00
Santosh P K
09133ff4f7
Merge pull request #5451 from opensourcerouting/rcu-log
logging subsystem rewrite
2020-04-16 20:23:44 +05:30
Donatas Abraitis
c845358213
Merge pull request #6238 from donaldsharp/test_evpn_vxlan_cleanup
tests: Cleanup bgp config for evpn vxlan topotest
2020-04-16 16:05:34 +03:00
Donald Sharp
e51d13ca7c tests: Cleanup bgp config for evpn vxlan topotest
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>
2020-04-16 07:04:27 -04:00
David Lamparter
f4b8291fcb *: move CLI node names to cmd_node->name
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>
2020-04-16 12:53:59 +02:00
David Lamparter
243895805a *: move CLI parent data to cmd_node->parent_node
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>
2020-04-16 12:53:00 +02:00
David Lamparter
612c2c15d8 *: remove second parameter on install_node()
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>
2020-04-16 12:53:00 +02:00
David Lamparter
62b346eefa *: clean up cmd_node initializers
... and use named assignments everywhere (so I can change the struct.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-16 12:53:00 +02:00
Donatas Abraitis
c3b426212f tests: Check if the right next-hop is shown (bgp_show_ip_bgp_fqdn)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-16 10:37:21 +03:00
Renato Westphal
260616d55d
Merge pull request #6154 from donaldsharp/check_interface_working
tests: Add a route-map test to ensure it accepts an unknown intf name
2020-04-14 23:37:47 -03:00
Donald Sharp
1cb0c038c2
Merge pull request #6214 from opensourcerouting/bfdd-debug
bfdd: code/logging/debug improvements
2020-04-14 19:06:10 -04:00
Donald Sharp
e68a7dbb09
Merge pull request #6096 from pjdruddy/vxlan_evpn_topo_test
tests: add basic topotest for VXLAN EVPN
2020-04-14 11:53:48 -04:00
Donatas Abraitis
8971c2d828 tests: Describe each scenario for rfc8212 to ease debugging
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-14 16:01:46 +03:00
Donatas Abraitis
74f852e33b tests: Remove extra empty vertical spaces
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-14 16:01:46 +03:00
Donatas Abraitis
c7688a6943 tests: Enable rfc8212 by default except datacenter profile
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-14 16:01:46 +03:00
Rafael Zalamena
9532601587 topotest: enable bfd debugs on all BFD tests
Lets attempt to get the most out of the debug messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-04-14 09:35:08 -03:00
Kuldeep Kashyap
afee014eda tests: Added new tests to bgp-basic-functionality-topo1
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>
2020-04-09 09:23:59 +00:00
Kuldeep Kashyap
089f79edd4 tests: Adding new test suite bgp_as_allow_in
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>
2020-04-09 09:10:21 +00:00
Donatas Abraitis
fdf44b9038
Merge pull request #6125 from kuldeepkash/bgp-communities
tests: Adding new test suite bgp_communities_topo1
2020-04-09 11:49:43 +03:00
David Lamparter
2ee1e4b1ba
Merge pull request #6175 from ton31337/fix/avoid_same_type_typecasting
*: Do not cast to the same type
2020-04-08 22:44:53 +02:00
Donald Sharp
c189a11d7f
Merge pull request #6185 from opensourcerouting/build-assorted-20200408
assorted build fixes
2020-04-08 13:29:45 -04:00
Renato Westphal
ff4e6ca785
Merge pull request #6041 from donaldsharp/wang_a_yump
Wang a yump
2020-04-08 13:33:17 -03:00
David Lamparter
d32ee243af tests: fix parallel build race
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>
2020-04-08 16:27:59 +02:00
Donald Sharp
cfe9a58785 tests: Add tests to rip and ripngd to show func works
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>
2020-04-08 10:18:31 -04:00
Donatas Abraitis
c4efd0f423 *: Do not cast to the same type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-08 17:15:06 +03:00
Donald Sharp
41fce07c34 tests: Add a route-map test to ensure it accepts an unknown intf name
Add a test to route-amps to ensure that it accepts an unknown interface
name.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-04-08 09:10:54 -04:00
Donald Sharp
337dcbb913 tests: Add a couple more static route tests
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>
2020-04-08 09:07:17 -04:00
Kuldeep Kashyap
38c3547ac8 tests: Adding new test suite bgp_communities_topo1
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>
2020-04-08 12:27:23 +00:00
Kuldeep Kashyap
b7250ecfdc tests: Added new tests to bgp-basic-functionality-topo1
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>
2020-04-08 12:21:26 +00:00
Kuldeep Kashyap
9d450273df tests: Adding new test suite bgp_as_allow_in
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>
2020-04-08 12:21:26 +00:00
Pat Ruddy
6f77a974d8 tests: add basic topotest for VXLAN EVPN
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>
2020-04-06 16:49:23 +01:00
Sri Mohana Singamsetty
70ecc066e7
Merge pull request #6105 from vivek-cumulus/bgp_link_bandwidth_unequal_cost_multipath
Unequal cost multipath (a.ka. weighted ECMP) with BGP link-bandwidth
2020-04-05 11:41:42 -07:00
Sri Mohana Singamsetty
2ebae25d08
Merge pull request #6143 from ton31337/fix/remove_prefixReceivedCount
bgpd: Remove `prefixReceivedCount` from JSON
2020-04-05 11:41:04 -07:00
Quentin Young
a5ba758e61
Merge pull request #6144 from ton31337/fix/python_formatter
tests: Run python formatter (black) for topotests
2020-04-05 13:20:30 -04:00
Renato Westphal
b90204a8e9 lib, tools: silence harmless warnings in the northbound tools
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>
2020-04-03 22:34:55 -03:00
reformat
787e762445 tests: Run python formatter (black) for topotests
Mostly ' => ", whitespace changes.

Using https://github.com/psf/black

Signed-off-by: reformat <reformat@nobody.nobody>
2020-04-03 19:41:28 +03:00
David Lamparter
cd05906c41
Merge pull request #6071 from ton31337/feature/rfc6286
bgpd: Add support for Autonomous-System-Wide Unique BGP Identifier
2020-04-03 15:16:59 +02:00
Donatas Abraitis
18a7d0eaaa tests: Replace prefixReceivedCount to pfxRcd in JSONs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-03 16:15:55 +03:00
Sri Mohana Singamsetty
dba3453515
Merge pull request #6130 from ton31337/fix/remove_some_redundant_attributes_from_json
bgpd: Remove deprecated JSON fields for `show bgp ... json`
2020-04-02 16:17:24 -07:00
Renato Westphal
16a064ef24
Merge pull request #6109 from volta-networks/feat_ldp_host_only
ldpd:  host only filter
2020-04-01 19:51:22 -03:00
Donatas Abraitis
0a9fe278f6 tests: Remove/change JSON attributes for show bgp ... json
This is related to some attributes changes: aspath, med, localPref.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-04-01 23:59:45 +03:00
David Lamparter
0bdeb5e58d lib: rewrite zlog lock-free & TLS-buffered
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>
2020-04-01 06:53:26 +02:00
Donald Sharp
d2f589ce7a tests: More cbit extensions
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>
2020-03-31 18:38:01 -04:00
lynne
6b4830dc1e tests: adding LDP tests for advertising host-routes.
Adding test to verify that proper LDP labels are advertised if
host-route configuration is changed.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-03-31 16:28:35 -04:00
David Lamparter
83b27fdaab
Merge pull request #6093 from LabNConsulting/working/lb/no-birds
*: use the current project name (FRRouting)
2020-03-31 15:10:17 +02:00
Donald Sharp
ca8e13e2f3 tests: topotests fixup for weight display
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-30 20:17:48 -07:00
vivek
000022d205 tests: Add tests for BGP link-bandwidth and weighted ECMP
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>
2020-03-30 20:12:32 -07:00
Sri Mohana Singamsetty
05dd25c23a
Merge pull request #6104 from donaldsharp/bgp_rr_fixup
Bgp rr fixup
2020-03-29 11:47:12 -07:00
David Lamparter
a64f931eba tests: fix clippy dependencies
Fixes straight "make check" without "make" first.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
David Lamparter
fb84c629b8 tests: use printfrr-based printf()
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>
2020-03-29 10:45:46 +02:00
Donald Sharp
a19aca1671 tests: Modify bgp_rr_ibgp to test RR server correctness
Fixup this basically unused test to ensure that a RR server
passes the nexthop through correctly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-28 14:06:18 -04:00
Donald Sharp
b54892e0ea bgpd: Convert users of rn->p to use accessor function
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>
2020-03-26 16:25:16 -04:00
Lou Berger
8678d6387c *: use the current project name (FRRouting)
Signed-off-by: Lou Berger <lberger@labn.net>
2020-03-25 17:38:56 -04:00
David Lamparter
46171e257c lib: rewrite zlog_hexdump()
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>
2020-03-24 19:43:18 +01:00
Renato Westphal
1a3ff5236c
Merge pull request #5851 from volta-networks/feat_ldp_oc_review
ldpd: adding support for LDP ordered label distribution control
2020-03-23 10:55:20 -03:00
Donatas Abraitis
03eb10e62f tests: Add a test case for rfc6286
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-22 22:44:00 +02:00
Martin Winter
6214e11a6a tests: fix check for nhid in ipv6 table output
Check based on actual output instead of assuming output based
on kernel version

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-03-20 23:53:39 +01:00
Martin Winter
14c40525be tests: Make topotest working on different locale
"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>
2020-03-20 23:50:29 +01:00
lynne
a73e9e05b6 tests: Fixing test for LDP
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>
2020-03-20 17:11:33 -04:00
Karen Schoener
418b28852a tests: Adding test for LDP ordered label distribution control
Adding test for LDP ordered label distribution control.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-03-20 17:11:33 -04:00
Quentin Young
cbbd3b30ba
Merge pull request #5755 from slankdev/bgpd-fix-prefix-sid-parse-error
bgpd: fix Prefix-SID parse error
2020-03-19 12:28:36 -04:00
Donald Sharp
33308371d8 tests: Increase some wait time in tests
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>
2020-03-19 08:24:37 -04:00
Russ White
09c04bc490
Merge pull request #5849 from donaldsharp/pim_register_prefix_list
Pim register prefix list
2020-03-17 14:57:10 -04:00
Russ White
047315df42
Merge pull request #5954 from ton31337/feature/rfc7607
bgpd: Proscribe the use of AS 0 (zero)
2020-03-17 10:27:35 -04:00
Donald Sharp
328ecc394b
Merge pull request #6009 from kuldeepkash/bgp_basic_functionality
tests: Optimize bgp-basic-functionality-topo1 test suite
2020-03-16 21:37:07 -04:00
Kuldeep Kashyap
af9c65d44a tests: Optimize bgp-basic-functionality-topo1 test suite
1. Used aggresive values to verify keepalive and holddown timers functionality
2. Modified variable name in lib/bgp.py

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-03-16 19:55:14 +00:00
Christian Franke
bcfa87906a tests/isisd: Update expected output to match corrected spelling
The update was performed using wuschl [1] like this:

$ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
$ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

[1] https://pypi.org/project/wuschl/

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2020-03-16 15:36:34 +01:00
Donatas Abraitis
dfc5fb79d5 tests: Add a test case for BGP_AS_ZERO
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-10 07:32:18 +02:00
Ruben Kerkhof
9635de6e9b tests: fix build with GCC 10
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-08 17:17:49 +01:00
Donald Sharp
c64d8d8577 tests: Add a test for the ip pim register-accept-list PLIST command
Add a test to the pim-basic to ensure that the prefix-list works as
expected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-06 16:27:24 -05:00
Donatas Abraitis
15569c58f8 *: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__
Just keep the code cool.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-05 20:23:23 +02:00
Sri Mohana Singamsetty
200334ecbb
Merge pull request #5855 from ton31337/fix/allow_using_add_sub_for_local-preference
bgpd: Allow using add/subtract for local-preference in route-maps
2020-03-02 09:40:34 -08:00
Donatas Abraitis
03252d6037 tests: Add a test case for set local-preference +/-LOCAL_PREF
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-28 14:03:47 +02:00
Kuldeep Kashyap
b9f80297c8 tests: Modified scripts to optimize execution time for route-map test suite
1. Modified scripts to optimize execution time for route-map test suite
2. Removed unnecessary print statements from /lib/bgp.py

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-02-26 21:02:09 +00:00
Donald Sharp
b01c46b964 tests: Reduce rip[ng]-topo1 run time
Reduce rip topo1 run time from ~100 seconds down to ~45 seconds.

1) Reduce very very long sleeps
2) Modify rip timers to be more aggressive in sending data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-19 15:16:21 -05:00
Donald Sharp
12a939b7e7 tests: bgp_multiview_topo1 was taking too long
The bgp_multiview_topo1 test had two issues

a) An abbundance of sleeps that are not necessary
b) The convergence time was too short.

The upshoot of this is that the test goes from 72 -> 33 seconds
run time on my machine.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-19 15:07:02 -05:00
Donald Sharp
1a21da6b01
Merge pull request #5802 from ton31337/feature/aggregate-address_origin_override
bgpd: Allow overriding ORIGIN for aggregate-address
2020-02-19 08:38:31 -05:00
Philippe Guibert
3c5f39e76d
Merge pull request #5651 from AnuradhaKaruppiah/evpn-pim-fixes
EVPN-PIM: complete anycast (MLAG) VTEP support
2020-02-18 18:21:16 +01:00
Donald Sharp
bed8d78bae bgpd: Add a couple more spaces for output on MsgRcvd and MsgSent
annie# show bgp ipv4 uni summ
BGP router identifier 192.168.201.136, local AS number 64539 vrf-id 0
BGP table version 22458946
RIB entries 1458006, using 178 MiB of memory
Peers 4, using 68 KiB of memory

Neighbor               V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
45.33.5.119            4          0       0       0        0    0    0    never       Active
65.19.134.122          4      15096 4611832  108292        0    0    0 6d22h55m       800670
107.13.46.23           4          0       0       0        0    0    0    never      Connect
robot(192.168.201.139) 4      64540 11159975 11365599        0    0    0 05w2d05h      Connect

Total number of neighbors 4

On very busy systems The column output for MsgRcvd and MsgSent can quickly move past 7 columns.
Add a couple more to allow for even display.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 20:38:13 -05:00
Anuradha Karuppiah
94bd5b9347 tests: Add a evpn-pim test case
This is a basic setup and test of evpn-pim.
Create a vxlan device ensure that pim notices this
and setups the appropriate groups and sends them
to the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Hiroki Shirokura
39416574fe tests: refactor Prefix-SID binary syntax
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2020-02-14 00:13:43 +00:00
Hiroki Shirokura
45a06b11a6 bgpd: refactor func prototype arround Prefix-SID
mp_update value isn't used by the function arround Prefix-SID.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2020-02-14 00:13:43 +00:00
Hiroki Shirokura
893799b011 topotests: add bgp_prefix_sid
This commit add behavior test for BGP Prefix-SID path
attribute generically.  In this time, there are only
1-test for Prefix-SID type-1 Label-Index TLV.

There are 3 nodes r1(FRR), peer1(exabgp) and peer2(exabgp)
on this topotest. And it perform following:

* peer1 advertise Prefix-SID to r1
* r1 is received Prefix-SID from peer1
* bgpd on r1 check the path attribute and parse correctly.
* user can check information from type-1 information via show cli
* bgpd on r1 advertise Prefix-SID to peer2
* peer2 is received Prefix-SID from r1
* peer2 check the path attribute and parse correctly.

This test uses exabgp's generic path attribute feature
of exabgp is used to advertise Prefix-SID path attribute
to bgpd. generic path attribute feature enable exabgp
users to specify binary format path attribute.
we can send valious binary pattern
(but overflow test doesn't can be performed).

The reason why this commit uses generic attribute feature
is that exabgp v3 doesn't support Prefix-SID path attribute
and topotest support exabgp only v3. (fyr. exabgp v4 supports it).
Thus this test includes little complicated binary format,
so I wrote full binary desection and explanation.
If topotest support exabgp v4, this test should
be rewrite with non generic attribute feature.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2020-02-14 00:13:43 +00:00
Donatas Abraitis
561137b0e1 tests: Add test case for aggregate-address <prefix> origin <origin>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-13 16:18:34 +02:00
Russ White
35f50b9305
Merge pull request #5744 from ton31337/fix/thread-as-withdraw_attributes
bgpd: Update some attributes how they are handled if malformed
2020-02-11 10:04:19 -05:00
Renato Westphal
c2c4b412fa
Merge pull request #5776 from volta-networks/fix_ldp_topol_test
ldpd: Fix LDP topotest to validate MPLS LDP CLI output
2020-02-10 18:48:25 -03:00
Karen Schoener
b290da1d44 tests: Fix LDP topotest to validate MPLS LDP CLI output
Fixing existing ldp-topol test to validate MPLS LDP CLI output.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-02-10 08:39:06 -05:00
Lou Berger
f2ebe24292 topotest: bgp_l3vpn_to_bgp_vrf - report unexpected BGP notifications
Signed-off-by: Lou Berger <lberger@labn.net>
2020-02-08 10:36:49 -05:00
Russ White
5bf7fe566d
Merge pull request #5722 from donaldsharp/kernel_routes
Kernel routes
2020-02-06 08:04:42 -05:00
Donatas Abraitis
85c58de773
Merge pull request #5761 from qlyoung/fix-bgp-gr-cruft
Fix bgp gr style
2020-02-06 08:16:25 +02:00
Donatas Abraitis
4ba5a9c55f bgpd: Update some attributes how they are handled if malformed
According to https://tools.ietf.org/html/rfc7606 some of the attributes
MUST be handled as "treat-as-withdraw" approach.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-05 11:01:39 +02:00
Quentin Young
362353195a bgpd, lib: fix style from BGP GR code
This patch fixes the noncompliant style for the following commit range:

4a6e80fbf
2ba1fe695
efcb2ebbb
8c48b3b69
dc95985fe
0f0444fbd
85ef4179a
eb451ee58
2d3dd828d
9e3b51a7f
d6e3c15b6
34aa74486
6102cb7fe
d7b3cda6f
2bb5d39b1
5f9c1aa29
5cce3f054
3a75afa4b
f009ff269
cfd47646b
2986cac29
055679e91
034e185dc
794b37d52
b0965c44e
949b0f24f
63696f1d8

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-04 15:19:04 -05:00
Quentin Young
b3ba5dc7fe *: don't null after XFREE; XFREE does this itself
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-02-03 11:22:13 -05:00
Russ White
64d50ba4c4
Merge pull request #5210 from bisdhdh/master
bgpd:BGP Graceful Restart Per Neighbor(BGPN) Feature.
2020-01-28 11:47:09 -05:00
Donald Sharp
abd2a1ff3f tests: Test some basic kernel <-> zebra interactions
Install some kernel routes with different admin distances
ensuring that they are installed correctly and characterized
properly in the rib.

Then add a static route to override the kernel and then remove
it again to ensure that we account for it properly still.

Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.com>
2020-01-23 19:44:15 -05:00
bisdhdh
f009ff2697 bgpd: Adding Selection Deferral Timer handler changes.
* Selection Deferral Timer for Graceful Restart.
* Added selection deferral timer handling function.
* Route marking as selection defer when update message is received.
* Staggered processing of routes which are pending best selection.
* Fix for multi-path test case.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
2020-01-23 09:34:25 +05:30
Donald Sharp
3d7660fa85 tests: Test ospf unnumbered behavior and ensure that it works
Recent commit: 0eb97b860d

Broke onlink behavior and as a result ospf unnumbered failed
to work.  This commit adds a small test to create 2 ospf routers,
connect them through ospf unlinked behavior and then ensure
that the routes are installed into the kernel as expected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-22 17:27:58 -05:00
Lou Berger
dccb75bbcf topotest: log results summary at end of lutil run
Signed-off-by: Lou Berger <lberger@labn.net>
2020-01-21 06:27:43 -05:00
Lou Berger
fe5bf01531 topotest: bgp_l3vpn_to_bgp_vrf - catch case of sharpd not being compiled
Signed-off-by: Lou Berger <lberger@labn.net>
2020-01-21 06:27:43 -05:00
Donatas Abraitis
9e1ecdbaa4
Merge pull request #5707 from donaldsharp/nexthop_encoding
Nexthop encoding
2020-01-18 23:25:56 +02:00
Donald Sharp
12b76399a8 tests: Add another router to the basic pim tests
Add an additional router to the basic pim tests.
1) This test will add a link between r1 and a new rp
2) This test will ensure that r1 and rp have the expected
who is the rp.
3) This test will ensure that the rp has received the upstream
data for the multicast stream that is started.

Ostensibly commit
68a02e06e5 is the first bad commit
commit 68a02e06e5
Author: Mark Stapp <mjs@voltanet.io>
Date:   Wed Nov 13 16:06:06 2019 -0500
    *: revise zapi nexthop encoding
    Use a per-nexthop flag to indicate the presence of labels; add
    some utility zapi encode/decode apis for nexthops; use the zapi
    apis more consistently.
    Signed-off-by: Mark Stapp <mjs@voltanet.io>

Sparked this commit in that it broke nexthop reporting to upper
level protocols.  Ensure that this expectation stays working
in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-18 13:47:29 -05:00
Donatas Abraitis
8117418824 tests: Add test for neighbor <X.X.X.X> maximum-prefix-out <Y>
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-17 16:20:30 +02:00
Stephen Worley
8058df22d4 tests: add basic nexthop group functionality test
Add a very basic nexthop group functionality test.

This test creates a 2-way ecmp group and installs a route
with it using sharpd. Then we check to see that the nexthop
groups are marked valid/installed in zebra.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-15 16:39:19 -05:00
Donald Sharp
abb5d7a933 tests: ospf6-topo1 did not work properly with nhg's and 5.3 kernels
Fix the ospf6-topo1 test to understand nhg's and what happens
when they are installed into a kernel that can support them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-10 08:57:18 -05:00
Donald Sharp
571ea93a70
Merge pull request #5410 from ton31337/feature/bgp_default-route_with_route-map_set
bgpd: An ability to set attributes for default-originate via route-map
2020-01-09 08:39:32 -05:00
Donatas Abraitis
462b30672f tests: Add a test for 'neighbor <neighbor> default-originate route-map <rm>'
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-01-07 10:02:47 +02:00
Quentin Young
f69aeb7696 bgpd: fix missing bounds checks for psid attr
Guess what - for a bounds check to work, it has to happen *before* you
read the data. We were trusting the attribute field received in a prefix
SID attribute and then checking if it was correct afterwards, but if was
wrong we'd crash before that.

This fixes the problem, and adds additional paranoid bounds checks.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-03 14:06:31 -05:00
Donatas Abraitis
886b8172e0 tests: Test if eBGP policy is not applied to iBGP peers
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-19 11:07:14 +02:00
Mark Stapp
1dc46d1ece tests: fix endian bug in test_typelist
Fix a byte-swapping bug that appeared on big-endian arch but
wasn't visible on little-endian runs.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-18 10:52:08 -05:00
Sri Mohana Singamsetty
8887295390
Merge pull request #5502 from ton31337/fix/rr_do_not_show_fqdn
bgpd: Show `ip` and `fqdn` in json output for `show [ip] bgp json`
2019-12-16 09:43:01 -08:00
Donatas Abraitis
6d9a2ec9b4 tests: Test if ip and fqdn are included in show [ip] bgp json
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-12-12 10:35:54 +02:00
Donald Sharp
4f63093247
Merge pull request #4765 from opensourcerouting/defaults-v2
lib/*: new config defaults system, v2
2019-12-06 14:07:42 -05:00
David Lamparter
2159152d9f topojson: use empty vtysh.conf for frr-reload.py
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
David Lamparter
5d5393b943 bgpd: use new defaults system (v2)
This moves all the DFLT_BGP_* stuff over to the new defaults mechanism.
bgp_timers_nondefault() added to get better file-scoping.

v2: moved everything into bgp_vty.c so that the core BGP code is
independent of the CLI-specific defaults.  This should make the future
northbound conversion easier.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
David Lamparter
96673e067d lib: add frr_version_cmp()
This just compares 2 version strings.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
David Lamparter
1c0d880814 lib: rename memory_vty.c to lib_vty.c
And memory_init() to lib_cmd_init().

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:29 +01:00
Mark Stapp
a594aff472 topotests: Adapt to linux kernel 5+
Make a few changes to try to support topotests with vrfs
on kernel 5 and later.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06 07:44:50 -05:00
Donald Sharp
2d3c8c2957
Merge pull request #5305 from ton31337/feature/draft-ietf-idr-deprecate-as-set-confed-set
bgpd: Reject incoming and outgoing UPDATES for AS_SET and AS_CONFED_SET
2019-12-03 21:29:09 -05:00
David Lamparter
0d8c7a26a1 *: make frr_yang_module_info const
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30 00:38:32 +01:00
Sri Mohana Singamsetty
6580da9f54
Merge pull request #5257 from ton31337/fix/update_rib_on_bgp_distance_changes
bgpd: Reflect the distance in RIB when it is changed for an arbitrary afi/safi
2019-11-19 08:35:57 -08:00
Donatas Abraitis
7ea16cb00d tests: Add a test case for bgp reject-as-sets
Test if AS_SET was stripped and announced without AS_SET to the peers.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-14 19:19:05 +02:00
Donatas Abraitis
8b54bc30f0 tests: Test if distance bgp (1-255) (1-255) (1-255) works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-14 10:13:02 +02:00
Donatas Abraitis
df12a3a2ab tests: Add a test case for sender-as-path-loop-detection
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-11-13 08:50:46 +02:00
Martin Winter
566c5d2127
Merge pull request #5196 from kuldeepkash/testcases
tests: Enhance bgp-path-attributes-topo1 test suite
2019-11-06 07:18:04 -05:00
Renato Westphal
c6d345e4a4 topotest: update the LDP VPLS test
The final test case of this topotest wasn't really testing
anything. Do the following changes to fix this:
* Remove "no link-detect" from the zebra configs so that link down
  failures are detected immediately;
* After shutting down the interface between r1 and r2, wait five
  seconds before testing if the pseudowires reconverged through
  the r3 router.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-11-04 13:05:47 -03:00
Renato Westphal
a89241b42d topotest: enable MPLS processing on all interfaces by default
This is necessary to make some tests work correctly. Only topologies
created using the topogen framework benefit from this change.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-11-04 13:05:47 -03:00
Christian Franke
5e168174f8 topotests/Dockerfile: Install libyang from repository
Instead of installing libyang from some old build, let's install
the current libyang from our Debian/Ubuntu repository.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2019-10-29 11:02:41 +01:00
Stephen Worley
737170f5bf topotests: Expect shared nexthop memory
A few topotests were failing since they were not aware
of shared nexthops and, therefore, matching on flags that
could be changed when another route sharing that nexthop is
installed.

Update routes that are not installed to not match their json output
on the nexthop flag information. The ones that are installed will
still retain their matches though since they can be sure the nexthop
should have those flags (they would be the route that set them).

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:43 -04:00
Kuldeep Kashyap
4a252f7205 tests: Enhance BGP Path attribute test cases
1. Added steps to modify BGP path attributes and verify
best path is changed

Signed-off-by: Kuldeep Kashyap <kashyapkas@gmail.com>
2019-10-21 09:48:20 +05:30
Kuldeep Kashyap
c7bb8a05ff tests: Enhance BGP Path attribute APIs
Modified affacted APIs to supported BGP Path attributes modification
and verification

Signed-off-by: Kuldeep Kashyap <kuldeepkas@gmail.com>
2019-10-21 09:47:00 +05:30
Donatas Abraitis
acf061a9ab
Merge pull request #5108 from donaldsharp/sendbuffer_size_bgp
Sendbuffer size bgp
2019-10-20 12:09:42 +03:00
Ashish Pant
85d4777301 tests: Add test cases for bgp community and large community
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Test cases to check functionality of bgp large community and
bgp community path attribute
2019-10-17 09:19:26 +05:30
Ashish Pant
6d32a6a18a tests: Update cli error list and retry function
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Add cli error returned for invalid bgp-community-list command

Fix retry function to avoid retries when expected is False
2019-10-17 09:17:03 +05:30
Ashish Pant
06e693f11b tests: Update bgp api for community and aggregate address
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Add support for not sending community data in bgp and update
aggregate address configuration code
2019-10-17 09:17:03 +05:30
Ashish Pant
ca2ef9e6ff tests: Add verify community list api
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Api checks if community list is present in the system or not
2019-10-17 09:17:03 +05:30
Ashish Pant
287d692409 tests: Add step api in topojson
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Print messages with a step number to log from test case
2019-10-17 09:17:03 +05:30
Donald Sharp
c2d020ad71 bgpd: Add ability to set tcp socket buffer size
Add -s X or --socket_size X to the bgp cli to allow
the end user to specify the outgoing bgp tcp kernel
socket buffer size.

It is recommended that this option is only used on
large scale operations.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-16 07:42:05 -04:00
Donald Sharp
b60afd5c38
Merge pull request #5097 from ton31337/fix/do_not_reconnect_if_prefix_overflow
bgpd: Keep the session down if maximum-prefix is reached
2019-10-15 16:18:19 -04:00
Martin Winter
0c7f64c5cf
Merge branch 'master' into ecmp_tests 2019-10-04 15:19:17 +02:00
Donatas Abraitis
1867569d78
Merge pull request #5082 from donaldsharp/add_bgp_rr_ibgp_topotest
tests: Add a topology that shows broken ibgp Route Reflector behavior
2019-10-04 11:32:20 +01:00
Donatas Abraitis
7630ff014e tests: Remove sleep from test_bgp_maximum_prefix_invalid_update
Sleep is not needed here while we fail instantly if maximum is reached.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-03 14:08:51 +03:00
Ashish Pant
819f982590 tests: Enabling bgp-ecmp-topo2 test cases
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
2019-10-03 07:15:20 +05:30
Ashish Pant
6ade2c18fb tests: Modify json for bgp-ecmp-topo2
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Modified json files to configure route-map which prefer global
address
2019-10-03 07:15:20 +05:30
Ashish Pant
915bed88d8 tests: Add topojson route-map for nexthop
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Add route-map option for ipv6 nexthop

Fix typo in bgp configuration
2019-10-03 07:15:20 +05:30
Ashish Pant
161572bdf9 tests: Fix topojson link local ipv6 address
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Removed code that disabled link local ipv6 address on the interface
2019-10-03 07:15:11 +05:30
Donald Sharp
dda524e843
Merge pull request #5087 from opensourcerouting/topotest-skip-on-assert-failure
topotests: skip tests when any assert fails
2019-10-01 19:14:11 -04:00
Donald Sharp
aa2a0498f3 tests: Add a topology that shows broken ibgp behavior
In a leaf/spine topology with only IBGP connections, where
the same network is being redistributed at multiple points
in the network ( say a redistribute connected at both leaf and spines )
we end up in a state where zebra gets very confused.

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

C>* 192.168.1.0/24 is directly connected, tor1-eth0, 00:00:30
C>* 192.168.2.0/24 is directly connected, tor1-eth1, 00:00:30
B   192.168.3.0/24 [200/0] via 192.168.4.2 inactive, 00:00:25
                           via 192.168.6.2 inactive, 00:00:25
B>* 192.168.4.0/24 [200/0] via 192.168.2.3, tor1-eth1, 00:00:25
  *                        via 192.168.6.2 inactive, 00:00:25
C>* 192.168.5.0/24 is directly connected, tor1-eth2, 00:00:30
B>* 192.168.6.0/24 [200/0] via 192.168.4.2 inactive, 00:00:25
  *                        via 192.168.5.4, tor1-eth2, 00:00:25

Effectively we have ibgp routes recursing through ibgp routes
and there is no metric to discern whom to listen to.

This draft:
https://tools.ietf.org/html/draft-ietf-idr-bgp-optimal-route-reflection-19

appears to address this issue.  From looking at both cisco and arista
deployments they are handling this issue by having the route reflector
prefer the localy learned routes over from their clients.

Add this topology, in a broken state, so that when we do fix this issue
it is a simple matter of touching this topology up and re-adding it
to the normal daily builds.  I also wanted to add this topology
since it is in a state of `doneness` and I wanted to move onto
my normal day job without having to remember about this test.

This topology is not configured to be run as part of the normal
topotests.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-01 07:45:38 -04:00
Rafael Zalamena
c8c265f571 topotests: skip tests when any assert fails
When an `assert` fails we should skip all other tests on the file. Once
a failure is detected we can't rely on the setup anymore, since most of
the tests assume the previous worked.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-09-30 21:15:15 -03:00
Quentin Young
c258527bd2 *: strip trailing whitespace
Some of it has snuck by CI

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-30 16:44:43 +00:00
Kuldeep Kashyap
468b867f4f tests: Add bgp route-map test cases
Adding 27 bgp route-map test cases to test multiple route-map scenarios

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
8aa6292547 tests: Add API to shut/noshut router interface
This API would help to shut/nohut specified router interfaces

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
21a51c4d0f tests: Adding verification APIs for bgp route-maps and community-lists
APIs to verify bgp route-maps, bgp community and large community configurations

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
380bb6d16b tests: Enhance support to create bgp community-list or large-community-list
Adding new API to create bgp community-list or large-community-list

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
89f86e8c7b tests: Enhance framework to create and delete route-map
Added APIs to create and delete route-maps configuration

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
9920237e4f tests: Add route-map to initial config creation from JSON
To enable route-map config build from JSON

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Kuldeep Kashyap
7f55cb6a88 tests: Adding API verify_bgp_attributes() to bgp.py
This API is to verify BGP attribute values set by route maps

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2019-09-26 10:06:16 +00:00
Donald Sharp
0cddbb1b6c
Merge pull request #5050 from LabNConsulting/working/lb/tt-update
topotest: bgp_l3vpn_to_bgp_vrf allow for different interface output
2019-09-24 16:07:35 -04:00
Renato Westphal
8f4f95e08a tests: remove more topotest backward-compatibility cruft
This isn't necessary anymore since topotest was integrated into
the FRR repo.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-23 09:38:05 -03:00
Lou Berger
05916dd519 topotest: bgp_l3vpn_to_bgp_vrf allow for different interface output
Signed-off-by: Lou Berger <lberger@labn.net>
2019-09-22 13:06:48 -04:00
Olivier Dugeon
1b3f47d04c isisd: Update TLVs processing for TE, RI & SR
In preparation to Segment Routing:
 - Update the management of Traffic Engineering subTLVs to the new tlvs parser
 - Add Router Capability TLV 242 as per RFC 4971 & 7981
 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25

Modified files:
 - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs
 - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process
   TE subTLVs, Router Capability TLV and SR subTLVs
 - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing
 - isis_te.[c,h]: remove all old TE structures and managment functions,
   and add hook call to set local and remote IP addresses as wellas update TE
   parameters
 - isis_zebra.[c,h]: add hook call when new interface is up
 - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs
 - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-09-17 17:35:50 +02:00
Quentin Young
df54f0536e tests: update tests for pthread init changes
Need to init frr_pthreads manually in tests now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-09-16 16:12:04 +00:00
Donald Sharp
840806a627
Merge pull request #4975 from opensourcerouting/disable-ecmp2-test
Disable bgp-ecmp-topo2 topotest until proper fix is developed
2019-09-14 07:43:31 -04:00
Sri Mohana Singamsetty
921308a535
Merge pull request #4969 from ton31337/feature/rewrite_bgp_aggregate-address_route-map_test
tests: Improve bgp_aggregate-address_route-map test
2019-09-13 11:03:36 -07:00
Olivier Dugeon
3c5ae0248e
Merge pull request #4949 from opensourcerouting/mpls-zapi-improvements
MPLS zapi improvements
2019-09-13 17:36:16 +02:00
Olivier Dugeon
d22a64e06f
Merge pull request #4948 from opensourcerouting/show-mpls-table
zebra: improve the output of "show mpls table"
2019-09-13 17:24:52 +02:00