mirror of
https://github.com/osrg/gobgp.git
synced 2024-05-11 05:55:10 +00:00
3ae91215be
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.
Scenario Test
This page explains how to set up a scenario test environment and run the test.
Contents
Prerequisites
Go, Docker, and Python3 need to be set up.
$ python --version
Python 3.9.7
$ go version
go version go1.17 linux/arm64
$ docker version
Client:
Version: 20.10.7
API version: 1.41
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu5.1
Built: Mon Nov 1 00:34:28 2021
OS/Arch: linux/arm64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.13.8
Git commit: 20.10.7-0ubuntu5.1
Built: Thu Oct 21 23:58:58 2021
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.5.5-0ubuntu3
GitCommit:
runc:
Version: 1.0.1-0ubuntu2
GitCommit:
docker-init:
Version: 0.19.0
GitCommit:
Set up dependencies
Execute the following commands to install the dependencies:
$ git clone https://github.com/osrg/gobgp
$ cd ./gobgp
$ python3 -m venv .test
$ source .test/bin/activate
$ pip install -r test/pip-requires.txt
Build GoBGP docker image form your source code
You need to build GoBGP docker image to test from the source code that you modified. You need run the following command every time you modify the source code.
$ fab -r ./test/lib make-gobgp-ctn
Run tests
There are two ways to run tests
-
Run all tests
You can run all scenario tests with run_all_tests.sh. If all tests passed, you can see "all tests passed successfully" at the end of the test.
$ ./test/scenario_test/run_all_tests.sh ... OK all tests passed successfully -
Run each test
You can run scenario tests individually with each test file. See
test/scenario_test/*.py, for the individual test files.$ PYTHONPATH=./test python3 test/scenario_test/<scenario test name>.py --gobgp-image=gobgp ... OK
Clean up
A lot of containers, networks temporary files are created during the test. Let's clean up.
$ docker rm -f $(sudo docker ps -a -q -f "label=gobgp-test")
$ docker network prune -f --filter "label=gobgp-test"
$ rm -rf /tmp/gobgp