summaryrefslogtreecommitdiff
path: root/tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2018-08-28 19:58:54 +0000
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-11-27 20:22:14 -0500
commit914d749d8af21ec2f23ba41cd84c2dc630815251 (patch)
treec4482cd1908048f7212f57d39b3423429fde6c0e /tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py
parenta73fb016ffeb2eebb21f70340b484b2d32493a1f (diff)
bgp_rfapi_basic_sanity: added check_timeout (uses FRR PR#2934)
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py')
-rw-r--r--tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py56
1 files changed, 56 insertions, 0 deletions
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')