370 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 9f2b64779a Reworked gobgp test to use collections.abc.Mapping to fix compatibility with Python 3.10 2023-07-15 18:35:19 +01: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
Jakub Chábek 7014234253 Add SIGINT as shutdown signal 2021-11-24 21:46:50 +09:00
FUJITA Tomonori 3d51923e3c make CI faster
Build GoBGP binaries of a pull request locally and copy them to the
container to be tested instead of copying the code into the container
and building the binaries inside.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2020-11-09 22:47:14 +09: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
FUJITA Tomonori 2aced9efac test: fix the versions of fabric and invoke
Seems that the latest versions change the APIs so CI tests fails.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-08-20 13:28:42 +00: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 2203e7640b test: switch to module from dep completely
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
2019-04-04 21:33:20 +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
FUJITA Tomonori d50f1fe374 test: fix get_reachability()
the output of ping command changed?

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-31 21:17:13 +09:00
Nasato Goto 23ac6ebb86 test/lib: Enable static IP address
This patch enable us to give test containers a static IP address
by passing 'ip_addr' argument to addif method.
In addition, 'v6=True' argument is needed when we specify static IPv6 address.

Usage:
  br01 = Bridge(name='br01', subnet='192.168.0.0/24', self_ip=False)
  g1 = GoBGPContainer(name='g1', asn=64512 router_id='10.0.0.1')
  br01.addif(g1, ip_addr='192.168.0.11')
2018-08-28 08:49:11 +09: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
Nasato Goto 7e07240b29 test/lib: Fix pkill command syntax for BusyBox
Fix syntax of pkill in order to make use of it for BusyBox Linux based container available.
This change is compatible with use of pkill for usual Linux.
2018-08-21 19:29:22 +09:00
Nasato Goto b45e3fa588 test/lib: Change shell for init script
Change shell of start.sh from /bin/bash to /bin/sh in order to
make BusyBox Linux based container available for scenario test.
2018-08-21 19:01:25 +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
FUJITA Tomonori c4775c4251 follow Standard Go Project Layout
https://github.com/golang-standards/project-layout

Now you can see clearly what are private and public library code.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-07-07 20:44:25 +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