]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/eigrp_topo1/test_eigrp_topo1.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / eigrp_topo1 / test_eigrp_topo1.py
index 6993bc53e706fe545834e6ceecc48d007f874b97..3c9392c3f58db8123d04d965389f6754b7a6551d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_eigrp_topo1.py
@@ -7,20 +8,6 @@
 # Cumulus Networks, Inc.
 # Donald Sharp
 #
-# 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 NETDEF DISCLAIMS ALL WARRANTIES
-# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NETDEF 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.
-#
 
 """
 test_eigrp_topo1.py: Testing EIGRP
@@ -46,7 +33,6 @@ from lib.topogen import Topogen, TopoRouter, get_topogen
 from lib.topolog import logger
 
 # Required to instantiate the topology builder class.
-from mininet.topo import Topo
 
 #####################################################
 ##
@@ -55,36 +41,29 @@ from mininet.topo import Topo
 #####################################################
 
 
-class NetworkTopo(Topo):
-    "EIGRP Topology 1"
-
-    def build(self, **_opts):
-        "Build function"
-
-        tgen = get_topogen(self)
-
-        for routern in range(1, 4):
-            tgen.add_router("r{}".format(routern))
+def build_topo(tgen):
+    for routern in range(1, 4):
+        tgen.add_router("r{}".format(routern))
 
-        # On main router
-        # First switch is for a dummy interface (for local network)
-        switch = tgen.add_switch("sw1")
-        switch.add_link(tgen.gears["r1"])
+    # On main router
+    # First switch is for a dummy interface (for local network)
+    switch = tgen.add_switch("sw1")
+    switch.add_link(tgen.gears["r1"])
 
-        # Switches for EIGRP
-        # switch 2 switch is for connection to EIGRP router
-        switch = tgen.add_switch("sw2")
-        switch.add_link(tgen.gears["r1"])
-        switch.add_link(tgen.gears["r2"])
+    # Switches for EIGRP
+    # switch 2 switch is for connection to EIGRP router
+    switch = tgen.add_switch("sw2")
+    switch.add_link(tgen.gears["r1"])
+    switch.add_link(tgen.gears["r2"])
 
-        # switch 4 is stub on remote EIGRP router
-        switch = tgen.add_switch("sw4")
-        switch.add_link(tgen.gears["r3"])
+    # switch 4 is stub on remote EIGRP router
+    switch = tgen.add_switch("sw4")
+    switch.add_link(tgen.gears["r3"])
 
-        # switch 3 is between EIGRP routers
-        switch = tgen.add_switch("sw3")
-        switch.add_link(tgen.gears["r2"])
-        switch.add_link(tgen.gears["r3"])
+    # switch 3 is between EIGRP routers
+    switch = tgen.add_switch("sw3")
+    switch.add_link(tgen.gears["r2"])
+    switch.add_link(tgen.gears["r3"])
 
 
 #####################################################
@@ -96,7 +75,7 @@ class NetworkTopo(Topo):
 
 def setup_module(module):
     "Setup topology"
-    tgen = Topogen(NetworkTopo, module.__name__)
+    tgen = Topogen(build_topo, module.__name__)
     tgen.start_topology()
 
     # This is a sample of configuration loading.