]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/bgp_ecmp_topo3/test_ibgp_ecmp_topo3.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / bgp_ecmp_topo3 / test_ibgp_ecmp_topo3.py
index 9b6480c0d3f884d3a14e1bfbb32349fb75b01950..366cf3d4a5f520e79b8d177a0a059b84e1bebd48 100644 (file)
@@ -1,24 +1,11 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # Copyright (c) 2019 by VMware, Inc. ("VMware")
 # Used Copyright (c) 2018 by Network Device Education Foundation, Inc.
 # ("NetDEF") in this file.
 #
-# Permission to use, copy, modify, and/or distribute this software
-# for any purpose with or without fee is hereby granted, provided
-# that the above copyright notice and this permission notice appear
-# in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND VMWARE DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VMWARE BE LIABLE FOR
-# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
-# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
-# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
 
 
 """
@@ -39,8 +26,7 @@ sys.path.append(os.path.join(CWD, "../../"))
 
 # pylint: disable=C0413
 # Import topogen and topotest helpers
-from lib.topogen import get_topogen
-from lib import topojson
+from lib.topogen import Topogen, get_topogen
 
 from lib.common_config import (
     write_test_header,
@@ -51,11 +37,12 @@ from lib.common_config import (
     reset_config_on_routers,
     shutdown_bringup_interface,
     apply_raw_config,
+    start_topology,
 )
 from lib.topolog import logger
+from lib.topojson import build_config_from_json
 from lib.bgp import create_router_bgp, verify_bgp_convergence
 
-
 pytestmark = [pytest.mark.bgpd, pytest.mark.staticd]
 
 
@@ -78,9 +65,19 @@ def setup_module(mod):
     logger.info("Testsuite start time: {}".format(testsuite_run_time))
     logger.info("=" * 40)
 
-    tgen = topojson.setup_module_from_json(mod.__file__)
+    # This function initiates the topology build with Topogen...
+    json_file = "{}/ibgp_ecmp_topo3.json".format(CWD)
+    tgen = Topogen(json_file, mod.__name__)
+    global topo
     topo = tgen.json_topo
 
+    # Starting topology, create tmp files which are loaded to routers
+    #  to start daemons and then start routers
+    start_topology(tgen)
+
+    # Creating configuration from JSON
+    build_config_from_json(tgen, topo)
+
     # Don't run this test if we have any failure.
     if tgen.routers_have_failure():
         pytest.skip(tgen.errors)