]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgp_rfapi_basic_sanity: added check_timeout (uses FRR PR#2934)
authorLou Berger <lberger@labn.net>
Tue, 28 Aug 2018 19:58:54 +0000 (19:58 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Nov 2018 01:22:14 +0000 (20:22 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_rfapi_basic_sanity/r1/bgpd.conf
tests/topotests/bgp_rfapi_basic_sanity/r3/bgpd.conf
tests/topotests/bgp_rfapi_basic_sanity/r4/bgpd.conf
tests/topotests/bgp_rfapi_basic_sanity/scripts/adjacencies.py
tests/topotests/bgp_rfapi_basic_sanity/scripts/check_timeout.py [new file with mode: 0644]
tests/topotests/bgp_rfapi_basic_sanity/test_bgp_rfapi_basic_sanity.py

index 9f65aaa6429a0a1788b0ce6402e0eb55264b9cea..fc301e13d79cb7b32a801ea920966f1daf8ae957 100644 (file)
@@ -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
index 90317262f04e11f46c7f2d1e15c93eda3530a1bc..0066f65a403e5cce8fc4b6b824969699904cd73a 100644 (file)
@@ -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
index f3d8e97d29b263d35173dde63b8aadfe52e9676b..67c06506b5b9db35b54de368b8a205adbcd6df60 100644 (file)
@@ -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
index 60afe9e1355a3d1a3b794309d55120be459f9e4c..2ae71ed9944948e665016058d80a07d445d4c9f3 100644 (file)
@@ -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 (file)
index 0000000..cca51dc
--- /dev/null
@@ -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')
index fa58d007560366b2871ce316a65bd9b7ea523e8b..576aebd688a7e26a705672fd9cfee09b9bd8758b 100755 (executable)
@@ -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