70 Commits
Author SHA1 Message Date
FUJITA Tomonori 7a34c7c0ed test: ignore the failure of caching dependeny with building docker image
`go get -d github.com/osrg/gobgp/...` could fail (e.g., an imported
library has gone). After that, we build a docker image from modified
source code.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-06-07 21:06:57 +09:00
Wataru Ishida 9b9a65d410 *: support replace-peer-as (aka as-override)
we use the term replace-peer-as instead of as-override
since openconfig is using it.

cli

```
$ gobgp n add <neighbor-addr> as <asn> replace-peer-as
```

config

```
neighbor:
  config:
    peer-as: <asn>
    neighbor-address: <neighbor-addr>
  as-path-options:
    config:
      replace-peer-as: true
```

Signed-off-by: Wataru Ishida <[email protected]>
2017-05-10 08:15:00 +00:00
Wataru Ishida 1f053c25c4 *: support remove private as
cli

```
$ gobgp n add <neighbor-addr> as <asn> remove-private-as (all|replace)
```

config

```
neighbor:
  config:
    peer-as: <asn>
    neighbor-address: <neighbor-addr>
    remove-private-as: all
```

Signed-off-by: Wataru Ishida <[email protected]>
2017-05-10 08:05:47 +00:00
ISHIDA Wataru 0f62519cd7 server: ignore routes when local AS is in AS_PATH
RFC4271 9.1.2 Phase 2: Route Selection

If the AS_PATH attribute of a BGP route contains an AS loop, the BGP
route should be excluded from the Phase 2 decision function.  AS loop
detection is done by scanning the full AS path (as specified in the
AS_PATH attribute), and checking that the autonomous system number of
the local system does not appear in the AS path.  Operations of a BGP
speaker that is configured to accept routes with its own autonomous
system number in the AS path are outside the scope of this document.

Also this commit adds support for allow-own-as option to relax this.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-05-09 11:10:45 -04:00
FUJITA Tomonori 633b693ec5 test: fix container build for test
fix the regression of commit e429c1aaf4

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-21 01:09:03 -07:00
FUJITA Tomonori e429c1aaf4 test: change Dockerfile for faster container build
use cache wisely.

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-18 23:28:05 +09:00
FUJITA Tomonori c2e7632397 Revert "test/lib/gobgp: Use local GoBGP executables in contaier"
This reverts commit 47ab84e34c.

using the same binaries on a host and inside a container isn't always
feasible (by default, not statically linked binary).

Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-18 23:28:00 +09:00
IWASE YusukeandFUJITA Tomonori 47ab84e34c test/lib/gobgp: Use local GoBGP executables in contaier
Currently, to reflect the modification of the local source code or to
switch the base image for GoBGP container, it is required to re-build
the GoBGP container image, and this take a long time to test or debug
with the scenario tests.

This patch fixes to use the local GoBGP executables (gobgp and gobgpd)
in container, and enables to reflect the changes without rebuidling
container image.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-04-17 23:05:59 +09:00
ISHIDA WataruandFUJITA Tomonori c7985efcf5 test: add test for unnumbered bgp feature
Signed-off-by: ISHIDA Wataru <[email protected]>
2017-04-04 22:07:46 +09:00
IWASE Yusuke e7a2c8e4a4 scenario_test: Support OSPFd in Quagga container
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-17 11:23:35 +09:00
IWASE Yusuke d9d1eb3eea scenario_test: Enable to start OSPFd in GoBGP container
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-17 11:19:18 +09:00
IWASE Yusuke a7932d7089 test/lib/quagga: Avoid ambiguous command "en"
With the newer version of Quagga, "en" command will be regarded as an
"Ambiguous command", because there are two commands "enable" and "end".

This patch replaces "en" command with "enable" command, and fixes this
problem.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 16:31:14 +09:00
IWASE Yusuke ecc9b5631e test/lib: Enable to disply name of config file
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 16:14:20 +09:00
IWASE Yusuke afc1fcb1e3 test/lib: Move noseplugin.py to test/lib module directory
To enable to use "noseplugin" as the Python module from the absolute
import scope in scenario_test, this patch moves noseplugin.py to
test/lib module directory.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 16:14:20 +09:00
IWASE Yusuke 03ba90ac0d test/lib: pep8 and pylint improvements
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 16:14:20 +09:00
IWASE Yusuke 2b86b42c7f scenario_test: "--force" option to remove directories
To avoid the intractive prompt before removals, this patch adds
"--force" option to remove directories.
Also, fixes "--recursive" to "--force" option when removing xml
files (not directories).

Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 15:25:07 +09:00
ISHIDA WataruandFUJITA Tomonori 3703916e55 server: fix in-policy bug
When a path is rejected by in-policy, the prefix must be withdrawn
since it might already exist in the rib.

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-09 14:59:03 +09:00
Wataru Ishida c4ced97e76 cli: use client library
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:46 +00:00
Wataru Ishida 3f2dd34d37 client: add golang client library
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 02:15:45 +00:00
Wataru Ishida b77dc6aa54 policy: fix bug of policy with multiple statements
policy can have multiple statements. In each statement, when condition
is matched, route-action is finally evaluated after actions with mods.
When route-action is 'none', we contine to next statement if it exists.
When route-action is 'accept' or 'reject', we stop proceeding.

This patch fixes a bug that route-action can't be set to 'none' which
means route-action always be set to 'accept' or 'reject' and can't proceed
to the next statement.

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-14 00:58:25 +00:00
FUJITA Tomonori 718e8076ff test: remove tcpdump usage in bgp_router_test.py
It's unreliable. Use monitor command instead.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-12 21:22:06 -08:00
FUJITA Tomonori 0af24ff85d test: add change of best paths from ibgp and ebgp
gobgp has two ibgp peers and one ebgp.

1. the best path is from ebgp so advertise it to ibgp peers.
2. one of ibgp peer sends the same path so now the path from ibgp
becomes best.
3. gobgp doesn't advertise it to another ibgp and needs to withdraw
the best from ebgp.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-07 19:08:34 -08:00
Wataru IshidaandFUJITA Tomonori a17832195c support neighbor belongs to VRF
$ gobgp vrf add red rd 100:100 rt both 100:100
$ gobgp neighbor add 10.0.0.1 as 2 vrf red
$ gobgp vrf red neighbor
Peer     AS  Up/Down State       |#Advertised Received Accepted
10.0.0.1 2   never   Active      |          0        0        0

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-04 13:19:47 +09:00
Wataru IshidaandFUJITA Tomonori 614746ca11 *: support long lived graceful restart
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-09 07:18:13 -07:00
Wataru Ishida ebd7306fd6 test: add test for vrf route injecting
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-04 05:46:26 +00:00
Wataru IshidaandFUJITA Tomonori 251c32ae0f test: add scenario test for zapi v3
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-03 17:04:53 -07:00
FUJITA Tomonori e8da11a5c4 test: use Docker's native network feature instead of pipework
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-09-12 23:07:44 -07:00
FUJITA Tomonori bad9935cd2 test: stop tcpdump write buffering
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-09-01 21:41:21 +09:00
Wataru IshidaandFUJITA Tomonori 3235c0618c api/cli: kill cmd package custom path/destination structs
reuse table package

Signed-off-by: Wataru Ishida <[email protected]>
2016-08-25 15:53:14 +09:00
ISHIDA WataruandFUJITA Tomonori 061d894c14 test: execute gobgp monitor on docker host
docker-py's exec_start stream fails often.
execute gobgp monitor on docker host instead.

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-08-15 18:53:03 +09:00
ISHIDA WataruandFUJITA Tomonori b5e49f1319 server: fix advertising multiple local withdrawals with same prefix
a bug introduced by 3327661896

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-08-03 12:09:07 +09:00
ISHIDA WataruandFUJITA Tomonori c54f6e8289 server: support injecting multipath to zebra
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-06 12:43:20 +09:00
ISHIDA Wataru 81bc3851b2 server: fix active connection regression
regression introduced by 4c9cd88c61

also fix test/lib to test configuration without local-address
(configure local-address only if neighbor-address is IPv6)

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-01 17:37:58 +00:00
ISHIDA Wataru addc3902e8 server: support peering with ipv6 link local address
fix DialTCPTimeoutWithMD5Sig to handle ipv6 scope-id
also update ipv6 test to test this feature

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-06-01 05:06:37 +00:00
ISHIDA Wataru 0dbf1d87cb policy: add local-pref action
$ gobgp policy statement st01 add action local-pref 110

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-25 02:53:42 +00:00
ISHIDA WataruandFUJITA Tomonori a7521827e1 server/table: fix intra-AS RTC route distribution
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-23 09:46:53 +09:00
FUJITA Tomonori 8fd25af4ce zebra: make zebra config consistent with the rests
- split config and state
- move to Bgp structure (aligned with Rpki, Bmp, and Mrt)

Also makes zebra configured via GRPC channel.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-17 08:52:28 +09:00
ISHIDA WataruandFUJITA Tomonori f580bd8fdb test: enhance route server test
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-14 01:48:33 +09:00
ISHIDA Wataru c97a2ee34f test/bird: add RawBirdContainer for test with raw bird config
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-12 03:05:05 +00:00
ISHIDA Wataru cbb4a6ace6 test/gobgp: add RawGoBGPContainer for test with raw gobgp config
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-12 02:54:53 +00:00
ISHIDA WataruandFUJITA Tomonori c9f7596584 test/exabgp: add RawExaBGPContainer for test with raw exabgp config
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-11 18:49:03 +09:00
ISHIDA WataruandFUJITA Tomonori b780f5e590 test/quagga: add RawQuaggaBGPContainer for test with raw quagga config
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-11 18:49:03 +09:00
ISHIDA WataruandFUJITA Tomonori c2d4b6992c test: add start_tcpdump()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-05-11 18:49:03 +09:00
FUJITA Tomonori 95e5dee506 Revert "travis-ci: workaround for "
Now the issue was fixed. No need for the workaround:

https://github.com/kr/text/issues/6

This reverts commit 9c8dca5b69.
2016-05-09 14:12:25 +09:00
FUJITA Tomonori 9c8dca5b69 travis-ci: workaround for
go get doesn't work for github.com/kr/text because it doesn't have
master branch somehow.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-05-05 23:29:42 +09:00
ISHIDA Wataru f6c70e980d config: make route-target config struct aligned with open-config model
have config/state container

Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-27 10:07:02 +00:00
ISHIDA WataruandFUJITA Tomonori fb6e000457 test: enable pass multiple commands to vtysh()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-26 07:10:38 +09:00
ISHIDA Wataru 23252d9ad8 test: add BGPContainer.define_policy() and BGPContainer.assign_policy()
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-24 10:43:37 +00:00
ISHIDA Wataru 1b6532d822 test/quagga: use vtysh instead of telnet
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-24 09:11:19 +00:00
ISHIDA Wataru 206aa6bec4 test/gobgp: enhance policy configuration
Signed-off-by: ISHIDA Wataru <[email protected]>
2016-04-24 09:11:18 +00:00