]> git.proxmox.com Git - mirror_frr.git/blobdiff - tests/topotests/bgp_aggregate_address_topo1/test_bgp_aggregate_address_topo1.py
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / tests / topotests / bgp_aggregate_address_topo1 / test_bgp_aggregate_address_topo1.py
index 9f269782594ef7bcead61b4ba971a349c2190033..370d01e52598604a8d99de6740f3df20440a453d 100644 (file)
@@ -1,4 +1,5 @@
 #!/usr/bin/env python
+# SPDX-License-Identifier: ISC
 
 #
 # test_bgp_aggregate_address_topo1.py
@@ -7,20 +8,6 @@
 # Copyright (c) 2020 by
 # Network Device Education Foundation, Inc. ("NetDEF")
 #
-# 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 BGP aggregate address features.
@@ -28,8 +15,6 @@ Test BGP aggregate address features.
 
 import os
 import sys
-import json
-import time
 import pytest
 import functools
 
@@ -40,32 +25,26 @@ sys.path.append(os.path.join(CWD, "../"))
 from lib import topotest
 from lib.topogen import Topogen, TopoRouter, get_topogen
 from lib.topolog import logger
-from mininet.topo import Topo
 
 pytestmark = [pytest.mark.bgpd]
 
 
-class BgpAggregateAddressTopo1(Topo):
-    def build(self, *_args, **_opts):
-        tgen = get_topogen(self)
-
-        r1 = tgen.add_router("r1")
-        r2 = tgen.add_router("r2")
-        peer1 = tgen.add_exabgp_peer(
-            "peer1", ip="10.0.0.2", defaultRoute="via 10.0.0.1"
-        )
+def build_topo(tgen):
+    r1 = tgen.add_router("r1")
+    r2 = tgen.add_router("r2")
+    peer1 = tgen.add_exabgp_peer("peer1", ip="10.0.0.2", defaultRoute="via 10.0.0.1")
 
-        switch = tgen.add_switch("s1")
-        switch.add_link(r1)
-        switch.add_link(peer1)
+    switch = tgen.add_switch("s1")
+    switch.add_link(r1)
+    switch.add_link(peer1)
 
-        switch = tgen.add_switch("s2")
-        switch.add_link(r1)
-        switch.add_link(r2)
+    switch = tgen.add_switch("s2")
+    switch.add_link(r1)
+    switch.add_link(r2)
 
 
 def setup_module(mod):
-    tgen = Topogen(BgpAggregateAddressTopo1, mod.__name__)
+    tgen = Topogen(build_topo, mod.__name__)
     tgen.start_topology()
 
     router = tgen.gears["r1"]