]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: check as number in show run
authorLouis Scalbert <louis.scalbert@6wind.com>
Fri, 14 Feb 2025 10:58:24 +0000 (11:58 +0100)
committerLouis Scalbert <louis.scalbert@6wind.com>
Mon, 24 Feb 2025 16:52:44 +0000 (17:52 +0100)
Creates the default VRF instance after the other VRF instances. The
default VRF instance is created in hidden state. Check that AS number
in show run is correctly written.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
tests/topotests/bgp_vrf_route_leak_basic/r1/bgpd.conf
tests/topotests/bgp_vrf_route_leak_basic/test_bgp-vrf-route-leak-basic.py

index 397f7938d2e0de2c9c17dc02f08e4237c63dd1d1..8363e2bc9969d8d8aefebab1a74f82cbc3f5e0c8 100644 (file)
@@ -1,12 +1,5 @@
 hostname r1
 
-router bgp 99
-  no bgp ebgp-requires-policy
-  address-family ipv4 unicast
-    redistribute connected
-    import vrf DONNA
-  !
-!
 router bgp 99 vrf DONNA
   no bgp ebgp-requires-policy
   address-family ipv4 unicast
@@ -31,3 +24,10 @@ router bgp 99 vrf ZITA
     network 172.16.101.0/24
   !
 !
+router bgp 99
+  no bgp ebgp-requires-policy
+  address-family ipv4 unicast
+    redistribute connected
+    import vrf DONNA
+  !
+!
index 3bc36862bf76c8459611e6297dbbb1a15dee4e3e..7a407761d309b0e527e03aba332f99a6037f9dec 100644 (file)
@@ -64,6 +64,16 @@ def teardown_module(mod):
     tgen.stop_topology()
 
 
+def test_router_bgp_as_pretty():
+    tgen = get_topogen()
+    # Don't run this test if we have any failure.
+    if tgen.routers_have_failure():
+        pytest.skip(tgen.errors)
+
+    output = tgen.gears["r1"].vtysh_cmd("show run")
+    assert "router bgp 99\n" in output, "router bgp 99 not found in show run"
+
+
 def test_vrf_route_leak_donna():
     logger.info("Ensure that routes are leaked back and forth")
     tgen = get_topogen()