diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-06-02 02:18:09 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-06-02 17:44:16 +0900 |
commit | 3d567b9fd822fde6dc12bc086430aaebfc7ade90 (patch) | |
tree | 805b84328d5f55d0ec6e32d285f724f23a72489e | |
parent | 3c377d437d9380111fb61bd0dc441eaf4e2c5209 (diff) |
test: add a test to check soft-reset-in behavior
test ec4e7a755f4ef11d0206f3fe905d3eecbed2533b
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r-- | test/scenario_test/ci-scripts/travis-build-script.sh | 2 | ||||
-rw-r--r-- | test/scenario_test/route_server_softreset_test.py (renamed from test/scenario_test/route_server_test3.py) | 27 |
2 files changed, 25 insertions, 4 deletions
diff --git a/test/scenario_test/ci-scripts/travis-build-script.sh b/test/scenario_test/ci-scripts/travis-build-script.sh index 9a7a416d..87fa9a7b 100644 --- a/test/scenario_test/ci-scripts/travis-build-script.sh +++ b/test/scenario_test/ci-scripts/travis-build-script.sh @@ -42,7 +42,7 @@ PIDS=("${PIDS[@]}" $!) sudo PYTHONPATH=$GOBGP/test python route_server_test2.py --gobgp-image $GOBGP_IMAGE --test-prefix rs2 -x & PIDS=("${PIDS[@]}" $!) -sudo PYTHONPATH=$GOBGP/test python route_server_test3.py --gobgp-image $GOBGP_IMAGE --test-prefix rs3 -x & +sudo PYTHONPATH=$GOBGP/test python route_server_softreset_test.py --gobgp-image $GOBGP_IMAGE --test-prefix rs3 -x & PIDS=("${PIDS[@]}" $!) sudo PYTHONPATH=$GOBGP/test python route_server_ipv4_v6_test.py --gobgp-image $GOBGP_IMAGE --test-prefix v6 -x & diff --git a/test/scenario_test/route_server_test3.py b/test/scenario_test/route_server_softreset_test.py index 2bdd8ece..6bd91c03 100644 --- a/test/scenario_test/route_server_test3.py +++ b/test/scenario_test/route_server_softreset_test.py @@ -44,11 +44,14 @@ class GoBGPTestBase(unittest.TestCase): g3 = GoBGPContainer(name='g3', asn=65002, router_id='192.168.0.3', ctn_image_name=gobgp_ctn_image_name, log_level=parser_option.gobgp_log_level) - ctns = [g1, g2, g3] + g4 = GoBGPContainer(name='g4', asn=65003, router_id='192.168.0.4', + ctn_image_name=gobgp_ctn_image_name, + log_level=parser_option.gobgp_log_level) + ctns = [g1, g2, g3, g4] # advertise a route from route-server-clients cls.clients = {} - for cli in [g2, g3]: + for cli in [g2, g3, g4]: cls.clients[cli.name] = cli initial_wait_time = max(ctn.run() for ctn in ctns) @@ -65,7 +68,7 @@ class GoBGPTestBase(unittest.TestCase): for cli in self.clients.itervalues(): self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=cli) - def test_02_test(self): + def test_02_softresetin_test1(self): g1 = self.gobgp g2 = self.clients['g2'] g3 = self.clients['g3'] @@ -93,6 +96,7 @@ class GoBGPTestBase(unittest.TestCase): ps0 = {'prefix-set-name': 'ps0', 'prefix-list': [p1]} g1.set_prefix_set(ps0) g1.create_config() + # this will cause g1 to do softresetin for all neighbors (policy is changed) g1.reload_config() time.sleep(1) @@ -107,6 +111,23 @@ class GoBGPTestBase(unittest.TestCase): num3 = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE'] self.assertTrue(num2 == num3) + def test_03_softresetin_test2(self): + g1 = self.gobgp + g2 = self.clients['g2'] + + g2.add_route('10.0.10.0/24') + time.sleep(1) + + num = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE'] + time.sleep(3) + + g1.local('gobgp n all softresetin') + time.sleep(3) + + num1 = g2.get_neighbor(g1)['info']['messages']['received']['UPDATE'] + + self.assertTrue(num == num1) + if __name__ == '__main__': if os.geteuid() is not 0: |