tests: Correct srv6 locator testcases

Previous commit changes the order of srv6 locator parameters. So, this
PR reflect the previous changes.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
This commit is contained in:
Ryoga Saito 2022-11-23 13:57:02 +09:00
parent 3afb06d324
commit 4d0ee77eaf
3 changed files with 8 additions and 16 deletions

View File

@ -124,7 +124,7 @@ def test_srv6():
srv6 srv6
locators locators
locator loc3 locator loc3
prefix 2001:db8:3::/48 func-bits 16 block-len 32 node-len 16 prefix 2001:db8:3::/48 block-len 32 node-len 16 func-bits 16
""" """
) )
check_srv6_locator(router, "expected_locators4.json") check_srv6_locator(router, "expected_locators4.json")

View File

@ -12,7 +12,7 @@ segment-routing
srv6 srv6
locators locators
locator loc1 locator loc1
prefix fc00:0:1::/48 func-bits 16 block-len 32 node-len 16 prefix fc00:0:1::/48 block-len 32 node-len 16 func-bits 16
behavior usid behavior usid
! !
! !

View File

@ -54,12 +54,10 @@ def setup_module(mod):
for rname, router in tgen.routers().items(): for rname, router in tgen.routers().items():
router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname)) router.run("/bin/bash {}/{}/setup.sh".format(CWD, rname))
router.load_config( router.load_config(
TopoRouter.RD_ZEBRA, os.path.join( TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
CWD, "{}/zebra.conf".format(rname))
) )
router.load_config( router.load_config(
TopoRouter.RD_SHARP, os.path.join( TopoRouter.RD_SHARP, os.path.join(CWD, "{}/sharpd.conf".format(rname))
CWD, "{}/sharpd.conf".format(rname))
) )
tgen.start_router() tgen.start_router()
@ -71,18 +69,14 @@ def teardown_module(mod):
def _check_srv6_locator(router, expected_locator_file): def _check_srv6_locator(router, expected_locator_file):
logger.info("checking zebra locator status") logger.info("checking zebra locator status")
output = json.loads( output = json.loads(router.vtysh_cmd("show segment-routing srv6 locator json"))
router.vtysh_cmd("show segment-routing srv6 locator json")
)
expected = open_json_file("{}/{}".format(CWD, expected_locator_file)) expected = open_json_file("{}/{}".format(CWD, expected_locator_file))
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
def _check_sharpd_chunk(router, expected_chunk_file): def _check_sharpd_chunk(router, expected_chunk_file):
logger.info("checking sharpd locator chunk status") logger.info("checking sharpd locator chunk status")
output = json.loads( output = json.loads(router.vtysh_cmd("show sharp segment-routing srv6 json"))
router.vtysh_cmd("show sharp segment-routing srv6 json")
)
expected = open_json_file("{}/{}".format(CWD, expected_chunk_file)) expected = open_json_file("{}/{}".format(CWD, expected_chunk_file))
return topotest.json_cmp(output, expected) return topotest.json_cmp(output, expected)
@ -164,7 +158,7 @@ def test_srv6_usid_locator_create_locator():
srv6 srv6
locators locators
locator loc2 locator loc2
prefix fc00:0:2::/48 func-bits 16 block-len 32 node-len 16 prefix fc00:0:2::/48 block-len 32 node-len 16 func-bits 16
""" """
) )
check_srv6_locator(router, "expected_locators_4.json") check_srv6_locator(router, "expected_locators_4.json")
@ -181,9 +175,7 @@ def test_srv6_usid_locator_set_behavior_usid():
# If you want to stop some specific line and start interactive shell, # If you want to stop some specific line and start interactive shell,
# please use tgen.mininet_cli() to start it. # please use tgen.mininet_cli() to start it.
logger.info( logger.info("Specify the SRv6 Locator loc2 as a Micro-segment (uSID) Locator")
"Specify the SRv6 Locator loc2 as a Micro-segment (uSID) Locator"
)
router.vtysh_cmd( router.vtysh_cmd(
""" """
configure terminal configure terminal