From: Donald Sharp Date: Wed, 29 Jun 2022 17:20:11 +0000 (-0400) Subject: tests: Convert one test to use interface based mpls config X-Git-Tag: base_8.4~152^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=cbc08d1fb9f511323363fd3578ed7b1a5f9a6859;p=matthieu%2Ffrr.git tests: Convert one test to use interface based mpls config To prove that this works. Modify a test that uses mpls to turn on mpls for the interfaces that need mpls via the new mpls command. Signed-off-by: Donald Sharp --- diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py b/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py index 36bfdfe068..c0a5c7ad9c 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/customize.py @@ -137,22 +137,6 @@ def ltemplatePreRouterStartHook(): if tgen.hasmpls != True: logger.info("MPLS not available, skipping setup") return False - # configure r2 mpls interfaces - intfs = ["lo", "r2-eth0", "r2-eth1", "r2-eth2"] - for intf in intfs: - cc.doCmd(tgen, "r2", "echo 1 > /proc/sys/net/mpls/conf/{}/input".format(intf)) - # configure MPLS - rtrs = ["r1", "r3", "r4"] - cmds = ["echo 1 > /proc/sys/net/mpls/conf/lo/input"] - for rtr in rtrs: - router = tgen.gears[rtr] - for cmd in cmds: - cc.doCmd(tgen, rtr, cmd) - intfs = ["lo", rtr + "-eth0", rtr + "-eth4"] - for intf in intfs: - cc.doCmd( - tgen, rtr, "echo 1 > /proc/sys/net/mpls/conf/{}/input".format(intf) - ) logger.info("setup mpls input") return True diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/r1/zebra.conf b/tests/topotests/bgp_l3vpn_to_bgp_direct/r1/zebra.conf index 18f61e0c54..767e17e62c 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/r1/zebra.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/r1/zebra.conf @@ -3,15 +3,18 @@ log file zebra.log hostname r1 ! interface lo + mpls ip address 1.1.1.1/32 ! interface r1-eth0 description to sw0 + mpls ip address 10.0.1.1/24 no link-detect ! interface r1-eth4 description to ce1 + mpls ip address 192.168.1.1/24 no link-detect ! diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/r2/zebra.conf b/tests/topotests/bgp_l3vpn_to_bgp_direct/r2/zebra.conf index dd1dbac32b..829ac969e3 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/r2/zebra.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/r2/zebra.conf @@ -3,20 +3,24 @@ log file zebra.log hostname r2 ! interface lo + mpls ip address 2.2.2.2/32 ! interface r2-eth0 description to sw0 + mpls ip address 10.0.1.2/24 no link-detect ! interface r2-eth1 description to sw1 + mpls ip address 10.0.2.2/24 no link-detect ! interface r2-eth2 description to sw2 + mpls ip address 10.0.3.2/24 no link-detect ! diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/r3/zebra.conf b/tests/topotests/bgp_l3vpn_to_bgp_direct/r3/zebra.conf index 9dbc290243..916dabf37d 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/r3/zebra.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/r3/zebra.conf @@ -3,10 +3,12 @@ log file zebra.log hostname r3 ! interface lo + mpls ip address 3.3.3.3/32 ! interface r3-eth0 description to sw1 + mpls ip address 10.0.2.3/24 no link-detect ! @@ -17,6 +19,7 @@ interface r3-eth1 ! interface r3-eth4 description to ce2 + mpls ip address 192.168.1.1/24 no link-detect ! diff --git a/tests/topotests/bgp_l3vpn_to_bgp_direct/r4/zebra.conf b/tests/topotests/bgp_l3vpn_to_bgp_direct/r4/zebra.conf index 415f03df51..e08ac86aec 100644 --- a/tests/topotests/bgp_l3vpn_to_bgp_direct/r4/zebra.conf +++ b/tests/topotests/bgp_l3vpn_to_bgp_direct/r4/zebra.conf @@ -3,15 +3,18 @@ log file zebra.log hostname r4 ! interface lo + mpls ip address 4.4.4.4/32 ! interface r4-eth0 description to sw1 + mpls ip address 10.0.2.4/24 no link-detect ! interface r4-eth4 description to ce3 + mpls ip address 192.168.1.1/24 no link-detect !