Commit Graph

2224 Commits

Author SHA1 Message Date
Donald Sharp
9fd80543fe tests: unicode to frr_unicode
Let's standardize on the internal to frr unicode function.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-17 13:19:52 -05:00
Donatas Abraitis
2beb3d3967 tests: Check if we are not sending duplicate BGP UPDATEs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-11 14:51:07 +02:00
nguggarigoud
938d5980d1 tests: Optimised static routing testsuits
1. Removed bgp specific triggers.
2. Removed repeatativ steps.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
d33a0fcf6f tests : Enhanced scripts to handle support bundle behaviour
1. Added Expected False to not true cases.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
88fedaaa7b tests: Adding static routing topojson automation suites.
Adding API's required for EVPN suite.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
72babe7cf3 tests: Incorporated new static route del behaviour
Updated 2 testcases with static  route deletion with
admin distance as a key.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
93792f5dd0 tests: Updated verify_bgp_rib api for multipaths.
verify_bgp_rib is updated in bgp.py file to
handle multi paths.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Naveen
03cb898f46 tests: Updated doctstring for start & stop router
Actual path for configs is /tmp/topotest/<suite>/<router>
common_config.py is updated.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Naveen Guggarigoudar
f8f6dbe9f7 tests: Enhanced the lib bgp.py for nexthop check
1. Enhanced the lib bgp.py for nexthop check

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
eee0457da7 tests: Enhanced lib by removing unnecessary sleep
1. libs modified are bgp.py and common_config.py

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
ee51a3d9ec tests: Enchanced static routing testsuits
1. BGP timers are modified to reduce the run time.
2. Static sleeps are removed from the scripts.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
naveen
0705f3120d tests: Adding static routing topojson automation suites.
1. Enhanced framework to
a. Verify fib active routes(lib/common_config.py).
b. Verify bgp multi path routes(lib/bgp.py).
c. Create mininet nodes with different names(lib/topojson.py).

4. 12 Test cases of static routing with ibgp.
Test suite execution time is ~30 minutes.

5. 12 Test cases of static routing with ebgp.
Test suite execution time is ~30 minutes.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-12-10 16:44:48 -08:00
Mark Stapp
e386d2b154
Merge pull request #7690 from donaldsharp/nht_show_is_not_not_not
zebra, tests: Fix `show ip nht`
2020-12-09 07:58:37 -05:00
Donald Sharp
dda33b6e0c zebra, tests: Fix show ip nht
The `show ip nht` and `show ipv6 nht` commands were broken.
This is because recent code commit: 0154d8ce45

assumed that p must not be NULL and this is not the case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-08 15:50:46 -05:00
kuldeepkash
3732ea226a tests: Enhanced auto-rd verification as per changes done in #7652
1. As per recent changes done in PR #7652, we have modified the auto-rd verification logic
2. Dev PR link: https://github.com/FRRouting/frr/pull/7652

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2020-12-08 15:53:20 +00:00
Donald Sharp
46a0656f7a tests: Close some open handles
I accidently installed something that is telling me about
unlosed handles in the tests.  Let's clean them up.

<and yes I have no idea wtf I did>

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-05 20:05:52 -05:00
Mark Stapp
e0ea4d0349
Merge pull request #7656 from donaldsharp/bgp_convergence
tests: Wait for convergence first
2020-12-03 14:17:09 -05:00
Donatas Abraitis
3cc92134a3
Merge pull request #7349 from opensourcerouting/bgp-delayopen
bgpd: RFC 4271 optional session attribute DelayOpenTimer
2020-12-03 08:26:44 +02:00
Donald Sharp
cb5a294642
Merge pull request #7590 from opensourcerouting/isisd-lfa
isisd: add support for classic LFA
2020-12-02 20:43:51 -05:00
Donald Sharp
dd2a6ddb3e
Merge pull request #7657 from mjstapp/fix_topo_asan_noise
tests: Cleanup topo asan noise
2020-12-02 20:07:53 -05:00
Donald Sharp
187a74a2c6
Merge pull request #7596 from gpnaveen/ospf_basic
tests : Adding 3 base ospf testcases.
2020-12-02 12:35:43 -05:00
Donald Sharp
d0bd9877b8
Merge pull request #7589 from pguibert6WIND/show_bgp_summary_desc
Show bgp summary desc
2020-12-02 12:18:07 -05:00
Mark Stapp
c46de798de tests: quiet noisy error log about asan files
Turn a noisy error log into a debug - it's just reporting
that we're _looking_ for asan output.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:38 -05:00
Mark Stapp
6ee4440e66 tests: fix typo in asan variable names
Use AddressSanitizer consistently

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-02 11:08:03 -05:00
Donald Sharp
bd842270fe
Merge pull request #7615 from gromit1811/feature_topotest_module_noload
tests: Add TOPOTEST_NOLOAD to skip module loading question
2020-12-02 09:23:30 -05:00
Donald Sharp
16845ff4b0 tests: Wait for convergence first
The test_bgp_multi_vrf_topo2.py script had a bunch
of places where it would change an interface status
or add delete routes that would affect bgp convergence
but it was never ensuring that convergence had happened
before the test verified the bgp rib.  I believe this
was leading to many intermittant ci failures in
testing for other PR's to be accepted.  Modify
the code to wait for bgp convergence if we just
made a change to the topology

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-02 07:26:33 -05:00
Philippe Guibert
aa72bd7e7f bgpd: add peer description for each afi/safi line in show summary
For each afi/safi of 'show bgp summary', display the peer description
each time needed. This information is useful, for instance in the case
of a device connected with multiple peers.
The topotest all_protocol_startup is changed accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-12-01 08:06:37 +00:00
Martin Winter
960c3f25f5
tests: Ignore YANG stderr messages in test_all_protocol_startup test
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:15 +01:00
Martin Winter
8972e2710c
tests: Fix logging output directory for older tests
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:15 +01:00
Martin Winter
1a31ada871
tests: Fix FRR process shutdown in failed topotest teardown phase
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:14 +01:00
Martin Winter
be2656eda2
tests: Fix Topotest runs with newerversion of Address Sanitizer
Fix Address Sanitizer Issue detection with newer ASAN versions

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-27 19:45:07 +01:00
Donald Sharp
8fd47beb8b
Merge pull request #7593 from opensourcerouting/bgp_features_ospf_fix
tests: Make ospf in bgp_features testsuite predictable
2020-11-26 18:36:54 -05:00
Donald Sharp
903bd636ca
Merge pull request #7611 from opensourcerouting/docker_key_update
tests: Update topotest Dockerfile to pick up keys from deb repo
2020-11-26 18:33:12 -05:00
Martin Winter
57d89808bc
tests: Update topotest Dockerfile to pick up keys from deb repo
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-26 18:08:53 +01:00
Martin Buck
d9ee35587c tests: Add TOPOTEST_NOLOAD to skip module loading question
This is the opposite of TOPOTEST_AUTOLOAD: Instead of automatically loading
missing modules, TOPOTEST_NOLOAD prevents module loading and supresses
questions about it.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2020-11-26 16:12:21 +01:00
Donatas Abraitis
3200009046
Merge pull request #7586 from kuldeepkash/bgp_multi_vrf
tests: Add tests to bgp_multi_vrf_topo2
2020-11-26 09:48:54 +02:00
Martin Winter
3636b6c158
tests: Make ospf convergence predictable by setting if priority
Added OSPF priorities to force a predictable DR/Backup router selection

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-26 04:10:05 +01:00
Mark Stapp
3abf06b722
Merge pull request #7607 from pguibert6WIND/topo_python3_preparation
Topo python3 preparation
2020-11-25 14:22:10 -05:00
Philippe Guibert
10870bbc20 topotests: precise importation folder
the topolog importation folder must be precised. otherwise following
error message appears:

root@dut-vm:~/topotests/bgp_flowspec# python3 test_bgp_flowspec_topo.py
Traceback (most recent call last):
  File "test_bgp_flowspec_topo.py", line 96, in <module>
    from lib.lutil import lUtil
  File "/root/topotests/bgp_flowspec/../lib/lutil.py", line 25, in <module>
    from topolog import logger
ImportError: No module named 'topolog'
root@dut-vm:~/topotests/bgp_flowspec#

The same error occurs with lutil and bgprib which are 2 libraries
located under lib/ folder. Some precisions are added too.

PR=71290
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-11-25 16:31:45 +00:00
Philippe Guibert
ecff3c7a0c topotests: python3, replace iteritems with items
replace iteritems() calls with items()

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-11-25 16:31:45 +00:00
Philippe Guibert
e7294b3200 topotests: python3, rename iterkey() with key() for dictionary usage
dictionary method iterkey() is not used in python3 and is replaced with
key() method.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-11-25 16:31:45 +00:00
Philippe Guibert
0e232bb883 topotests: python3, fix error ValueError: can't have unbuffered text I/O
This error occurs when passing some 0 values to open() extra argument.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-11-25 16:31:42 +00:00
Philippe Guibert
6cb6c403f1 topotests: python3, replace execfile with exec
python3 does not support execfile implementation.
replace it with open and exec api that are available in both python 2
and 3 implementations.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-11-25 16:19:33 +00:00
Kuldeep Kashyap
2f4455fc4c tests: Add tests to bgp_multi_vrf_topo2
1. Added 4 test cases for frr/daemon restart(chaos testing)

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-11-25 08:57:08 +00:00
Donald Sharp
5a6947e530
Merge pull request #7591 from opensourcerouting/isisd-bug-fixes
isisd: assorted bug fixes
2020-11-24 20:59:50 -05:00
nguggarigoud
816fdbbf53 tests : Adding 3 base ospf testcases.
Test suite execution time is 90 Secs.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-11-25 05:34:06 +05:30
Renato Westphal
66e5fbe08f tests: add IS-IS classic LFA topotest
This new topotest comprises of 13 testing steps and tests essentially
all implemented LFA knobs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-24 20:15:52 -03:00
Renato Westphal
c8a4f33195 tests: add IS-IS classic LFA unit tests
These unit tests check the basic LFA loop-free condition on a
variety of different network topologies. None of the implemented
LFA tie-breakers are tested here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-24 20:15:52 -03:00
GalaxyGorilla
da78f4fe92 tests: Introduce BFD OSPFv2/v3 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.

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-11-24 19:14:21 +00:00
Donald Sharp
7b1d13bb1f
Merge pull request #7560 from opensourcerouting/fix_topotest_logs
topotests: Fix logging by redirecting it to correct file
2020-11-24 11:30:14 -05:00
Mark Stapp
d13964a914 tests: restore route scale test to 1M routes
Restore the scale topotest config to use 1M routes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-23 16:53:43 -05:00
Renato Westphal
50ec21859f isisd, tests: fix bug when sending TI-LFA repair paths to zebra
Commit 4c75f7c773 fixed a bug in which the TI-LFA repair paths
weren't preserving the original Prefix-SID of the routes. That
commit, however, didn't update the zebra interface code to account
for backup nexthops that don't have a repair list but do have a
SR label. As a consequence, backup nexthops that didn't have any
repair label were not preserving the original Prefix-SID of the
corresponding routes. Fix this and update the TI-LFA topotest
accordingly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-23 15:22:36 -03:00
Renato Westphal
e33b95b4bb isisd: uninstall local routes that don't have any valid nexthop
Once the remote end of a connected link is shut down (or lose
its address), isisd will remove the corresponding route from its
RIB after SPF runs. A new route for the same destination should
be computed based on the local LSP, and that route by definition
doesn't have any nexthop.  The problem is that, when isisd tries
to replace the old route by the new one, it fails because routes
without nexthops can't be installed.  That causes the old invalid
route to remain in the RIB when it shouldn't. To fix this problem,
change the zebra interface code to uninstall a route whenever it
can't be installed (because it lacks nexthops) instead of doing
nothing in that case.

This change should fix occasional failures of the test_isis_sr_topo1
topotest.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-23 14:50:32 -03:00
Martin Winter
ed827751d3
topotests: Fix logging by redirecting it to correct file
Fix lib to start loggin to correct daemon file on startup
Fix bgp-auth tests for the logging changes
Fixes Issue # 7545

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-11-20 17:48:49 +01:00
Donatas Abraitis
a1477006f9
Merge pull request #7562 from donaldsharp/python_fixes
tests: Fix common_config.py issues
2020-11-20 09:37:58 +02:00
Donatas Abraitis
e9ac289675 tests: Add more descriptive error messages and increase timeouts
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-11-19 16:49:44 +02:00
Donald Sharp
a28055a478 tests: Fix common_config.py issues
1) in generate_ips if start_ipaddr does not have a `/` in it
there exists a code path where both mask and step are
null values.  Write a bit of code to ensure this pre-req
is found early and often

2) in verify_rib there exists a code path where static_route
is null when we get to the non static route section.  Change
the code to operate on the advertise_network_dict that
we are iterating over.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-19 07:40:03 -05:00
Donald Sharp
4abdbea978
Merge pull request #7543 from GalaxyGorilla/fix_refcmp_newline
tests: ignore Windows vs Unix style newlines
2020-11-17 15:30:07 -05:00
Donald Sharp
b83bb9aa62
Merge pull request #6851 from kuldeepkash/bgp_graceful_restart
tests: Fix for bgp_gr_functionality_topo1/topo2 failures
2020-11-17 11:57:29 -05:00
GalaxyGorilla
6fc170c5af tests: ignore Windows vs Unix style newlines
Within unit tests the output of vtysh commands is compared to hand
made reference files. For some reason the output of those vtysh
commands contains Windows Style newlines which results in error
outputs which make it hard to identify this problem.

Since there seems to be no benefit in checking those newlines
anyway this commit just normalizes them.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-11-17 13:19:44 +00:00
Donatas Abraitis
7c98d487b8 *: Replace typo (supress => suppress)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-11-17 12:13:38 +02:00
Donald Sharp
f18ba3cd18 bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI
Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL )

Then convert all the places that have the two level for loop to
iterate over all afi/safis

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-14 18:53:03 -05:00
Santosh P K
9b936c5c36
Merge pull request #4770 from kssoman/fib
Advertise FIB installed routes to bgp peers
2020-11-12 18:59:24 +05:30
Kuldeep Kashyap
abb229fde3 tests: Enhance libraries to optimize test execution
1. Enhance libraries to optimize test execution as per Donald's suggestion

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-11-12 11:45:12 +00:00
Kuldeep Kashyap
eb41fbd556 tests: Fix bgp_gr_functionality_topo2 issue
1. Added convergence step just after BGP-GR capablities are exchanged and clear bgp
is performed , reason for this is, in few machine bgp sessions are taking more time
to come up.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-11-12 05:28:46 +00:00
Kuldeep Kashyap
1702289913 tests: Fix bgp_gr_functionality_topo1 issue
1. Removed UTP test cases keeping only functional test as part of these suites
2. Added convergence step just after BGP-GR capablities are exchanged and clear bgp
is performed, reason for this is, in few machine bgp sessions are taking more time
to come up.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-11-12 05:28:46 +00:00
Donald Sharp
9a3efff6ac
Merge pull request #7500 from mjstapp/fix_topo_scale_mem
tests: reduce scale of the route scale test
2020-11-10 16:40:53 -05:00
Donald Sharp
02a17eaddf
Merge pull request #7498 from mjstapp/fix_topo_count_only
tests: only test count of nexthops in bgp max-paths test
2020-11-10 15:17:59 -05:00
Mark Stapp
d6a75b53e7 tests: reduce scale of the route scale test
Reduce the number of routes used in the route-scale test: we're
having memory troubles, and this may help the CI run with fewer
false failures. Also re-orged the route-scale test code a bit
so it can be driven from the json file, with fewer hard-coded
values.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-10 14:14:23 -05:00
Mark Stapp
c57638d6fd tests: remove duplicate verify_fib_routes from common_config.py
There were two copies of the function - we only need one.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-10 10:06:48 -05:00
Mark Stapp
15df6d3165 tests: only test count of nexthops in bgp max-paths test
Add support to compare the number of RIB nexthops, rather than the
specific nexthop addresses. Use this in the bgp_ecmp topotests that
test maximum-paths - testing the specific nexthops is wrong there,
it's not deterministic and we get spurious failures.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-10 09:58:15 -05:00
Soman K S
1cc5593892 tests: Advertise FIB installed routes to bgp peers
Added test case for bgp suppress-fib-pending
Updated document

Signed-off-by: kssoman <somanks@gmail.com>
2020-11-06 08:59:39 +05:30
David Schweizer
cd32a1a4ee
tests: topotests for route-flap dampening
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2020-11-02 16:30:04 +01:00
Donatas Abraitis
55b15c384f tests: Add more tests for BGP default-originate command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-30 18:09:16 +02:00
Russ White
763a60663c
Merge pull request #7371 from AnuradhaKaruppiah/mh-uplink-tracking-1
evpn-mh: uplink tracking and startup delay
2020-10-28 12:13:57 -04:00
Pat Ruddy
7dbe42ce4c tests: do not rely on fixed indices in show output
Make tests more robust to changing show outputs by searching for
item of interest rather than using a fixed index.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-10-27 20:12:40 +00:00
Anuradha Karuppiah
f93333e990 tests: add a topotest to validate uplink tracking
When all the uplinks are disabled the access ports used for multihoming
are error-disabled/protodowned.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-27 09:34:19 -07:00
Anuradha Karuppiah
a9a77f022d topotests: bgp-evpn-mh: configure uplinks and change the startup-delay
1. The default startup-delay for multihomed devices is three minutes. While
that is necessary/reasonable for a real network it is not needed for a
test env. Lower the startup-delay to 1s to keep the test run time low.
2. Configure uplinks for mh uplink-tracking

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-27 09:34:19 -07:00
Patrick Ruddy
dd51171227
Merge pull request #7158 from AnuradhaKaruppiah/mh-df-election
evpn-mh: support for DF election
2020-10-27 16:09:45 +00:00
Madhuri Kuruganti
1a0416bd6f bgpd: conditional advertisement - copyright
Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
2020-10-27 16:15:36 +05:30
Madhuri Kuruganti
e73c112ef9 bgpd: conditional advertisement - topotests-2
Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
2020-10-27 16:15:36 +05:30
Madhuri Kuruganti
fa36596cbd bgpd: conditional advertisement - topotests
Router2# show ip bgp neighbors 10.10.20.3 json

!--- Output suppressed.

    "addressFamilyInfo":{
      "ipv4Unicast":{
        "updateGroupId":2,
        "subGroupId":2,
        "packetQueueLength":0,
        "inboundSoftConfigPermit":true,
        "commAttriSentToNbr":"extendedAndStandard",
        "advertiseMap":{
          "condition":"NON_EXIST",
          "conditionMap":"EXIST-MAP",
          "advertiseMap":"ADV-MAP",
          "advertiseStatus":"Withdraw"
        },
        "acceptedPrefixCounter":0,
        "sentPrefixCounter":2
      },
      "ipv6Unicast":{
        "inboundSoftConfigPermit":true,
        "commAttriSentToNbr":"extendedAndStandard",
        "advertiseMap":{
          "condition":"EXIST",
          "conditionMap":"ALLOW_ALL",
          "advertiseMap":"ALLOW_ALL",
          "advertiseStatus":"Advertise"
        },
        "acceptedPrefixCounter":0
      }
    },

!--- Output suppressed.

router@router:~/frr/tests/topotests/bgp_conditional_advertisement$ sudo pytest -s test_bgp_conditional_advertisement.py
[sudo] password for router:
mkdir: cannot create directory ‘/tmp/topotests’: File exists
2020-10-14 17:00:46,649 INFO: Running environment diagnostics
=========================================================================================== test session starts ============================================================================================
platform linux2 -- Python 2.7.17, pytest-4.6.11, py-1.9.0, pluggy-0.13.1
rootdir: /home/router/frr/tests/topotests, inifile: pytest.ini
collected 2 items

test_bgp_conditional_advertisement.py 2020-10-14 17:00:47,137 INFO: Testsuite start time: Wed Oct 14 17:00:47 2020
2020-10-14 17:00:47,137 INFO: ========================================
2020-10-14 17:00:47,138 INFO: Running setup_module to create topology
2020-10-14 17:00:48,711 INFO: loading topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:00:48,712 INFO: starting topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:00:49,042 INFO: r1: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:51,284 INFO: r2: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:53,582 INFO: r3: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:55,826 INFO: Running setup_module() done
2020-10-14 17:00:57,747 INFO: '_all_routes_advertised' polling started (interval 1 secs, maximum wait 130 secs)
2020-10-14 17:00:58,262 INFO: '_all_routes_advertised' succeeded after 0.52 seconds
2020-10-14 17:00:58,262 INFO: TC11: "router3" BGP convergence - PASSED!!!
2020-10-14 17:00:58,863 INFO: '_exist_map_routes_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:00:59,419 INFO: '_exist_map_routes_present' succeeded after 0.56 seconds
2020-10-14 17:00:59,419 INFO: TC21: exist-map routes present in "router2" BGP table - PASSED!!!
2020-10-14 17:01:00,017 INFO: '_exist_map_routes_not_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:02:00,192 INFO: '_exist_map_routes_not_present' succeeded after 60.18 seconds
2020-10-14 17:02:00,192 INFO: TC22: exist-map routes not present in "router2" BGP table - PASSED!!!
2020-10-14 17:02:00,736 INFO: '_non_exist_map_routes_not_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:02:59,215 INFO: '_non_exist_map_routes_not_present' succeeded after 58.48 seconds
2020-10-14 17:02:59,215 INFO: TC31: non-exist-map routes not present in "router2" BGP table - PASSED!!!
2020-10-14 17:02:59,968 INFO: '_non_exist_map_routes_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:03:59,300 INFO: '_non_exist_map_routes_present' succeeded after 59.33 seconds
2020-10-14 17:03:59,300 INFO: TC32: non-exist-map routes present in "router2" BGP table - PASSED!!!
2020-10-14 17:03:59,919 INFO: '_non_exist_map_no_condition_route_map' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:05:00,306 INFO: '_non_exist_map_no_condition_route_map' succeeded after 60.39 seconds
2020-10-14 17:05:00,306 INFO: TC41: non-exist-map route-map removed in "router2" - PASSED!!!
2020-10-14 17:05:01,024 INFO: '_exist_map_no_condition_route_map' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:05:59,405 INFO: '_exist_map_no_condition_route_map' succeeded after 58.38 seconds
2020-10-14 17:05:59,406 INFO: TC42: exist-map route-map removed in "router2" - PASSED!!!
2020-10-14 17:05:59,941 INFO: '_exist_map_routes_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:06:59,622 INFO: '_exist_map_routes_present_rmap_filter' succeeded after 59.68 seconds
2020-10-14 17:06:59,622 INFO: TC51: exist-map routes present with route-map filter - PASSED!!!
2020-10-14 17:07:00,150 INFO: '_exist_map_routes_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:07:00,688 INFO: '_exist_map_routes_present_no_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:07:00,688 INFO: TC52: exist-map routes present, no route-map filter - PASSED!!!
2020-10-14 17:07:01,229 INFO: '_non_exist_map_routes_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:07:01,767 INFO: '_non_exist_map_routes_present_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:07:01,767 INFO: TC53: non-exist-map routes present, with route-map filter - PASSED!!!
2020-10-14 17:07:02,321 INFO: '_non_exist_map_routes_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:00,419 INFO: '_non_exist_map_routes_present_no_rmap_filter' succeeded after 58.10 seconds
2020-10-14 17:08:00,419 INFO: TC54: non-exist-map routes present, no route-map filter - PASSED!!!
2020-10-14 17:08:01,485 INFO: '_exist_map_routes_not_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:02,039 INFO: '_exist_map_routes_not_present_rmap_filter' succeeded after 0.55 seconds
2020-10-14 17:08:02,039 INFO: TC61: exist-map routes not present, route-map filter - PASSED!!!
2020-10-14 17:08:02,568 INFO: '_exist_map_routes_not_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:59,147 INFO: '_exist_map_routes_not_present_no_rmap_filter' succeeded after 56.58 seconds
2020-10-14 17:08:59,147 INFO: TC62: exist-map routes not present, no route-map filter - PASSED!!!
2020-10-14 17:08:59,686 INFO: '_non_exist_map_routes_not_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:09:59,354 INFO: '_non_exist_map_routes_not_present_rmap_filter' succeeded after 59.67 seconds
2020-10-14 17:09:59,354 INFO: TC63: non-exist-map routes not present, route-map filter - PASSED!!!
2020-10-14 17:09:59,886 INFO: '_non_exist_map_routes_not_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:10:00,424 INFO: '_non_exist_map_routes_not_present_no_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:10:00,424 INFO: TC64: non-exist-map routes not present, no route-map filter - PASSED!!!
.2020-10-14 17:10:01,989 INFO: assert skipped at "bgp_conditional_advertisement.test_bgp_conditional_advertisement/test_memory_leak": Memory leak test/report is disabled
s2020-10-14 17:10:01,989 INFO: Running teardown_module to delete topology
2020-10-14 17:10:01,990 INFO: stopping topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:10:01,990 INFO: stopping "s2"
2020-10-14 17:10:01,990 INFO: stopping "s1"
2020-10-14 17:10:01,993 INFO: r1: stopping bgpd
2020-10-14 17:10:01,995 INFO: r1: stopping staticd
2020-10-14 17:10:02,010 INFO: r1: stopping zebra
2020-10-14 17:10:02,013 INFO: r1: stopping bgpd
2020-10-14 17:10:02,015 INFO: r1: stopping zebra
2020-10-14 17:10:02,025 INFO: r1: waiting for daemons stopping: bgpd, zebra (0.1 seconds)
2020-10-14 17:10:02,143 INFO: r2: stopping bgpd
2020-10-14 17:10:02,147 INFO: r2: stopping staticd
2020-10-14 17:10:02,152 INFO: r2: stopping zebra
2020-10-14 17:10:02,156 INFO: r2: stopping bgpd
2020-10-14 17:10:02,164 INFO: r2: stopping zebra
2020-10-14 17:10:02,175 INFO: r2: waiting for daemons stopping: zebra (0.1 seconds)
2020-10-14 17:10:02,291 INFO: r3: stopping bgpd
2020-10-14 17:10:02,302 INFO: r3: stopping staticd
2020-10-14 17:10:02,309 INFO: r3: stopping zebra
2020-10-14 17:10:02,313 INFO: r3: stopping bgpd
2020-10-14 17:10:02,316 INFO: r3: stopping zebra
2020-10-14 17:10:02,323 INFO: r3: waiting for daemons stopping: zebra (0.1 seconds)
2020-10-14 17:10:03,615 INFO: Testsuite end time: Wed Oct 14 17:10:03 2020
2020-10-14 17:10:03,615 INFO: ========================================

================================================================================== 1 passed, 1 skipped in 556.55 seconds ===================================================================================

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>

temp

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
2020-10-27 16:15:36 +05:30
Anuradha Karuppiah
732a1ac926 topotest: tests for evpn-mh DF via Type-4 routes
Change DF preference and validate DF role.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-10-26 10:33:21 -07:00
Olivier Dugeon
acd043db00
Merge pull request #7184 from opensourcerouting/anycast-sids-v4
isisd: refactor Prefix-SID code + Anycast-SIDs (v2)
2020-10-23 21:03:55 +02:00
Renato Westphal
6a95513d54 tests: extend the isisd SR topotest to test Anycast-SIDs as well
Add the following Anycast-SIDs on routers rt4 and rt5:
* segment-routing prefix 10.10.10.10/32 index 100 no-php-flag n-flag-clear
* segment-routing prefix 2001:db8:1000::10/128 index 101 no-php-flag n-flag-clear

The updated JSON data will then check whether the Anycast-SIDs are
being processed as expected (e.g. rt1 should use ECMP to rt2 and rt3,
rt2 should use rt4 only as it's directly connected, etc).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23 10:31:39 -03:00
Renato Westphal
4c75f7c773 isisd: fix the TI-LFA repair paths to preserve the original Prefix-SID
When computing backup nexthops for routes that contain a Prefix-SID,
the original Prefix-SID label should be present at the end of
backup label stacks (after the repair labels). This commit fixes
that oversight in the original TI-LFA code. The SPF unit tests and
TI-LFA topotes were also updated accordingly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23 10:31:39 -03:00
Renato Westphal
d47d6089e0 isisd: refactor handling of SR Prefix-SIDs
Embed Prefix-SID information inside SPF data structures so that
Prefix-SIDs can be installed together with their associated routes
at the end of the SPF algorithm. This is different from the current
implementation where Prefix-SIDs are parsed and processed separately,
which is vastly suboptimal.

Advantages of the new code:
* No need to parse the LSPDB an additional time to detect and process
  SR-related changes;
* Routes are installed with their Prefix-SID labels in the same ZAPI
  message. This can prevent packet dropping for a few milliseconds
  after each SPF run if there are BGP-labeled routes (e.g. L3VPN) that
  recurse on IGP labeled routes;
* Much easier to support Anycast-SIDs, as the SPF code will naturally
  figure out the best nexthops and use only them (that can't be done
  in any reasonable way if the Prefix-SID Sub-TVLs are processed
  separately);
* Less code to maintain and reduced memory footprint;

The "show isis segment-routing prefix-sids" command was removed as
it doesn't make sense anymore now that "show isis route" exists.
Prefix-SIDs are a property of routes, so what was done was to extend
the "show isis route" command with a new "prefix-sid" option that
changes the output table to show the Prefix-SID information associated
to each route.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23 10:31:39 -03:00
Renato Westphal
d4fcd8bd82 isisd: create routes for local destinations
This is preparatory change for the upcoming SR Prefix-SID
refactoring.
Since Prefix-SID information will be stored inside IS-IS routes
(instead of being maintained separately), it will be necessary to
have local routes in order to store local Prefix-SID information.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-23 10:30:36 -03:00
Mark Stapp
b3d6bc6ef0 * : update signature of thread_cancel api
Change thread_cancel to take a ** to an event, NULL-check
before dereferencing, and NULL the caller's pointer. Update
many callers to use the new signature.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-23 08:59:34 -04:00
Donatas Abraitis
90a65457d1
Merge pull request #7345 from opensourcerouting/bgp-aggr-suppress
bgpd: aggregate-address suppress-map
2020-10-23 15:02:57 +03:00
Rafael Zalamena
6ba6de7e17 bgpd,topotests: log route suppression messages
To see the messages activate the BGP debug: `debug bgp updates`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-10-22 13:52:06 -03:00
Donatas Abraitis
2dbe669bdf :* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-22 09:07:41 +03:00
Rafael Zalamena
e84dfa4c2e topotests: test aggregate address suppress map
Add test for new aggregate address option: test aggregate address option
without converged routes, then test again with a different route map
with converged routes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-10-21 21:50:06 -03:00
Martin Winter
dad65cbe73
Merge pull request #7276 from donaldsharp/speedup_isis_topotests
tests: add `lsp-gen-interval 2` to isis configuration
2020-10-21 13:30:51 +02:00
David Schweizer
05c0bc24de
tests: topotests for BGP DelayOpenTimer
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2020-10-20 17:00:02 +02:00
Donald Sharp
c10e14e96d *: Create/Use accessor functions for lock count
Create appropriate accessor functions for the rn->lock
data.  We should be accessing this data through accessor
functions since it is private data to the data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-17 13:39:10 -04:00
Renato Westphal
955c9b438e tests: fix spurious failures in the TI-LFA topotest
Skip comparing neighbor-extended-circuit-id in yang output. They
are not consistent.

This is similar to commit ecc11c93b7 which fixed the same
problem in the IS-IS SR topotest.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-16 20:40:11 -03:00
Renato Westphal
9687c500c6 tests: add IS-IS TI-LFA topotest
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-14 16:27:37 -03:00
Renato Westphal
ca74d663b5 tests: add IS-IS TI-LFA unit tests
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-10-14 16:27:37 -03:00
Donald Sharp
6431621e4e
Merge pull request #7180 from kuldeepkash/bgp-communities
tests: Add bgp_communities_topo1 test suite
2020-10-14 09:14:10 -04:00
Kuldeep Kashyap
c66ca86168 tests: Enable evpn_type5_test_topo1 suite to run in CI
1. Suite: evpn_type5_test_topo1 was added to pytest.ini during triaging phase as
there was bug: https://github.com/FRRouting/frr/issues/6867, which is fixed. Enabling
suite to be run in CI.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-10-13 14:55:14 +00:00
Kuldeep Kashyap
1cba703357 tests: Add bgp_communities_topo1 test suite
1. Adding test to verify well known communities: no-export, local-AS, internet
2. Exection time is 90 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-10-13 04:58:31 +00:00
Donald Sharp
2e37407f9d ospf6d, tests: Prevent use after free
The code pattern:

for (ALL_LSDB(lsdb, lsa)) {
	remove_lsa(lsa)
}

has a use after free in ALL_LSDB, since we ask for the next pointer,
after it has been freed.

Modify the code such that we grab the next pointer before we can
possibly free it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11 11:16:44 -04:00
Donald Sharp
9000da255f tests: add lsp-gen-interval 2 to isis configuration
Force faster generation of lsp's and also cause the
networks to converge faster.  All affected tests
run faster now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-10 09:44:30 -04:00
Quentin Young
f20093b5c3 tests: bgp_l3vpn_to_bgp_vrf test needed to correct order
The bgp_l3vpn_to_bgp_vrf test is looking for a prefix
on multiple routers that the ordered received is non-deterministic.
As such the regex's are failing occassionaly when the
route is received in an unexpected order.

One possible order:
(#89) scripts/check_routes.py:120 COMMAND:ce3:vtysh -c "show bgp ipv4 uni 6.0.1.0":2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3.* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight.* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1.* Origin IGP, metric 98, localpref 123, valid, internal.* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56:pass:Redundant route 1 details c:
COMMAND OUTPUT:BGP routing table entry for 6.0.1.0/24^M
Paths: (2 available, best #1, table default)^M
  Advertised to non peer-group peers:^M
  192.168.1.1^M
  Local^M
    99.0.0.3 from 0.0.0.0 (99.0.0.3)^M
      Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best (Weight)^M
      Community: 0:67^M
      Extended Community: RT:89:123^M
      Large Community: 12:34:56^M
      Last update: Wed Oct  7 11:12:22 2020^M
  Local^M
    192.168.1.1 from 192.168.1.1 (192.168.1.1)^M
      Origin IGP, metric 98, localpref 123, valid, internal^M
      Community: 0:67^M
      Extended Community: RT:52:100 RT:89:123^M
      Large Community: 12:34:56^M
      Last update: Wed Oct  7 11:12:41 2020:
R:89   ce3    Redundant route 1 details c                              1    0

Second possible order:
(#89) scripts/check_routes.py:120 COMMAND:ce3:vtysh -c "show bgp ipv4 uni 6.0.1.0":2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3.* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight.* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1.* Origin IGP, metric 98, localpref 123, valid, internal.* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56:pass:Redundant route 1 details c:
COMMAND OUTPUT:BGP routing table entry for 6.0.1.0/24^M
Paths: (2 available, best #2, table default)^M
  Advertised to non peer-group peers:^M
  192.168.1.1^M
  Local^M
    192.168.1.1 from 192.168.1.1 (192.168.1.1)^M
      Origin IGP, metric 98, localpref 123, valid, internal^M
      Community: 0:67^M
      Extended Community: RT:52:100 RT:89:123^M
      Large Community: 12:34:56^M
      Last update: Wed Oct  7 11:14:45 2020^M
  Local^M
    99.0.0.3 from 0.0.0.0 (99.0.0.3)^M
      Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best (Weight)^M
      Community: 0:67^M
      Extended Community: RT:89:123^M
      Large Community: 12:34:56^M
      Last update: Wed Oct  7 11:14:27 2020:
R:89   ce3    Redundant route 1 details c                              0    1

BGP displays the paths in the order received since it's just a linked list.
For this test modify/add the luCommands to track that we may
receive the paths in a non-deterministic order.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-08 13:02:06 -04:00
whitespace
701a01920e *: reformat python files
We are now using black.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-07 17:22:26 -04:00
Donatas Abraitis
64fe0feea3
Merge pull request #7239 from opensourcerouting/bgp-aggregate-med
bgpd: aggregate-address on matching MED only
2020-10-07 09:44:30 +03:00
Lou Berger
a69e5dd7ef tests: bgp_l3vpn_to_bgp_vrf - verify details of exported/imported routes
Signed-off-by: Lou Berger <lberger@labn.net>
2020-10-06 10:34:32 -04:00
Lou Berger
7946452bfc tests: bgp_l3vpn_to_bgp_vrf - change 1 route to have equal metrics
Signed-off-by: Lou Berger <lberger@labn.net>
2020-10-06 10:34:32 -04:00
Lou Berger
5df69602e7 tests: bgp_l3vpn_to_bgp_vrf - add bestpath checks
Signed-off-by: Lou Berger <lberger@labn.net>
2020-10-06 10:34:32 -04:00
Lou Berger
b4bfe0aa47 tests: lib/bgprib.py - add bestpath checks and logging to lu log file
Signed-off-by: Lou Berger <lberger@labn.net>
2020-10-06 10:34:32 -04:00
Lou Berger
801f483b4e tests: bgp_l3vpn_to_bgp_vrf - add redundant ce routes
Signed-off-by: Lou Berger <lberger@labn.net>
2020-10-06 10:34:32 -04:00
Rafael Zalamena
d3c9581960 topotests: test aggregate-address matching-MED-only
Add a new topology test for `aggregate-address` to test
`matching-MED-only` and its combination with `summary-only`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-10-06 06:42:17 -03:00
Santosh P K
002bac8b5b
Merge pull request #6904 from chiragshah6/yang_nb6
lib, bgpd: Convert global configurations to transactional cli
2020-10-05 21:53:39 +05:30
Chirag Shah
15cbc38206 tests: add bgp yang module registery to attr test
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-03 11:25:37 -07:00
Chirag Shah
64fb3f8666 tests/bgpd: initialized candidate_config to vtysh
In test_peer_attr.c test is initializd with vty handler
but candiate_config is not set.

northbound converted bgp cli expects to derefence the
candidate_config field which leads to crash.

(gdb) p *test->vty->candidate_config
$9 = {dnode = 0x0, version = 0}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-03 11:25:37 -07:00
Martin Winter
ecc11c93b7
tests: Skip comparing neighbor-extended-circuit-id in yang output. They are not consistent
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-10-02 22:07:25 +02:00
Igor Ryzhov
a09775ec9b tests: don't compare internal vrfId in topotests
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 14:45:51 +03:00
Igor Ryzhov
0224261ee4 tests: don't compare internal vrfId in topotests
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-02 11:24:16 +03:00
Quentin Young
46d80d4532
Merge pull request #7226 from opensourcerouting/topotestfixes
tests: Topotest fixes to skip comparing InterfaceIndex and Internal status
2020-10-01 19:17:34 -04:00
Martin Winter
71edf4dd17
Merge pull request #7224 from mjstapp/fix_topo_ptyest
tests: fix typos in zebra_rib and _netlink
2020-10-01 23:01:02 +02:00
Martin Winter
737a7c578f
tests: Topotest fixes to skip comparing InterfaceIndex and Internal status in json_cmp
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-10-01 21:33:55 +02:00
Mark Stapp
5094b56dc5 tests: fix typos in zebra_rib and _netlink
Fix a couple of typos in the zebra_rib and _netlink topotest
suites.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-01 14:17:06 -04:00
Mark Stapp
207c9fb4a1 tests: fix regex in all_proto test
Make sure the all-protocols test_isis_interfaces testcase uses
a regex substitution that includes all the hex characters.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-01 10:21:03 -04:00
Donald Sharp
b0b19fd0ec
Merge pull request #7201 from mjstapp/fix_topo_ubu20
tests: pim-basic mcast scripts fixes for python3
2020-09-29 18:14:30 -04:00
Mark Stapp
f635350e8e tests: pim-basic mcast scripts fixes for python3
The pim-basic suite uses some private python scripts to
send and receive mcast traffic: revise them to support
both py2 and py3.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-29 15:03:43 -04:00
Donald Sharp
e587774b74
Merge pull request #7039 from opensourcerouting/bgp-norib-runtime
bgpd: set/unset no-rib option at runtime
2020-09-29 13:42:02 -04:00
Donald Sharp
97e551e300
Merge pull request #7177 from mjstapp/fix_topo_tab_open
tests: python3 compat fixes for topotests: tabs and misc api
2020-09-29 10:06:48 -04:00
Donald Sharp
f4efc793b5
Merge pull request #7197 from idryzhov/fix-tests
tests: skip tests when building without daemon
2020-09-29 09:59:20 -04:00
Igor Ryzhov
b69d84882b tests: skip tests when building without daemon
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-09-29 13:16:54 +03:00
Stephen Worley
8f4d7212f5 tests: add topotest for NHG Proto APIs
Add a topotest for basic NHG Proto Add/Del/Replace.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-09-28 12:41:00 -04:00
Mark Stapp
1e5b2db644 tests: avoid python2 regex syntax
Update a few regexs to avoid python2-specific syntax

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
45c3045aef tests: report uname info once per test
Report 'uname' info once per test, not once per
configured router in each test.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
61196140a6 tests: improve unicode handling
Support more of the string/unicode interactions in various
topotests.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
11761ab0f4 tests: python3 compat fixes for topotests: tabs and misc
Use only spaces in python files; no tabs; also a couple of small
api fixes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-26 15:40:00 -04:00
Mark Stapp
ccda0eadac
Merge pull request #7155 from donaldsharp/TRAP
Offload/Trap
2020-09-23 16:06:37 -04:00
Stephen Worley
57d7d1948e
Merge pull request #7160 from mjstapp/fix_topo_daemons_list
tests: fix bug in handling of daemons to start
2020-09-23 14:47:13 -04:00
Donatas Abraitis
64b1483ccb
Merge pull request #7154 from donaldsharp/frr_topotests
tests: Our tests are for FRR
2020-09-23 17:33:08 +03:00
Mark Stapp
bb91e9c03b tests: fix bug in handling of daemons to start
Ensure the list of daemons to start is either the one specified
by a caller or the default one from the router configuration.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-23 08:48:25 -04:00
Mark Stapp
b6033bd1c1
Merge pull request #7067 from donaldsharp/remove_solaris
Remove solaris
2020-09-22 17:04:19 -04:00
Donald Sharp
5a3cf85391 lib, zebra: Add ability to read kernel notice of TRAP/OFFLOAD
The linux kernel is getting RTM_F_TRAP and RTM_F_OFFLOAD for
kernel routes that have an underlying asic offload.  Write the
code to receive these notifications from the linux kernel and
to store that data for display about the routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-22 15:57:43 -04:00
Donald Sharp
e2dcd0c2c5
Merge pull request #7132 from volta-networks/fix_ldp_sync_cmds
Fix ldp sync cmds
2020-09-22 14:20:21 -04:00
Donald Sharp
622c4996ef tests: Our tests are for FRR
These tests at this point only work for FRR.  Let's cut to the chase
and admit it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>`
2020-09-22 10:11:58 -04:00
lynne
e82329ef20 ldpd: update topo tests for new show isis ldp-sync command output
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2020-09-21 12:07:13 -04:00
Donald Sharp
cae8bc967c *: Remove solaris from FRR
The Solaris code has gone through a deprecation cycle.  No-one
has said anything to us and worse of all we don't have any test
systems running Solaris to know if we are making changes that
are breaking on Solaris.  Remove it from the system so
we can clean up a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-21 10:02:20 -04:00
vivek
211a9d4b97 topotests: Add test for BGP graceful shutdown
Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2020-09-20 20:19:51 -07:00
Donald Sharp
0b8125588a
Merge pull request #7069 from opensourcerouting/fix-set-metric
lib: fix the "set metric" route-map command
2020-09-19 08:06:36 -04:00
Donald Sharp
dfc51e66bf
Merge pull request #6814 from gpnaveen/ospf_basic_functionality
tests: ospf basic functionality topojson testcases.
2020-09-18 21:20:04 -04:00
Donald Sharp
d6b4fbb723
Merge pull request #7131 from mjstapp/fix_topo_py2_iter
tests: use .items instead of .iteritems in topotests
2020-09-18 18:15:43 -04:00
Donald Sharp
bd1b1a1774
Merge pull request #7130 from volta-networks/fix_ldp_sync_topotest
tests: increase timeout to avoid intermittent LDP Sync test failure
2020-09-18 18:00:42 -04:00
Mark Stapp
e5f0ed147b tests: use .items instead of .iteritems in topotests
Avoid py2-only .iteritems() api.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-09-18 15:55:23 -04:00
Karen Schoener
1d6002df48 tests: increase timeout to avoid intermittent LDP Sync test failure
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-09-18 13:59:09 -04:00
Donald Sharp
aef6542984
Merge pull request #7129 from kuldeepkash/bgp_basic_functionality
tests: Add bgp_route_aggregation test suite
2020-09-18 12:31:17 -04:00
Russ White
0a6e6613d7
Merge pull request #7089 from pguibert6WIND/netns-refactor
Netns refactor
2020-09-18 11:02:30 -04:00
Kuldeep Kashyap
c3794eb210 tests: Add bgp_route_aggregation test suite
1. Added 2 tests to verify bgp route aggregation using summary-only and
   as-set commands
2. Execution time is ~90 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-09-18 14:11:58 +00:00
nguggarigoud
dd2da503cd tests: Optimising a step for not true case.
1. Optimising a step for not true case.
2. Fixing a timing issue in route calculation script.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
nguggarigoud
b29a56b3ae tests: removing initial wait time in ospf.py
1. Removed initial_wait in ospf library.
2. Removed one test case which was random
   failure, will add back after traiging.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
nguggarigoud
035267a374 tests: Adding daemon check for ospfd in common_config.py
start ospfd only when ospf config is used.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
naveen
a81774ec7d tests: ospf basic functionality topojson testcases.
1. Removed static sleeps.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
naveen
4256a20961 tests: ospf_basic_functionality topojson testcases.
1. Adding 18 ospf testcases to topojson.
2. Adding ospf.py library.

Test suite execution time is ~18 minutes.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-18 15:13:46 +05:30
Martin Winter
576cada54c
Merge pull request #7066 from donaldsharp/more_test_speedups
tests: Speed up topotests by being more aggressive
2020-09-16 22:27:16 +02:00
nguggarigoud
f052d1fc39 tests: Addressing lint error.
Added new line to remove git link error.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-15 15:51:07 +05:30
nguggarigoud
955212d91b tests: fixing pytest.skip error.
Updated scripts to handle skip on lower
kernel version.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-15 15:44:10 +05:30
naveen
3dfd384ec4 tests: Moving kernel version check to API.
Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-15 15:44:10 +05:30
naveen
eb5e807234 tests: Kernel version check for topojson scripts.
1. Added linux kernel version check to avoid failures
in CI systems if matching kernel version not found.

Signed-off-by: naveen <nguggarigoud@vmware.com>
2020-09-15 15:44:10 +05:30
Martin Winter
f6bcffb623
tests: Add topotest for BGP metric change
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-09-14 21:58:57 +02:00
Donald Sharp
9fa352cfb7 tests: Speed up topotests by being more aggressive
We have a bunch of tests that wait *then* check a command for success/failure.
Modify the tests to check *first* then to wait.  This reduces test
run times on my system by ~1400 seconds for a full run.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-11 20:20:42 -04:00
Renato Westphal
beb91114ec
Merge pull request #6789 from volta-networks/feat_ldp_igp_sync
ldpd: Add support for LDP-IGP Synchronization
2020-09-11 15:55:04 -03:00
Philippe Guibert
370fb8f819 test: topotest bgp_evpn_rt5 runs on kernel > 4.18
if kernel is less than 4.18, then test will not run.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:24 +02:00
Philippe Guibert
f54b51035b topotests: bgp_evpn_rt5 test uses ip link instead of bridge-utils
bridge-utils package is not available on tested distributions.
use ip link instead.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:24 +02:00
Philippe Guibert
d4b10c1b74 topotests: add bgp_evpn_rt5 test with vrf netns backend
this test checks connectivity between a vrf-lite device and a vrf-netns
device. this ensures that evpn serice is importing appropriate evpn rt5
entries in the correct vrf.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:24 +02:00
Donatas Abraitis
4c33bf263f
Merge pull request #7064 from donaldsharp/bgp_timings_faster
tests: Modify bgpd.conf to have faster keepalive/hold timers
2020-09-10 15:10:11 +03:00
Karen Schoener
1fe192228b ldpd: adding topotests for the LDP IGP Sync feature
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-09-09 11:12:02 -04:00
Donald Sharp
6a8a0f159a tests: Modify bgpd.conf to have faster keepalive/hold timers
Modify bgpd.conf in all easily accessible topotests to use 3 10
as their timers du jour.  This will allow the tests to converge
faster.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-08 12:58:26 -04:00
Don slice
0922d2e56e topotests: Add test for bgp update-delay configuration
Signed-off-by: Don Slice <dslice@nvidia.com>
2020-09-08 04:27:15 -07:00
Donatas Abraitis
a8b517846c
Merge pull request #7051 from donaldsharp/ospf_test_speedup
Ospf test speedup
2020-09-05 08:17:31 +03:00
Renato Westphal
b686742e2b
Merge pull request #6934 from Niral-Networks/niral_dev_vrf_isis_core_pr4
isisd, yang, doc : Support for different VRF in ISIS.
2020-09-04 18:44:56 -03:00
Donatas Abraitis
f6af4aecf4
Merge pull request #6826 from pjdruddy/bgp-auth-vrf-frr
Bgp auth vrf frr
2020-09-04 16:03:47 +03:00
Martin Winter
0c7b459c2c
Merge pull request #6926 from kuldeepkash/dynamic_route_leak
tests: Add bgp_vrf_dynamic_route_leak test suite
2020-09-03 19:03:22 +02:00
Donald Sharp
ff3218f5af tests: Reduce run time of bgp_l3vpn_to_bgp_vrf
Reduces run time of the bgp_l3vpn_to_bgp_vrf topotests
from ~118 seconds to ~87 seconds by reducing hello timers
in bgp and ospf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
f3ce48d31a tests: Reduce bfd-topo2 run time
Reduce run time of bfd-topo2 from ~62 seconds to ~33 seconds
by modifying the hello/dead intervals for both ospf and ospfv3

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
2022ed089e tests: Reduce ldp-oc-acl-topo1 run time
Reduce the ldp-oc-acl-topo1 test run time from ~69 seconds
to ~39 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
e1cbae1a2e tests: Reduce bgp-evpn-vxlan-topo1 run time
Reduce the runtime from ~82 seconds to ~51 seconds by
reducing hello/hold timers for both bgp and ospf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
0668365829 tests: Reduce ospf-topo1 run time
Reduce run time from ~114 seconds to ~55 seconds by
configuring hello/dead interval timers for ospf and ospfv3

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
20a91d054c tests: Reduce bgp_l3vpn_to_bgp_direct run time
Reduce run time from ~76 seconds to ~47 seconds by modifying
both bgp and ospf timers to be more aggressive

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
39adeb7617 tests: Reduce ldp-vpls-topo1 run time
Reduce this tests run time from ~76 seconds to ~49 seconds
by decreasing the hello/dead interval timers in ospf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
8add049dfc tests: Speedup bgp_rfapi_basic_sanity run
Decrease run time from ~70 seconds to ~41 seconds by
reducing hello/dead interval timers in ospf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
b17dd2a023 tests: Speedup bfd-profiles-topo1 runtime
Decrease run time from ~70 seconds to ~60 seconds
by modifying the hello/dead interval interface timers
in ospf

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
5a65e36b11 tests: Decrease ospf-sr-topo1 run time
Reduce ospf-sr-topo1 run time from ~60 seconds to ~30 seconds
by shortening the hello and dead timers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
d23a0ba74c tests: ospf-topo2 speed up
Modify ospf hello/dead timers to speed up run time from ~25 seconds to
~17 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
14f2e6b50b tests: Modify ldp-oc-topo1 to run faster
Convert run times by lowering hello/dead interval timers to
smaller values from ~66 seconds to ~36 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
221bbedb11 tests: Speedup ldp-topo1 tests
These ospf timer changes, speed up convergence from ~85 seconds to
~40 seconds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-03 10:54:16 -04:00
Donald Sharp
4e2286abc8 tests: Speed up bgp_features topotests by a lot
Initial run of topotests on my machine takes ~210 seconds
With these changes we are at ~40 seconds

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-09-02 15:47:14 -04:00
David Schweizer
251931afbd
tests: Enhance bgp_features topotest suite with tests for "bgp no-rib"
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2020-09-02 18:20:09 +02:00
Kuldeep Kashyap
985195f2b4 tests: Add bgp_vrf_dynamic_route_leak test suite
1. Added test to verify bgp vrf dynamic route leak functionality
2. Total execution time is ~8 mins
3. Added kernel version check, these script would be run for kernel version >= 4.19

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-09-01 16:11:24 +00:00
Kuldeep Kashyap
bc0a514728 tests: Add f/w support for bgp_vrf_dynamic_route_leak tests automation
1. Adding f/w support for bgp_vrf_dynamic_route_leak tests automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-09-01 15:48:10 +00:00
Pat Ruddy
318c1fa36f tests: topotest for bgp authentication
18 tests which cover
authenticated passord session extablishment
password removal
wrong password
over default, default prefix-based, vrf, vrf prefix-based, multi-vrf and
multi-vrf prefix-based configurations

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-09-01 09:42:39 +01:00
harios_niral
9375b5aa24 topotests : Topotest for different VRF in isisd
1. Topotest for isis-vrf is added for ipv4 and ipv6.
2. Test case for checking isis topology.
3. Test case for checking zebra isis routes.
4. Test case for checking linux vrf routes.
5. 2 new API's written in topotest/lib for checking vrf routes.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>"
Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-09-01 00:56:44 -07:00
harios_niral
65251ce80f doc, yang, isisd : Support for different VRF in isisd
1. Added isis with different vrf and it's dependecies.
2. Added new vrf leaf in yang.
3. A minor change for IF_DOWN_FROM_Z passing argrument is
   replaced with ifp pointer in api "isis_if_delete_hook()".
4. Minor fix in the isisd spf unit test.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>"
Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-09-01 00:48:05 -07:00
Rafael Zalamena
48a1bbdf76
Merge pull request #6925 from kuldeepkash/bgp_basic_functionality
tests: Add new tests to bgp-basic-functionality-topo1
2020-08-30 07:40:28 -03:00
Mark Stapp
cd79342c12 tests: small topotest improvements for python3
Avoid unnecessary use of StringIO in one place, use version-
dependent method in another. Remove a couple of other py2->py3
problems.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-28 10:10:46 -04:00
Kuldeep Kashyap
19f4da0bec tests: Add new tests to bgp-basic-functionality-topo1
1. Added new tests to bgp-basic-functionality-topo1
3. Execution time increased by 55 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-08-28 12:24:20 +00:00
Renato Westphal
75aa7aa135 isisd: add abiliy to compute the reverse shortest path tree
RFC 7490 says:
 "The reverse SPF computes the cost from each remote node to root. This
  is achieved by running the normal SPF algorithm but using the link
  cost in the direction from the next hop back towards root in place of
  the link cost in the direction away from root towards the next hop".

Support for reverse SPF will be necessary later as it's one of the
algorithms used to compute R-LFA/TI-LFA repair paths.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26 20:16:19 -03:00
Renato Westphal
52a7c25e63 tests, isisd: add IS-IS SPF unit tests
Now that the IS-IS SPF code is more modular, write some unit tests
for it.

This commit includes a new test program called "test_isis_spf" which
can load any test topology (there are 13 different ones available)
and run SPF on any desired node. In the future this same test program
and topologies will also be used to test reverse SPF and TI-LFA.

The "test_common.c" file contains helper functions used to parse the
topology descriptions from "test_topologies.c" into LSP databases
that can be used as an input to the SPF code.

This commit also introduces the F_ISIS_UNIT_TEST flag which is used
to prevent the IS-IS code from scheduling any event when running
under the context of an unit test.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-26 20:16:19 -03:00
Donald Sharp
c6d41e93e0
Merge pull request #5799 from pguibert6WIND/flowspec_ipv6
Flowspec ipv6
2020-08-26 08:26:46 -04:00
Donald Sharp
b532b92d31
Merge pull request #6988 from mjstapp/fix_topo_stop_logic
tests: improve topotest stop logic
2020-08-25 14:59:11 -04:00
Mark Stapp
942a224eae tests: fix router stop logic
Change the public router stop method to always do a two-phase
shutdown - once without waiting and a second time with a wait.
Ordinary callers need to use this approach when stopping routers.
Move the detailed internal details to a private method that tests
should not call directly.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-25 10:52:17 -04:00
Mark Stapp
a85a3d1ef9 tests: remove some unused imports
Remove unused imports from some topojson tests

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-25 10:51:47 -04:00
Mark Stapp
af39fbe7df tests: include all daemons in all-proto error tests
Some daemons run in all-protocol-startup weren't included in
error-output testing.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-25 10:50:12 -04:00
Russ White
e3dcd431cd
Merge pull request #6938 from opensourcerouting/bgp-instance-shutdown
bgpd: BGP instance administrative shutdown
2020-08-25 10:31:01 -04:00
Donald Sharp
ce26564ed4
Merge pull request #6975 from opensourcerouting/topotest-zebra-nl-buf-size
topotests: bump zebra netlink socket buffer size
2020-08-25 08:00:56 -04:00
Renato Westphal
cd8ce25a70
Merge pull request #6726 from Orange-OpenSource/dev_ospf_sr
ospfd: Segment Routing Improvement
2020-08-24 16:23:45 -03:00
Rafael Zalamena
8e72eff7d8 topotests: bump zebra netlink socket buffer size
Use the same value as we use in production release configuration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-08-24 07:29:23 -03:00
Martin Winter
53d49b1a0e
tests: Cleanup and fix error message in bgp_features testsuite
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-08-21 13:46:02 +02:00
Philippe Guibert
e764d5faab topotest: add bgp flowspec ipv4/ipv6 test
this test ensures that an incoming bgp ipv4 and ipv6 flowspec
entry is received with a nexthop IP associated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-08-21 13:37:08 +02:00
Martin Winter
9104f54962
tests: Add new bgp_features testsuite with test for bgp shutdown
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2020-08-21 01:36:21 +02:00
Chirag Shah
390a886277 *: record transaction based on control flag
In case of config rollback is enabled,
record northbound transaction based on a control flag.
The actual frr daemons would set the flag to true via
nb_init from frr_init.
This will allow test daemon to bypass recording
transacation to db.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-08-20 14:12:04 -07:00
Olivier Dugeon
f786c4d7c9 OSPFd: Explicit Null option for Segment-Routing
Add new option to `segment-routing prefix` command to set the
Explcit Null flag in addition to the No-PHP flag. MPLS LFIB configuration
has been also updated to take into account the Explicit Null flag.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-08-20 15:51:48 +02:00
Olivier Dugeon
6f751f1493 ospfd: Add Segment Routing Local Block
RFC 8665 defines a Segment Routing Local Block for Adjacency SID.
This patch provides the possibility to modify the SRLB as well as
reserved the block range from the Label Manager.

 - Introduce new CLI 'segment-routing local-block'
 - Add local block to SRDB structure
 - Parse / Serialize SRLB in Router Information LSA
 - Update OSPF-SR topotest
 - Update documentation

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2020-08-20 14:37:40 +02:00
Kaushik
eab88f3655 isisd : Transformational changes to support different VRFs.
1. Created a structure "isis master".
2. All the changes are related to handle ISIS with different vrf.
3. A new variable added in structure "isis" to store the vrf name.
4. The display commands for isis is changed to support different VRFs.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-08-14 13:46:22 -07:00
Donald Sharp
40ce7a4203
Merge pull request #6889 from opensourcerouting/isisd-assorted-fixes
isisd minor fixes and enhancements
2020-08-14 12:50:03 -04:00
Donald Sharp
22c9bfb824
Merge pull request #6883 from pjdruddy/evpn-refactor
Evpn refactor
2020-08-14 09:02:25 -04:00
Donald Sharp
bbbfa7f77d
Merge pull request #6899 from opensourcerouting/bfd-knobs
bfdd: support passive mode and minimum TTL
2020-08-14 08:54:36 -04:00
Rafael Zalamena
39bea45c19 topotests: new BFD test for multi hop features
Add a new test to cover the new features for multi hop BFD peers:

- Test that we correctly receive TTL from protocol integration.
- Check minimum TTL usage and 'show' command.
- Check for passive mode.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-08-12 14:57:03 -03:00
Rafael Zalamena
360d6ca513 topotests: fix default BFD peer shutdown state
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>
2020-08-12 10:56:49 -03:00
Pat Ruddy
2d706c4e25 tests: remove ifindex from VNI JSON comparison
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>
2020-08-12 12:39:33 +01:00
Pat Ruddy
578c52e5c0 tests: add EVPN IP learning tests
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>
2020-08-12 12:39:33 +01:00
Donald Sharp
9d0843ac88
Merge pull request #6895 from mjstapp/fix_topo_vpls_timeout
tests: add time to ldp vpls testcase
2020-08-11 17:21:08 -04:00
Donald Sharp
659d56e13f
Merge pull request #6755 from xThaid/dplane_batching
zebra: dataplane batching
2020-08-11 13:59:12 -04:00
Mark Stapp
ceb71630ed
Merge pull request #6870 from donaldsharp/test_fixups
Test fixups
2020-08-11 12:40:52 -04:00
Mark Stapp
e513ad68d4 tests: add time to ldp vpls testcase
Add some more wait time to an LDP vpls testcase - it seems to have
trouble in the CI sometimes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-08-11 09:33:39 -04:00
Renato Westphal
f29b62b49d tests: tune some parameters to speed up the IS-IS SR topotest
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>
2020-08-11 01:00:56 -03:00
Jakub Urbańczyk
531c92b82f tests: zebra netlink testcases
Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-08-10 21:57:12 +02:00
Sebastien Merle
31f937fb43 lib, zebra: Add SR-TE policy infrastructure to zebra
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>
2020-08-07 11:08:49 +02:00
Donald Sharp
dbb0ba05aa tests: no learning is not accepted
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>
2020-08-06 16:32:04 -04:00
Donald Sharp
2055cbee81 tests: Add some small clues to what dut is having the issue
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>
2020-08-06 16:31:06 -04:00
Donald Sharp
99ecb5a571
Merge pull request #6873 from mjstapp/fix_topo_retry_sigterm
tests: stop daemons consistently in mem leak path
2020-08-06 16:28:25 -04:00
Rafael Zalamena
084cb75254
Merge pull request #6587 from AnuradhaKaruppiah/evpn-mh-pr-1
EVPN Multihoming part-1
2020-08-06 19:49:14 +00:00
Mark Stapp
d2bdb82ffd tests: stop daemons consistently in mem leak path
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>
2020-08-06 11:47:12 -04:00
Donatas Abraitis
2b42623bd3
Merge pull request #6847 from donaldsharp/time_to_rerun
Time to rerun
2020-08-05 17:34:46 +03:00
Anuradha Karuppiah
df98b92c12 topotests: initial set of tests for evpn multihoming
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>
2020-08-05 06:46:13 -07:00
Donald Sharp
b34232cf86 lib, tests: Add notation about whether or not a route-map is about to be reprocessed
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>
2020-08-04 10:16:09 -04:00
Rafael Zalamena
50ecf9dc14 topotests: remove sharpd from route map output
`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>
2020-08-03 21:21:14 -03:00
Mark Stapp
76e036e4b0 tests: Avoid top ecmp route_scale test case when memory limited
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>
2020-07-30 14:23:52 -04:00
Mark Stapp
0ae6467f0e tests: rework route_scale topotest
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>
2020-07-30 14:23:52 -04:00
Kuldeep Kashyap
e66778d007 tests: Skipping evpn_type5_test_topo1 tests from CI runs
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>
2020-07-30 14:29:25 +00:00
Donald Sharp
c19e12b74f tests: Remove 'log monitor' from tests
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>
2020-07-27 11:09:16 -04:00
Mark Stapp
6c4b304f33
Merge pull request #6662 from kuldeepkash/evpn_type2_tests
tests: Adding test suites evpn_type5_test_topo1
2020-07-27 08:16:31 -04:00
Russ White
a90f46738a
Merge pull request #6730 from wesleycoakley/pbrd-dscp-ecn
DSCP / ECN-based PBR Matching
2020-07-23 12:08:38 -04:00
Kuldeep Kashyap
1b66072ce0 tests: Adding test suites evpn_type5_test_topo1
1. Added 15 test cases to test evpn type5 functionality
2. Total execution time is ~9 mins

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-07-22 09:04:16 +00:00
Kuldeep Kashyap
3c334c3915 tests: Adding framework support for EVPN-Type5 automation
1. Added APIs to create evpn related config.
2. Added APIs to verify evpn config and routes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-07-22 06:12:55 +00:00
Quentin Young
65b86778c1
Merge pull request #6711 from GalaxyGorilla/bfd_isis_profiles
Add BFD profiles for IS-IS
2020-07-21 14:45:31 -04:00
Donald Sharp
3eb15671ee
Merge pull request #6731 from opensourcerouting/style-string-prep
*: string coding style
2020-07-15 20:06:55 -04:00
Donald Sharp
c71ff7a60e
Merge pull request #6746 from opensourcerouting/topotests-wtf
topotests: stop the zombie apocalypse
2020-07-15 20:04:07 -04:00
Wesley Coakley
4402515921 tests: expand pbr-topo1 to cover DSCP & ECN
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2020-07-15 12:59:36 -04:00
David Lamparter
f033a78a99 topotests: stop wasting time at exit
... and clean up zombie child processes

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-15 18:50:30 +02:00
David Lamparter
ba5410e32f topotests: update Dockerfile
... python3 is non-optional now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-07-15 18:50:12 +02:00
David Lamparter
79f6fdeb3f topotests: unshittify backtraces
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>
2020-07-15 18:48:57 +02:00
Kuldeep Kashyap
f6f20a77e8 tests: [topojson] Increase BGP convergence wait time
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>
2020-07-14 13:09:06 +00:00
David Lamparter
3efd0893d0 *: un-split strings across lines
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>
2020-07-14 10:37:25 +02:00
Donatas Abraitis
635cc1ec60 tests: Remove bgp_show_ip_bgp_fqdn test
Not really relevant for now.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-07-10 20:33:10 +03:00
Donald Sharp
373edbbc99
Merge pull request #6530 from mjstapp/backup_nhg_notify
lib, zebra: async notifications for backup routes and LSPs
2020-07-10 10:54:59 -04:00
GalaxyGorilla
a29bea9947 tests: align BFD profiles tests for IS-IS
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2020-07-10 11:29:32 +00:00
Donald Sharp
eb94db103c
Merge pull request #6703 from mjstapp/fix_bgp_30_secs
tests: print actual time spent waiting for bgp convergence
2020-07-09 20:29:08 -04:00
Donald Sharp
af83fd8b7b
Merge pull request #6709 from mjstapp/fix_topo_ipaddr
tests: use ipaddress module; tolerate missing support bundle file
2020-07-09 20:20:36 -04:00
Mark Stapp
8b547a6dab test: use ipaddress module instead of ipaddr
Use the standard ipaddress module instead of installing 'ipaddr',
which may be deprecated now.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-09 12:32:10 -04:00
Mark Stapp
7172f19da4 tests: don't fail topotests if bundle file not present
Test for the existence of the support_bundle conf file before
trying to access it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-09 12:13:55 -04:00
Mark Stapp
526d442fe4 tests: print actual time spent waiting for bgp convergence
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>
2020-07-09 09:51:16 -04:00
Renato Westphal
4030687aab
Merge pull request #6385 from GalaxyGorilla/bfd_igp_topotest
isis: tests: Fast RIB recovery from BFD recognized link failures
2020-07-08 14:38:09 -03:00
Mark Stapp
6b193087ca staticd,zebra: use ALLOW_RECURSION for static routes
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>
2020-07-07 13:14:01 -04:00
Kuldeep Kashyap
c39fe454e2 tests: Generate support bundle/dump data on tests failures
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>
2020-07-07 16:02:22 +00:00
Mark Stapp
3a298c75fd
Merge pull request #6685 from donaldsharp/fix_rare_ospf_test_failure
tests: Fix rare case in ospf tests due to small hello timer
2020-07-07 10:38:26 -04:00
Mark Stapp
58923d880f tests: fix short timeout in lib/bgp.py
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>
2020-07-07 08:25:01 -04:00
Donald Sharp
a2ab6fd8fa tests: Fix rare case in ospf tests due to small hello timer
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>
2020-07-07 07:36:54 -04:00
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
Donatas Abraitis
65f40ecdb5 tests: Improve bgp_aggregate-address_route-map test
Rewrite some parts to add more visibility what's going on if test fails.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-09-13 11:16:32 +03:00
Martin Winter
4e5441e749 tests: Disable bgp-ecmp-topo2 topotest until proper fix is developed
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-09-13 02:13:12 +02:00
Donald Sharp
963d10dfb0 tests: Add admin distance 255 static routes
Add a couple of test cases to ensure that admin distance of
255 actually causes the route to be accepted by zebra but
not installed into the linux kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-11 07:53:43 -04:00
Donald Sharp
bce69e3c54 tests: Fix topotests due to json error
Recent commit: 5fba22485b added a new topotest that used
an older version of FRR that referenced some json code
that was changed in between when the PR was submitted
and when it got in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-10 23:16:01 -04:00
Lou Berger
ccc13acc0f
Merge pull request #4866 from ton31337/feature/apply_route-map_for_aggregate-address
bgpd: Apply route-map for aggregate-address
2019-09-10 11:59:10 -04:00
Renato Westphal
635a039eef lib, zebra: rename LSP type used for OSPF SR
SR support for IS-IS is coming so we need to be able to distinguish
OSPF and IS-IS LSPs.

While here, add missing case statement for LDP on
lsp_type_from_re_type().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 21:06:11 -03:00
Renato Westphal
e29f8d0db3 tests: remove topotest compatibility with older ldpd versions
Now that topotest was integrated into the FRR repository, we
don't need to worry anymore about creating tests that work across
different FRR versions. The topotests present on any branch need
to be compatible only with the FRR daemons from that same branch.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 20:58:09 -03:00
Renato Westphal
a971aeb68e zebra: improve the output of "show mpls table"
Use the table generator to adjust the columns width according to
the table's content.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 20:54:59 -03:00
Stephen Worley
a4e6a2f808 topotests: Add libcap-dev to the Dockerfile
Add libcap-dev to the Dockerfile now that its a required depency.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-09-06 18:20:47 -04:00
Donald Sharp
dfff0ef449 tests: Ensure we wait 1 bgp timeout period before declaring failure
The lib/bgp.py test code is bringing up neighbors and clearing them
to test that things are working appropriately.  The problem we have
is that we are only waiting 30 seconds for declaration of failure.
In a high load system packets can be lost and as such the initial
convergence may not happen.  Modify the test to wait for 1 retry
window test period before declaring failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-06 08:46:27 -04:00
David Lamparter
0cf6db21ec *: frr_elevate_privs -> frr_with_privs
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-03 17:18:35 +02:00
Ashish Pant
c7d88b2d10 tests: Fix topojson address-family configuration
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

address-family configuration was commented out in earlier commit
by mistake. Re-enabling it now.
2019-09-03 09:42:30 +05:30
Ashish Pant
243daff303 tests: Fix topojson static route tests
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Fix static route test in bgp-basic-functionality-topo1 and
example-topojson-test after lib changes

Add example-topojson-test to ignore from pytest.ini
2019-09-03 07:22:33 +05:30
Ashish Pant
27d9695dd5 tests: Add ecmp test cases
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

Adds ecmp test case for ibgp and ebgp topology.
2019-09-03 07:22:22 +05:30
Stephen Worley
6d9effdf85 tests: Update Dockerfile to a valid libyang version
The built docker container was installing an old version of libyang.
Updated it to point to the most recent build for Debian.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-08-31 10:51:34 -04:00
Donald Sharp
955e2c3ec5 tests: Ensure topotests are actually waiting appropriately for peers to come up
The FRR bgp topotests are employing a luCommand that looks for bgp peering
to be up on the first router with a `wait` sub-command.  Please note that
a variety of tests are using this.  This wait command has a variety of time
outs being used `30`, `90`, and `300`.  BGP peering with how we compile
it have very long timers and 30( and possibly 90) seconds is clearly not enough when
we are waiting, given the nature of our test beds.  Additionally we were employing a model
where once the first summary command succeeded we automatically assumed that all
subsuquent summary commands( to look at other routers ) would not need to
possibly wait.  This is insufficient in that if I have multiple peerings in
multiple vrf's there is no guarantee that one router peers being up will
be sufficient information to know that all the other routers peers are up.

Modify the test cases to be a bit more conformant about this and to
allow peer checks to actually wait a reasonable amount of time for
all peers to have a chance to come up.

Signed-off-by: Donald Sharp <sharpdc@cumulusnetworks.com>
2019-08-29 09:33:47 -04:00
Donatas Abraitis
cf3b331d45
Merge pull request #4896 from donaldsharp/docker_dev_build
tests: Modify docker build for local to have dev build
2019-08-29 10:15:52 +03:00
Martin Winter
4298dfd12e
Merge pull request #4852 from ashish12pant/fix_log
tests: Enhance execution logs in topojson
2019-08-29 04:35:37 +02:00
Donald Sharp
1b7412c866 tests: Modify docker build for local to have dev build
Allow a local build of a frr docker container to be built with
`--enable-dev-build`.  This allows better decodes of symbols
which could be useful when you are trying to fix something
that is broken inside the docker container.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-28 15:50:23 -04:00
Donatas Abraitis
5fba22485b topotests: Add test for checking if route-map is applied for aggregate-address
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-08-28 16:45:44 +03:00
Dinesh G Dutt
5cb5f4d04d bgpd: Eliminate all incorrect formulations of afi/safi in JSON
In a number of places, the JSON output had invalid key names for
AFI/SAFI. For example, the key name in JSON was "IPv4 Unicast" which
is invalid as a JSON Key name. Many JSON tools such as those used in
Ansible, jq etc. all fail to parse the output in these scenarios. The
valid name is ipv4Unicast. There's already a routine afi_safi_json()
defined to handle this change, but it was not consistently called.
The non-JSON version was called afi_safi_print() and it merely returned
the CLI version of the string, didn't print anything.

This patch deals with this issue by:
   - Renaming afi_safi_print to get_afi_safi_str()
   - get_afi_safi_str takes an additional param, for_json which if true
     will return the JSON-valid string
   - Renaming afi_safi_json to get_afi_safi_json_str()
   - Creating a new routine get_afi_safi_vty_str() for printing to vty
   - Consistently using get_afi_safi_str() with the appropriate for_json
     value

Signed-off-by: Dinesh G Dutt <5016467+ddutt@users.noreply.github.com>
2019-08-27 14:05:39 +00:00
Ashish Pant
bca7983774 tests: Enhance execution logs in topojson
Signed-off-by: Ashish Pant <ashish12pant@gmail.com>

1. Add check if show running output is corrupted as frr-reload does
   not return cause of failure, just the error codes.
2. Change logger level to debug for some extra information.
3. Modify logger messages for more clear information.
4. Print configuration commands to console instead of show running
5. Print show command output to console.
6. Move show running output within flag show_router_config.
7. Add retry decorator for retyring show commands.
2019-08-22 16:24:45 +05:30
Donald Sharp
a7e52bd7b6 tests: Add a couple simple Null0 spelling tests
Add a bit of code to test different spelling of Null0 routes.
This was broken at some point in the past and with recent
changes is working again, but it would be nice to
know when this breaks again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-21 11:44:48 -04:00
Marcel Röthke
24b7eb485d bgpd: fix bgp_table range lookup
In case the topmost node has a larger prefix length than the lookup
prefix it never matches even if it was still lower than maxlen

This also alters a test case to check for this bug.

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
2019-08-16 16:42:11 +02:00
Sri Mohana Singamsetty
5acb534daf
Merge pull request #4802 from donaldsharp/static_blackhole
staticd: Fix blackhole routes being installed
2019-08-12 20:49:17 -07:00
Donald Sharp
76eb017923
Merge pull request #4497 from opensourcerouting/rcu
RCU support
2019-08-08 08:41:07 -04:00
Donald Sharp
a6e85307c3 staticd: Fix blackhole routes being installed
When we are ready to install a route, we were treating
blackhole routes as something that should be nexthop tracked
which does not work as well as one would expect.

Additionally add some test code to show that this actually
fixes this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-07 21:55:23 -04:00
Donald Sharp
3a738964ec
Merge pull request #4763 from opensourcerouting/ds-work
lib: get rid of pqueue_*, use DECLARE_HEAP in thread.c
2019-08-07 16:45:02 -04:00
Quentin Young
3c1c172f02
Merge pull request #4790 from opensourcerouting/ctype-cast
*: fix ctype casts
2019-08-06 13:21:13 -04:00
David Lamparter
fefa5e0ff5 *: fix ctype (isalpha & co.) casts
The correct cast for these is (unsigned char), because "char" could be
signed and thus have some negative value.  isalpha & co. expect an int
arg that is positive, i.e. 0-255.  So we need to cast to (unsigned char)
when calling any of these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-08-06 16:54:52 +02:00
Igor Ryzhov
c7975431e6 all: remove logical-router functionality
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2019-08-02 17:10:11 +03:00
Sri Mohana Singamsetty
b7655d8476
Merge pull request #4713 from ton31337/fix/set_comm-list_delete_into_config_memcpy
bgpd: Strip `delete` keyword when looking up for communities
2019-08-01 21:19:43 -07:00
David Lamparter
b21ea71ea9
Merge pull request #4758 from donaldsharp/test_epoch
tests: Do not use peerUptime as a measure of if a clear worked
2019-08-01 17:07:43 +02:00
David Lamparter
77faa5bd79 lib: remove pqueue_* (again)
All users of the pqueue_* implementations have been migrated to use
some new data structure (TYPEDSKIP for ospf, HEAP for thread.c).

Remove.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-08-01 17:02:53 +02:00
Donald Sharp
abdb6bcebd tests: Do not use peerUptime as a measure of if a clear worked
The peerUptime data received from a `show bgp ipv4 uni summ json`
gives you the time in seconds since the peer has come up.
The clear_bgp_and_verify function is checking the peerUptime
for before and after and if they are the same then the test
was declaring a clear failure.

The problem with this is of course that the tests can run fast
enough that the peerUptime is the same for before and after the clear.

Modify the test case to use peerUptimeEstablishedEpoch.
This value is the seconds since the epoch since the establishment
of the peer.  This will allow us to know that a clear happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-31 12:33:55 -04:00
Stephen Worley
7de7c75b29 tests: Add asserts to check return on list *_del
Add some asserts where `list_del()` is called to verify they object
was found when it was deleted.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-07-31 11:35:21 -04:00
David Lamparter
6046b690b5 lib/seqlock: avoid syscalls in no-waiter cases
When we have no contention on the seqlock, we shouldn't incur the cost
of syscalls.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-07-31 03:33:41 +02:00
Donald Sharp
42fc558ee3 zebra, tests: Remove ROUTE_ENTRY_NEXTHOPS_CHANGED
The flag ROUTE_ENTRY_NEXTHOPS_CHANGED is only ever set or unset.
Since this flag is not used for anything useful, remove from system.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes the compilation of the gRPC northbound module.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

sonic# show bgp ipv6 summary

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

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

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

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

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

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

Total number of neighbors 3
sonic#

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-16 20:47:30 -05:00
Donald Sharp
cc95fbd9ff topotests: Start abstraction of module_present for other platforms
Start abstraction of the module_present into module_present_linux and freebsd
To allow for multiple platforms that the topotests can be run on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-15 10:54:11 -05:00
Donald Sharp
af99f19eb2 topotests: Cleanup diagnose_env to allow thought about multi-platforms
Start the cleanup of diagnose_env to allow the running of topotests
on platforms besides linux.

So we split up diagnose_env into linux and freebsd variants.
At this point in time freebsd doesn't have any special code.
To be determined in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-15 10:49:59 -05:00
Donald Sharp
b7822d2016 topotests: Add a basic route leak vrf test
A recent commit broke this functionality, so add a very basic
route leak vrf test.

router bgp 99 vrf DONNA
  address-family ipv4 uni
    redistribute connected
    import vrf EVA
router bgp 99 vrf EVA
  address-family ipv4 uni
    redistribute connected
    import vrf DONNA

Routes should be leaked between the two vrf's.  Ensure that it does.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-12-12 13:37:46 +01:00
Christian Franke
cffe9e34de tests/topotests: Pull docker image from registry
We have set up automated builds for the topotest images at dockerhub.
Therefore, people don't need to perform a local build to run the
topotests on docker, but can use the image built by dockerhub.

As there is not much benefit in building locally, but the disadvantage
of weird errors if using an outdated image, change the topotests target
to always pull the most recent image from dockerhub.

Add an environment variable to disable this, e.g. for local development.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-10 18:01:34 +01:00
Renato Westphal
99fb518fef lib, tests: add support for keyless YANG lists
YANG allows lists without keys for operational data, in which case
the list elements are uniquely identified using a positional index
(starting from one).

This commit does the following:
* Remove the need to implement the 'get_keys' and 'lookup_entry'
  callbacks for keyless lists.
* Extend nb_oper_data_iter_list() so that it special-cases keyless
  lists appropriately. Since both the CLI and the sysrepo plugin
  use nb_oper_data_iterate() to fetch operational data, both these
  northbound clients automatically gain the ability to understand
  keyless lists without additional changes.
* Extend the confd plugin to special-case keyless lists as well. This
  was a bit painful to implement given ConfD's clumsy API, but
  keyless lists should work ok now.
* Update the "test_oper_data" unit test to test keyless YANG lists in
  addition to regular lists.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-09 13:58:53 -02:00
Donald Sharp
debaa48ba6
Merge pull request #3452 from opensourcerouting/reprobuild-master
[master] build reproducibility
2018-12-09 09:36:24 -05:00
Donald Sharp
64b81b3a64
Merge pull request #3442 from opensourcerouting/confirmed-commits
lib: add support for confirmed commits
2018-12-09 09:35:49 -05:00
Donald Sharp
290e0a7b41
Merge pull request #3420 from LabNConsulting/working/master/topotest/ce4-in-vrf
Topotest: put ce4 into vrf (no default), plus a couple of lib changes
2018-12-08 13:43:01 -05:00
Lou Berger
43c2c66bdf topotest: bgp_l3vpn_to_bgp_vrf put ce4 into vrf (without a default)
Signed-off-by: Lou Berger <lberger@labn.net>
2018-12-08 10:43:44 -05:00
Lou Berger
90892d35e1 topotests/lib: help script writers understand wrong VRF failure
Signed-off-by: Lou Berger <lberger@labn.net>
2018-12-08 10:43:31 -05:00
Lou Berger
8cd7c744df topotest: remove sleep on staticd startup
Signed-off-by: Lou Berger <lberger@labn.net>
2018-12-08 10:42:21 -05:00
David Lamparter
e4cdd7ccc5 tests: fix domainname dependency
These are causing random test failures when the host's domainname is
actually set to something (as opposed to empty/unset, which it is 99% of
times.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-12-07 19:34:45 +01:00
Renato Westphal
fbdc1c0a84 lib: add support for confirmed commits
Confirmed commits allow the user to request an automatic rollback to
the previous configuration if the commit operation is not confirmed
within a number of minutes. This is particularly useful when the user
is accessing the CLI through the network (e.g. using SSH) and any
configuration change might cause an unexpected loss of connectivity
between the user and the managed device (e.g. misconfiguration of a
routing protocol). By using a confirmed commit, the user can rest
assured the connectivity will be restored after the given timeout
expires, avoiding the need to access the router physically to fix
the problem.

When "commit confirmed TIMEOUT" is used, a new "commit" command is
expected to confirm the previous commit before the given timeout
expires. If "commit confirmed TIMEOUT" is used while there's already
a confirmed-commit in progress, the confirmed-commit timeout is
reset to the new value.

In the current implementation, if other users perform commits while
there's a confirmed-commit in progress, all commits are rolled back
when the confirmed-commit timeout expires. It's recommended to use
the "configure exclusive" configuration mode to prevent unexpected
outcomes when using confirmed commits.

When an user exits from the configuration mode while there's a
confirmed-commit in progress, the commit is automatically rolled
back and the user is notified about it. In the future we might
want to prompt the user if he or she really wants to exit from the
configuration mode when there's a pending confirmed commit.

Needless to say, confirmed commit only work for configuration
commands converted to the new northbound model. vtysh support will
be implemented at a later time.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2018-12-07 11:11:33 -02:00
Donald Sharp
29dfc63cbf
Merge pull request #3437 from opensourcerouting/bugfix/topotests-use-copy
tests/topotests: Use copied tests in Docker
2018-12-06 19:31:26 -05:00
Christian Franke
464e85c84d tests/topotests: Also search sbin for modprobe
We call `modprobe -n` to check if mpls modules are available to be
loaded. We do this as normal user, to only ask for root permissions
if we are actually loading the module.

This breaks if `modprobe` is in `/sbin` and normal users don't have
sbin in path.

So add `/sbin` to the search path to work around this.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-06 18:33:21 +01:00
Christian Franke
ebdaa9ce5f tests/topotests: Use copied tests in Docker
If we mount the tests into the container from the host, we also
mount any `*.pyc` files with them, which will lead to issues
as the mount is done read-only to avoid any changes to the host.

Since the tests are now integrated and we already create a writeable
copy of the FRR tree, just use the tests from the FRR tree to avoid
this issue.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-06 15:30:03 +01:00
Ameya Dharkar
436df704e4 bgp: new topotest BGP templates to display default local preference and local-AS in BGP commands
This commit adds a template for "show bgp ipv4/ipv6" display to include default local preference and local-AS O/P.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
2018-12-05 11:45:31 -08:00
Olivier Dugeon
5898044382
Merge pull request #3174 from opensourcerouting/feature/isis-triggered-hello
Feature: IS-IS triggered hello
2018-12-04 18:33:36 +01:00
Christian Franke
7fe06d5559 topotests: Update json_cmp_result to return readable result
Before this update, json_cmp_results which were formatted as strings
would not show the error mesage but just an object reference.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 16:13:58 +01:00
Christian Franke
32bc1eafb6 topotests/isis-topo1: Set useful IS-IS debugs
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-04 16:13:50 +01:00
Christian Franke
54b60cf9b0 Revert "tests/topotests: Change docker build context"
This reverts commit 659782730b.

Apparently, the build context is inferred from the Dockerfile path.
Yay for sensible documentation. :/

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-01 19:40:49 +01:00
Christian Franke
ecd2f14c47 tests/topotests: Set -o cache_dir=/tmp
We are mounting the topotests from the host into the container
and mark them as read-only to avoid any modifications to the host.

Pytest tries to create a .pytest_chache directory in that location
which fails because of the read-only mount.

Configure a different cache dir which is writable to resolve this.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-01 17:16:01 +01:00
Christian Franke
659782730b tests/topotests: Change docker build context
In order to support automated builds, the build context needs to be
the repository root.

So adapt our dockerfile and buildscript for this. Also, add files which
should not be included into the build context in .dockerignore to limit
the size of the build context to something sensible.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-01 16:54:58 +01:00
Christian Franke
b25e517b61 tests/topotests: Update documentation
The documentation needs an update to match the integrated version.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-12-01 16:33:34 +01:00
Donald Sharp
d9d759ff7e
Merge pull request #3396 from opensourcerouting/feature/topotests-docker
feature: docker image for topotests
2018-11-30 15:39:50 -05:00
Russ White
9f7b49e105
Merge pull request #3342 from opensourcerouting/nb-operational-data
Northbound: improved support for YANG-modeled operational data
2018-11-29 15:19:38 -05:00
Christian Franke
5f1ac6d669 topotests: Only set -t when input is a terminal
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
ff37641ba2 topotests: Adapt docker changes for integrated tests
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
f509ad9785 docker/frr-topotests: Fix missing $ in if check
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
937e5dab6a docker/compile_frr: Don't build with disable shared
With libyang, we need to build the frr_user_types.so libyang
plugin for FRR to work.

This means we cannot build with disable shared.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
9b5470a843 docker: Improve README and frr-topotests usage
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
7996f1975d Dockerfile: Install libyang
Recent versions of FRR require libyang to build. So install it from
the FRR CI servers.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
6926d304a8 Docker: Fail if compilation is unsucessful
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
877d4e3642 Docker: Document additional environment variables
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
4242d6e2ae Docker: Use pytest as default command
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
31eae3e3b0 Docker: move openvswitch setup to separate script
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
3311145d70 Docker: Allow executing topotests while in subdir of FRR repo
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
1ab13617bf Docker: really cleanup when TOPOTEST_CLEAN is specified
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
f1c0836f67 Docker: Update buildscript not to delete old images
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
d9e887de2a Docker: Call the run script frr-topotests.sh
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
8e6f0d80f6 Dockerfile: Use iputils-ping instead of inetutils-ping, install strace
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
7b75f8cce3 Docker: Update buildscripts to be more efficient
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
ca64604f47 docker: Install topotests into image
Also: Change directory layout so we can do an indempotent sync from host
later.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
04c63c05b5 docker: reindent shell scripts
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
c12ec8557e docker: Run container with its own network namespace
For normal operation, there is no need for the container to run
in the host network environment or to have access to the users
X Session.

To accomodate usecases which need this, there is now a `TOPOTEST_OPTIONS`
environment variable to provide additional options to the docker run
command.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Christian Franke
e425ee6357 Dockerfile: Move to project root and combine RUNs
According to https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
`apt-get update` should always be combined with `apt-get install` in
the same `RUN` statement, to avoid installation of outdated packages.

Also, combine some more `RUN`s together as to avoid fewer layers.

Finally, remove some comments which are superflous. Comments shouldn't
describe what is done, especially when it's obvious. They should
explain why something is done.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Rafael Zalamena
1e9c095c6f docker: add support for running inside container
Based on the original @cfra idea of running topotest on docker.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-29 16:51:27 +01:00
Donald Sharp
096694da47 topotests: Add ospf-sr-topo1 back in
Due to weird merge issues ospf-sr-topo1 was not pulled in.
This gets this back into the tree.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2018-11-27 20:22:14 -05:00
Donald Sharp
d21321142a Add a tiny breadcrumb to hopefully help end user
Add a breadcrumb for people testing to hopefully allow
them to figure out what is going wrong when they
are testing different versions of FRR using
topotests and staticd is not running because
this version of staticd needs to be cleaned up

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
b941f9587f bgp-ecmp-topo1: fix some pylint warnings
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
47bbb80ad2 bgp-ecmp-topo1: fix vrf default change
Python's `string' method 'replace' doesn't actually modify the string,
instead it returns a new string with the modified content.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Philippe Guibert
f847adaf8f bgp-ecmp-topo1: change default vrf name
By default, default vrf name is default, whereas BGP default vrf was
hardcoded to Default. Because this will be fixes, do not care about the
vrf name field and apply a regexp to move Default to default.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Christian Franke
940e6a5f9e ospf6-topo1: Don't compare link-local routes
Topotests would fail with errors like these:

    AssertionError: Linux Kernel IPv6 Routing Table verification failed for router r1:
      --- actual OSPFv3 IPv6 routing table
      +++ expected OSPFv3 IPv6 routing table
      @@ -8,6 +8,6 @@
       fc00:4:4:4::/64 via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
       fc00🅰️a🅰️:/64 dev r1-sw5 proto XXXX metric 256 pref medium
       fc00🅱️b🅱️:/64 via fe80::__(r3-sw5)__ dev r1-sw5 proto XXXX metric 20 pref medium
      -fe80::/64 dev lo proto XXXX metric 256 pref medium
       fe80::/64 dev r1-stubnet proto XXXX metric 256 pref medium
      -fe80::/64 dev r1-sw5 proto XXXX metric 256 pref medium
      +fe80::/64 dev r1-sw5 proto XXXX metric 256 pref medium
      +unreachable fe80::/64 dev lo proto XXXX metric 256 error -101 pref medium

Resolve this by not comparing link-local routes.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
paco
86c21ac7fc lib, lm-proxy-topo1: label manager proxy test
Label proxy manager test covering both LDP and BGP label requests.

lib/topotest.py:restartRouter() function has been fixed in order to
allow propagating options to deamons other than zebra.

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-11-27 20:22:14 -05:00
Martin Winter
fa2adbc528 pick ospf6 router-id syntax based on version
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Martin Winter
6bfe4b8bfc lib: checkRouterVersion to determine version
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Donald Sharp
9ac2326ed0 Clean up deprecated usage of router-id
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
bd170de3b6 bfd-topo1: import topology picture
Import the graphviz file and the generated picture.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
14bb9445d6 bfd-topo1: add fast reconvergence test
Test that after a link goes down BGPd will be notified and recovered
quickly. Also test that BFD show command tells us that the peer went
down.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
843713317d bfd-topo1: add convergence tests
Test if BFD peers have found each other and if the BGP neighors have
connected.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
4d45d6d3b0 topogen/topotest: add support for BFDd
Allow BFDd to be configured and used.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Lou Berger
d1f4560e7d bgp_rfapi_basic_sanity_config2: allow for slow CI
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
9a75228916 bgp_rfapi_basic_sanity_config2: added rfapi test with partial table download This is identical to bgp_rfapi_basic_sanity with the exception of non-default config
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
7a9a953d7e bgp_rfapi_basic_sanity: added query only NVE
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Martin Winter
2f726781b6 lib: Add support for Ubuntu 18.04 with installed FRR package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Lou Berger
16872f5683 bgp_rfapi_basic_sanity: added multi-path to timeout test
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
1677325096 bgp_rfapi_basic_sanity: added cost to 2nd MP route
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
4ce7be6957 bgp_rfapi_basic_sanity: added multi-path and updated responses
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
d12ac2a975 bgp_rfapi_basic_sanity: wait for clean exit
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
914d749d8a bgp_rfapi_basic_sanity: added check_timeout (uses FRR PR#2934)
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
a73fb016ff bgp_rfapi_basic_sanity: added close check
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
ccabd61819 bgp_rfapi_basic_sanity: address PR comments (copyright, switch)
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
197d4fdad4 bgp_rfapi_basic_sanity: added basic rfapi sanity topotest
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
0eff58207e lib: fix ip4_route_zebra header removal code
The `strip` function is actually a method of the String object.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Christian Franke
41077aa191 lib/ospf-topo1-vrf: don't compare headers of show ip route
Signed-off-by: Christian Franke <nobody@nowhere.ws>
2018-11-27 20:22:14 -05:00
Donald Sharp
a93eb16a51 lib: Always attempt to set mpls platform_labels
The code was not attempting to set the max platform_labels
on a per router basis, leaving us w/ situations where
mpls install would fail because platform_labels was 0.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
9aecc71d53 ospf-topo1-vrf: show errors and reduce code
Use standardized code and fix assert messages to include errors.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Quentin Young
dadd89e672 update ref file for cidr mask display
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-11-27 20:22:14 -05:00
Lou Berger
c49edeb452 bgp_l3vpn_to_bgp_vrf: allow for long adjancies, seen with l3mdev_accept=1
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
a945bf0777 bgp_l3vpn_to_bgp_vrf: ignore output of sysctl, reenables test!
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Lou Berger
af01532c45 lib: speedup test exit when startup fails
Signed-off-by: Lou Berger <lberger@labn.net>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
96984a17a5 ldp-vpls-topo1: remove duplicated code and sleep
Use the new standardized code for router output compare and remove a
code sleep.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00
Philippe Guibert
224737467e ospf-topo1-vrf: replace link_enable api with zebra topotest api
Because on some platforms like i386, 'ip netns ' commands are unstable,
then I use an other API to operate the shutdown/no shutdown operation by
using vtysh.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Philippe Guibert
f561216813 lib: add zebra api to shutdown an interface
this function operates on vtysh, and performs a shutdown on an
interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Philippe Guibert
918138769c ospf-topo1-vrf: replace ip_route method with ip_route_zebra
To analyse which route has been entered in the kernel, the
 zebra show ip route vrf command is used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Philippe Guibert
b220b3c83a lib: add ip_route_zebra function
This command permits dumping zebra routes from a vrf

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Philippe Guibert
35490676eb ospf-topo1-vrf: setup with OSPF VRF
OSPF test with VRF backend NETNS

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Philippe Guibert
0ab7733f7f lib: topogen support for link_enable on other netns
In the case where vrf backend is based on NETNS, the link enable command
switches from context so as to perform the command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-11-27 20:22:14 -05:00
Rafael Zalamena
e3060696ef bgp_vrf_netns: reduce code duplication
Use new standardized functions to reduce code duplication.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-11-27 20:22:14 -05:00