diff options
| author | Mark Stapp <mstapp@nvidia.com> | 2021-10-11 11:57:30 -0400 |
|---|---|---|
| committer | Mark Stapp <mstapp@nvidia.com> | 2021-10-11 17:25:46 -0400 |
| commit | 4008633d7b9c74b751b25be640206abd29e77404 (patch) | |
| tree | 2bda15f68826f04aeec35a95e81767a7916a6c8e /tests/topotests/isis_topo1_vrf | |
| parent | 5b9414484cb5e10973084108b66181938eab43eb (diff) | |
tests: in isis_topo1_vrf, only configure valid interfaces
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>
Diffstat (limited to 'tests/topotests/isis_topo1_vrf')
| -rw-r--r-- | tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py index 74d5edecab..a0cae0a40b 100644 --- a/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py +++ b/tests/topotests/isis_topo1_vrf/test_isis_topo1_vrf.py @@ -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)) |
