debug bfd zebra
!
bfd
- peer 192.168.0.2 vrf r1-cust1
+ peer 192.168.0.2 vrf r1-bfd-cust1
echo-mode
no shutdown
!
-router bgp 101 vrf r1-cust1
+router bgp 101 vrf r1-bfd-cust1
no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.2 remote-as 102
-interface r1-eth0 vrf r1-cust1
+interface r1-eth0 vrf r1-bfd-cust1
ip address 192.168.0.1/24
!
debug bfd zebra
!
bfd
- peer 192.168.0.1 vrf r2-cust1
+ peer 192.168.0.1 vrf r2-bfd-cust1
receive-interval 1000
transmit-interval 500
echo-mode
no shutdown
!
- peer 192.168.1.1 vrf r2-cust1
+ peer 192.168.1.1 vrf r2-bfd-cust1
echo-mode
no shutdown
!
-router bgp 102 vrf r2-cust1
+router bgp 102 vrf r2-bfd-cust1
no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.0.1 remote-as 101
-interface r2-eth0 vrf r2-cust1
+interface r2-eth0 vrf r2-bfd-cust1
ip address 192.168.0.2/24
!
-interface r2-eth1 vrf r2-cust1
+interface r2-eth1 vrf r2-bfd-cust1
ip address 192.168.1.2/24
!
-interface r2-eth2 vrf r2-cust1
+interface r2-eth2 vrf r2-bfd-cust1
ip address 192.168.2.2/24
!
debug bfd zebra
!
bfd
- peer 192.168.1.2 vrf r3-cust1
+ peer 192.168.1.2 vrf r3-bfd-cust1
echo-interval 100
echo-mode
no shutdown
-router bgp 103 vrf r3-cust1
+router bgp 103 vrf r3-bfd-cust1
no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.1.2 remote-as 102
-interface r3-eth0 vrf r3-cust1
+interface r3-eth0 vrf r3-bfd-cust1
ip address 192.168.1.1/24
!
debug bfd zebra
!
bfd
- peer 192.168.2.2 vrf r4-cust1
+ peer 192.168.2.2 vrf r4-bfd-cust1
transmit-interval 2000
receive-interval 2000
no shutdown
-router bgp 104 vrf r4-cust1
+router bgp 104 vrf r4-bfd-cust1
no bgp ebgp-requires-policy
no bgp network import-check
neighbor 192.168.2.2 remote-as 102
-interface r4-eth0 vrf r4-cust1
+interface r4-eth0 vrf r4-bfd-cust1
ip address 192.168.2.1/24
!
logger.info("Testing with VRF Namespace support")
cmds = [
- "if [ -e /var/run/netns/{0}-cust1 ] ; then ip netns del {0}-cust1 ; fi",
- "ip netns add {0}-cust1",
- "ip link set dev {0}-eth0 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth0 up",
+ "if [ -e /var/run/netns/{0}-bfd-cust1 ] ; then ip netns del {0}-bfd-cust1 ; fi",
+ "ip netns add {0}-bfd-cust1",
+ "ip link set dev {0}-eth0 netns {0}-bfd-cust1 up",
]
cmds2 = [
- "ip link set dev {0}-eth1 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth1 up",
- "ip link set dev {0}-eth2 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth2 up",
+ "ip link set dev {0}-eth1 netns {0}-bfd-cust1",
+ "ip netns exec {0}-bfd-cust1 ip link set {0}-eth1 up",
+ "ip link set dev {0}-eth2 netns {0}-bfd-cust1 up",
]
for rname, router in router_list.items():
- # create VRF rx-cust1 and link rx-eth0 to rx-cust1
+ # create VRF rx-bfd-cust1 and link rx-eth0 to rx-bfd-cust1
for cmd in cmds:
output = tgen.net[rname].cmd(cmd.format(rname))
if rname == "r2":
# move back rx-eth0 to default VRF
# delete rx-vrf
cmds = [
- "ip netns exec {0}-cust1 ip link set {0}-eth0 netns 1",
- "ip netns delete {0}-cust1",
+ "ip netns exec {0}-bfd-cust1 ip link set {0}-eth0 netns 1",
+ "ip netns delete {0}-bfd-cust1",
]
cmds2 = [
- "ip netns exec {0}-cust1 ip link set {0}-eth1 netns 1",
+ "ip netns exec {0}-bfd-cust1 ip link set {0}-eth1 netns 1",
"ip netns exec {0}-cust2 ip link set {0}-eth1 netns 1",
]
test_func = partial(
topotest.router_json_cmp,
router,
- "show ip bgp vrf {}-cust1 summary json".format(router.name),
+ "show ip bgp vrf {}-bfd-cust1 summary json".format(router.name),
expected,
)
_, res = topotest.run_and_expect(test_func, None, count=125, wait=1.0)
test_func = partial(
topotest.router_json_cmp,
router,
- "show ip bgp vrf {}-cust1 json".format(router.name),
+ "show ip bgp vrf {}-bfd-cust1 json".format(router.name),
expected,
)
_, res = topotest.run_and_expect(test_func, None, count=40, wait=1)
# Disable r2-eth0 link
router2 = tgen.gears["r2"]
topotest.interface_set_status(
- router2, "r2-eth0", ifaceaction=False, vrf_name="r2-cust1"
+ router2, "r2-eth0", ifaceaction=False, vrf_name="r2-bfd-cust1"
)
# Wait the minimum time we can before checking that BGP/BFD
test_func = partial(
topotest.router_json_cmp,
router,
- "show ip bgp vrf {}-cust1 json".format(router.name),
+ "show ip bgp vrf {}-bfd-cust1 json".format(router.name),
expected,
)
_, res = topotest.run_and_expect(test_func, None, count=16, wait=1)
LOOPBACK_1 = {
"ipv4": "10.10.10.10/32",
"ipv6": "10::10:10/128",
- "ipv4_mask": "255.255.255.255",
- "ipv6_mask": None,
}
LOOPBACK_2 = {
"ipv4": "20.20.20.20/32",
"ipv6": "20::20:20/128",
- "ipv4_mask": "255.255.255.255",
- "ipv6_mask": None,
}
"loopback1",
LOOPBACK_1[addr_type],
"RED_A",
- LOOPBACK_1["{}_mask".format(addr_type)],
)
create_interface_in_kernel(
tgen,
"loopback2",
LOOPBACK_2[addr_type],
"RED_B",
- LOOPBACK_2["{}_mask".format(addr_type)],
)
step(
"loopback1",
LOOPBACK_1[addr_type],
"RED_A",
- LOOPBACK_1["{}_mask".format(addr_type)],
)
create_interface_in_kernel(
"loopback2",
LOOPBACK_2[addr_type],
"BLUE_A",
- LOOPBACK_2["{}_mask".format(addr_type)],
)
step(
"loopback1",
LOOPBACK_1[addr_type],
"RED_A",
- LOOPBACK_1["{}_mask".format(addr_type)],
)
create_interface_in_kernel(
tgen,
"loopback2",
LOOPBACK_2[addr_type],
"BLUE_A",
- LOOPBACK_2["{}_mask".format(addr_type)],
)
step(
LOOPBACK_2 = {
"ipv4": "20.20.20.20/32",
"ipv6": "20::20:20/128",
- "ipv4_mask": "255.255.255.255",
- "ipv6_mask": None,
}
MAX_PATHS = 2
"loopback2",
LOOPBACK_2[addr_type],
"RED_B",
- LOOPBACK_2["{}_mask".format(addr_type)],
)
intf_red1_r11 = topo["routers"]["red1"]["links"]["r1-link2"]["interface"]
tc_name, result
)
- step("Toggle the interface on R3(ifconfig 192.34).")
+ step("Toggle the interface on R3.")
intf_r3_r4 = topo["routers"]["r3"]["links"]["r4"]["interface"]
shutdown_bringup_interface(tgen, "r3", intf_r3_r4)
tc_name, result
)
- step("Toggle the interface on R4(ifconfig 192.34).")
+ step("Toggle the interface on R4.")
intf_r4_r3 = topo["routers"]["r4"]["links"]["r3"]["interface"]
shutdown_bringup_interface(tgen, "r4", intf_r4_r3)
LOOPBACK_2 = {
"ipv4": "10.0.0.16/24",
"ipv6": "fd00:0:0:3::5/64",
- "ipv4_mask": "255.255.255.0",
- "ipv6_mask": None,
}
PREFERRED_NEXT_HOP = "global"
"loopback2",
LOOPBACK_2[addr_type],
"ISR",
- LOOPBACK_2["{}_mask".format(addr_type)],
)
for addr_type in ADDR_TYPES:
step(
"On router R1 Change the next-hop of static routes in vrf "
- "ISR to LOOPBACK_1"
+ "ISR to LOOPBACK_2"
)
input_routes_r1 = {
!
-router bgp 100 vrf r1-cust1
+router bgp 100 vrf r1-bgp-cust1
bgp router-id 10.0.1.1
bgp bestpath as-path multipath-relax
no bgp ebgp-requires-policy
"ipv4Unicast":{
"routerId":"10.0.1.1",
"as":100,
- "vrfName":"r1-cust1",
+ "vrfName":"r1-bgp-cust1",
"peerCount":1,
"peers":{
"10.0.1.101":{
{
"routerId":"10.0.1.1",
"as":100,
- "vrfName":"re1-cust1",
+ "vrfName":"re1-bgp-cust1",
"peerCount":1,
"peers":{
"10.0.1.101":{
!
-interface r1-eth0 vrf r1-cust1
+interface r1-eth0 vrf r1-bgp-cust1
ip address 10.0.1.1/24
!
line vty
if CustomizeVrfWithNetns == True:
logger.info("Testing with VRF Namespace support")
- # create VRF r1-cust1
- # move r1-eth0 to VRF r1-cust1
+ # create VRF r1-bgp-cust1
+ # move r1-eth0 to VRF r1-bgp-cust1
cmds = [
- "if [ -e /var/run/netns/{0}-cust1 ] ; then ip netns del {0}-cust1 ; fi",
- "ip netns add {0}-cust1",
- "ip link set dev {0}-eth0 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth0 up",
+ "if [ -e /var/run/netns/{0}-bgp-cust1 ] ; then ip netns del {0}-bgp-cust1 ; fi",
+ "ip netns add {0}-bgp-cust1",
+ "ip link set {0}-eth0 netns {0}-bgp-cust1 up",
]
for cmd in cmds:
cmd = cmd.format("r1")
def teardown_module(module):
tgen = get_topogen()
# move back r1-eth0 to default VRF
- # delete VRF r1-cust1
+ # delete VRF r1-bgp-cust1
cmds = [
- "ip netns exec {0}-cust1 ip link set {0}-eth0 netns 1",
- "ip netns delete {0}-cust1",
+ "ip netns exec {0}-bgp-cust1 ip link set {0}-eth0 netns 1",
+ "ip netns delete {0}-bgp-cust1",
]
for cmd in cmds:
tgen.net["r1"].cmd(cmd.format("r1"))
expected = json.loads(open(reffile).read())
test_func = functools.partial(
- topotest.router_json_cmp, router, "show bgp vrf r1-cust1 summary json", expected
+ topotest.router_json_cmp, router, "show bgp vrf r1-bgp-cust1 summary json", expected
)
_, res = topotest.run_and_expect(test_func, None, count=90, wait=0.5)
assertmsg = "BGP router network did not converge"
test_func = functools.partial(
topotest.router_json_cmp,
tgen.gears["r1"],
- "show ip bgp vrf r1-cust1 ipv4 json",
+ "show ip bgp vrf r1-bgp-cust1 ipv4 json",
expect,
)
_, res = topotest.run_and_expect(test_func, None, count=12, wait=0.5)
- assertmsg = 'expected routes in "show ip bgp vrf r1-cust1 ipv4" output'
+ assertmsg = 'expected routes in "show ip bgp vrf r1-bgp-cust1 ipv4" output'
assert res is None, assertmsg
for intf_dict in interfaces:
for interface, data in intf_dict.items():
# Adding interface to VLAN
- cmd = "vconfig add {} {}".format(interface, vlan)
+ vlan_intf = "{}.{}".format(interface, vlan)
+ cmd = "ip link add link {} name {} type vlan id {}".format(
+ interface,
+ vlan_intf,
+ vlan
+ )
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
- vlan_intf = "{}.{}".format(interface, vlan)
-
- ip = data["ip"]
- subnet = data["subnet"]
-
# Bringing interface up
- cmd = "ip link set up {}".format(vlan_intf)
+ cmd = "ip link set {} up".format(vlan_intf)
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
# Assigning IP address
- cmd = "ifconfig {} {} netmask {}".format(vlan_intf, ip, subnet)
+ ifaddr = ipaddress.ip_interface(
+ u"{}/{}".format(
+ frr_unicode(data["ip"]),
+ frr_unicode(data["subnet"])
+ )
+ )
+
+ cmd = "ip -{0} a flush {1} scope global && ip a add {2} dev {1} && ip l set {1} up".format(
+ ifaddr.version, vlan_intf, ifaddr
+ )
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
rnode = tgen.routers()[dut]
if create:
- cmd = "sudo ip link add name {} type dummy".format(name)
+ cmd = "ip link show {0} >/dev/null || ip link add {0} type dummy".format(name)
rnode.run(cmd)
- addr_type = validate_ip_address(ip_addr)
- if addr_type == "ipv4":
- cmd = "ifconfig {} {} netmask {}".format(name, ip_addr, netmask)
+ if not netmask:
+ ifaddr = ipaddress.ip_interface(frr_unicode(ip_addr))
else:
- cmd = "ifconfig {} inet6 add {}/{}".format(name, ip_addr, netmask)
-
+ ifaddr = ipaddress.ip_interface(u"{}/{}".format(
+ frr_unicode(ip_addr),
+ frr_unicode(netmask)
+ ))
+ cmd = "ip -{0} a flush {1} scope global && ip a add {2} dev {1} && ip l set {1} up".format(
+ ifaddr.version, name, ifaddr
+ )
+ logger.info("[DUT: %s]: Running command: %s", dut, cmd)
rnode.run(cmd)
if vrf:
rnode = tgen.routers()[dut]
for intf, mac in input_dict[dut].items():
- cmd = "ifconfig {} hw ether {}".format(intf, mac)
+ cmd = "ip link set {} address {}".format(intf, mac)
logger.info("[DUT: %s]: Running command: %s", dut, cmd)
try:
# set mtu of fhr(f1) to i1 interface to 100 so that bsm fragments
step("set mtu of fhr(f1) to i1 interface to 100 so that bsm fragments")
- fhr_node.run("ifconfig f1-i1-eth2 mtu 100")
- inter_node.run("ifconfig i1-f1-eth0 mtu 100")
+ fhr_node.run("ip link set f1-i1-eth2 mtu 100")
+ inter_node.run("ip link set i1-f1-eth0 mtu 100")
# Use scapy to send pre-defined packet from senser to receiver
result = scapy_send_bsr_raw_packet(tgen, topo, "b1", "f1", "packet2")
r0_r1_intf = topo["routers"]["r0"]["links"]["r1"]["interface"]
r1_r0_intf = topo["routers"]["r1"]["links"]["r0"]["interface"]
- rtr0.run("ifconfig {} mtu 1200".format(r0_r1_intf))
+ rtr0.run("ip link set {} mtu 1200".format(r0_r1_intf))
clear_ospf(tgen, "r0")
"Modify the MTU to non default Value on R0 to R1 interface. "
"Reset ospf neighbors on R0."
)
- rtr0.run("ifconfig {} mtu 1500".format(r0_r1_intf))
+ rtr0.run("ip link set {} mtu 1500".format(r0_r1_intf))
clear_ospf(tgen, "r0")
result = config_ospf_interface(tgen, topo, r1_ospf_mtu)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
- rtr0.run("ifconfig {} mtu 1200".format(r0_r1_intf))
+ rtr0.run("ip link set {} mtu 1200".format(r0_r1_intf))
clear_ospf(tgen, "r0")
step("Modify the MTU to again default valaue on R0 to R1 interface.")
- rtr0.run("ifconfig {} mtu 1500".format(r0_r1_intf))
+ rtr0.run("ip link set {} mtu 1500".format(r0_r1_intf))
clear_ospf(tgen, "r0")
"Configure ospf interface with jumbo MTU (9216)." "Reset ospf neighbors on R0."
)
- rtr0.run("ifconfig {} mtu 9216".format(r0_r1_intf))
- rtr1.run("ifconfig {} mtu 9216".format(r1_r0_intf))
+ rtr0.run("ip link set {} mtu 9216".format(r0_r1_intf))
+ rtr1.run("ip link set {} mtu 9216".format(r1_r0_intf))
clear_ospf(tgen, "r0")
clear_ospf(tgen, "r1")
password zebra
log file /tmp/r1-ospfd.log
!
-router ospf vrf r1-cust1
+router ospf vrf r1-ospf-cust1
ospf router-id 10.0.255.1
redistribute kernel
redistribute connected
-VRF Name: r1-cust1
+VRF Name: r1-ospf-cust1
============ OSPF network routing table ============
N 10.0.1.0/24 [10] area: 0.0.0.0
directly attached to r1-eth0
-VRF Name: r1-cust1
+VRF Name: r1-ospf-cust1
============ OSPF network routing table ============
N 10.0.1.0/24 [10] area: 0.0.0.0
directly attached to r1-eth0
password zebra
log file /tmp/r1-zebra.log
!
-interface r1-eth0 vrf r1-cust1
+interface r1-eth0 vrf r1-ospf-cust1
ip address 10.0.1.1/24
!
-interface r1-eth1 vrf r1-cust1
+interface r1-eth1 vrf r1-ospf-cust1
ip address 10.0.3.2/24
!
ip forwarding
-VRF r1-cust1:
+VRF r1-ospf-cust1:
O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, weight 1, XX:XX:XX
C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX
O>* 10.0.2.0/24 [110/20] via 10.0.3.3, r1-eth1, weight 1, XX:XX:XX
-VRF r1-cust1:
+VRF r1-ospf-cust1:
O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, weight 1, XX:XX:XX
C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX
O>* 10.0.2.0/24 [110/20] via 10.0.3.3, r1-eth1, weight 1, XX:XX:XX
log file /tmp/r2-ospfd.log
!
!
-router ospf vrf r2-cust1
+router ospf vrf r2-ospf-cust1
ospf router-id 10.0.255.2
redistribute kernel
redistribute connected
-VRF Name: r2-cust1
+VRF Name: r2-ospf-cust1
============ OSPF network routing table ============
N 10.0.1.0/24 [20] area: 0.0.0.0
via 10.0.3.2, r2-eth1
-VRF Name: r2-cust1
+VRF Name: r2-ospf-cust1
============ OSPF network routing table ============
N 10.0.1.0/24 [20] area: 0.0.0.0
via 10.0.3.2, r2-eth1
password zebra
log file /tmp/r2-zebra.log
!
-interface r2-eth0 vrf r2-cust1
+interface r2-eth0 vrf r2-ospf-cust1
ip address 10.0.2.1/24
!
-interface r2-eth1 vrf r2-cust1
+interface r2-eth1 vrf r2-ospf-cust1
ip address 10.0.3.3/24
!
ip forwarding
-VRF r2-cust1:
+VRF r2-ospf-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, weight 1, XX:XX:XX
O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, weight 1, XX:XX:XX
C>* 10.0.2.0/24 is directly connected, r2-eth0, XX:XX:XX
-VRF r2-cust1:
+VRF r2-ospf-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, weight 1, XX:XX:XX
O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, weight 1, XX:XX:XX
C>* 10.0.2.0/24 is directly connected, r2-eth0, XX:XX:XX
log file /tmp/r3-ospfd.log
!
!
-router ospf vrf r3-cust1
+router ospf vrf r3-ospf-cust1
ospf router-id 10.0.255.3
redistribute kernel
redistribute connected
-VRF Name: r3-cust1
+VRF Name: r3-ospf-cust1
============ OSPF network routing table ============
N 10.0.1.0/24 [20] area: 0.0.0.0
via 10.0.3.2, r3-eth0
-VRF Name: r3-cust1
+VRF Name: r3-ospf-cust1
============ OSPF network routing table ============
N 10.0.10.0/24 [10] area: 0.0.0.0
directly attached to r3-eth1
password zebra
log file /tmp/r3-zebra.log
!
-interface r3-eth0 vrf r3-cust1
+interface r3-eth0 vrf r3-ospf-cust1
ip address 10.0.3.1/24
!
-interface r3-eth1 vrf r3-cust1
+interface r3-eth1 vrf r3-ospf-cust1
ip address 10.0.10.1/24
!
ip forwarding
-VRF r3-cust1:
+VRF r3-ospf-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r3-eth0, weight 1, XX:XX:XX
O>* 10.0.2.0/24 [110/20] via 10.0.3.3, r3-eth0, weight 1, XX:XX:XX
O 10.0.3.0/24 [110/10] is directly connected, r3-eth0, weight 1, XX:XX:XX
-VRF r3-cust1:
+VRF r3-ospf-cust1:
O 10.0.10.0/24 [110/10] is directly connected, r3-eth1, weight 1, XX:XX:XX
C>* 10.0.10.0/24 is directly connected, r3-eth1, XX:XX:XX
logger.info("Testing with VRF Namespace support")
cmds = [
- "if [ -e /var/run/netns/{0}-cust1 ] ; then ip netns del {0}-cust1 ; fi",
- "ip netns add {0}-cust1",
- "ip link set dev {0}-eth0 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth0 up",
- "ip link set dev {0}-eth1 netns {0}-cust1",
- "ip netns exec {0}-cust1 ifconfig {0}-eth1 up",
+ "if [ -e /var/run/netns/{0}-ospf-cust1 ] ; then ip netns del {0}-ospf-cust1 ; fi",
+ "ip netns add {0}-ospf-cust1",
+ "ip link set dev {0}-eth0 netns {0}-ospf-cust1",
+ "ip netns exec {0}-ospf-cust1 ip link set {0}-eth0 up",
+ "ip link set dev {0}-eth1 netns {0}-ospf-cust1",
+ "ip netns exec {0}-ospf-cust1 ip link set {0}-eth1 up",
]
for rname, router in router_list.items():
- # create VRF rx-cust1 and link rx-eth0 to rx-cust1
+ # create VRF rx-ospf-cust1 and link rx-eth0 to rx-ospf-cust1
for cmd in cmds:
output = tgen.net[rname].cmd(cmd.format(rname))
# move back rx-eth0 to default VRF
# delete rx-vrf
cmds = [
- "ip netns exec {0}-cust1 ip link set {0}-eth0 netns 1",
- "ip netns exec {0}-cust1 ip link set {0}-eth1 netns 1",
- "ip netns delete {0}-cust1",
+ "ip netns exec {0}-ospf-cust1 ip link set {0}-eth0 netns 1",
+ "ip netns exec {0}-ospf-cust1 ip link set {0}-eth1 netns 1",
+ "ip netns delete {0}-ospf-cust1",
]
router_list = tgen.routers()
# Shared test function to validate expected output.
def compare_show_ip_route_vrf(rname, expected):
"""
- Calls 'show ip ospf vrf [rname]-cust1 route' for router `rname` and compare the obtained
+ Calls 'show ip ospf vrf [rname]-ospf-cust1 route' for router `rname` and compare the obtained
result with the expected output.
"""
tgen = get_topogen()
- vrf_name = "{0}-cust1".format(rname)
+ vrf_name = "{0}-ospf-cust1".format(rname)
current = topotest.ip4_route_zebra(tgen.gears[rname], vrf_name)
ret = topotest.difflines(
current, expected, title1="Current output", title2="Expected output"
test_func = partial(
topotest.router_output_cmp,
router,
- "show ip ospf vrf {0}-cust1 route".format(rname),
+ "show ip ospf vrf {0}-ospf-cust1 route".format(rname),
expected,
)
result, diff = topotest.run_and_expect(test_func, "", count=160, wait=0.5)
for rname, router in tgen.routers().items():
logger.info(
- 'Comparing router "%s" "show ip ospf vrf %s-cust1 json" output',
+ 'Comparing router "%s" "show ip ospf vrf %s-ospf-cust1 json" output',
router.name,
router.name,
)
expected = {
- "{}-cust1".format(router.name): {
- "vrfName": "{}-cust1".format(router.name),
+ "{}-ospf-cust1".format(router.name): {
+ "vrfName": "{}-ospf-cust1".format(router.name),
"routerId": "10.0.255.{}".format(rname[1:]),
"tosRoutesOnly": True,
"rfc2328Conform": True,
}
# Area specific additional checks
if router.name == "r1" or router.name == "r2" or router.name == "r3":
- expected["{}-cust1".format(router.name)]["areas"]["0.0.0.0"] = {
+ expected["{}-ospf-cust1".format(router.name)]["areas"]["0.0.0.0"] = {
"areaIfActiveCounter": 2,
"areaIfTotalCounter": 2,
"authentication": "authenticationNone",
test_func = partial(
topotest.router_json_cmp,
router,
- "show ip ospf vrf {0}-cust1 json".format(rname),
+ "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
expected,
)
_, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
# Simulate a network down event on router3 switch3 interface.
router3 = tgen.gears["r3"]
topotest.interface_set_status(
- router3, "r3-eth0", ifaceaction=False, vrf_name="r3-cust1"
+ router3, "r3-eth0", ifaceaction=False, vrf_name="r3-ospf-cust1"
)
# Expect convergence on all routers
test_func = partial(
topotest.router_output_cmp,
router,
- "show ip ospf vrf {0}-cust1 route".format(rname),
+ "show ip ospf vrf {0}-ospf-cust1 route".format(rname),
expected,
)
result, diff = topotest.run_and_expect(test_func, "", count=140, wait=0.5)
'Checking OSPF IPv4 kernel routes in "%s" after link down', router.name
)
- str = "{0}-cust1".format(router.name)
+ str = "{0}-ospf-cust1".format(router.name)
reffile = os.path.join(CWD, "{}/zebraroutedown.txt".format(router.name))
expected = open(reffile).read()
# Run test function until we get an result. Wait at most 60 seconds.