From: Lou Berger Date: Sat, 8 Feb 2020 15:36:49 +0000 (-0500) Subject: topotest: bgp_l3vpn_to_bgp_vrf - report unexpected BGP notifications X-Git-Tag: base_7.4~368^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f2ebe24292cbb6b914a492c7e6ccf0c369d5f06c;p=matthieu%2Ffrr.git topotest: bgp_l3vpn_to_bgp_vrf - report unexpected BGP notifications Signed-off-by: Lou Berger --- 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 index 0000000000..d447548783 --- /dev/null +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/scripts/notification_check.py @@ -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 diff --git a/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py b/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py index 2dad5e7687..7e36398298 100755 --- a/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_vrf/test_bgp_l3vpn_to_bgp_vrf.py @@ -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