From bd15005d3adf4662c38b47b7f0a3555e544280f0 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Thu, 7 Dec 2017 16:18:00 -0500 Subject: [PATCH] bgp_direct_to_bgp_vpn: scripts - avoid race condition, and test for predicable results Signed-off-by: Lou Berger --- .../bgp_direct_to_bgp_vpn/scripts/add_routes.py | 10 ++++++++-- .../bgp_direct_to_bgp_vpn/scripts/check_routes.py | 11 +++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/topotests/bgp_direct_to_bgp_vpn/scripts/add_routes.py b/tests/topotests/bgp_direct_to_bgp_vpn/scripts/add_routes.py index 03e1a16765..2b853b934a 100644 --- a/tests/topotests/bgp_direct_to_bgp_vpn/scripts/add_routes.py +++ b/tests/topotests/bgp_direct_to_bgp_vpn/scripts/add_routes.py @@ -1,13 +1,19 @@ from lutil import luCommand luCommand('r1','vtysh -c "add vrf cust1 prefix 99.0.0.1/32"','.','none','IP Address') +luCommand('r3','vtysh -c "show bgp ipv4 vpn"','i99.0.0.1/32','wait','See R1s address') +luCommand('r4','vtysh -c "show bgp ipv4 vpn"','i99.0.0.1/32','wait','See R1s address') luCommand('r3','vtysh -c "add vrf cust1 prefix 99.0.0.2/32"','.','none','IP Address') +luCommand('r1','vtysh -c "show bgp ipv4 vpn"','i99.0.0.2/32','wait','See R3s address') +luCommand('r4','vtysh -c "show bgp ipv4 vpn"','i99.0.0.2/32','wait','See R3s address') luCommand('r4','vtysh -c "add vrf cust1 prefix 99.0.0.3/32"','.','none','IP Address') +luCommand('r1','vtysh -c "show bgp ipv4 vpn"','i99.0.0.3/32','wait','See R4s address') +luCommand('r3','vtysh -c "show bgp ipv4 vpn"','i99.0.0.3/32','wait','See R4s address') luCommand('r1','vtysh -c "show vnc registrations local"','99.0.0.1','pass','Local Registration') luCommand('r3','vtysh -c "show vnc registrations local"','99.0.0.2','pass','Local Registration') luCommand('r4','vtysh -c "show vnc registrations local"','99.0.0.3','pass','Local Registration') -luCommand('r1','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration') +luCommand('r1','vtysh -c "show vnc registrations remote"','4 out of 4','wait','Remote Registration') luCommand('r3','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration') -luCommand('r4','vtysh -c "show vnc registrations remote"','6 out of 6','wait','Remote Registration') +luCommand('r4','vtysh -c "show vnc registrations remote"','4 out of 4','wait','Remote Registration') 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_direct_to_bgp_vpn/scripts/check_routes.py b/tests/topotests/bgp_direct_to_bgp_vpn/scripts/check_routes.py index 0b6f7ff49b..dab2f8c2cf 100644 --- a/tests/topotests/bgp_direct_to_bgp_vpn/scripts/check_routes.py +++ b/tests/topotests/bgp_direct_to_bgp_vpn/scripts/check_routes.py @@ -1,13 +1,12 @@ from lutil import luCommand luCommand('ce1','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes') -luCommand('ce2','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes') +luCommand('ce2','vtysh -c "show bgp ipv4 uni"','7 routes and 9','wait','Local and remote routes') luCommand('ce3','vtysh -c "show bgp ipv4 uni"','7 routes and 7','wait','Local and remote routes') luCommand('r1','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI') luCommand('r2','vtysh -c "show bgp ipv4 uni"','No BGP prefixes displayed','pass','Unicast SAFI') luCommand('r3','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI') luCommand('r4','vtysh -c "show bgp ipv4 uni"','7 routes and 9','pass','Unicast SAFI') -luCommand('r1','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI') -luCommand('r2','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI') -luCommand('r3','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI') -luCommand('r4','vtysh -c "show bgp ipv4 vpn"','9 routes and 9','pass','VPN SAFI') - +luCommand('r1','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI') +luCommand('r2','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI') +luCommand('r3','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI') +luCommand('r4','vtysh -c "show bgp ipv4 vpn"','7 routes and 7','pass','VPN SAFI') -- 2.39.5