From 197d4fdad45db084523650d110d3440a6d63d0c5 Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Mon, 27 Aug 2018 19:28:36 +0000 Subject: bgp_rfapi_basic_sanity: added basic rfapi sanity topotest Signed-off-by: Lou Berger --- tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py new file mode 100644 index 0000000000..60afe9e135 --- /dev/null +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py @@ -0,0 +1,10 @@ +luCommand('r1','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) +luCommand('r3','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) +luCommand('r4','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) +luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0.* 00:0','wait','Core adjacencies up') +luCommand('r1','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') +luCommand('r3','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') +luCommand('r4','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') +luCommand('r1','ping 3.3.3.3 -c 1',' 0. packet loss','wait','PE->PE3 (loopback) ping') +luCommand('r1','ping 4.4.4.4 -c 1',' 0. packet loss','wait','PE->PE4 (loopback) ping') +luCommand('r4','ping 3.3.3.3 -c 1',' 0. packet loss','wait','PE->PE3 (loopback) ping') -- cgit v1.2.3 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 --- .../topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf | 2 + .../topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf | 2 + .../topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf | 2 + .../bgp_rfapi_basic_sanity/scripts/adjacencies.py | 2 +- .../scripts/check_timeout.py | 56 ++++++++++++++++++++++ .../test_bgp_rfapi_basic_sanity.py | 9 ++++ 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf b/tests/topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf index 9f65aaa642..fc301e13d7 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf +++ b/tests/topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf @@ -19,6 +19,8 @@ router bgp 5226 address-family ipv4 vpn neighbor 2.2.2.2 activate exit-address-family +! + rfp holddown-factor 100 ! vnc defaults rd auto:vn:123 diff --git a/tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf b/tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf index 90317262f0..0066f65a40 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf +++ b/tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf @@ -17,6 +17,8 @@ router bgp 5226 address-family ipv4 vpn neighbor 2.2.2.2 activate exit-address-family +! + rfp holddown-factor 100 ! vnc defaults rd auto:vn:123 diff --git a/tests/topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf b/tests/topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf index f3d8e97d29..67c06506b5 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf +++ b/tests/topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf @@ -18,6 +18,8 @@ router bgp 5226 address-family ipv4 vpn neighbor 2.2.2.2 activate exit-address-family +! + rfp holddown-factor 100 ! vnc defaults rd auto:vn:123 diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py index 60afe9e135..2ae71ed994 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py @@ -7,4 +7,4 @@ luCommand('r3','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacen luCommand('r4','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') luCommand('r1','ping 3.3.3.3 -c 1',' 0. packet loss','wait','PE->PE3 (loopback) ping') luCommand('r1','ping 4.4.4.4 -c 1',' 0. packet loss','wait','PE->PE4 (loopback) ping') -luCommand('r4','ping 3.3.3.3 -c 1',' 0. packet loss','wait','PE->PE3 (loopback) ping') +#luCommand('r4','ping 3.3.3.3 -c 1',' 0. packet loss','wait','PE->PE3 (loopback) ping') 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') 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 fa58d00756..576aebd688 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 @@ -65,6 +65,15 @@ def test_check_close(): #CheckFunc = 'ltemplateVersionCheck(\'3.1\', cli=True)' ltemplateTest('scripts/check_close.py', False, CliOnFail, CheckFunc) +def test_check_timeout(): + 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/check_timeout.py', False, CliOnFail, CheckFunc) + def test_cleanup_all(): CliOnFail = None # For debugging, uncomment the next line -- cgit v1.2.3 From d1f4560e7d0e024ff1cfbdf229eca7adb2a8561a Mon Sep 17 00:00:00 2001 From: Lou Berger Date: Wed, 29 Aug 2018 19:28:13 +0000 Subject: bgp_rfapi_basic_sanity_config2: allow for slow CI Signed-off-by: Lou Berger --- tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py') diff --git a/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py index 2ae71ed994..1f53791f6a 100644 --- a/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py +++ b/tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py @@ -1,7 +1,7 @@ luCommand('r1','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) luCommand('r3','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) luCommand('r4','ping 2.2.2.2 -c 1',' 0. packet loss','wait','PE->P2 (loopback) ping',60) -luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0.* 00:0','wait','Core adjacencies up') +luCommand('r2','vtysh -c "show bgp summary"',' 00:0.* 00:0.* 00:0','wait','Core adjacencies up',30) luCommand('r1','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') luCommand('r3','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') luCommand('r4','vtysh -c "show bgp vrf all summary"',' 00:0','pass','All adjacencies up') -- cgit v1.2.3