summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/bgp_router_test.py
AgeCommit message (Collapse)Author
2020-08-31added `.env` file for vscode to find test/lib moduleImcom Jin
replace `is not` exp in *_test.py files to suppress python syntax warning with py3
2019-06-22Python3 support to gobgp testsFranza Cavalcante
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.
2018-10-29Use assertEqual in python testsCarl Baldwin
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-05-21bgp_router_test: Retry assertions of RIB for stabilityIWASE Yusuke
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-01-27scenario_test: Enable to try assertion several timesIWASE Yusuke
Some times, on Travis-CI, some test cases fail unexpectedly in checking paths in RIBs due to advertisements are not yet received from other routers. Currently, in order to avoid this unexpected result, "time.sleep" is inserted after adding new routes, but it is not enough. This patch introduces a new function to enable to do assertion several times and avoid failure with the first assertion. Note: This patch does not introduces this change into all test cases, do only into some test cases which fail relatively frequently. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2018-01-27test/lib/Quagga: Use vtysh to add/del routesIWASE Yusuke
Currently, to advertise or withdraw routes on QuaggaBGPContainer, we need to configure static routes in configure file and restart Quagga daemons. In other words, we can NOT send withdrawing advertisement from Quagga side. Also, restating Quagga daemons frequently can make scenario test unstable, and it should be avoided. This patch fixes to use "vtysh" and reduces the number of restating Quagga daemons. Note: According to this change, adding routes on Quagga should be called after starting daemons. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-03-16test/lib: Move noseplugin.py to test/lib module directoryIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2017-03-16scenario_test: pep8 and pylint improvementsIWASE Yusuke
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
2017-03-07scenario_test: Remove "sudo" command for running testsIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2016-12-02server: fix bug of deleteNeighbor()Wataru Ishida
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 <ishida.wataru@lab.ntt.co.jp>
2016-11-12test: remove tcpdump usage in bgp_router_test.pyFUJITA Tomonori
It's unreliable. Use monitor command instead. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-07test: use passive connection for gobgp and gobgp connectionFUJITA Tomonori
kinda workaround. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-09test: fix bug of bgp_router_test.pyWataru Ishida
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 <ishida.wataru@lab.ntt.co.jp>
2016-10-04server: fix bug of withdrawal handlingWataru Ishida
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-10-03test: Adopt to the updated Ryu BGP Packet lib APIIWASE Yusuke
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 <iwase.yusuke0@gmail.com>
2016-08-25api/cli: kill cmd package custom path/destination structsWataru Ishida
reuse table package Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-25server/api: fix GetRib API to return sorted destinationWataru Ishida
the feature has been broken. Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
2016-08-15test: skip BGPKeepAliveISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-08-03server: fix advertising multiple local withdrawals with same prefixISHIDA Wataru
a bug introduced by 332766189685028c4f9852e4285fb1a9025223cc Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-08-03test: deconfigure deleted peer for later testsISHIDA Wataru
Depending on Docker version, Docker re-allocates deleted container's IP address to new container. If both deleted and new container run a BGP daemon and are peering to other containers, other containers who think they are connecting to deleted container's BGP daemon wrongly connect to new container's BGP daemon (because IP address is same) To avoid this issue, let's deconfigure deleted peer before going to next test. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-06-02server: fix another regression of active connectionISHIDA Wataru
Another regression introduced by 4c9cd88c61cb848e36a45657b7cbc63b9c783dc4 Previous fix (81bc3851b2c1f112f157b98a3cf60757a199a31a) fixes active connection of neighbors configured via configuration file. This fixes that of neighbors configured via gRPC API. Test is also added. Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-24test: add BGPContainer.define_policy() and BGPContainer.assign_policy()ISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-04-19server: send local withdrawal paths regardless of path calculation resultISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-03-31server: update path-attributes when peer is disconnectedISHIDA Wataru
close #807 also add a test to check this issue is fixed Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2016-03-14scenario_test: run scenario test on travisHiroshi Yokoi
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
2016-02-29server: support active connection with md5 protectionISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-11-11scenario_test: use default interface for ipv4-peeringISHIDA Wataru
avoid creating many linux bridges via pipework Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-11-08scenario_test: test local-pref and med handlingISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-08-08*: kill protobuf path structureISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-29test: insert sleep to fix unstable testISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-27test: introduce test_prefix to separate test executionISHIDA Wataru
test_prefix is used for work directory, docker name, bridge name Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-24test: build docker image once, use it for all testsISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-14server: fix bug of active connectionISHIDA Wataru
also added scenario test to check active connection properly works Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-03test: stop using gobgp monitor commandISHIDA Wataru
gobgp monitor command can failed to get notification. stop using it in case Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-03test: stretch timeoutISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-03server: bug fix of extra as-path prependingISHIDA Wataru
When gobgp originates a route, the generated route had incorrect as-path. this patch fix this bug. Scenario test is also added to check this. [before] $ gobgp neighbor global rib Network Next Hop AS_PATH Age Attrs *> 10.0.1.0/24 192.168.10.3 65001 00:03:20 [{Origin: IGP} {Med: 0}] *> 10.0.2.0/24 192.168.10.4 65002 00:03:36 [{Origin: IGP} {Med: 200}] *> 10.10.0.0/24 0.0.0.0 65000 00:03:37 [{Origin: IGP}] $ gobgp neighbor 192.168.10.5 adj-out Network Next Hop AS_PATH Attrs 10.0.1.0/24 192.168.10.2 65000 65001 [{Origin: IGP}] 10.0.2.0/24 192.168.10.2 65000 65002 [{Origin: IGP}] 10.10.0.0/24 192.168.10.2 65000 65000 [{Origin: IGP}] [after] $ gobgp neighbor global rib Network Next Hop AS_PATH Age Attrs *> 10.0.1.0/24 192.168.10.3 65001 00:03:20 [{Origin: IGP} {Med: 0}] *> 10.0.2.0/24 192.168.10.4 65002 00:03:36 [{Origin: IGP} {Med: 200}] *> 10.10.0.0/24 0.0.0.0 00:03:37 [{Origin: IGP}] $ gobgp neighbor 192.168.10.5 adj-out Network Next Hop AS_PATH Attrs 10.0.1.0/24 192.168.10.2 65000 65001 [{Origin: IGP}] 10.0.2.0/24 192.168.10.2 65000 65002 [{Origin: IGP}] 10.10.0.0/24 192.168.10.2 65000 [{Origin: IGP}] Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-03test: check gobgp properly adds it's own asn to aspathISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-07-03test: introduce modular test libraryISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-04-15api: add a method to convert internal structs to protobuf structsISHIDA Wataru
- add ToApiStruct() for convertion of internal structs to protobuf structs to avoid ugly convertion by json.Marshal() && json.Unmarshal() - move grpc server code under /server instead of /api - update proto file to include more detailed path information Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-04-14scenario_test: bgp_router_test retry checking ribHiroshi Yokoi
2015-04-14api: use gRPC instead of RESTISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
2015-03-29scenario_test: add non-route-server bgp scenario testISHIDA Wataru
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>