mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 17:40:04 +00:00
tests: Check if labeled IPv6 unicast default route works too
Also, check if remote label is explicit null according to the AFI. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
df04c23c8f
commit
e7dce035ab
@ -1,18 +1,32 @@
|
||||
!
|
||||
router bgp 65001
|
||||
no bgp default ipv4-unicast
|
||||
no bgp default ipv6-unicast
|
||||
no bgp ebgp-requires-policy
|
||||
neighbor 192.168.12.2 remote-as external
|
||||
neighbor 192.168.12.2 timers 1 3
|
||||
neighbor 192.168.12.2 timers connect 1
|
||||
neighbor 2001:db8:12::2 remote-as external
|
||||
neighbor 2001:db8:12::2 timers 1 3
|
||||
neighbor 2001:db8:12::2 timers connect 1
|
||||
address-family ipv4 unicast
|
||||
redistribute connected
|
||||
exit-address-family
|
||||
!
|
||||
address-family ipv6 unicast
|
||||
redistribute connected
|
||||
exit-address-family
|
||||
!
|
||||
address-family ipv4 labeled-unicast
|
||||
neighbor 192.168.12.2 activate
|
||||
neighbor 192.168.12.2 default-originate route-map r2
|
||||
exit-address-family
|
||||
!
|
||||
address-family ipv6 labeled-unicast
|
||||
neighbor 2001:db8:12::2 activate
|
||||
neighbor 2001:db8:12::2 default-originate route-map r2
|
||||
exit-address-family
|
||||
!
|
||||
!
|
||||
route-map r2 permit 10
|
||||
set community 65001:65001
|
||||
|
@ -1,4 +1,5 @@
|
||||
!
|
||||
interface r1-eth0
|
||||
ip address 192.168.12.1/24
|
||||
ipv6 address 2001:db8:12::1/64
|
||||
!
|
||||
|
@ -2,10 +2,18 @@
|
||||
router bgp 65002
|
||||
no bgp ebgp-requires-policy
|
||||
no bgp default ipv4-unicast
|
||||
no bgp default ipv6-unicast
|
||||
neighbor 192.168.12.1 remote-as external
|
||||
neighbor 192.168.12.1 timers 1 3
|
||||
neighbor 192.168.12.1 timers connect 1
|
||||
neighbor 2001:db8:12::1 remote-as external
|
||||
neighbor 2001:db8:12::1 timers 1 3
|
||||
neighbor 2001:db8:12::1 timers connect 1
|
||||
address-family ipv4 labeled-unicast
|
||||
neighbor 192.168.12.1 activate
|
||||
exit-address-family
|
||||
!
|
||||
address-family ipv6 labeled-unicast
|
||||
neighbor 2001:db8:12::1 activate
|
||||
exit-address-family
|
||||
!
|
||||
|
@ -1,4 +1,5 @@
|
||||
!
|
||||
interface r2-eth0
|
||||
ip address 192.168.12.2/24
|
||||
ipv6 address 2001:db8:12::2/64
|
||||
!
|
||||
|
@ -82,7 +82,7 @@ def test_bgp_labeled_unicast_default_originate():
|
||||
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
|
||||
assert result is None, "Failed to advertise default route for labeled-unicast"
|
||||
|
||||
def _bgp_check_received_routes():
|
||||
def _bgp_check_received_ipv4_routes():
|
||||
output = json.loads(
|
||||
r2.vtysh_cmd("show bgp ipv4 labeled-unicast 0.0.0.0/0 json")
|
||||
)
|
||||
@ -94,14 +94,35 @@ def test_bgp_labeled_unicast_default_originate():
|
||||
"community": {
|
||||
"string": "65001:65001",
|
||||
},
|
||||
"remoteLabel": 0,
|
||||
}
|
||||
]
|
||||
}
|
||||
return topotest.json_cmp(output, expected)
|
||||
|
||||
test_func = functools.partial(_bgp_check_received_routes)
|
||||
test_func = functools.partial(_bgp_check_received_ipv4_routes)
|
||||
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
|
||||
assert result is None, "Failed to receive default route for labeled-unicast"
|
||||
assert result is None, "Failed to receive IPv4 default route for labeled-unicast"
|
||||
|
||||
def _bgp_check_received_ipv6_routes():
|
||||
output = json.loads(r2.vtysh_cmd("show bgp ipv6 labeled-unicast ::/0 json"))
|
||||
expected = {
|
||||
"paths": [
|
||||
{
|
||||
"valid": True,
|
||||
"metric": 666,
|
||||
"community": {
|
||||
"string": "65001:65001",
|
||||
},
|
||||
"remoteLabel": 2,
|
||||
}
|
||||
]
|
||||
}
|
||||
return topotest.json_cmp(output, expected)
|
||||
|
||||
test_func = functools.partial(_bgp_check_received_ipv6_routes)
|
||||
_, result = topotest.run_and_expect(test_func, None, count=60, wait=0.5)
|
||||
assert result is None, "Failed to receive IPv6 default route for labeled-unicast"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user