]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: in isis_topo1_vrf, only configure valid interfaces
authorMark Stapp <mstapp@nvidia.com>
Mon, 11 Oct 2021 15:57:30 +0000 (11:57 -0400)
committerMark Stapp <mstapp@nvidia.com>
Mon, 11 Oct 2021 21:25:46 +0000 (17:25 -0400)
Fix a loop in the setup phase of isis_topo1_vrf: only configure
interfaces that each router actually has.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py

index 74d5edecabcddd469ce00b37ba389b1f6eede77b..a0cae0a40b3409fa390fd1285a3ce88fa939468a 100644 (file)
@@ -105,15 +105,21 @@ def setup_module(mod):
         "ip link add {0}-cust1 type vrf table 1001",
         "ip link add loop1 type dummy",
         "ip link set {0}-eth0 master {0}-cust1",
-        "ip link set {0}-eth1 master {0}-cust1",
     ]
 
+    eth1_cmds = ["ip link set {0}-eth1 master {0}-cust1"]
+
     # For all registered routers, load the zebra configuration file
     for rname, router in tgen.routers().items():
         # create VRF rx-cust1 and link rx-eth0 to rx-cust1
         for cmd in cmds:
             output = tgen.net[rname].cmd(cmd.format(rname))
 
+        # If router has an rX-eth1, link that to vrf also
+        if "{}-eth1".format(rname) in router.links.keys():
+            for cmd in eth1_cmds:
+                output = output + tgen.net[rname].cmd(cmd.format(rname))
+
     for rname, router in tgen.routers().items():
         router.load_config(
             TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))