From 914d749d8af21ec2f23ba41cd84c2dc630815251 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Tue, 28 Aug 2018 19:58:54 +0000 Subject: bgp_rfapi_basic_sanity: added check_timeout (uses FRR PR#2934) Signed-off-by: Lou Berger --- .../scripts/check_timeout.py | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py new file mode 100644 index 0000000000..cca51dc9a3 --- /dev/null +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py @@ -0,0 +1,56 @@ +from lutil import luCommand +holddownFactorSet = luCommand('r1','vtysh -c "show running"','rfp holddown-factor','none','Holddown factor set') +if not holddownFactorSet: + luCommand('r1','vtysh -c "show vnc summary"','.','pass','Holddown factor not set -- skipping test') +else: + #holddown time test + luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 lifetime 10"','', 'none', 'Prefix registered') + luCommand('r1','vtysh -c "show vnc registrations local"','1.111.0.0/16','wait','Local registration') + + luCommand('r3','vtysh -c "debug rfapi-dev register vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16 lifetime 10"','', 'none', 'Prefix registered') + luCommand('r3','vtysh -c "show vnc registrations local"','1.222.0.0/16','wait','Local registration') + + luCommand('r4','vtysh -c "show vnc registrations"','Remotely: *Active: 4 ','wait', 'See registrations, L=10') + luCommand('r1','vtysh -c "show vnc registrations"','.','none') + luCommand('r3','vtysh -c "show vnc registrations"','.','none') + + luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 111.111.111.111"','pfx=', 'pass', 'Query R1s info') + luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 1.222.222.222"','pfx=', 'pass', 'Query R3s info') + + luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16"','', 'none', 'Prefix timeout') + luCommand('r1','vtysh -c "show vnc registrations"','1.111.0.0/16','wait','Local holddown',1) + luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16"','', 'none', 'Prefix timeout') + luCommand('r3','vtysh -c "show vnc registrations"','1.222.0.0/16','wait','Local holddown',1) + luCommand('r4','vtysh -c "show vnc registrations"','.','none') + luCommand('r4','vtysh -c "show vnc registrations"','.','none') + + luCommand('r4','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') + luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') + luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') + + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown',20) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + + #kill test + luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 lifetime 10"','', 'none', 'Prefix registered') + luCommand('r1','vtysh -c "show vnc registrations local"','1.111.0.0/16','wait','Local registration') + + luCommand('r3','vtysh -c "debug rfapi-dev register vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16 lifetime 10"','', 'none', 'Prefix registered') + luCommand('r3','vtysh -c "show vnc registrations local"','1.222.0.0/16','wait','Local registration') + + luCommand('r4','vtysh -c "show vnc registrations"','Remotely: *Active: 4 ','wait', 'See registrations L=10 (pre-kill)',5) + luCommand('r1','vtysh -c "show vnc registrations"','.','none') + luCommand('r3','vtysh -c "show vnc registrations"','.','none') + luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 kill"','', 'none', 'Prefix kill') + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Registration killed',1) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 1','wait','Remote in holddown',5) + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 1','wait','Remote in holddown',5) + + luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16 kill"','', 'none', 'Prefix kill') + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 1','wait','Registration killed',1) + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 2','wait','Remote in hold down',5) + + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown',20) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') -- cgit v1.2.3 From 4ce7be6957818ed3b49a7be372a1efd9364d1dd9 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 29 Aug 2018 12:40:25 +0000 Subject: bgp_rfapi_basic_sanity: added multi-path and updated responses Signed-off-by: Lou Berger --- .../bgp_rfapi_basic_sanity/scripts/add_routes.py | 11 +++++++++++ .../bgp_rfapi_basic_sanity/scripts/check_close.py | 6 +++--- .../bgp_rfapi_basic_sanity/scripts/check_routes.py | 12 ++++++------ .../scripts/check_timeout.py | 22 +++++++++++----------- .../bgp_rfapi_basic_sanity/scripts/cleanup_all.py | 7 ++++--- .../test_bgp_rfapi_basic_sanity.py | 8 ++++---- 6 files changed, 39 insertions(+), 27 deletions(-) (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py index 4fe4da9a62..1a7b0b65dc 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py @@ -7,14 +7,25 @@ else: luCommand('r1','vtysh -c "debug rfapi-dev open vn 10.0.0.1 un 1.1.1.1"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI') luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 11.11.11.0/24 lifetime {}"'.format(to),'', 'none', 'Prefix registered') luCommand('r1','vtysh -c "show vnc registrations local"','1 out of 1','wait','Local registration') +luCommand('r1','vtysh -c "debug rfapi-dev response-omit-self off"','.','none') +luCommand('r1','vtysh -c "debug rfapi-dev query vn 10.0.0.1 un 1.1.1.1 target 11.11.11.11"','11.11.11.0/24', 'pass', 'Query self') luCommand('r3','vtysh -c "debug rfapi-dev open vn 10.0.0.2 un 2.2.2.2"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI') luCommand('r3','vtysh -c "debug rfapi-dev register vn 10.0.0.2 un 2.2.2.2 prefix 22.22.22.0/24 lifetime {}"'.format(to),'', 'none', 'Prefix registered') luCommand('r3','vtysh -c "show vnc registrations local"','1 out of 1','wait','Local registration') +luCommand('r3','vtysh -c "debug rfapi-dev response-omit-self on"','.','none') +luCommand('r3','vtysh -c "debug rfapi-dev query vn 10.0.0.2 un 2.2.2.2 target 22.22.22.22"','rc=2', 'pass', 'Self excluded') luCommand('r4','vtysh -c "debug rfapi-dev open vn 10.0.0.3 un 3.3.3.3"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI') luCommand('r4','vtysh -c "debug rfapi-dev register vn 10.0.0.3 un 3.3.3.3 prefix 33.33.33.0/24 lifetime {}"'.format(to),'', 'none', 'Prefix registered') luCommand('r4','vtysh -c "show vnc registrations local"','1 out of 1','wait','Local registration') +luCommand('r4','vtysh -c "debug rfapi-dev response-omit-self off"','.','none') +luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 33.33.33.33"','33.33.33.0/24', 'pass', 'Query self') + +luCommand('r4','vtysh -c "debug rfapi-dev register vn 10.0.0.3 un 3.3.3.3 prefix 11.11.11.0/24 lifetime {}"'.format(to),'', 'none', 'MP Prefix registered') +luCommand('r4','vtysh -c "show vnc registrations local"','2 out of 2','wait','Local registration') +luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 11.11.11.11"','11.11.11.0/24', 'pass', 'Query self MP') + luCommand('r1','vtysh -c "show vnc registrations"','.','none') luCommand('r3','vtysh -c "show vnc registrations"','.','none') luCommand('r4','vtysh -c "show vnc registrations"','.','none') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py index c168ed560e..63fb79b540 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py @@ -6,7 +6,7 @@ luCommand('r1','vtysh -c "show vnc registrations"','.','none') luCommand('r3','vtysh -c "show vnc registrations"','111.111.111.0/24','wait','See registration') luCommand('r4','vtysh -c "show vnc registrations"','111.111.111.0/24','wait','See registration') luCommand('r1','vtysh -c "debug rfapi-dev close vn 20.0.0.1 un 1.1.1.21"','status 0', 'pass', 'Closed RFAPI') -luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See cleanup') -luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See cleanup') -luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See cleanup') +luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See cleanup') +luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See cleanup') +luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2','wait','See cleanup') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py index 4cfaa28412..a380c79fcf 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_routes.py @@ -3,17 +3,17 @@ luCommand('r1','vtysh -c "show bgp ipv4 vpn"','','none','VPN SAFI') luCommand('r2','vtysh -c "show bgp ipv4 vpn"','','none','VPN SAFI') luCommand('r3','vtysh -c "show bgp ipv4 vpn"','','none','VPN SAFI') luCommand('r4','vtysh -c "show bgp ipv4 vpn"','','none','VPN SAFI') -luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See all registrations') -luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See all registrations') -luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2','wait','See all registrations') -num = '3 routes and 3' +luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See all registrations') +luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See all registrations') +luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2','wait','See all registrations') +num = '4 routes and 4' luCommand('r1','vtysh -c "show bgp ipv4 vpn"',num,'pass','VPN SAFI okay') luCommand('r2','vtysh -c "show bgp ipv4 vpn"',num,'pass','VPN SAFI okay') luCommand('r3','vtysh -c "show bgp ipv4 vpn"',num,'pass','VPN SAFI okay') luCommand('r4','vtysh -c "show bgp ipv4 vpn"',num,'pass','VPN SAFI okay') luCommand('r1','vtysh -c "debug rfapi-dev query vn 10.0.0.1 un 1.1.1.1 target 22.22.22.22"','pfx=', 'pass', 'Query R2s info') luCommand('r1','vtysh -c "debug rfapi-dev query vn 10.0.0.1 un 1.1.1.1 target 33.33.33.33"','pfx=', 'pass', 'Query R4s info') -luCommand('r3','vtysh -c "debug rfapi-dev query vn 10.0.0.2 un 2.2.2.2 target 11.11.11.11"','pfx=', 'pass', 'Query R1s info') +luCommand('r3','vtysh -c "debug rfapi-dev query vn 10.0.0.2 un 2.2.2.2 target 11.11.11.11"','11.11.11.0/24.*11.11.11.0/24.*', 'pass', 'Query R1s+R4s info') luCommand('r3','vtysh -c "debug rfapi-dev query vn 10.0.0.2 un 2.2.2.2 target 33.33.33.33"','pfx=', 'pass', 'Query R4s info') -luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 11.11.11.11"','pfx=', 'pass', 'Query R1s info') +luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 11.11.11.11"','11.11.11.0/24.*11.11.11.0/24.*', 'pass', 'Query R1s+R4s info') luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 22.22.22.22"','pfx=', 'pass', 'Query R2s info') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py index cca51dc9a3..4ac10c5498 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py @@ -28,9 +28,9 @@ else: luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') - luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown',20) - luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') - luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown',20) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') #kill test luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 lifetime 10"','', 'none', 'Prefix registered') @@ -43,14 +43,14 @@ else: luCommand('r1','vtysh -c "show vnc registrations"','.','none') luCommand('r3','vtysh -c "show vnc registrations"','.','none') luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 kill"','', 'none', 'Prefix kill') - luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Registration killed',1) - luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 1','wait','Remote in holddown',5) - luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 1','wait','Remote in holddown',5) + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 4 .*In Holddown: *Active: 0','wait','Registration killed',1) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 3 .*In Holddown: *Active: 1','wait','Remote in holddown',5) + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 3 .*In Holddown: *Active: 1','wait','Remote in holddown',5) luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16 kill"','', 'none', 'Prefix kill') - luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 1','wait','Registration killed',1) - luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 2','wait','Remote in hold down',5) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 1','wait','Registration killed',1) + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 2','wait','Remote in holddown',5) - luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown',20) - luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') - luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown',20) + luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py index d0d66ea277..096e97fa94 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/cleanup_all.py @@ -1,13 +1,14 @@ from lutil import luCommand -luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 11.11.11.0/24"','', 'none', 'Prefix registered') +luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 11.11.11.0/24"','', 'none', 'Prefix removed') luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 0 ','wait','Local registration removed') luCommand('r1','vtysh -c "debug rfapi-dev close vn 10.0.0.1 un 1.1.1.1"','status 0', 'pass', 'Closed RFAPI') -luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 22.22.22.0/24"','', 'none', 'Prefix registered') +luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 22.22.22.0/24"','', 'none', 'Prefix removed') luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 0 ','wait','Local registration removed') luCommand('r3','vtysh -c "debug rfapi-dev close vn 10.0.0.2 un 2.2.2.2"','status 0', 'pass', 'Closed RFAPI') -luCommand('r4','vtysh -c "debug rfapi-dev unregister vn 10.0.0.3 un 3.3.3.3 prefix 33.33.33.0/24"','', 'none', 'Prefix registered') +luCommand('r4','vtysh -c "debug rfapi-dev unregister vn 10.0.0.3 un 3.3.3.3 prefix 33.33.33.0/24"','', 'none', 'Prefix removed') +luCommand('r4','vtysh -c "debug rfapi-dev unregister vn 10.0.0.3 un 3.3.3.3 prefix 11.11.11.0/24"','', 'none', 'MP prefix removed') luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 0 ','wait','Local registration removed') luCommand('r4','vtysh -c "debug rfapi-dev close vn 10.0.0.3 un 3.3.3.3"','status 0', 'pass', 'Closed RFAPI') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py b/tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py index 576aebd688..0e1f236b7d 100755 --- a/tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py @@ -29,23 +29,23 @@ sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')) from lib.ltemplate import * -def test_adjacencies(): +def test_add_routes(): CliOnFail = None # For debugging, uncomment the next line #CliOnFail = 'tgen.mininet_cli' CheckFunc = 'ltemplateVersionCheck(\'3.1\')' #uncomment next line to start cli *before* script is run #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' - ltemplateTest('scripts/adjacencies.py', False, CliOnFail, CheckFunc) + ltemplateTest('scripts/add_routes.py', False, CliOnFail, CheckFunc) -def test_add_routes(): +def test_adjacencies(): CliOnFail = None # For debugging, uncomment the next line #CliOnFail = 'tgen.mininet_cli' CheckFunc = 'ltemplateVersionCheck(\'3.1\')' #uncomment next line to start cli *before* script is run #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' - ltemplateTest('scripts/add_routes.py', False, CliOnFail, CheckFunc) + ltemplateTest('scripts/adjacencies.py', False, CliOnFail, CheckFunc) def test_check_routes(): CliOnFail = None -- cgit v1.2.3 From 16872f5683b3595c682526a1bd37233cff6d1122 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 29 Aug 2018 14:18:02 +0000 Subject: bgp_rfapi_basic_sanity: added multi-path to timeout test Signed-off-by: Lou Berger --- .../bgp_rfapi_basic_sanity/scripts/add_routes.py | 1 + .../bgp_rfapi_basic_sanity/scripts/check_close.py | 11 +++++++-- .../scripts/check_timeout.py | 26 ++++++++++++++++------ 3 files changed, 29 insertions(+), 9 deletions(-) (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py index 7b5b192227..2aba5a446d 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/add_routes.py @@ -7,6 +7,7 @@ else: to = "6" cost = "cost 50" luCommand('r1','vtysh -c "debug rfapi-dev open vn 10.0.0.1 un 1.1.1.1"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI') +luCommand('r1','vtysh -c "debug rfapi-dev query vn 10.0.0.1 un 1.1.1.1 target 11.11.11.11"','rc=2', 'pass', 'Clean query') luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 11.11.11.0/24 lifetime {}"'.format(to),'', 'none', 'Prefix registered') luCommand('r1','vtysh -c "show vnc registrations local"','1 out of 1','wait','Local registration') luCommand('r1','vtysh -c "debug rfapi-dev response-omit-self off"','.','none') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py index 63fb79b540..5fffce7ca0 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_close.py @@ -1,6 +1,11 @@ from lutil import luCommand +holddownFactorSet = luCommand('r1','vtysh -c "show running"','rfp holddown-factor','none','Holddown factor set') +if not holddownFactorSet: + to = "-1" +else: + to = "1" luCommand('r1','vtysh -c "debug rfapi-dev open vn 20.0.0.1 un 1.1.1.21"','rfapi_set_response_cb: status 0', 'pass', 'Opened RFAPI') -luCommand('r1','vtysh -c "debug rfapi-dev register vn 20.0.0.1 un 1.1.1.21 prefix 111.111.111.0/24 lifetime 5"','', 'none', 'Prefix registered') +luCommand('r1','vtysh -c "debug rfapi-dev register vn 20.0.0.1 un 1.1.1.21 prefix 111.111.111.0/24 lifetime {}"'.format(to),'', 'none', 'Prefix registered') luCommand('r1','vtysh -c "show vnc registrations local"','111.111.111.0/24','wait','Local registration',1) luCommand('r1','vtysh -c "show vnc registrations"','.','none') luCommand('r3','vtysh -c "show vnc registrations"','111.111.111.0/24','wait','See registration') @@ -9,4 +14,6 @@ luCommand('r1','vtysh -c "debug rfapi-dev close vn 20.0.0.1 un 1.1.1.21"','statu luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See cleanup') luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3','wait','See cleanup') luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2','wait','See cleanup') - +luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown',20) +luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown') +luCommand('r4','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py index 4ac10c5498..f4467ecc33 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py @@ -1,5 +1,8 @@ from lutil import luCommand holddownFactorSet = luCommand('r1','vtysh -c "show running"','rfp holddown-factor','none','Holddown factor set') +luCommand('r1','vtysh -c "show vnc registrations"','.','none') +luCommand('r3','vtysh -c "show vnc registrations"','.','none') +luCommand('r4','vtysh -c "show vnc registrations"','.','none') if not holddownFactorSet: luCommand('r1','vtysh -c "show vnc summary"','.','pass','Holddown factor not set -- skipping test') else: @@ -11,16 +14,25 @@ else: luCommand('r3','vtysh -c "show vnc registrations local"','1.222.0.0/16','wait','Local registration') luCommand('r4','vtysh -c "show vnc registrations"','Remotely: *Active: 4 ','wait', 'See registrations, L=10') + + luCommand('r4','vtysh -c "debug rfapi-dev register vn 10.0.0.3 un 3.3.3.3 prefix 1.222.0.0/16 lifetime 5 cost 50"','', 'none', 'MP Prefix registered') + luCommand('r4','vtysh -c "show vnc registrations local"','1.222.0.0/16','wait','Local registration (MP prefix)') + luCommand('r1','vtysh -c "show vnc registrations"','.','none') luCommand('r3','vtysh -c "show vnc registrations"','.','none') - luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 111.111.111.111"','pfx=', 'pass', 'Query R1s info') - luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 1.222.222.222"','pfx=', 'pass', 'Query R3s info') + luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 1.111.111.111"','pfx=', 'pass', 'Query R1s info') + luCommand('r4','vtysh -c "debug rfapi-dev query vn 10.0.0.3 un 3.3.3.3 target 1.222.222.222"','1.222.0.0/16.*1.222.0.0/16', 'pass', 'Query R3s+R4s info') + luCommand('r4','vtysh -c "debug rfapi-dev unregister vn 10.0.0.3 un 3.3.3.3 prefix 1.222.0.0/16"','', 'none', 'MP Prefix removed') + luCommand('r4','vtysh -c "show vnc registrations"','In Holddown: *Active: 1 ','wait', 'MP prefix in holddown') + luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 1 ','wait', 'MP prefix in holddown') + luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 1 ','wait', 'MP prefix in holddown') + luCommand('r1','vtysh -c "debug rfapi-dev query vn 10.0.0.1 un 1.1.1.1 target 1.222.222.222"','1.222.0.0/16', 'pass', 'Query R3s info') luCommand('r1','vtysh -c "debug rfapi-dev unregister vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16"','', 'none', 'Prefix timeout') - luCommand('r1','vtysh -c "show vnc registrations"','1.111.0.0/16','wait','Local holddown',1) + luCommand('r1','vtysh -c "show vnc registrations holddown"','1.111.0.0/16','wait','Local holddown',1) luCommand('r3','vtysh -c "debug rfapi-dev unregister vn 10.0.0.2 un 2.2.2.2 prefix 1.222.0.0/16"','', 'none', 'Prefix timeout') - luCommand('r3','vtysh -c "show vnc registrations"','1.222.0.0/16','wait','Local holddown',1) + luCommand('r3','vtysh -c "show vnc registrations holddown"','1.222.0.0/16','wait','Local holddown',1) luCommand('r4','vtysh -c "show vnc registrations"','.','none') luCommand('r4','vtysh -c "show vnc registrations"','.','none') @@ -28,9 +40,9 @@ else: luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 2 ','wait', 'In holddown') - luCommand('r1','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown',20) - luCommand('r3','vtysh -c "show vnc registrations"','Locally: *Active: 1 .* Remotely: *Active: 3 .*In Holddown: *Active: 0','wait','Out of holddown') - luCommand('r4','vtysh -c "show vnc registrations"','Locally: *Active: 2 .* Remotely: *Active: 2 .*In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r1','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown',20) + luCommand('r3','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown') + luCommand('r4','vtysh -c "show vnc registrations"','In Holddown: *Active: 0','wait','Out of holddown') #kill test luCommand('r1','vtysh -c "debug rfapi-dev register vn 10.0.0.1 un 1.1.1.1 prefix 1.111.0.0/16 lifetime 10"','', 'none', 'Prefix registered') -- cgit v1.2.3