From 94bc49b98ba32b6b334d78d2668b2f2b274e8d53 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 21 Oct 2015 22:51:03 +0900 Subject: test: ROUTE REFRESH handling with update EXPORT policy test Signed-off-by: FUJITA Tomonori --- test/scenario_test/lib/quagga.py | 5 ++ .../scenario_test/route_server_policy_grpc_test.py | 58 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/test/scenario_test/lib/quagga.py b/test/scenario_test/lib/quagga.py index f36b56a8..6001d9a3 100644 --- a/test/scenario_test/lib/quagga.py +++ b/test/scenario_test/lib/quagga.py @@ -152,6 +152,11 @@ class QuaggaBGPContainer(BGPContainer): raise Exception('not found peer {0}'.format(peer.router_id)) + def send_route_refresh(self): + with QuaggaTelnetDaemon(self) as tn: + tn.write('clear ip bgp * soft\n') + #tn.read_until('bgpd#') + def create_config(self): self._create_config_bgp() if self.zebra: diff --git a/test/scenario_test/route_server_policy_grpc_test.py b/test/scenario_test/route_server_policy_grpc_test.py index 54dcf3da..06f72e3c 100644 --- a/test/scenario_test/route_server_policy_grpc_test.py +++ b/test/scenario_test/route_server_policy_grpc_test.py @@ -367,6 +367,64 @@ class ExportPolicyUpdate(object): wait_for(lambda: len(q2.get_global_rib()) == 2) +@register_scenario +class ExportPolicyUpdateRouteRefresh(object): + """ + export-policy update and route refresh handling test + + r1:192.168.2.0 + r2:192.168.20.0 + r3:192.168.200.0 + ------------------------------------------------- + | q1 | + e1 ->(r1,r2,r3)-> | ->(r1,r2,r3)-> rib ->(r1,r2,r3)-> adj-rib-out | ->(r1,r2,r3)-> q1 + | | + | q2 | + | ->(r1,r2,r3)-> rib ->(r1)-> adj-rib-out | ->(r1)-> q2 + ------------------------------------------------- + | + update gobgp.conf + q2 sends route refresh + | + V + ------------------------------------------------- + | q1 | + e1 ->(r1,r2,r3)-> | ->(r1,r2,r3)-> rib ->(r1,r2,r3)-> adj-rib-out | ->(r1,r2,r3)-> q1 + | | + | q2 | + | ->(r1,r2,r3)-> rib ->(r1,r3)-> adj-rib-out | ->(r1,r3)-> q2 + ------------------------------------------------- + """ + @staticmethod + def boot(env): + lookup_scenario("ExportPolicyUpdate").boot(env) + + @staticmethod + def setup(env): + lookup_scenario("ExportPolicyUpdate").setup(env) + + @staticmethod + def check(env): + lookup_scenario("ExportPolicyUpdate").check(env) + + @staticmethod + def setup2(env): + g1 = env.g1 + e1 = env.e1 + q1 = env.q1 + q2 = env.q2 + + g1.local('gobgp policy prefix del ps0 192.168.200.0/24') + q2.send_route_refresh() + + for c in [e1, q1, q2]: + g1.wait_for(BGP_FSM_ESTABLISHED, c) + + @staticmethod + def check2(env): + lookup_scenario("ExportPolicyUpdate").check2(env) + + @register_scenario class ImportPolicyIPV6(object): """ -- cgit v1.2.3