263 Commits
Author SHA1 Message Date
Satoshi Fujimoto eed50e9d04 test: Test for Graceful Restart with multiple peers
Signed-off-by: Satoshi Fujimoto <[email protected]>
2017-06-08 13:44:13 +09:00
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
Denis ShevchenkoandFUJITA Tomonori b37d9bb56a flowspec: handling of >2 logical elements and fixed test 2017-05-23 14:30:33 +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
FUJITA Tomonori 353c9c1711 test: remove unnecessary root check in bgp_unnumbered_test.py
Signed-off-by: FUJITA Tomonori <[email protected]>
2017-04-18 14:47:54 +09:00
IWASE YusukeandFUJITA Tomonori 3b25c7c850 scenario_test/README: Update commands to clean up
Signed-off-by: IWASE Yusuke <[email protected]>
2017-04-17 23:05:59 +09:00
IWASE YusukeandFUJITA Tomonori 3881b9b3fe scenario_test/README: Remove list for each test file
For the maintainability, this patch removes the list for each scenario
test file.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-04-17 23:05:59 +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
IWASE YusukeandFUJITA Tomonori 616ae9f2cd scenario_test/README: Remove redundant brake tag
Also adds the language type of code blocks.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-04-17 23:05:59 +09:00
IWASE YusukeandFUJITA Tomonori c3b41aff38 scenario_test/README: Update list of required images
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 be6a0dbe86 scenario_test: Test for NextHop Tracking with Zebra
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-17 11:24:26 +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 0f102be986 scenario_test: pep8 and pylint improvements
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
IWASE Yusuke 5d3fba4293 jenkins-build-script: Add shebang line
Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-16 15:25:07 +09:00
IWASE Yusuke 4d7e3bd16f scenario_test: Remove "sudo" command for running tests
For the convenience when running scenario_test on Python virtualenv,
this patch removes "sudo" command for running tests.

Note: To enable to execute Docker without the root privilege, add
your local user into "docker" group.

Signed-off-by: IWASE Yusuke <[email protected]>
2017-03-07 16:36:06 +09:00
Matthieu TexierandFUJITA Tomonori 55e9684259 flowspec: comply with new draft RFC5575bis normalized operators 2017-03-02 15:56:02 +09:00
Matthieu TexierandFUJITA Tomonori 6de16dc885 flowspec: comply with RFC 5575 about TCP flags rules
This patch proposes a new way to configure BGP flowspec TCP flags
rules It allows to comply with RFC 5575 by defining flags like this
=SA =A / '!SA' / '=SA&=!U' = means match, ! means not, & means and,
all TCP flags are identified by their first charater S for SYN A for
Ack ...
2017-02-17 21:20:59 +09:00
ISHIDA WataruandFUJITA Tomonori f276279bf6 table: fix bug of adj-table accepted counter
old filtered value could be POLICY_DIRECTION_IMPORT

Signed-off-by: ISHIDA Wataru <[email protected]>
2017-02-15 00:03:57 +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 IshidaandFUJITA Tomonori fff2c32fb4 server: fix bug when global import policy rejects a route
routes rejected by global import policy was not deleted from RIB

Signed-off-by: Wataru Ishida <[email protected]>
2016-12-10 06:51:21 -08:00
Wataru Ishida e4a4b3e382 server: fix bug of deleteNeighbor()
cleaning outgoing channel while fsm handler is running may cause crash

Dec  2 06:14:36 g2 gobgpd[6955]: {"Topic":"Peer","level":"info","msg":"Delete a peer configuration for:10.173.176.211","time":"2016-12-02T06:14:36Z"}
Dec  2 06:14:36 g2 gobgpd[6955]: {"Data":"","Key":"10.173.176.211","Topic":"Peer","level":"warning","msg":"sent notification","time":"2016-12-02T06:14:36Z"}
Dec  2 06:14:36 g2 gobgpd[6955]: {"Key":"10.173.176.211","Reason":"notification-sent code 6(cease) subcode 3(peer deconfigured)","State":"BGP_FSM_ESTABLISHED","Topic":"Peer","level":"info","msg":"Peer Down","time":"2016-12-02T06:14:36Z"}
Dec  2 06:14:36 g2 gobgpd[6955]: panic: interface conversion: interface {} is nil, not *server.FsmOutgoingMsg
Dec  2 06:14:36 g2 gobgpd[6955]: goroutine 69 [running]:
Dec  2 06:14:36 g2 gobgpd[6955]: panic(0xd26200, 0xc82030c4c0)
Dec  2 06:14:36 g2 gobgpd[6955]: /usr/local/go/src/runtime/panic.go:481 +0x3e6
Dec  2 06:14:36 g2 gobgpd[6955]: github.com/osrg/gobgp/server.(*FSMHandler).sendMessageloop(0xc8201a66e0, 0x0, 0x0)
Dec  2 06:14:36 g2 gobgpd[6955]: /usr/local/opt/gopath/src/github.com/osrg/gobgp/server/fsm.go:1136 +0x3c3
Dec  2 06:14:36 g2 gobgpd[6955]: github.com/osrg/gobgp/server.(*FSMHandler).(github.com/osrg/gobgp/server.sendMessageloop)-fm(0x0, 0x0)
Dec  2 06:14:36 g2 gobgpd[6955]: /usr/local/opt/gopath/src/github.com/osrg/gobgp/server/fsm.go:1175 +0x2e
Dec  2 06:14:36 g2 gobgpd[6955]: gopkg.in/tomb%2ev2.(*Tomb).run(0xc8201a66e0, 0xc820278140)
Dec  2 06:14:36 g2 gobgpd[6955]: /usr/local/opt/gopath/src/gopkg.in/tomb.v2/tomb.go:163 +0x21
Dec  2 06:14:36 g2 gobgpd[6955]: created by gopkg.in/tomb%2ev2.(*Tomb).Go
Dec  2 06:14:36 g2 gobgpd[6955]: /usr/local/opt/gopath/src/gopkg.in/tomb.v2/tomb.go:159 +0x131

Signed-off-by: Wataru Ishida <[email protected]>
2016-12-02 02:18:09 -05:00
Wataru Ishida 93d1dca70a config: simplify route-disposition configuration
before:

```yaml
actions:
    route-disposition:
        accept-route: true
        reject-route: false
```

after

```yaml
action:
    router-disposition: accept-route
```

Signed-off-by: Wataru Ishida <[email protected]>
2016-11-17 23:22:55 -05: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 141535f344 test: wait for condition properly rather than randomly waiting in vrf_neighbor_test2
Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-12 21:26:43 -08: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 c463e12538 test: use passive connection for gobgp and gobgp connection
kinda workaround.

Signed-off-by: FUJITA Tomonori <[email protected]>
2016-11-07 22:01:39 -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 Ishida 4534be2609 server: fix bug of disable/enable/softreset behavior for vrfed neighbor
Signed-off-by: Wataru Ishida <[email protected]>
2016-11-06 07:44:04 +00: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 900a1321ff test: fix bug of bgp_router_test.py
Since g3's route (MED 10) is weaker than g2's,
g3's route should not be advertised to g2 from g1.
But when g3's route arrives on g1 before g2's, g1 advertises g3's route.
This commit ensures g3's route come after g2's route

Signed-off-by: Wataru Ishida <[email protected]>
2016-10-09 06:32:42 +00: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 Ishida c2ad9462d6 server: fix bug of withdrawal handling
Signed-off-by: Wataru Ishida <[email protected]>
2016-10-04 04:08:35 +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
IWASE YusukeandFUJITA Tomonori a021647b0a test: Adopt to the updated Ryu BGP Packet lib API
From Ryu v4.6, the Packet library can parse the entire BGP packet
via packet.Packet() API.
This patch fixes to adopt bgp_router_test.py to the updated API,
and reverts the Ryu version in pip-requires.txt to the latest.

Signed-off-by: IWASE Yusuke <[email protected]>
2016-10-03 16:31:51 -07:00
Wataru IshidaandFUJITA Tomonori 22f888766a travis: divide scenario tests to multiple travis jobs
Signed-off-by: Wataru Ishida <[email protected]>
2016-09-14 11:32:45 +09:00