mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 13:37:17 +02:00
Merge ebbae8cb92
into 3dd4d417be
This commit is contained in:
commit
6497146fb0
|
@ -27,6 +27,7 @@ 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 time import sleep
|
||||
|
||||
pytestmark = [pytest.mark.staticd]
|
||||
|
||||
|
@ -319,6 +320,35 @@ def test_srv6_static_sids_sid_readd_all():
|
|||
check_srv6_static_sids(router, "expected_srv6_sids.json")
|
||||
|
||||
|
||||
def test_srv6_static_sids_sid_multiple_uN_behavior():
|
||||
"""
|
||||
Request for multiple uN with different locators
|
||||
"""
|
||||
tgen = get_topogen()
|
||||
if tgen.routers_have_failure():
|
||||
pytest.skip(tgen.errors)
|
||||
router = tgen.gears["r1"]
|
||||
|
||||
router.vtysh_cmd(
|
||||
"""
|
||||
configure terminal
|
||||
segment-routing
|
||||
srv6
|
||||
static-sids
|
||||
sid fcbb:cccc:1::/48 locator MAIN1 behavior uN
|
||||
srv6
|
||||
locators
|
||||
locator MAIN1
|
||||
prefix fcbb:cccc:1::/48 block-len 32 node-len 16 func-bits 16
|
||||
"""
|
||||
)
|
||||
|
||||
sleep(1)
|
||||
output = json.loads(router.vtysh_cmd("show ipv6 route static json"))
|
||||
if "fcbb:bbbb:1::/48" not in output or "fcbb:cccc:1::/48" not in output:
|
||||
assert False, "Failed. Expected entry for fcbb:cccc:1::/48 and fcbb:bbbb:1::/48"
|
||||
|
||||
|
||||
def test_srv6_static_sids_srv6_disable():
|
||||
"""
|
||||
Disable SRv6
|
||||
|
|
|
@ -1521,19 +1521,6 @@ static int get_srv6_sid_explicit(struct zebra_srv6_sid **sid,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* It is not allowed to allocate an explicit SID for a given context if the context
|
||||
* is already associated with an explicit SID
|
||||
*/
|
||||
if (s->sid->alloc_mode == SRV6_SID_ALLOC_MODE_EXPLICIT) {
|
||||
zlog_err("%s: cannot alloc SID %pI6 for ctx %s: ctx already associated with SID %pI6",
|
||||
__func__, sid_value,
|
||||
srv6_sid_ctx2str(buf, sizeof(buf),
|
||||
&s->ctx),
|
||||
&s->sid->value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
zctx = s;
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue