301 Commits

Author SHA1 Message Date
Arthur de Kerhor 3ae91215be graceful restart: send initial paths list to all neighbors
Before this PR, when graceful restart was configured for a neighbor
and when the restart flag was set by the restarting speaker, if
the neighbor was not advertising the GR capability, the initial
paths list was never sent by the restarting speaker to its neighbor

This is a problem when the server is configured with graceful
restart for all its peers without knowing if the peer supports it.
If some of the peers don't support it, they may never receive the
routes from the restarting speaker, leading to an inconsistent
routing state.
2024-04-30 16:05:51 +02:00
Maxime Peim 9fbc03765a send-max: respect configuration 2024-04-29 17:29:42 +09:00
Yuya Kusakabe 270ee41d9a mup: add Source Address to Type 1 ST Route
This patch adds Source Address to Type 1 ST Route as defined in draft-mpmz-bess-mup-safi-03.
See https://datatracker.ietf.org/doc/html/draft-mpmz-bess-mup-safi-03#section-3.1.3
2023-12-15 15:24:24 +09:00
Joshua DeWald 02fa6129af Implementation of Dynamic Neighbor MD5 (Issue #2589)
Adds usage of the "prefix-based" TCP MD5 for dynamic
neighbors. Non-dynamic neighbors will continue to use
non-prefix based, which makes it more compatible with
running on older kernels, as only 4.14+ includes the
necessary support.

This change also includes tests of dynamic peers in general.
2023-11-07 11:28:12 -08:00
Pavel Odintsov d5809673ed Added hack to address nose library incompatibility with Python 3.10 2023-07-15 18:34:26 +01:00
Yuya Kusakabe cbd1d66d8b mup: fix TEID processing in Type 1/2 ST Route
Fix TEID processing in Type 2 ST Route:
- TEID can be 0-32 bits value as described in I-D.

Accept hex and IPv4 format for TEID in CLI and show TEID as IPv4 format in CLI.
- TEID is generally represented in hexadecimal format.
- IPv4 format is useful because Type 2 ST Route can be used in the longest match algorithm as described in I-D.
2023-03-23 16:19:33 +09:00
Yuya Kusakabe cc75b037c1 cli,mup: support Prefix SID in Interwork/Direct Segment Discovery route 2022-10-16 17:01:26 +09:00
Yuya Kusakabe b77c0cec07 cli,mup: add mup option to t2st
> When advertising the Type 2 ST route, the controller SHOULD attach a BGP MUP Extended community corresponding to the Direct segment.
https://www.ietf.org/archive/id/draft-mpmz-bess-mup-safi-01.html#name-generation-of-the-type-2-st
2022-10-16 17:01:02 +09:00
Yuya Kusakabe 975db96b86 mup: handle Type 1 ST Route Prefix as Prefix instead of single address
See https://www.ietf.org/archive/id/draft-mpmz-bess-mup-safi-01.html#name-bgp-type-1-session-transfor for details.
2022-09-28 11:38:26 +09:00
Yuya Kusakabe 6966da918c mup: fixes for BGP-MUP
- Route Target support for MUP routes
- Only Direct Segment Discovery route needs MUP Extended Community
- TEID value of 0 is invalid
2022-09-01 15:24:40 +09:00
Yuya Kusakabe 1f024afaa0 test: add scenario test for BGP-MUP SAFI and Extended Community 2022-08-31 20:59:52 +09:00
FUJITA Tomonori 49a3897be8 fix markdownlint warnings
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2022-08-05 20:38:21 +09:00
FUJITA Tomonori 307c913fb2 update scnario tests doc and script
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-09 12:40:34 +00:00
FUJITA Tomonori e3b99e3f47 delete unmaintained jenkins script for testing
who still uses jenkins?

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2021-12-09 12:40:27 +00:00
Imcom Jin af37271526 added .env file for vscode to find test/lib module
replace `is not` exp in *_test.py files to suppress python syntax warning with py3
2020-08-31 17:58:01 +08:00
FUJITA Tomonori 2e05695f68 avoid installing routes with originator ID to global when softresetin
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-26 07:02:54 +09:00
FUJITA Tomonori f1f0f77f59 test: update scenario_test dependencies
- python3 is necessary
- no need to download docker images in advance

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-21 20:05:33 +09:00
FUJITA Tomonori 75cf2deb5b test: update scenario_test command
specify the name of a docker image to use the image built locally.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-21 20:01:56 +09:00
FUJITA Tomonori 19e99002f5 test: rm pipework functions
not used anymore.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-10-21 13:21:10 +09:00
mageshgv 29412028a7 Fix adj-out display with add path enabled 2019-10-18 07:28:10 +09:00
mageshgv 0794811562 Transition to graceful restart state on hold timer expiry if applicable 2019-10-17 14:54:52 +09:00
mageshgv 0235f7c675 Support vrfs in zapi multipath 2019-10-15 20:58:16 +09:00
mageshgv 0da37b0210 Maintain unique vrf IDs in watchEventBestPath vrf map
Fixes missing route propagation to proper vrfs in zapi
2019-10-04 18:19:05 -07:00
Magesh GV 6f3cb40164 Update adjrib for LLGR and preserve aslooped attr
Fixes LLGR community cleared on softreset.
Fixes AS Path looped routes added back to rib on Graceful Restart.
2019-10-02 20:45:44 +09:00
Franza Cavalcante 8c90684b27 Python3 support to gobgp tests
This PR removes dependencies on old Fabric version, as it's not
supported by Python3.

The current Fabric versions don't support the colors and indent
used previously, so we found substitute methods from other
libraries and defined these in the library files.

The local function from fabric is now just a wrapper to invoke's
run function. All the files were processed through 2to3 command.

All the tests were executed and we don't see any difference on
the outputs when running Python2 or Python3.

The creation of gobgp container is removed from base.py into
fabfile.py, in order to comply with Fabric2 changes and simplify
dependencies.
2019-06-22 19:53:11 +09:00
Nasato Goto e27d517183 scenario_test: fix malfunctional test 2019-04-08 18:41:18 +09:00
FUJITA Tomonori 301b48532d support received, accepted, and advertised counters per family
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-11-26 17:49:48 +09:00
Carl Baldwin 8bccb4278a Use assertEqual in python tests
In trying to run the local tests, I found that changing these
assertTrue calls to assertEqual helped me out. With this, a failure
shows the actual and expected values rather than just saying "True is
not False" which is less helpful.
2018-10-29 20:10:19 +00:00
Nasato Goto e792901691 test: Fix bridge methos and relative scenario test
This patch fix the logic of addif methos of Bridge class.
IP address information will be registerd according to the
IP version of bridge.
This change lead the fixing of one of scenario test, "bgp_zebra_test.py".
2018-08-28 08:49:11 +09:00
FUJITA Tomonori 008c961ecd policy cleanup
- remove ReplaceDefinedSet and ReplaceStatement APIs; not intutive and
  should create a new one instead of modifying the existing.

- Rename ReplacePolicyAssignment to SetPolicyAssignment API; we use
  internally SetPolicy() name from the beginning.

- Rename UpdatePolicy() to SetPolicies() API; It doesn't update
  anything so the name is confusing. It discards the all policies and
  create policies from the argument.

- Changes some member names in structures for policy.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-23 10:05:19 +09:00
FUJITA Tomonori 71e56c542e rpc cleanup
- clean up RPC function names
- rewrite gobgp command to use the api instead of config package
- delete unused client package

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-08 21:24:48 +09:00
Jeff Bean 72bbb96783 potential - Found a bug in the python tests 2018-06-23 18:38:23 -07:00
Marcin Ptaszyński 5fbd0cb243 table: support AfiSafiIn Policy Condition match 2018-06-13 20:53:17 -07:00
IWASE Yusuke e84ed701c0 graceful_restart_test: Confirm stale paths removed
This patch adds checks to confirm the stale paths are also removed from
the adj-RIB-in table.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-30 12:58:07 +09:00
IWASE Yusuke 57e87d41a8 graceful_restart_test: Assert timer not expired
This patch fixes to assert the Graceful Restart time is not expired
while waiting for re-establishing peer connection.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-30 12:57:30 +09:00
IWASE Yusuke a9584e6eb3 scenario_test: Extend Graceful Restart time
The current Graceful Restart time is 20 sec, but this value is not
enough long and can be exceeded unexpectedly while waiting for
re-establishing peer connections. Then the stale paths on a receiving
router are dropped before the paths successfully synced, and some test
cases on "graceful_restart_test.py" will be passed unexpectedly.

This patch extends the Graceful Restart time to 30 sec and introduces
the constants for Graceful Restart time and Long-Lived Graceful Restart
time.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-30 11:33:02 +09:00
IWASE Yusuke b31ab93fb4 bgp_zebra_nht_test: Test case to sync nexthop states
This patch adds a test case to test if the path, which came after the
NEXTHOP_UPDATE message was received from Zebra, is updated by reflecting
the nexthop cache.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-29 11:15:20 +09:00
FUJITA Tomonori df6c998bc1 table: update accepted number in adj-in rib after softreset-in
update accepted number in adj-in rib after AllowOwnAs has changed.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28 23:20:59 +09:00
FUJITA Tomonori aef984c85c test/aspath: check accepted and received numbers
make sure that an adj-rib return the accepted and received numbers
when it has an as-looped path.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-05-28 22:25:52 +09:00
IWASE Yusuke 503d043c62 rtc_test: Test cases for infinite RTC UPDATE loop
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-28 15:47:17 +09:00
IWASE Yusuke ee80298806 rtc_test: Test cases for inter-AS
This patch adds test cases for the Route Target Constraint of the
inter-AS route distribution and combination of the inter-AS and intra-AS
route distribution.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-28 10:50:13 +09:00
IWASE Yusuke d9ed5fcc11 rtc_test: Enhance test cases for intra-AS RTC
This patch adds assertion points for the counts of advertised and
received routes. Also adds comments for the states of VRFs and routes.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-28 09:30:05 +09:00
IWASE Yusuke eb568b68d2 server: Withdraw routes when received RTM withdrawal
Because the RTM is removed from adj-RIB-in before collecting the
candidate routes to be withdrawn, the candidates are unexpectedly
filtered before sending withdraw messages. Then on the peers, the VPN
routes are left on.

This patch fixes to selects candidates from the filtered paths and send
withdraw messages as expected. Also resolves the TODO in
"test/scenario_test/rtc_test.py".

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-24 08:41:35 +09:00
Satoshi Fujimoto a7ecbaac46 test/rtc: Add test for conflict RTC config
Add test for the issue reported on #1682
(https://github.com/osrg/gobgp/issues/1682).

Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
2018-05-24 08:32:03 +09:00
IWASE Yusuke 87245b488b bgp_zebra_nht_test: Test cases when nexthop unreachable
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23 13:00:33 +09:00
IWASE Yusuke 34f74cd314 bgp_zebra_nht_test: Improve pylint result
Also removes a debug print.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23 13:00:33 +09:00
IWASE Yusuke 2c5f27f7cf bgp_zebra_nht_test: Use utility functions of test/lib
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-23 13:00:33 +09:00
IWASE Yusuke 107095db19 bgp_confederation_test: Improve pylint result
Also removes a debug print

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-21 16:33:05 +09:00
IWASE Yusuke 8efeb17ba5 bgp_router_test: Retry assertions of RIB for stability
To improve the stability of "bgp_router_test.py", this patch fixes to
retry assertions of RIB on a Quagga router after shutting down a
neighbor.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-21 16:31:54 +09:00
IWASE Yusuke 2c388e0757 scenario_test: Wait for GoBGP starting up
For the stability of some scenario tests, this patch fixes to wait for
GoBGP starting up after restarting GoBGP daemon. Currently, there are
cases that CLI command can be called without checking whether GoBGP
daemon is surely started or not.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-05-15 09:46:16 +09:00