Commit Graph

2224 Commits

Author SHA1 Message Date
Donald Sharp
d64162ce84
Merge pull request #8210 from LabNConsulting/chopps/always-batch
northbound: KISS always batch yang config, it's faster.
2021-06-02 18:13:42 -04:00
Hiroki Shirokura
c60c1ade86 *: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*
https://github.com/FRRouting/frr/pull/5865#discussion_r597670225

As this comment says. ZEBRA_FLAG_XXX should not have been used.
To communicate SRv6 Route Information. A simple Nexthop Flag would
have been sufficient for SRv6 information. And I fixed the whole
thing that way.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
e2a5888d7c tests: update sharpd srv6 route command
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
a2df1e4f9a sharpd: follow the practice on cli design for json output
The "show sharp segment-routing srv6" command was a
json output command, but it did not follow the common
practice of the other commands.

It follows the review and outputs the json format by
using the json keyword. Otherwise, it produces human
readable output.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
04d43dbd02 tests: fix json style on srv6_locator test
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
7c653fc53e topotests: bgp_srv6l3vpn_to_bgp_vrf (step4)
Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
b83127e156 bgpd: fix prefix-sid crash bug and add topotest (step4)
This commit fix bgpd's prefix-sid type4,5 feature which has
miss implementation from https://github.com/FRRouting/frr/pull/5653
was merged. Due to some nessesary lines are not presented.

When bgpd receives multi update message with same service-sid on
prefix-sid type-5 attribute, bgpd will crash arround path-attribute's
values object reference count.

And also, this commit add a topotest to check that feature work fine.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
c5a044e055 topotests: for zapi's seg6 route configuration (step3)
This commit checks seg6 route configuration via ZAPI is
working fine.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:48 -04:00
Hiroki Shirokura
96d423f7c9 topotests: keep srv6-locator feature fine (step2)
This commit is a part of #5853 works.
This commit add new topotest to verify SRv6-manager's functionality.
Following tests are performed on this topotest.

- check that SRv6-locator is set correctly
- check that default SRv6-function locator is set correctly
- check that SRv6-function is installed as ipv6 route correctly

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:47 -04:00
Hiroki Shirokura
0adde13a58 topotests: for zapi's seg6local route configuration (step1)
This commit checks seg6local route configuration via ZAPI is
working fine.

SRv6 feature is little young feature as kernel feature so netlink
interface may be changed/updated in the future. And this ZAPI extention
is something to support new routing paradigm, so it should be checked by
topotests until srv6 feature of linux kernel will be well stable.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
2021-06-02 10:24:47 -04:00
Christian Hopps
fd396924d6 northbound: KISS always batch yang config (file read), it's faster
The backoff code assumed that yang operations always completed quickly.
It checked for > 100 YANG modeled commands happening in under 1 second
to enable batching. If 100 yang modeled commands always take longer than
1 second batching is never enabled. This is the exact opposite of what
we want to happen since batching speeds the operations up.

Here are the results for libyang2 code without and with batching.

| action        |  1K rts |  2K rts | 1K rts | 2K rts | 20k rts |
|               | nobatch | nobatch |  batch |  batch |   batch |
| Add IPv4      |    .881 |    1.28 |   .703 |   1.04 |    8.16 |
| Add Same IPv4 |    28.7 |     113 |   .590 |   .860 |    6.09 |
| Rem 1/2 IPv4  |    .376 |    .442 |   .379 |   .435 |    1.44 |
| Add Same IPv4 |    28.7 |     113 |   .576 |   .841 |    6.02 |
| Rem All IPv4  |    17.4 |    71.8 |   .559 |   .813 |    5.57 |

(IPv6 numbers are basically the same as iPv4, a couple percent slower)

Clearly we need this. Please note the growth (1K to 2K) w/o batching is
non-linear and 100 times slower than batched.

Notes on code: The use of the new `nb_cli_apply_changes_clear_pending`
is to commit any pending changes (including the current one). This is
done when the code would not correctly handle a single diff that
included the current changes with possible following changes. For
example, a "no" command followed by a new value to replace it would be
merged into a change, and the code would not deal well with that. A good
example of this is BGP neighbor peer-group changing. The other use is
after entering a router level (e.g., "router bgp") where the follow-on
command handlers expect that router object to now exists. The code
eventually needs to be cleaned up to not fail in these cases, but that
is for future NB cleanup.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-06-02 14:05:26 +00:00
Rafael Zalamena
d532d1092e
Merge pull request #8644 from idryzhov/fix-vrf-bind
lib: fix binding to a vrf
2021-06-02 10:47:10 -03:00
Russ White
3d7bd27619
Merge pull request #8683 from kuldeepkash/bgp_gshut
tests: Add bgp_gshut_topo1 test suite
2021-06-01 11:43:48 -04:00
Donatas Abraitis
2cdd73387c
Merge pull request #8698 from donaldsharp/pim_black_tests
tests: Fixup some pylint warnings in test_multicast_pim_sm_topo2.py
2021-06-01 09:41:04 +03:00
Igor Ryzhov
60070c3d02 tests: remove tcp_l3mdev_accept setting
This is not necessary anymore with fixed `vrf_bind`.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-31 22:12:55 +03:00
Igor Ryzhov
36eef8586d lib: fix binding to a vrf
There are two possible use-cases for the `vrf_bind` function:
- bind socket to an interface in a vrf
- bind socket to a vrf device

For the former case, there's one problem - success is returned when the
interface is not found. In that case, the socket is left unbound without
throwing an error.

For the latter case, there are multiple possible problems:
- If the name is not set, then the socket is left unbound (zebra, vrrp).
- If the name is "default" and there's an interface with that name in the
  default VRF, then the socket is bound to that interface.
- In most daemons, if the router is configured before the VRF is actually
  created, we're trying to open and bind the socket right after the
  daemon receives a VRF registration from zebra. We may not receive the
  VRF-interface registration from zebra yet at that point. Therefore,
  `if_lookup_by_name` fails, and the socket is left unbound.

This commit fixes all the issues and updates the function description.

Suggested-by: Pat Ruddy <pat@voltanet.io>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-31 22:12:55 +03:00
Louis Scalbert
8c1d4cd512 bgpd: add show bgp summary filter by neighbor or AS
Add ability to filter session on show bgp summary by neighbor or
remote AS:

ubuntu# show bgp summary ?
  neighbor     Show only the specified neighbor session
  remote-as    Show only the specified remote AS session
ubuntu# show bgp summary neighbor ?
  A.B.C.D   Neighbor to display information about
  WORD      Neighbor on BGP configured interface
  X:X::X:X  Neighbor to display information about
ubuntu# show bgp summary remote-as ?
  (1-4294967295)  AS number
  external        External (eBGP) AS sessions
  internal        Internal (iBGP) AS sessions

This patch includes the documentation and the topotest.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2021-05-26 16:16:08 +02:00
Mark Stapp
2d3eb91699
Merge pull request #8498 from ton31337/feature/opaque_data_void_zebra
Zebra OPAQUE data from other daemons stuff
2021-05-24 07:48:02 -04:00
Donatas Abraitis
99447cf226
Merge pull request #8705 from donaldsharp/ospf_sr_topo1_speedup
tests: Speedup ospf_sr_topo1 by over 100 seconds
2021-05-21 14:30:34 +03:00
Donald Sharp
2db528e384
Merge pull request #8701 from ton31337/feature/show_ip_bgp_alias
bgpd: Show BGP prefixes by community alias
2021-05-21 07:23:10 -04:00
Donatas Abraitis
a418752d47
Merge pull request #8662 from idryzhov/fix-check-linux-vrf
tests: fix bgp_l3vpn_to_bgp_vrf
2021-05-21 10:03:21 +03:00
Donald Sharp
21967e4e82
Merge pull request #8628 from idryzhov/isis-vrf-redist
isisd: fix redistribution in vrf
2021-05-20 09:00:46 -04:00
Donald Sharp
bd7fb46e5b tests: Speedup ospf_sr_topo1 by over 100 seconds
Add some basic timer operations to speed up convergence.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-19 16:01:01 -04:00
Donald Sharp
8863a71845
Merge pull request #8684 from kuldeepkash/multicast-sm-topo1
tests: Fix for multicast_pim_sm test failure
2021-05-19 14:28:48 -04:00
Donatas Abraitis
b15be1605a tests: Show BGP prefixes by community alias
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-19 18:11:39 +03:00
Donald Sharp
8a2b922c34 tests: Fixup some pylint warnings in test_multicast_pim_sm_topo2.py
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-19 08:04:50 -04:00
nguggarigoud
bcce695415 tests : Adding 2 ospf asbr summary testcases.
Test suite execution time is ~1 minutes.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:52:54 -07:00
nguggarigoud
8694dd78db tests: adding ospf basic 2 testcases.
Test cases included are 1 ospf cost, 1 ospf mtu.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:23:15 -07:00
Kuldeep Kashyap
f0cbb887f1 tests: Fix for multicast_pim_sm failure
Test case test_verify_mroute_when_5_different_receiver_joining_same_sources_p0
is failing intermittently in master. Fixed the issue.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-05-17 18:52:55 -07:00
Kuldeep Kashyap
ba00df52eb tests: Add bgp_gshut_topo1 suite
1. Automated test cases to verify BGP Graceful Shutdown community functionality,
   with 2 different topologies.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-05-17 17:49:10 -07:00
Igor Ryzhov
d769bde5be tests: fix missing gitignore entry
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-17 13:01:55 +03:00
Donatas Abraitis
1ebc214ea6 tests: Check if opaque data from BGP is accessable in Zebra
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-14 22:12:33 +03:00
Igor Ryzhov
5cfffcdd8d isisd: fix dangling instances
We only need an instance when we have at least one area configured in a
VRF. Currently we have the following issues:
- instance for the default VRF is always created
- instance is not removed after the last area config is removed

This commit fixes both issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:38 +03:00
Igor Ryzhov
8c6482db8c isisd: fix redistribution in vrf
When the redistribution is configured in non-default VRF, isisd should
redistribute routes from this VRF instead of default.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:35 +03:00
Russ White
a63273a5b4
Merge pull request #8556 from donaldsharp/bgp_pbr_weird
Bgp flowspec cleanups
2021-05-13 23:14:34 -04:00
Martin Winter
d8baf3db2d
Merge pull request #8144 from LabNConsulting/chopps/ly2
libyang2
2021-05-14 01:12:06 +02:00
Christian Hopps
3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
Donald Sharp
16a8eb4d00
Merge pull request #8649 from ton31337/fix/unify-naming-for-topotests-directory
tests: Rename tests/topotests directories to be consistent
2021-05-13 07:26:15 -04:00
Igor Ryzhov
440daf95fd tests: fix bgp_l3vpn_to_bgp_vrf
Too many arguments for format string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-12 18:55:40 +03:00
Donald Sharp
21ef301cad tests: Add pytestmark to the flowspec topotest
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:33:08 -04:00
Donald Sharp
b8bd26ad12 tests: Fix pylint issues in test_bgp_recursive_route_ebgp_multi_hop.py
Tests had format for strings with 2 variables but 1 place to put the data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-12 07:30:47 -04:00
Olivier Dugeon
31db7fc227
Merge pull request #8509 from volta-networks/pathd_ls_client
pathd: Traffic Engineering Database support
2021-05-12 09:42:56 +02:00
Donatas Abraitis
93a3eae793 tests: Skip example_topojson_test and example_test from being tested
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-12 09:00:30 +03:00
Donatas Abraitis
764b81858f tests: Unify directory naming for topotests
Change every `-` to `_` in directory names. This is to avoid mixing _ and -.

Just for consistency and directory sorting properly.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-11 14:14:26 +03:00
Javier Garcia
f008db919d pathd. TED support . Topotest - [part 3/4]
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-10 15:25:13 +02:00
David Lamparter
3b20069fd6
Merge pull request #8648 from idryzhov/fix-test-assert
tests: fix build warning
2021-05-10 12:52:21 +02:00
David Lamparter
83f5d2581a
Merge pull request #8441 from mjstapp/fix_topo_pylint1 2021-05-09 19:48:33 +02:00
David Lamparter
2ab691e6c0
Merge pull request #8626 from idryzhov/fix-isis-topo1
tests: fix isis-topo1 topologies
2021-05-09 19:46:01 +02:00
David Lamparter
de10458d6e
Merge pull request #8380 from mjstapp/nexthop_cmp_basic 2021-05-09 19:29:45 +02:00
David Lamparter
b4a0d49a68
Merge pull request #8640 from pjdruddy/fix-bgp-auth-key-error
tests: fix intermittent key error in bgp-auth topotest
2021-05-09 19:22:55 +02:00
Igor Ryzhov
f3d2d1e0be tests: fix build warning
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-09 18:23:43 +03:00
Quentin Young
556beacf10 bgpd: rework BGP_MAX_PACKET_SIZE & friends
BGP_MAX_PACKET_SIZE no longer represented the absolute maximum BGP
packet size as it did before, instead it was defined as 4096 bytes,
which is the maximum unless extended message capability is negotiated,
in which case the maximum goes to 65k.

That introduced at least one bug - last_reset_cause was undersized for
extended messages, and when sending an extended message > 4096 bytes
back to a peer as part of NOTIFY data would trigger a bounds check
assert.

This patch redefines the macro to restore its previous meaning,
introduces a new macro - BGP_STANDARD_MESSAGE_MAX_PACKET_SIZE - to
represent the 4096 byte size, and renames the extended size to
BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE for consistency. Code locations
that definitely should use the small size have been updated, locations
that semantically always need whatever the max is, no matter what that
is, use BGP_MAX_PACKET_SIZE.

BGP_EXTENDED_MESSAGE_MAX_PACKET_SIZE should only be used as a constant
when storing what the negotiated max size is for use at runtime and to
define BGP_MAX_PACKET_SIZE. Unless there is a future standard that
introduces a third valid size it should not be used for any other
purpose.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-05-06 11:54:02 -04:00
Pat Ruddy
650e0d1bb8 tests: fix intermittent key error in bgp-auth topotest
There is a rare case where with prefix peers the peer is
completely absent from the json output when checking the
peer state resulting in a python key error. Check key exists
before checking the state.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-05-06 14:36:52 +01:00
Rafael Zalamena
4478793c43
Merge pull request #8636 from idryzhov/ospfv3-vrf-support
OSPFv3 VRF support
2021-05-06 08:50:32 -03:00
Donald Sharp
dd82f72543
Merge pull request #8497 from ton31337/feature/bgp_community_alias
bgpd: Create BGP alias names for community/large-community
2021-05-06 06:07:07 -04:00
harios_niral
0681195e86 tests: add topotest for ospf6d vrf support
Co-authored-by: Kaushik Nath <kaushiknath.null@gmail.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
2021-05-06 10:54:31 +03:00
Donald Sharp
c41e4b45e7
Merge pull request #8598 from idryzhov/fix-topotest-bgp-auth
tests: fix bgp-auth topotest
2021-05-05 11:17:37 -04:00
Donatas Abraitis
b820f3d0a3 tests: Check if bgp community alias NAME ALIAS commands works
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-05 16:37:01 +03:00
Donatas Abraitis
48c2039199
Merge pull request #8564 from rameshabhinay/bgp_tcp_mss
bgpd: Support tcp-mss for bgp neighbors
2021-05-05 13:45:39 +03:00
Igor Ryzhov
3adfae9613 tests: fix isis-topo1 topologies
parse_topology function doesn't correctly process vertex types with
spaces. Therefore the reference topology files are completely messed up,
we have values in incorrect fields - types in metrics, metrics in
parents, etc.

This commit fixes the parsing function and the reference files.

The same fix was done for isis-topo1-vrf in #8365.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-05 12:26:38 +03:00
Mark Stapp
403e26cd03 tests: add unit test for nexthop comparisons
Add a nexthop unit test module, just exercising the 'basic'
comparison api for now.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-05-04 15:51:01 -04:00
Abhinay Ramesh
4ab467017e bgpd: Support tcp-mss for bgp neighbors
Problem Statement:
=================
In scale setup BGP sessions start flapping.

RCA:
====
In virtualized environment there are multiple places where
MTU need to be set. If there are some places were MTU is not set
properly then there is chances that BGP packets get fragmented,
in scale setup this will lead to BGP session flap.

Fix:
====
A new tcp option is provided as part of this implementation,
which can be configured per neighbor and helps to set the TCP
max segment size. User need to derive the path MTU between the BGP
neighbors and set that value as part of tcp-mss setting.

1. CLI Configuration:
	[no] neighbor <A.B.C.D|X:X::X:X|WORD> tcp-mss (1-65535)

2. Running config
    frr# show running-config
    router bgp 100
     neighbor 198.51.100.2 tcp-mss 150       => new entry
     neighbor 2001:DB8::2 tcp-mss 400        => new entry

3. Show command
    frr# show bgp neighbors 198.51.100.2
    BGP neighbor is 198.51.100.2, remote AS 100, local AS 100, internal link
    Hostname: frr
      Configured tcp-mss is 150, synced tcp-mss is 138     => new display

4. Show command json output

    frr# show bgp neighbors 2001:DB8::2 json
    {
      "2001:DB8::2":{
        "remoteAs":100,
        "bgpTimerKeepAliveIntervalMsecs":60000,
        "bgpTcpMssConfigured":400,                               => new entry
        "bgpTcpMssSynced":388,                                  => new entry

Risk:
=====
Low - This is a config driven feature and it sets the max segment
size for the TCP session between BGP peers.

Tests Executed:
===============
Have done manual testing with three router topology.
1. Executed basic config and un config scenarios
2. Verified if the config is updated in running config
   during config and no config operation
3. Verified the show command output in both CLI format and
   JSON format.
4. Verified if TCP SYN messages carry the max segment size
   in their initial packets.
5. Verified the behaviour during clear bgp session.
6. done packet capture to see if the new segment size
   takes effect.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-05-04 06:21:24 +00:00
David Lamparter
62cd66d90b tests: add scapy to topotests Docker
Not having scapy in the docker image leads to very obtuse failures in
the pim bsm tests (obtuse, as in, it just fails without any hint as to
why...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:55 +02:00
David Lamparter
507e0e5d66 lib: add *_swap_all to typesafe containers
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:04 +02:00
Mark Stapp
f71e1ff6a9
Merge pull request #8545 from opensourcerouting/assert-our-own
*: make our own assert() actually work
2021-05-03 11:17:36 -04:00
David Lamparter
8dff30f801 tests: fix assert.h header change fallout
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
64dd77361f lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.

Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
Igor Ryzhov
b32454e10c tests: fix bgp-auth topotest
Individual tests must not depend on each other. In particular, a test
can't be sure that the previous test config is applied or cleared.
It is definitely not true when a single test is executed, for example:
`test_bgp_auth.py::test_prefix_peer_remove_passwords`.

This commit makes all tests independent of each other. It also adds a
call to check_all_peers_established at the start of "remove_passwords"
tests to make sure that we not only block new peers with an incorrect
password, but also clean the existing peers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-01 01:31:26 +03:00
Rafael Zalamena
058d0236b6
Merge pull request #8588 from idryzhov/a-lot-of-isis-fixes
a lot of isis fixes
2021-04-30 07:58:19 -03:00
Igor Ryzhov
ec62fbaa07 isisd: fix ldp-sync configuration
YANG model and CLI commands allow user to configure LDP-sync per area.
But the actual implementation is incorrect - all commands are changing
the config for the whole VRF instead of a single area. This commit fixes
this issue by actually implementing per area configuration.

Fixes #8578.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
Igor Ryzhov
bcf2208156 isisd: allow arbitrary order of area/interface configuration
Currently we don't allow to configure the interface before the area is
configured. This approach has the following issues:

1. The area config can be deleted even when we have an interface config
   relying on it. The code is not ready for that - we'll have a whole
   bunch of stale pointers if user does that.
2. The code doesn't correctly process the event of changing the VRF for
   an interface. There is no mechanism to ensure that the area exists
   in the new VRF so currently the circuit still stays in the old VRF.

This commit allows an arbitrary order of area/interface configuration.
There is no more need to configure the area before configuring the
interface.

This change fixes both the issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-29 17:05:21 +03:00
rgirada
2fbb8f4543 ospfd: show ip ospf interface only shows BDR info, Added DR info.
Description:
	DR information is missing under "show ip ospf interface [json]".
	Added DR infomation to display in "show ip ospf interface".

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-04-29 04:20:14 -07:00
Quentin Young
e70620f6a6
Merge pull request #8546 from ton31337/fix/add_markers_for_recent_bgpd 2021-04-28 19:51:28 +00:00
Jafar Al-Gharaibeh
fa4154ef8b
Merge pull request #8322 from qlyoung/topotests
Assorted topotests cleanup
2021-04-28 10:40:25 -05:00
Igor Ryzhov
8d3dab20b5 tests: fix topotest polling log
The current log prints maximum wait time which is not actually correct,
because it doesn't include the command execution time. We usually have
"failed after X seconds" log with X being far longer than this maximum.

Let's print the maximum number of tries instead.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-28 02:52:58 +03:00
Donatas Abraitis
ad889e0d17 tests: Add pytest bgpd markers for recent BGP tests
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-27 09:23:58 +03:00
Rafael Zalamena
ae08637827
Merge pull request #8540 from donaldsharp/kill_them_all
tests: Remove kill_mininet_router_process
2021-04-26 11:52:38 +00:00
Rafael Zalamena
cd66038b98
Merge pull request #8555 from idryzhov/fix-bfd-test
tests: fix bfd-bgp-cbit-topo3 test
2021-04-26 11:49:00 +00:00
Igor Ryzhov
f49bdb86eb tests: fix bfd-bgp-cbit-topo3 test
This test is completely incorrect on test_bfd_loss_intermediate step.
It shuts down the interface and then "waiting" for the BGP session to
fail. But instead of the actual wait it compares the output of "show bfd
peers" with the "up" state. As it does this comparison right after the
interface shutdown, the BFD session has not yet failed and the comparison
is always successful except very rare cases when the command takes a lot
of time to execute (due to the heavy load on CI system I suppose).

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-24 01:33:32 +03:00
Igor Ryzhov
2ccc493333
Merge pull request #8495 from opensourcerouting/ospfv3-bfd-rework
ospf6d: rework BFD integration and add BFD profiles support
2021-04-24 00:47:31 +03:00
Rafael Zalamena
d5f9847a9e topotests: test PIM BFD profile integration
Test that PIM BFD profile integration works.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:29:00 -03:00
Rafael Zalamena
0d00ac9cb5 topotests: add new basic PIM topology test
Test for PIM (re)convergence and BFD usage.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-23 09:29:00 -03:00
David Lamparter
6a0eb6885b *: drop zassert.h
It's not actually working properly...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-23 12:06:35 +02:00
Donald Sharp
ec8f360f2d tests: Remove kill_mininet_router_process
This function kills all processes that happen to have the same
name to frr processes and it was only ever used in the setup.
Setup should not be used to kill old runs.  That should be a
separate process.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-22 15:47:37 -04:00
Rafael Zalamena
7fcb9ef4cc topotests: test OSPFv3 BFD profiles
See if the BFD sessions created by OSPFv3 are using the configured BFD profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:04 -03:00
Rafael Zalamena
4a9e802c3c topotests: converge OSPFv3 faster
Tweak OSPFv3 interface configuration to converge faster.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-22 16:10:04 -03:00
David Lamparter
0c4285d77e build: properly split CFLAGS from AC_CFLAGS
`CFLAGS` is a "user variable", not intended to be controlled by
configure itself.  Let's put all the "important" stuff in AC_CFLAGS and
only leave debug/optimization controls in CFLAGS.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-04-21 15:42:36 +02:00
Martin Winter
6e0368f61a
Merge pull request #8434 from donaldsharp/python_bullshit
Python pylint stuff
2021-04-16 23:17:04 +02:00
Martin Winter
0575d5a8f8
Merge pull request #8437 from donaldsharp/verify_bgp_community_no_sleep
tests: Do not sleep(5) when verifying bgp communities
2021-04-15 14:03:37 +02:00
Donald Sharp
afbb000e26 tests: test_bgp_vrf_dynamic_route_leak_topo1.py was missing a variable
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
6882ab5e7f tests: Fix test_bgp_multi_vrf_topo2.py string formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
0b711f0a20 tests: test_bgp_multi_vrf_topo1.py fix formatting issues pointed out by pylint
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
f4baa8fe25 tests: Remove unnecessary formating for strings
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:10 -04:00
Donald Sharp
d9df892180 tests: Remove duplicate functions in python code
We have basically two identical functions in test_bgp_gr_functionality_topo1.py
Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-15 07:17:06 -04:00
Sri Mohana Singamsetty
e64a538c70
Merge pull request #8448 from ton31337/feature/show_rpki_state_in_global_show_bgp
bgpd: Show RPKI short state in `show bgp <afi> <safi>`
2021-04-13 17:32:37 -07:00
Mark Stapp
d7265db9b3 tests: run black over mcast-pim-static, static_routing_with_[ei]bgp
Run black and clean up formatting along with pylint cleanup.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 13:34:57 -04:00
Mark Stapp
ec3ed7234d tests: fix pylint errors in static_routing_with_ibgp
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
aa59a7090a tests: fix pylint errors in static_routing_with_ebgp tests
Fix pylint errors; also enable the test in 'topo4', which has never
run.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
914faab594 tests: fix pylint errors in mcast-pim-static-rp-topo1
Fix pylint errors.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-13 11:45:55 -04:00
Mark Stapp
f3dbd9d3ef
Merge pull request #8145 from pguibert6WIND/nhrp_use_zebra
nhrp: use zebra
2021-04-13 08:02:56 -04:00
Donatas Abraitis
d89b48fe28 tests: Add BGP RPKI show header to outputs
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-12 10:34:52 +03:00
Philippe Guibert
e63801cd5f topotests: add standard nhrp test between spoke and hub
This test establishes a binding between nbma ip of a spoke and its
protocol address. This information is pushed to hub.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Donald Sharp
9e7fd5ecbd tests: Do not sleep(5) when verifying bgp communities
There are better ways of ensuring that the remote side
has your change instead of sleeping

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 12:02:18 -04:00
Donald Sharp
0b25370e95 tests: More black fixups
Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:35:05 -04:00
Donald Sharp
98ca91e181 tests: Add some more pytest marks for bgpd
Just another round of trying to add pytest.mark.bgpd.  Not finished yet just
what I could stand doing for a few minutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:34:45 -04:00
Donatas Abraitis
6740a191ad Revert "bgpd: BGP session not established for ipv6 link local address with vrf config"
This reverts commit 0b6d35324e.
2021-04-09 10:14:32 +03:00
Patrick Ruddy
fb94a2e65d
Merge pull request #8402 from opensourcerouting/debian10-topotest-fix
tests: fix for l3mdev topotests on kernel 4.19
2021-04-08 14:54:54 +01:00
Donatas Abraitis
9d78be6aac
Merge pull request #7434 from sudhanshukumar22/bgp-link-local-address
bgpd: BGP session not established for ipv6 link local address with vrf config
2021-04-08 09:26:55 +03:00
Mark Stapp
a702694a60
Merge pull request #8365 from aldobrrrr/fix_parse_topology_function_in_isis_topo1_vrf_test
topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
2021-04-07 15:01:12 -04:00
Quentin Young
660c59ed6f tests: fix use of undefined variable in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
5aab262b74 tests: fix improper format strings in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
8ab4625666 tests: remove duplicate pim test function
Twice defined

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
c287dfd25c tests: provide sane default for --topology-only
Fixes:

/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1463: in getoption
    val = getattr(self.option, name)
E   AttributeError: 'Namespace' object has no attribute 'topology_only'

The above exception was the direct cause of the following exception:
/usr/lib/python3.9/site-packages/pluggy/manager.py:127: in register
    hook._maybe_apply_history(hookimpl)
/usr/lib/python3.9/site-packages/pluggy/hooks.py:333: in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:84: in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
tests/topotests/conftest.py:62: in pytest_configure
    if config.getoption("--topology-only"):
/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1474: in getoption
    raise ValueError(f"no option named {name!r}") from e
E   ValueError: no option named 'topology_only'

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Russ White
63caaeb2c1
Merge pull request #8407 from ton31337/fix/nexthop_should_not_be_changed_if_peer_shares_common_subnet
tests: Nexthop should not be changed if peer X shares a common subnet
2021-04-06 11:02:19 -04:00
Mark Stapp
1832ff8b49
Merge pull request #8295 from opensourcerouting/ospf6-topo-stabilize
topotest: stabilize OSPFv3 topology
2021-04-06 09:48:45 -04:00
Donatas Abraitis
b1367d6859 tests: Nexthop should not be changed if peer X shares a common subnet
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-06 10:32:02 +03:00
David Schweizer
6a93e3df4e
tests: fix python3 backported iproute2 vrf check
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:55 +02:00
David Schweizer
b04af734aa
tests: fix l3mdev config in isis-topo1-vrf topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:54 +02:00
David Schweizer
b7589f4e5c
tests: fix l3mdev config in bgp_vrf_lite_ipv6_rtadv topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:53 +02:00
David Schweizer
f2d729056e
tests: fix l3mdev config in bgp_l3vpn_to_bgp_vrf topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:52 +02:00
David Schweizer
a94d054dfd
tests: fix l3mdev config in bgp_evpn_rt5 topotest
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:51 +02:00
David Schweizer
3d762f26a6
tests: add l3mdev config helpers for VRF topotests
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-04-05 09:25:50 +02:00
Kuldeep Kashyap
2268cf50d5 tests: Fix for BGP_GR test failures
Few tests were failing in BGP-GR intermittently. Fixing the failures.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-04-05 00:15:40 -07:00
sudhanshukumar22
0b6d35324e bgpd: BGP session not established for ipv6 link local address with vrf config
Description:
BGP session not established for ipv6 link local address with vrf config

Problem Description/Summary :
BGP session not established for ipv6 link local address with vrf configyy
1.Configure ipv6 link-local address fe80::1234/64 on dut1 and fe80::4567/64 on dut2
2.Configure BGP neighbors for ipv6 link-local on both dut1 and dut2
3.Verify BGP session is UP over link-local ipv6 address
4.Observed that bgp session not established for ipv6 link local address

Expected Behavior :
BGP session should be established for ipv6 link local address with vrf config

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2021-04-01 02:43:51 -07:00
Mark Stapp
e2efe13327
Merge pull request #8350 from opensourcerouting/printfrr-revamp
lib: `printfrr()` care package
2021-03-31 09:10:30 -04:00
David Lamparter
7798203f5c lib: add %pSQ and %pSE string escape formats
These are for string quoting (`%pSQ`) and string escaping (`%pSE`); the
sets / escape methods are currently rather "basic" and might be extended
in the future.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:34:56 +02:00
David Lamparter
a4cb97a6c1 lib: add %*pHX + %*pHS hexdump in printfrr
(I'll get to `zlog_hexdump()` in a separate pass.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:34:51 +02:00
David Lamparter
9c4380daee lib: add %pVA recursive printfrr
Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier
chars and `%pVA` is clearer anyway.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:32:59 +02:00
David Lamparter
cb4928ce77 lib: add FMT_NSTD() for non-standard printf exts
... to suppress the warnings when using something that isn't quite ISO C
compatible and would otherwise cause compiler warnings from `-Wformat`.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-30 22:32:59 +02:00
Russ White
1bed7a6fef
Merge pull request #8057 from ranjanyash54/default-route
ospf6d: Default Route functionality
2021-03-30 10:34:05 -04:00
Russ White
a2d351d19e
Merge pull request #8137 from Orange-OpenSource/ospf_ls
ospfd: Add Link State support
2021-03-30 10:28:37 -04:00
Russ White
40bf85a391
Merge pull request #8056 from jmmikkel/peertype
bgpd: Add "bgp bestpath peer-type multipath-relax"
2021-03-30 10:26:57 -04:00
Emanuele Altomare
dbceeaa502 topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
Now the parse_topology function handles well the vertex type identifier.

Signed-off-by: Emanuele Altomare <emanuele@common-net.org>
2021-03-29 17:41:16 +02:00
Rafael Zalamena
bcddbefe04 topotests: add tests for OSPFv3 default route
Three new tests:

 - OSPFv3 convergence using 'ipv6 ospf6 neighbor json'
 - Default route functionality:
   * Check that the LSA is present
   * Check that the route was installed

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-29 06:37:10 -07:00
David Lamparter
487eefcfbe lib: record output positions in printfrr
This replaces `%n` with a safe, out-of-band option that simply records
the start and end offset of the output produced for each `%...`
specifier.

The old `%n` code is removed.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 17:01:29 +01:00
David Lamparter
212e04e5a7 lib: rework printfrr extensions to output directly
Allowing printfrr extensions to directly write to the output buffer has
a few advantages:
- there is no arbitrary length limit imposed (previously 64)
- the output doesn't need to be copied another time
- the extension can directly use bprintfrr() to put together pieces

The downside is that the theoretical length (regardless of available
buffer space) must be computed correctly.

Extended unit tests to test these paths a bit more thoroughly.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-27 16:56:55 +01:00
David Lamparter
9a5d359ce8
Merge pull request #8317 from mjstapp/fix_short_printfrr_buf 2021-03-26 19:40:21 +01:00
Donald Sharp
ecf9b1bb50
Merge pull request #8167 from LabNConsulting/chopps/tests-add-gdb
tests: add option for auto-launching gdb
2021-03-25 10:27:50 -04:00
ckishimo
4436ba8d46 ospfd: add topotest for suppress-fa feature
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-24 16:00:35 +01:00
Igor Ryzhov
09e2d8ed97
Merge pull request #8203 from opensourcerouting/ospf-bfd-napi
ospfd,doc,topotests: rework OSPFv2 BFD integrantion
2021-03-24 10:36:48 +03:00
Mark Stapp
f62fd2ac9f tests: use printfrr to use extended format specs
Test was using 'pFX' with printf() - need to use printfrr().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-23 14:50:14 -04:00
Joanne Mikkelson
1a9cb083b7 bgpd: Allow next hop recursion in zebra if any multipath is not eBGP
When "bgp bestpath peer-type multipath-relax" is enabled, multipaths
with both eBGP and iBGP learned routes may exist. It is not desirable
for the iBGP next hops to be discarded from the FIB because they are not
directly connected. When publishing a nexthop group to zebra, the
ZEBRA_FLAG_ALLOW_RECURSION flag is normally not set when the best path
is eBGP; when "bgp bestpath aspath multipath-relax" is configured, the
flag will now be set if any paths are from iBGP peers. This leaves
all-eBGP multipaths still requiring nexthops over connected routes.

Signed-off-by: Joanne Mikkelson <jmmikkel@arista.com>
2021-03-23 08:59:33 -07:00
Joanne Mikkelson
ee88563ac2 bgpd: Add "bgp bestpath peer-type multipath-relax"
This new BGP configuration is akin to "bgp bestpath aspath
multipath-relax". When applied, paths learned from different peer types
will be eligible to be considered for multipath (ECMP). Paths from all
of eBGP, iBGP, and confederation peers may be included in multipaths
if they are otherwise equal cost.

This change preserves the existing bestpath behavior of step 10's result
being returned, not the result from steps 8 and 9, in the case where
both 8+9 and 10 determine a winner.

Signed-off-by: Joanne Mikkelson <jmmikkel@arista.com>
2021-03-23 08:59:33 -07:00
Russ White
638fa8dd4e
Merge pull request #8253 from opensourcerouting/topotest-python3-backports
tests: iproute2 VRF capability check for topotests
2021-03-23 11:25:35 -04:00
Olivier Dugeon
927b08024e topotest: Add new OSPF TE topotest
This new test launches a small network composed by 4 OSPF routers with
Traffic Engineering and Segment Routing configuration. To assess the Link
State Traffic Engineering feature, the TED of each router is compared
against the reference TED which corresponds to the network topology.
Then a series of 6 steps, where Link, TE & SR configurations are modified
up to r4 shutwdown, are used to verify that the TED is correctly updated
on the 4 routers.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-03-23 15:39:29 +01:00
Russ White
38981e4bba
Merge pull request #8120 from ton31337/feature/bgp_ipv6_default_activated
bgpd: Activate ipv6-unicast for peer automatically if globally defined
2021-03-23 09:36:43 -04:00
Rafael Zalamena
8d69272b8f topotests: test OSPF BFD profile
Use BFD profiles in test to make sure it doesn't break.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:18:42 -03:00
Rafael Zalamena
c98581cdc8 topotests: improve OSPF(v2|v3) convergence test
Wait until all routers are actually `Full` instead of just looking at routes.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:13:19 -03:00
Rafael Zalamena
639b03ca24 topotests: remove old configuration files
We version the tests with FRR so it is no longer necessary to support
old versions.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 10:12:40 -03:00
Rafael Zalamena
25329da182 topotest: stabilize OSPFv3 topology
Changes:
- Decrease hello interval to avoid packet loss slow downs
- Decrease dead interval to converge faster
- Remove previous 'Full' state check that wasn't checking for all
  peers (only one per router)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23 09:48:16 -03:00
Donald Sharp
cb39b2d4aa
Merge pull request #8280 from kuldeepkash/bgp_convergence_test
tests: Fix bgp convergence issue mentioned in #8279
2021-03-22 10:15:36 -04:00
Donatas Abraitis
37916b2b11
Merge pull request #8121 from opensourcerouting/macro-cleanup
*: require ISO C11 + semicolons after file-scope macros
2021-03-22 11:00:34 +02:00
Donald Sharp
6dfe243c38
Merge pull request #8278 from ckishimo/ospfv3_iface
ospf6d: fix iface commands lost when removing from area
2021-03-20 20:11:16 -04:00
Christian Hopps
3f950192fe tests: add options for debugging topotest failures
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-03-19 12:45:37 -04:00
Donald Sharp
e43ba29689
Merge pull request #8263 from opensourcerouting/docker-update
tests: docker fixes & improvements
2021-03-18 13:59:30 -04:00
Kuldeep Kashyap
53402dbf1e tests: Fix bgp convergence issue mentioned in #8279
1. Enhance verify_bgp_convergence() to solve issue mentioned in #8279

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-17 17:43:57 -07:00
Donald Sharp
28bada3d8f
Merge pull request #8255 from pjdruddy/fix-ifindex-test
Fix ifindex test
2021-03-17 09:10:20 -04:00
David Lamparter
53abc26569 tests: simplify docker rsync & support worktrees
The previous, more complex mechanism failed to take into account that
git worktrees only have a stub .git file & copying the worktree itself
is not enough.  Just extract a file list beforehand & don't bother with
git inside the container.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 13:42:20 +01:00
David Lamparter
071f5c1664 tests: add libelf-dev to Dockerfile
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 13:42:20 +01:00
Rafael Zalamena
57e627628d
Merge pull request #8229 from idryzhov/bfdd-echo-rx-tx
bfdd: separate echo rx/tx timers
2021-03-17 10:41:33 +00:00
ckishimo
d205f01e1d tests: fix too many arguments for logging
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 09:35:47 +01:00
David Lamparter
80413c2073 *: require semicolon after FRR_DAEMON_INFO & co.
... again ...

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter
960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
David Lamparter
bf8d3d6aca *: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet.  Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition.  And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...

With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.

Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:17 +01:00
ckishimo
9b1bb522e0 tests: fix warning when checking ospfv3 convergence
The following error is shown when running the OSPFv3 tests

2021-03-16 23:37:44,792 INFO: Function returned global name 'data_rid' is not defined
2021-03-16 23:37:44,792 INFO: Retry [#1] after sleeping for 2s
2021-03-16 23:37:46,794 INFO: Verifying OSPF6 neighborship on router r1:
2021-03-16 23:37:46,993 INFO: Output for command [ show ipv6 ospf6 neighbor ] on router r1:
Neighbor ID     Pri    DeadTime    State/IfState         Duration I/F[State]
2.2.2.2           1    00:00:03     Full/PointToPoint    00:00:01 r1-r2-eth0[PointToPoint]

Fix the "data_rid" warning by using the correct variable

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-03-17 00:19:54 +01:00
Igor Ryzhov
4df3e31c3d bfdd: separate echo rx/tx timers
Currently there is a single interval for both RX and TX echo functions.
This commit introduces separate RX and TX timers for echo packets.

The main advantage is to be able to set the receive interval to zero
when we don't want to receive echo packets from the remote system.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-16 22:14:57 +03:00
Pat Ruddy
a1997ea033 tests: re-enable RTE tests after removing fixed ifindices
Change ifindex test to grab the correct indices using the API
provided.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-03-16 15:29:20 +00:00
Pat Ruddy
2bf118962f tests: fix formatting error to make black clean
Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-03-16 15:29:19 +00:00
Karen Schoener
eb44a85454 tests: update LDP SNMP topotest to walk mib objects that are statistics
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-03-16 10:23:34 -04:00
lynne
83543d89ae test: fix isis-snmp test
Remove ifindex values being tested because it can change
between runs of the test.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-03-16 08:00:41 -04:00
David Schweizer
83d2076e4f tests: add. iproute2 VRF capability check example
Additional example usage of iproute2_is_vrf_capable check in
isis-topo1-vrf topotest.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-16 09:34:21 +01:00
David Schweizer
ddbc1ad2a0 tests: iproute2 VRF capability check examples
Example usage of iproute2_is_vrf_capable check in bgp_multi_vrf_topo1
and bgp_multi_vrf_topo2 topotests.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-15 12:49:59 +01:00
David Schweizer
0414a76446 tests: check for iproute2 VRF capability
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-03-15 12:48:38 +01:00
Renato Westphal
bfa46e3bdd
Merge pull request #8147 from volta-networks/feat_ldp_snmp_without_stats
ldpd: Add support for read-only snmp mib objects (excluding statistics)
2021-03-14 22:25:00 -03:00
Renato Westphal
e1908ceb42
Merge pull request #7945 from volta-networks/feat_isis_snmp
isisd: add support for read-only snmp mibs objects
2021-03-14 22:14:27 -03:00
Rafael Zalamena
5b2906f4b4 topotests: temporary disable test assert
The test has been failing often recently and it is causing some false
positives for unrelated PRs.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-14 10:15:20 -03:00
Rafael Zalamena
296951b598 topotests: remove some interface index check
Don't expect the interface index to be always the same.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-12 17:33:23 -03:00
Rafael Zalamena
0085000b9e topotests: remove some FRR version checks
We version the tests with the source code so we should no longer attempt
to support old versions in development branch.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-12 17:32:12 -03:00
GalaxyGorilla
17128dea27 tests: Replace ospf-sr-topo1 by ospf-sr-topo2
The new ospf-sr-topo2 tests are much broader and detailed,
hence it makes no sense to keep the old ospf-sr-topo1
tests.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-03-10 10:37:58 +00:00
GalaxyGorilla
9dd6fc9ded tests: OSPF SR topotests (ospf-sr-topo2)
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-03-10 10:14:38 +00:00
Russ White
7c7e4db935
Merge pull request #8123 from gromit1811/fix_topotest_ipv6_linklocal
tests: Fix determination of IPv6 link-local addresses
2021-03-09 11:25:10 -05:00
David Lamparter
6adedc6fe3
Merge pull request #8176 from LabNConsulting/chopps/fix-locale-fail
tests: Sort expected and actual to avoid locale issues
2021-03-09 12:34:38 +01:00
Donatas Abraitis
f79d311b3e
Merge pull request #8180 from kuldeepkash/topojson_framework
tests: Improve error/assert message logging
2021-03-08 09:32:09 +02:00
Donatas Abraitis
7b94dd35dd
Merge pull request #8195 from qlyoung/fix-community-type-command
tests: fix community-list invalid command
2021-03-07 17:04:57 +02:00
Kuldeep Kashyap
5cbb02ebde tests: Improve error/assert message logging
1. Improved error meesage logging.
2. No functionality changes only put some meaningfull error messages.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-06 00:51:43 -08:00
Donald Sharp
122a7974dd
Merge pull request #8196 from ton31337/feature/rfc8654_bgpd
bgpd: Add BGP Extended message support
2021-03-05 07:18:42 -05:00
Rafael Zalamena
ee56932473
Merge pull request #8165 from wesleycoakley/misc-qol-fixups
staticd, pimd, tests: small fixups and cov fix
2021-03-05 11:22:47 +00:00
Christian Hopps
00756aa345 tests: Sort expected and actual to avoid locale issues
Avoid undocumented topotest dependency on installing en_US locale.
With this change dependency is removed.

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-03-04 12:33:26 -05:00
Quentin Young
bb4bcaad9a
Merge pull request #8190 from gromit1811/fix_topotest_pylint
tests: Fix topotest.py pylint errors
2021-03-03 15:43:38 -05:00
Donatas Abraitis
8b6ff0de56 tests: Use BGP Extended Message length
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-03-03 22:21:08 +02:00
Rafael Zalamena
fecbc5d2e7
Merge pull request #8189 from idryzhov/topotest-mkdir
tests: don't complain when /tmp/topotests exists
2021-03-03 19:30:11 +00:00
Quentin Young
60e7da0cff tests: fix community-list invalid command
Didn't test this but it's already randomly broken so cant be worse

Hopefully fixes:

raise InvalidCLIError("%s" % output)
InvalidCLIError: line 2: % Command incomplete[4]: bgp
large-community-list standard Test1 permit

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-03-03 13:56:39 -05:00
Martin Buck
67c3bf97c3 tests: Fix topotest.py pylint errors
Fix 2 string formatting errors (cosmetic only - remove unused string
formatting arguments). Also fix obvious typos in empty class FreeBSDRouter
implementation.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-03-03 16:19:59 +01:00
Igor Ryzhov
f60e5fd3d1
Merge pull request #8183 from kuldeepkash/multicast_pim_bsm
tests: Fix for test failure in PR #8158
2021-03-03 18:05:41 +03:00
Igor Ryzhov
cac0ed050e tests: don't complain when /tmp/topotests exists
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-03 14:22:15 +03:00
Wesley Coakley
23f3a92e34
tests: address coverity / styling issues in topotests
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-03-02 20:44:15 -05:00
Mark Stapp
0c449b017b tests: make the topogen object available when starting daemons
Pass the topogen 'tgen' object into the startRouterDaemons()
method. it can be used to start a debug cli immediately after
starting a daemon, and that can be handy.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-03-02 13:59:35 -05:00
Donald Sharp
17d1e8a386 tests: Don't generate support bundles when we get the results we want
We are generating support bundles for tests being run that
are passing.  Tell the system...

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-02 13:41:50 -05:00
Donald Sharp
9dfe1acd2a tests: Remove sleep(60) and look for convergence
Sleeping when convergence is not guaranteed in 60 seconds
and then testing the rib to see if it has the data is
not a great way to have a test complete all the time.

Modify the code so that we check for convergence
and if we have converged then look in the rib.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-02 13:41:50 -05:00
lynne
0a4340469e tests: Adding test for ISIS SNMP
Adding test to verify walking of the ISIS SNMP MIB

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-03-02 10:06:31 -05:00
Kuldeep Kashyap
d99438d27d tests: Fix for test failure in PR #8158
1. There were few tests where routes were configured with blackhole and
non-blackhole nexthops simultaneously, enhanced tests accordingly and
verified in master branch and with PR #8158 changes.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-03-02 05:32:28 -08:00
Donald Sharp
5980ad0ae0 tests: Run black against tests again to clean up formatting
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:18:49 -05:00
Donald Sharp
b9a210f951 tests: Add pytest.mark.snmp
Add the ability to run snmp tests

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:17:53 -05:00
Donald Sharp
5ad1fd54a8 tests: Add some pytest.mark.bgpd
Add some pytest.mark.bgpd.  This is about all I could stomach doing
in one patch.  I'll do another pass at another time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 09:11:38 -05:00
Donatas Abraitis
484ff4899b tests: Check if bgp default ipv[46]-unicast commands work
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-02-28 19:51:12 +02:00
Renato Westphal
784f92f052 isisd: handle corner case involving TI-LFA and the SR No-PHP flag
When the last SID in the TI-LFA repair list is an Adj-SID from the
penultimate hop router towards the final hop, the No-PHP flag of the
original Prefix-SID must be honored in the repair list itself since
the penultimate hop router won't have a chance to process that SID
and pop it if necessary.

Reported-by: Fredi Raspall <fredi@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-02-26 15:54:01 -03:00
Kuldeep Kashyap
5900cf46f7 tests: Fix for blackhole test in test_mcast_pim_bsmp suite
1. Fixed for blackhole test in test_mcast_pim_bsmp suite

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-02-25 23:49:58 -08:00
Karen Schoener
0534e94c10 tests: add topotest for LDP SNMP
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-02-24 17:38:02 -05:00
Anuradha Karuppiah
6bf6282da9 tests: increase ping attempts in EVPN MH to fix failures on ARM
There are two fixes to handle slow convergence on ARM -
1. Ping on every re-try attempt to account for initial packet loss
2. Handle incomplete show outputs gracefully

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2021-02-24 08:11:26 -08:00
Russ White
a09016c833
Merge pull request #8020 from ton31337/feature/test_aggregator_as_with_0_exabgp
tests: Test if BGP AGGREGATOR attribute is discarded if ASN comes as 0
2021-02-23 11:06:34 -05:00
Donald Sharp
fa17cdc70f
Merge pull request #8125 from opensourcerouting/topotest-labn-jsoncmp
tests: JSON comparison command for LabN topotests
2021-02-22 09:38:03 -05:00
Mark Stapp
6589cae5f8
Merge pull request #7920 from donaldsharp/more_pytest_cleanup
More pytest cleanup
2021-02-22 07:31:22 -05:00
David Schweizer
92cf76677b
tests: example using new "jsoncmp_pass" command
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-02-22 10:49:36 +01:00
David Schweizer
4e3828b771
tests: JSON comparison command for LabN topotests
The changes add the "jsoncmp_pass" and the "jsoncmp_fail" commands to
compare VTY shell's JSON output to an expected JSON object during
topotests using the LabN testing framework. This helps to eliminate
false negative test results (i.e. due to routes beeing out of order
after convergence or cosmetic changes in VTY shell's text output).

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-02-22 10:31:57 +01:00
Martin Buck
fd03dacd03 tests: Fix determination of IPv6 link-local addresses
When parsing the output of "ip -6 address", allow arbitrary base interface
names (the part after "@" in the interface name), not just "if0-9". Without
this, link-local addresses sometimes are attributed to the wrong interface
because we're not matching the interface name but still handle the
interface's addresses.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2021-02-22 09:48:16 +01:00
Mark Stapp
e9867ca57b tests: report kernel version check failures
Report kernel version check failures in the test log.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-02-16 11:55:47 -05:00
Martin Winter
9ee2ebdc82
Merge pull request #8015 from mjstapp/fix_topo_gen_support
tests: make generate support bundle python3
2021-02-16 17:49:18 +01:00
Mark Stapp
70b99f2fff tests: make generate support bundle python3 only
Make the generate-support-bundle script and interactions more
python3-friendly, and use python3 explicitly.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-02-15 08:13:06 -05:00
Martin Winter
7a9c641d5c
Merge pull request #7917 from pjdruddy/l3vpn-mpls-snmp-upstream-1
L3vpn mpls snmp upstream 1
2021-02-10 01:37:58 +01:00
Pat Ruddy
f40594ca77 tests: mplsL3vpn SNMP topotest
Tests to exercise the MPLS-L3VPN-STD MIB

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-09 17:04:49 +00:00
Donald Sharp
350bdbdd95 tests: Modify timers on bgp_blackhole_community
Modify the timers on the bgp_blackhole_community test to
be more aggressive so our test system will recover faster
when we drop packets.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-08 19:37:58 -05:00
Quentin Young
5609ba6ad4
Merge pull request #7946 from ckishimo/ospfv3_json_2
tests: add ospf6 support via json files
2021-02-08 01:23:25 -05:00
Quentin Young
658186e8b6
Merge pull request #7937 from pjdruddy/topotest-evpn-svi-advertise
tests: update EVPN VXLAN for SVI behaviour change
2021-02-05 14:30:55 -05:00
Donatas Abraitis
f3e438f21c tests: Test if BGP AGGREGATOR attribute is discarded if ASN comes as 0
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-02-05 20:35:58 +02:00
Donald Sharp
6ddbc710cc
Merge pull request #7218 from kuldeepkash/multicast_pim_bsm
tests: Add multicast-pim-bsm-topo1 suite
2021-02-05 10:20:15 -05:00
Donald Sharp
1889e8e876
Merge pull request #7126 from vijaykug/multicast_with_static_rp
tests: Add multicast-pim-static-rp-topo1 test suite
2021-02-05 09:37:40 -05:00
Donald Sharp
5c0d9617e5
Merge pull request #7998 from volta-networks/fix_isis_attach_bit
isisd: When adjacencies go up and down add support to modify attached-bit
2021-02-04 18:46:19 -05:00
Donald Sharp
efb62eeddf tests: Add pytest.mark.staticd to topotests
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:35:42 -05:00
Donald Sharp
47679d6e44 tests: staticd is not being used in bgp_rr_ibgp test
Clean this up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:29:46 -05:00
Donald Sharp
785eb4f72f tests: Add pytest.mark.pathd
Go through and mark tests using pathd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:29:45 -05:00
Donald Sharp
2c647bcdc8 tests: Add pytest.mark.nhrpd
Go through all tests and mark pytest.mark.nhrpd

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:29:04 -05:00
Donald Sharp
3dedee4fe1 tests: Add pytest.mark.ospfd to tests
Add pytest marking for ospfd.  This commit also has some other test markings
because I do not want to have to go through the same test multiple times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:28:36 -05:00
Donald Sharp
6907ac7e2c tests: Fixup to use the new pytestmark = syntax
Go through all the current tests and convert over to correct syntax

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 18:20:31 -05:00
Donald Sharp
ad39be1f59 tests: The ldp-sync-isis-topo1 test does not use ospf
We have a ospfd.conf file in the r2 directory but the
ldp-sync-isis-topo1 test does not use ospf.  Let's remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-02-04 17:54:47 -05:00
Mark Stapp
ecd32c7741 tests: fix ospf6_topo1 missing ref files
Only one of the four reference files was present; add the missing
three. The test just silently passed if a ref file was missing:
change that to a failure.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-02-03 16:28:18 -05:00
Donald Sharp
cc73a06499
Merge pull request #7314 from kuldeepkash/multicast-sm-topo1
Add multicast-pim-sm-topo1 test suite
2021-02-02 10:43:09 -05:00
Russ White
8f57f7413c
Merge pull request #6766 from opensourcerouting/xref
lib: xrefs - general cross-references & unique IDs
2021-02-02 07:44:21 -05:00
lynne
0883be0c5e tests: restore isis-lsp-bits-topo1 test
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-02-01 16:04:10 -05:00
Stephen Worley
13f93db328 topotests: add test for infinite recursion
Add a test for the infinite recursion case fixed
with 0c4dbb5f8fe8fb188fa0e0aa8ce04764e893b79b

See that commit for details of the problem. This test uses a simpler
version of the repro found there as the test.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2021-02-01 13:27:28 -05:00
David Lamparter
494d842022 tests: add unit test for xrefs
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-02-01 17:28:11 +01:00
Kuldeep Kashyap
c6d473e53b tests: Add multicast-pim-sm-topo2 test suite
1. Added 8 test cases to verify multicast PIM SM functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-01-29 16:12:48 +00:00
Kuldeep Kashyap
03e7807be0 tests: Add multicast-pim-sm-topo1 test suite
1. Added 10 test cases to verify multicast PIM SM functionality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-01-29 16:12:48 +00:00
Pat Ruddy
0c2b0c0098 tests: update evpn vxlan for svi behaviour change
This test relied on the default addition of SVI MAC in zebra
now this has been fixed the test needs to be updated to work
with the new behaviour.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-29 09:52:03 +00:00
Karen Schoener
d34cf8a75b tests: update snmp topotest api test_oid_walk
Update snmp topotest api test_oid_walk to validate a subset
of rows in a mib walk.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-28 19:05:42 -05:00
lynne
d61731fbe3 tests: temporarily remove isis-lsp-bits-topo1 topotest
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-01-28 13:37:52 -05:00
Donald Sharp
e6d17d2fa9
Merge pull request #7933 from deastoe/show-route-header-sep
lib: restore blank line after show route header
2021-01-28 09:55:52 -05:00
ckishimo
3076de892d tests: add dual stack OSPF topotest
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-27 17:31:12 +01:00
ckishimo
1feb577c63 tests: add verify_ospf6_neighbor
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-27 17:31:12 +01:00
ckishimo
1f661c8c90 tests: start ospf6d daemon
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-27 17:30:52 +01:00
Duncan Eastoe
ec20380c34 tests: more robust show route header stripping
In test_converge_protocols() use sed to match the "show ip(v6) route"
header and strip it, rather than using tail which requires hardcoding
the expected length of the header (which is subject to change).

Signed-off-by: Duncan Eastoe <duncan.eastoe@att.com>
2021-01-27 12:19:52 +00:00
Russ White
aee697b454
Merge pull request #7901 from donaldsharp/pim_marking
tests: Fix to use global variable for pim marking
2021-01-26 07:39:02 -05:00
Russ White
044a731747
Merge pull request #7928 from volta-networks/fix_simple_snmp_add_checks
tests: update simple_snmp_test to check for memory leaks, router failure
2021-01-26 07:34:11 -05:00
Russ White
a9294a8cbd
Merge pull request #7127 from opensourcerouting/ospf_ti-lfa
ospfd: add support for Topology Independent LFA (TI-LFA)
2021-01-26 07:32:04 -05:00
Russ White
1e2daeeb1d
Merge pull request #7843 from volta-networks/feat_isis_attach_bit
isisd: Fix Attach-bit processing
2021-01-26 07:28:20 -05:00
ckishimo
2718dd0251 tests: support ospf6d area config
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:23:22 +01:00
ckishimo
12011c4015 tests: fix create_router_ospf6 to use ospf6 instead of ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:19:38 +01:00
ckishimo
889da6763c tests: make __create_ospf_global for both ospfv2/3
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:15:19 +01:00
ckishimo
6c5fedcfd1 tests: remove unused __create_ospf6_global()
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:14:56 +01:00
ckishimo
a7394afa52 tests: create_interfaces_cfg add ospfv3 support
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 11:01:05 +01:00
ckishimo
3ee31ad131 tests: create_interfaces_cfg add ospf cost
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:57:06 +01:00
ckishimo
6e7f58da09 tests: create_interfaces_cfg refactor ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-26 10:52:32 +01:00
Karen Schoener
662c057635 tests: update simple_snmp_test to check for memory leaks, router failure
Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-25 10:01:24 -05:00
Donatas Abraitis
a5de4a566d tests: Check if BLACKHOLE community prefixes are visible inside local AS
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:11:01 +02:00
Donald Sharp
7ed8fcff2b tests: Fix to use global variable for pim marking
Use the preferred methodology of marking
for pim tests and update new pim tests with
appropriate mark

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-22 15:54:31 -05:00
Donald Sharp
f939c3a69f
Merge pull request #7899 from ton31337/fix/bgpd_blackhole_community
bgpd: Massage Blackhole community
2021-01-22 08:36:27 -05:00
Donald Sharp
75691bb7c4
Merge pull request #7904 from volta-networks/fix_test_oid_walk
tests: update snmp test infastructure api test_oid_walk
2021-01-22 08:32:39 -05:00
Donald Sharp
ddbda04e87
Merge pull request #7909 from pjdruddy/snmp-skip-test
test: add snmp skip test
2021-01-22 08:23:56 -05:00
Donald Sharp
f95224c170
Merge pull request #7902 from opensourcerouting/topotest-marker
tests: Standardized Topotest PyTest Markers
2021-01-22 08:23:02 -05:00
Pat Ruddy
fd9f7cacf4 test: add snmp skip test
Since SNMP is a pain to install add a check which will be used
in all SNMP tests in future to silently skip SNMP tests if SNMP
has not been installed on the base system.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-22 10:12:47 +00:00
Martin Winter
82b844d8d3
Merge pull request #7765 from gpnaveen/ospf_chaos_test
tests : Adding 3 ospf chaos testcases.
2021-01-21 23:59:29 +01:00
Karen Schoener
6ea2bd40d8 tests: update snmp test infastructure api test_oid_walk
Update test_oid_walk to either validate specific oids or
to validate all rows walked.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2021-01-21 11:43:03 -05:00
David Schweizer
6bd548aa49
tests: pytest markers in topotest templates
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-01-21 17:06:58 +01:00
David Schweizer
309638adb5
tests: pytest marker registrations for all daemons
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
2021-01-21 16:24:02 +01:00
Donald Sharp
8cf7ab7539
Merge pull request #7782 from kuldeepkash/multicast_pim_sm_topo2
tests: Add new scenarios to test multicast-pim-sm
2021-01-21 09:45:38 -05:00
lynne
3db5abf2d0 tests: Adding test for ISIS Attached-bit
Adding test to verify default route is added when attached-bit
receive and send are enabled and not added when feature is disabled.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-01-21 09:18:18 -05:00
Donatas Abraitis
3130cfd742 tests: Test if prefix is not re-advertised downstream with blackhole community
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-21 16:00:53 +02:00
nguggarigoud
a3276d2c76 tests: Adding 3 ospf chaos testcases.
This script involves Restart ospfd,
restart frr with ospf enabled,
staticd with redistribution inside ospf is enabled

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-21 04:55:58 +05:30
Donatas Abraitis
44ba9e779d
Merge pull request #7832 from pjdruddy/snmp-test-infra
Snmp test infra
2021-01-20 09:15:14 +02:00
Mark Stapp
bdbef5edc6
Merge pull request #7233 from donaldsharp/route_map_optimizations
Route map optimizations
2021-01-19 13:20:02 -05:00
GalaxyGorilla
94dd5670d0 ospfd: Fix P2MP handling when TI-LFA is enabled
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
f026b24ed9 ospfd: Fix backup path RIB handling
* Inject backup paths with proper flags
  * Add outgoing label on top of the backup label stack
  * Ignore explicit/implicit outgoing labels
  * Adjust tests

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
be4d276c89 tests: Add topotest for OSPF SR TI-LFA
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
a4553b5bdb ospfd: Add 'debug ospf ti-lfa' command
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
bdcfd34a41 ospfd: Add support for non-adjacent TI-LFA P/Q spaces
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
66dc21bb23 tests: Integrate unit tests for TI-LFA
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
184b834b6c tests: Add verbosity flag to OSPF TI-LFA unit tests
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
385a1e07b1 ospfd: Add support for TI-LFA node protection
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
cc1725bd34 ospfd: Make use of adjacency SIDs in TI-LFA
When P and Q spaces are adjacent then it makes sense to use adjacency SIDs to
from the P node to the Q node. There are some other corner cases where this
makes also sense like when a P/Q node adjacent to root node.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
GalaxyGorilla
7fd0729f76 ospfd: TI-LFA basic infrastructure and algorithms
Signed-off-by: GalaxyGorilla <sascha@netdef.org>
2021-01-19 15:32:13 +00:00
Russ White
4c35f214b7
Merge pull request #6455 from GalaxyGorilla/bfd_ospf_topotest
tests: Introduce BFD OSPFv2/v3 topotests
2021-01-19 07:39:05 -05:00
kuldeepkash
693a44e183 tests: Add new scenarios to test multicast-pim-sm(different topology)
Add new scenarios to test multicast-pim-sm(different topology)

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-18 20:09:07 +00:00
kuldeepkash
eab72dc8e0 tests: Add/enhance framework for multicast-pim-sm automation
1. Add/enhance framework for multicast-pim-sm automation

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-18 20:09:07 +00:00
kuldeepkash
c9b5d52c65 tests: Add new scenarios to test multicast-pim-sm
1, Added new scenarios to test multicast-pim-sm

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-18 20:08:53 +00:00
Kuldeep Kashyap
6f86321528 tests: Add multicast-pim-bsm-topo2 suite
1. Added 7 testcases to verify PIM BSM functionality. Here we have used Scapy
   to send raw packet, generated using Cisco and FRR. Raw packets are kept in

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-01-18 18:17:13 +00:00
Kuldeep Kashyap
df94c7e840 tests: Add multicast-pim-bsm-topo1 suite
1. Added 8 testcases to verify PIM BSM functionality. Here we have used Scapy
   to send raw packet, generated using Cisco and FRR. Raw packets are kept in
   JSON file and sent tests on-demand in script.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-01-18 18:17:13 +00:00
Kuldeep Kashyap
f40b18e8bb tests: Add framework support for multicast-pim-bsm-topo1
1. Added framework support for multicast-pim-bsm-topo1 suite automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-01-18 18:17:06 +00:00
Donatas Abraitis
fba9c8d2fd
Merge pull request #7874 from donaldsharp/more_pytest_mark
More pytest mark
2021-01-18 10:12:24 +02:00
Vijay Gupta
d25f322e5a tests: Add multicast-pim-static-rp-topo1 test suits
Signed-off-by: Vijay Gupta <vijayg@vmware.com>

1 Added 17 testcases to verify multicast static RP functionality
2 Execution time ~12min
2021-01-17 21:41:20 -08:00
Donald Sharp
e1713aa16d tests: Set default timers to 3/10 for bgp using create_router_bgp
Tests were timing out in our test system due to lost packets and
flakiness of the lower end systems.  Just set the timers to 3/10
and give them plenty of time to converge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-16 08:29:49 -05:00
Donald Sharp
fed1681178 tests: Modify zebra_rib tests to include some basic route-map tests
New test does this:
a) Ensures that we run the correct number of times given two
`ip protocol X` commands( ie we do not run the route-map application
against all routes, only those affected )
b) Ensure that when we modify the route-map the state ends up sane
this includes making a static route depend on a sharp route that
gets removed from the change of the sharp route-map
c) Ensure that the kernel routes are correct.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 19:34:33 -05:00
Donald Sharp
3771ded194 tests: Add pytest.mark.pbr
Add a mark to topotests that mark pbr tests

`pytest -k pbr`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 09:18:59 -05:00
Donald Sharp
3914e57591 tests: Add pytest.mark.isis
Add a mark to topotests that mark isis tests

`pytest -k isis`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 09:17:53 -05:00
Donald Sharp
1d0c76b74d tests: Add pytest.mark.bfd
Add a mark to topotests that mark bfd tests.

`pytest -k bfd`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-15 08:58:24 -05:00
Mark Stapp
ea8885d54e
Merge pull request #7870 from donaldsharp/pytest_marking
tests: Start the ability to mark tests
2021-01-15 08:44:51 -05:00
Donatas Abraitis
2f8e365008 tests: Check if peer-group is working in topotests
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-15 11:35:57 +02:00
Donald Sharp
b9f3e47f3a tests: Start the ability to mark tests
Add the ability for our topotests to take advantage of pytest `mark`ing.
This effectively allows you to tell pytest to run against certain sets
of tests.  For a demonstration purpose I've added in marks for:
babel
eigrp
ldp
ospf
pim
rip

And setup tests to run against those tests that only test those protocols.

You can run against eigrp tests by running `pytest -k eigrp`
Other combinations are also available based upon simple boolean logic.
Just read the pytest.mark documentation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-14 20:29:14 -05:00
Donald Sharp
f2aee6967c
Merge pull request #7837 from ckishimo/tests_ospf
tests: fix redistribute key in ospf tests
2021-01-13 13:31:32 -05:00
Donatas Abraitis
26542c7138
Merge pull request #7849 from gpnaveen/static_rte_test
tests: Static route cases with admin dist and tag.
2021-01-13 09:09:38 +02:00
Donatas Abraitis
6f860c4618
Merge pull request #7748 from adrianomarto/bgp-listen-on-multiple-addresses
BGP daemon listen for connections on multiple addresses
2021-01-13 08:57:38 +02:00
Pat Ruddy
b300ed94b1 tests: sample snmp test to check infra
Simple test which creates a router running snmp and bgpd and
checks we can read the correct bgpVersion using snmp.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-12 19:59:56 +00:00
Olivier Dugeon
4683138cda
Merge pull request #7707 from opensourcerouting/isisd-rlfa
isisd, ldpd: add Remote LFA support
2021-01-12 19:25:15 +01:00
Donald Sharp
484eabb1d7
Merge pull request #7439 from opensourcerouting/bgp-damp-profile2
bgpd: BGP route-flap dampening profiles for peers and peer groups
2021-01-12 11:45:41 -05:00
Russ White
bc560f64d9
Merge pull request #7687 from gpnaveen/ospf_p2mp
tests: Adding ospf p2mp basic test.
2021-01-12 08:03:33 -05:00
nguggarigoud
26bbe9af5e tests: Static route cases with admin dist and tag.
1. Adding api to verify ip nht command.
2. 5 cases of static routes with admin dist and tag
3. Run time = 89Secs

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-12 17:13:26 +05:30
ckishimo
88b7d3e726 tests: move redistribute function into lib
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
9458be1aec tests: fix ospf cosmetic output
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
65980a0224 tests: remove old def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
c6b59ef48c tests: use new def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
ckishimo
881fa68f05 tests: add new def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-12 11:18:22 +01:00
nguggarigoud
dc5298d741 tests: Adding ospf p2mp basic test.
This test verifies basic p2mp test

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-01-12 09:28:50 +05:30
Babis Chalios
daee3312bf tests: add machinery to test SNMP
Add initial 'walk' and 'get' test APIs for SNMP

Signed-off-by: Babis Chalios <babis@voltanet.io>
Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-11 14:36:41 +00:00
Babis Chalios
92be50e63e tests: API to launch snmpd in a topotest scenario
Prepare the infrastructure to allow configuring and launching an SNMP
daemon as part of testing scenario.

Signed-off-by: Babis Chalios <babis@voltanet.io>
Signed-off-by: Pat Ruddy Chalios <pat@voltanet.io>
2021-01-11 14:36:40 +00:00
Sebastien Merle
f7f6a796e8 pathd: Skip SR-TE topotests if pathd has been disabled
* If pathd binary is not found, skip the SR-TE topotests.
 * Fix some compilation warnings when pathd is not built.

Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2021-01-11 12:52:15 +01:00
Adriano Marto Reis
733367c04e tests: tests for bgpd listing on multiple addresses
* Added a new topotest to test bgpd listening on multiple addresses.
* Updated the existing bgpd tests according to the parameter added to
bgp_master_init.

Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
2021-01-11 08:33:52 +00:00
Donald Sharp
7df0e6bb3b
Merge pull request #7756 from pjdruddy/bgplu-fixes
Bgplu fixes
2021-01-09 15:48:22 -05:00
Donald Sharp
537e7e9241 tests: Wait for bgp convergence *after* we re-add the interfaces
In test_bgp_mutli_vrf_topo2.py it's clear that we remove then
re-add the vrf interfaces.  Then the test was immediately
checking to ensure that the routes were available.

BGP needs time to reconverge.  Let's ensure that first.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-08 20:58:04 -05:00
Renato Westphal
ef8e91d4a2 tests: add IS-IS RLFA topotest
Add new RLFA topotest that tests all RLFA configuration knobs and
how isisd and ldpd react to various configuration changes that can
occur in the network.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-01-08 22:22:11 -03:00
Renato Westphal
c40de29448 tests: add remote LFA unit tests
Extend the existing SPF unit testing infrastructure so that it can
test RLFA as well.

These new unit tests are useful to test the RLFA PQ node
computation on several different network topologies in a timely
manner. Artificial LDP labels (starting from 50000) are used to
activate the computed RLFAs.

It's worth mentioning that the computed backup routing tables
contain both local LFAs and remote LFAs, as running RLFA separately
isn't possible.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2021-01-08 22:22:11 -03:00
Renato Westphal
dc70c83afa
Merge pull request #7816 from pjdruddy/revert_labelmanager_statics
Revert labelmanager statics
2021-01-08 20:57:25 -03:00
Donald Sharp
662aa246aa tests: Fix gr_tests
The bgp_gr_functionality_topo1 test was shutting down an
interface on r2 and then trying to bring it up on r1.
Hijinx ensued.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-07 17:30:04 -05:00
Donatas Abraitis
acb92e3524
Merge pull request #7749 from wesleycoakley/bgpd-large-community-format-fix
bgpd: reject malformed large-communities
2021-01-07 10:33:59 +02:00
Donald Sharp
fe035acc87
Merge pull request #7820 from kuldeepkash/topojson_framework
tests: [topojson]Add/Enhance framework to support PIM automation
2021-01-06 08:59:34 -05:00
Wesley Coakley
c850908b9d bgpd: separate lcommunity validation from tokenizer
`lcommunity_gettoken` expects a space-delimeted list of 0 or more large
communities. `lcommunity_list_valid` can perform this check.
`lcommunity_list_valid` now validates large community lists more
accurately based on the following condition: Each quantity in a standard bgp
large community must:

1. Contain at least one digit
2. Fit within 4 octets
3. Contain only digits unless the lcommunity is "expanded"
4. Contain a valid regex if the lcommunity is "expanded"

Moreover we validate that each large community list contains exactly 3
such values separated by a single colon each.

One quirk of our validation which is worth documenting is:

```
bgp large-community-list standard test2 permit 1:c:3
bgp large-community-list expanded test1 permit 1:c:3
```

The first line will throw an error complaining about a "malformed community-list
value". The second line will be accepted because the each value is each treated as
a regex when matching large communities, it simply will never match anything so
it's rather useless.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-01-06 07:18:20 -05:00
Donatas Abraitis
f32fc99078
Merge pull request #7815 from ckishimo/pytests
tests: fix typos and remove duplicate output
2021-01-06 09:08:35 +02:00
kuldeepkash
e58fdb55d6 tests: [topojson]Enhance lib/topojson.py to support PIM automation
1. Enhanced lib/topojson.py for creating topologies with switches and routers
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:13:05 +00:00
kuldeepkash
aafca66993 tests: [topojson]Enhance lib/common_config.py to support PIM automation
1. Enhanced lib/common_config.py for common configuration/verification needed
   for PIM automation
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:08:31 +00:00
kuldeepkash
e8cd26fdc5 tests: [topojson]Add lib/pim.py to support PIM automation
1. Added lib/pim.py for PIM configuration/verification
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:05:30 +00:00
ckishimo
90340b2b82 tests: fix typos
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-05 20:00:19 +01:00
Pat Ruddy
cdb2af427a tests: add test for labelmanager plugin
An external label manager plugin may want to use the following
functions:
    - create_label_chunk
    - assign_label_chunk
    - delete_label_chunk
    - release_label_chunk
This test ensures that they are externally visible.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-05 18:20:50 +00:00
Mark Stapp
b04932df02
Merge pull request #7772 from LabNConsulting/ziemba/tests-lutil-timestamp
tests: topotests/lib/lutil.py: add timestamp to log of test start
2021-01-05 11:29:49 -05:00
ckishimo
19185dbac2 tests: remove duplicate output
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-05 17:26:01 +01:00
Russ White
ee117a8bd6
Merge pull request #7507 from ton31337/fix/bgpd_do_not_send_update_if_path_really_did_not_change
bgpd: Do not send BGP UPDATE if the route actually not changed
2021-01-05 10:26:18 -05:00
Pat Ruddy
160ad964e7 tests: add BGPLU label sanity test
This test checks the interactions between the BGP label requesting
code and the labelpool code to ensure the correct number of labels
and label chunks are requested and those labels are freed back into
the pool when the corresponding prefix is removed.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
G. Paul Ziemba
2f17f52a02 tests: topotests/lib/lutil.py: add timestamp to log of test start
Timestamps in test logs are needed for correlation with messages in
    routing protocol log files. Vox populi indicates preference for
    timestamp at beginning of line.

    OLD:
    (#55) scripts/rip-show.py:61 COMMAND:r1:vtysh -c "show ip rip status": 00:0.* 00:0:wait:RIP Peers:

    NEW:
    Sat Dec 19 08:26:45 2020 (#55) scripts/rip-show.py:61 COMMAND:r1:vtysh -c "show ip rip status": 00:0.* 00:0:wait:RIP Peers:

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2020-12-29 05:34:46 -08:00
Mark Stapp
d4473065f4
Merge pull request #7759 from qlyoung/reformat-tests-again
Reformat tests again
2020-12-23 08:11:00 -05:00
Martin Winter
90cd28e91a
Merge pull request #6212 from gpnaveen/static_routes
tests: Adding static routing topojson automation suites.
2020-12-22 14:11:37 -08:00
Donald Sharp
29c0ce20ef tests: dict_values are not lists in version 3
While accidently running the topotests with version 3
I keep getting:

TypeError: `dict_values` object does not support indexing..

version 2 of python dict.values() returns a list.
version 3 does not

Write some code to allow both to be handled.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-18 19:12:30 -05:00
Olivier Dugeon
065f7c7cc0
Merge pull request #7351 from opensourcerouting/feature/pathd
Add a new SR-TE policy management daemon and an optional PCEP module
2020-12-18 20:28:22 +01:00
Sebastien Merle
4d7b695d3a pathd: New SR-TE policy management daemon
This new daemon manages Segment-Routing Traffic-Engineering
(SR-TE) Policies and installs them into zebra. It provides
the usual yang support and vtysh commands to define or change
SR-TE Policies.

In a nutshell SR-TE Policies provide the possibility to steer
traffic through a (possibly dynamic) list of Segment Routing
segments to the endpoint of the policy. This list of segments
is part of a Candidate Path which again belongs to the SR-TE
Policy. SR-TE Policies are uniquely identified by their color
and endpoint. The color can be used to e.g. match BGP
communities on incoming traffic.

There can be multiple Candidate Paths for a single
policy, the active Candidate Path is chosen according to
certain conditions of which the most important is its
preference. Candidate Paths can be explicit (fixed list of
segments) or dynamic (list of segment comes from e.g. PCEP, see
below).

Configuration example:

segment-routing
 traffic-eng
  segment-list SL
   index 10 mpls label 1111
   index 20 mpls label 2222
  !
  policy color 4 endpoint 10.10.10.4
   name POL4
   binding-sid 104
   candidate-path preference 100 name exp explicit segment-list SL
   candidate-path preference 200 name dyn dynamic
  !
 !
!

There is an important connection between dynamic Candidate
Paths and the overall topic of Path Computation. Later on for
pathd a dynamic module will be introduced that is capable
of communicating via the PCEP protocol with a PCE (Path
Computation Element) which again is capable of calculating
paths according to its local TED (Traffic Engineering Database).
This dynamic module will be able to inject the mentioned
dynamic Candidate Paths into pathd based on calculated paths
from a PCE.

https://tools.ietf.org/html/draft-ietf-spring-segment-routing-policy-06

Co-authored-by: Sebastien Merle <sebastien@netdef.org>
Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Co-authored-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-12-18 16:34:02 +01:00
whitespace
9fa6ec1473 tests: please follow the style guide
thanks

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-12-17 15:32:55 -05:00
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