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 <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2022-06-29 13:20:11 -04:00
parent 39ffa8e8e8
commit cbc08d1fb9
5 changed files with 13 additions and 16 deletions

View File

@ -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

View File

@ -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
!

View File

@ -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
!

View File

@ -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
!

View File

@ -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
!