summaryrefslogtreecommitdiff
path: root/tests/topotests/lib/topojson.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/topotests/lib/topojson.py')
-rw-r--r--tests/topotests/lib/topojson.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/topotests/lib/topojson.py b/tests/topotests/lib/topojson.py
index 4f23e1ace0..3ca3353ed3 100644
--- a/tests/topotests/lib/topojson.py
+++ b/tests/topotests/lib/topojson.py
@@ -40,7 +40,7 @@ from lib.common_config import (
topo_daemons,
number_to_column,
)
-from lib.ospf import create_router_ospf, create_router_ospf6
+from lib.ospf import create_router_ospf
from lib.pim import create_igmp_config, create_pim_config
from lib.topolog import logger
@@ -334,7 +334,6 @@ def build_config_from_json(tgen, topo=None, save_bkup=True):
("igmp", create_igmp_config),
("bgp", create_router_bgp),
("ospf", create_router_ospf),
- ("ospf6", create_router_ospf6),
]
)
@@ -353,6 +352,18 @@ def build_config_from_json(tgen, topo=None, save_bkup=True):
logger.info("build_config_from_json: failed to configure topology")
pytest.exit(1)
+ logger.info("Built config now clearing ospf neighbors as that router-id might not be what is used")
+ for ospf in ["ospf", "ospf6"]:
+ for router in data:
+ if ospf not in data[router]:
+ continue
+
+ r = tgen.gears[router]
+ if ospf == "ospf":
+ r.vtysh_cmd("clear ip ospf process")
+ else:
+ r.vtysh_cmd("clear ipv6 ospf6 process")
+
def create_tgen_from_json(testfile, json_file=None):
"""Create a topogen object given a testfile.