]> git.puffer.fish Git - matthieu/frr.git/commitdiff
topotest: bgp_l3vpn_to_bgp_vrf - report unexpected BGP notifications
authorLou Berger <lberger@labn.net>
Sat, 8 Feb 2020 15:36:49 +0000 (10:36 -0500)
committerLou Berger <lberger@labn.net>
Sat, 8 Feb 2020 15:36:49 +0000 (10:36 -0500)
Signed-off-by: Lou Berger <lberger@labn.net>
tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py [new file with mode: 0644]
tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py

diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py
new file mode 100644 (file)
index 0000000..d447548
--- /dev/null
@@ -0,0 +1,9 @@
+from lutil import luCommand
+rtrs = ['ce1', 'ce2', 'ce3', 'r1', 'r2', 'r3', 'r4']
+for rtr in rtrs:
+    ret = luCommand(rtr, 'vtysh -c "show bgp neigh"', 'Notification received .([A-Za-z0-9/ ]*)', 'none', 'collect neighbor stats')
+    found = luLast()
+    if ret != False and found != None:
+        val = found.group(1)
+        ret = luCommand(rtr, 'vtysh -c "show bgp neigh"', 'Notification received', 'fail', 'Notify RXed! {}'.format(val))
+#done
index 2dad5e7687a06daae1f960968ed5189202f5abd2..7e36398298c5bb788c035f0e46d684ea98a66062 100755 (executable)
@@ -47,6 +47,15 @@ def test_adjacencies():
     #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True)'
     ltemplateTest('scripts/adjacencies.py', False, CliOnFail, CheckFunc)
 
+def test_notification_check():
+    CliOnFail = None
+    # For debugging, uncomment the next line
+    #CliOnFail = 'tgen.mininet_cli'
+    CheckFunc = 'ltemplateVersionCheck(\'4.1\', iproute2=\'4.9\')'
+    #uncomment next line to start cli *before* script is run
+    #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
+    ltemplateTest('scripts/notification_check.py', False, CliOnFail, CheckFunc)
+
 def SKIP_test_add_routes():
     CliOnFail = None
     # For debugging, uncomment the next line
@@ -75,6 +84,15 @@ def test_check_linux_mpls():
     #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
     ltemplateTest('scripts/check_linux_mpls.py', False, CliOnFail, CheckFunc)
 
+def test_notification_check():
+    CliOnFail = None
+    # For debugging, uncomment the next line
+    #CliOnFail = 'tgen.mininet_cli'
+    CheckFunc = 'ltemplateVersionCheck(\'4.1\', iproute2=\'4.9\')'
+    #uncomment next line to start cli *before* script is run
+    #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
+    ltemplateTest('scripts/notification_check.py', False, CliOnFail, CheckFunc)
+
 def test_check_scale_up():
     CliOnFail = None
     # For debugging, uncomment the next line
@@ -84,6 +102,15 @@ def test_check_scale_up():
     #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
     ltemplateTest('scripts/scale_up.py', False, CliOnFail, CheckFunc)
 
+def test_notification_check():
+    CliOnFail = None
+    # For debugging, uncomment the next line
+    #CliOnFail = 'tgen.mininet_cli'
+    CheckFunc = 'ltemplateVersionCheck(\'4.1\', iproute2=\'4.9\')'
+    #uncomment next line to start cli *before* script is run
+    #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
+    ltemplateTest('scripts/notification_check.py', False, CliOnFail, CheckFunc)
+
 def test_check_scale_down():
     CliOnFail = None
     # For debugging, uncomment the next line
@@ -93,6 +120,15 @@ def test_check_scale_down():
     #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
     ltemplateTest('scripts/scale_down.py', False, CliOnFail, CheckFunc)
 
+def test_notification_check():
+    CliOnFail = None
+    # For debugging, uncomment the next line
+    #CliOnFail = 'tgen.mininet_cli'
+    CheckFunc = 'ltemplateVersionCheck(\'4.1\', iproute2=\'4.9\')'
+    #uncomment next line to start cli *before* script is run
+    #CheckFunc = 'ltemplateVersionCheck(\'4.1\', cli=True, iproute2=\'4.9\')'
+    ltemplateTest('scripts/notification_check.py', False, CliOnFail, CheckFunc)
+
 def SKIP_test_cleanup_all():
     CliOnFail = None
     # For debugging, uncomment the next line