]> git.puffer.fish Git - mirror/frr.git/commitdiff
topotests: check protocol convergence at init in bgp_vpnv4_noretain
authorLouis Scalbert <louis.scalbert@6wind.com>
Wed, 14 Jun 2023 09:05:01 +0000 (11:05 +0200)
committerLouis Scalbert <louis.scalbert@6wind.com>
Fri, 16 Jun 2023 12:18:25 +0000 (14:18 +0200)
Check that the BGP session is Established before starting the tests.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_summary.json [new file with mode: 0644]
tests/topotests/bgp_vpnv4_noretain/test_bgp_vpnv4_noretain.py

diff --git a/tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_summary.json b/tests/topotests/bgp_vpnv4_noretain/r2/ipv4_vpn_summary.json
new file mode 100644 (file)
index 0000000..a4408f1
--- /dev/null
@@ -0,0 +1,17 @@
+{
+  "routerId":"192.0.2.2",
+  "as":65500,
+  "vrfId":0,
+  "vrfName":"default",
+  "peerCount":1,
+  "peers":{
+    "10.125.0.1":{
+      "remoteAs":65500,
+      "localAs":65500,
+      "version":4,
+      "state":"Established",
+      "peerState":"OK"
+    }
+  },
+  "totalPeers":1
+}
index 994582fc6290361d4a3b445bf301908a8ef1bec6..94acd62f6d1e1c6f51958d0d3a133d33cc7b4d63 100644 (file)
@@ -169,6 +169,30 @@ def check_show_bgp_ipv4_vpn(rname, json_file):
     assert result is None, assertmsg
 
 
+def test_protocols_convergence_step0():
+    """
+    Assert that all protocols have converged
+    """
+    tgen = get_topogen()
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    # check that r2 peerings are ok
+    logger.info("Checking BGP ipv4 vpn summary for r2")
+    router = tgen.gears["r2"]
+    json_file = "{}/{}/ipv4_vpn_summary.json".format(CWD, router.name)
+    expected = json.loads(open(json_file).read())
+    test_func = partial(
+        topotest.router_json_cmp,
+        router,
+        "show bgp ipv4 vpn summary json",
+        expected,
+    )
+    _, result = topotest.run_and_expect(test_func, None, count=20, wait=0.5)
+    assertmsg = '"{}" JSON output mismatches'.format(router.name)
+    assert result is None, assertmsg
+
+
 def test_bgp_no_retain_step1():
     """
     Check bgp no retain route-target all on r1