From 56a38d04ee36851a7c7bf24cff570f1e7d75b875 Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Tue, 14 Jan 2025 06:06:37 +0000 Subject: [PATCH 1/7] add SRv6 control plane test case --- tests/srv6/test_srv6_static_config.py | 85 +++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 tests/srv6/test_srv6_static_config.py diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py new file mode 100644 index 00000000000..80bdfd59840 --- /dev/null +++ b/tests/srv6/test_srv6_static_config.py @@ -0,0 +1,85 @@ +import time +import logging +import pytest + +WAIT_TIME = 5 + +def test_uN_config(duthosts, rand_one_dut_hostname): + duthost = duthosts[rand_one_dut_hostname] + + # add a locator configuration entry + duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") + # add a uN sid configuration entry + duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1:: action uN") + time.sleep(WAIT_TIME) + + frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + + # verify that bgpcfgd generates FRR config correctly + assert "locator loc1" in frr_config + assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" in frr_config + + appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + + # verify that APPL_DB gets programmed by FRR correctly + assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" in appl_db_my_sids + + # delete the configurations + duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") + duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1::") + time.sleep(WAIT_TIME) + + frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + + # verify that bgpcfgd deletes relevant FRR config + assert "locator loc1" not in frr_config + assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" not in frr_config + + appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + + # verify that the APPL_DB entry gets cleaned correctly + assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" not in appl_db_my_sids + + +def test_uDT46_config(duthosts, rand_one_dut_hostname): + duthost = duthosts[rand_one_dut_hostname] + + # add Vrf1 config + duthost.command("config vrf add Vrf1") + duthost.command("sysctl -w net.vrf.strict_mode=1") + + # add a locator configuration entry + duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") + # add a uDT46 sid configuration entry + duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2:: action uDT46 decap_vrf Vrf1") + time.sleep(WAIT_TIME) + + frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + + # verify that bgpcfgd generates FRR config correctly + assert "locator loc1" in frr_config + assert "sid fcbb:bbbb:1:2::/64 locator loc1 behavior uDT46 vrf Vrf1" in frr_config + + appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + + # verify that APPL_DB gets programmed by FRR correctly + assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids + + # delete the configurations + duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") + duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::") + time.sleep(WAIT_TIME) + + frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + + # verify that bgpcfgd deletes relevant FRR config + assert "locator loc1" not in frr_config + assert "sid fcbb:bbbb:1:2::/64 locator loc1 behavior uDT46 vrf Vrf1" not in frr_config + + appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + + # verify that the APPL_DB entry gets cleaned correctly + assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" not in appl_db_my_sids + + # delete the Vrf config + duthost.command("config vrf del Vrf1") \ No newline at end of file From 2b021e28630e8831645e847fdcbb81f0d6309b8a Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Wed, 15 Jan 2025 00:56:02 +0000 Subject: [PATCH 2/7] add topo marker and make the test case compatible with multi-asic devices --- tests/srv6/test_srv6_static_config.py | 62 ++++++++++++++++++--------- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 80bdfd59840..26140cd2253 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -2,81 +2,103 @@ import logging import pytest +pytestmark = [ + pytest.mark.topology('t0') +] + WAIT_TIME = 5 -def test_uN_config(duthosts, rand_one_dut_hostname): - duthost = duthosts[rand_one_dut_hostname] +def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_index): + duthost = duthosts[enum_frontend_dut_hostname] + asic_index = enum_rand_one_asic_index + + if duthost.is_multi_asic: + cli_options = " -n " + duthost.get_namespace_from_asic_id(asic_index) + else: + cli_options = '' + + sonic_db_cli = "sonic-db-cli" + cli_options + vtysh_shell = "vtysh" + cli_options # add a locator configuration entry - duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uN sid configuration entry - duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1:: action uN") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1:: action uN") time.sleep(WAIT_TIME) - frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd generates FRR config correctly assert "locator loc1" in frr_config assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" in frr_config - appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" in appl_db_my_sids # delete the configurations - duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") - duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1::") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1::") time.sleep(WAIT_TIME) - frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd deletes relevant FRR config assert "locator loc1" not in frr_config assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" not in frr_config - appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that the APPL_DB entry gets cleaned correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" not in appl_db_my_sids -def test_uDT46_config(duthosts, rand_one_dut_hostname): - duthost = duthosts[rand_one_dut_hostname] +def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_index): + duthost = duthosts[enum_frontend_dut_hostname] + asic_index = enum_rand_one_asic_index + + if duthost.is_multi_asic: + cli_options = " -n " + duthost.get_namespace_from_asic_id(asic_index) + else: + cli_options = '' + + sonic_db_cli = "sonic-db-cli" + cli_options + vtysh_shell = "vtysh" + cli_options # add Vrf1 config duthost.command("config vrf add Vrf1") duthost.command("sysctl -w net.vrf.strict_mode=1") # add a locator configuration entry - duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uDT46 sid configuration entry - duthost.command("sonic-db-cli CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2:: action uDT46 decap_vrf Vrf1") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2:: action uDT46 decap_vrf Vrf1") time.sleep(WAIT_TIME) - frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd generates FRR config correctly assert "locator loc1" in frr_config assert "sid fcbb:bbbb:1:2::/64 locator loc1 behavior uDT46 vrf Vrf1" in frr_config - appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*".format(cli_options))["stdout"] # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids # delete the configurations - duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") - duthost.command("sonic-db-cli CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::") time.sleep(WAIT_TIME) - frr_config = duthost.command("vtysh -c \"show running-config\"")["stdout"] + frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd deletes relevant FRR config assert "locator loc1" not in frr_config assert "sid fcbb:bbbb:1:2::/64 locator loc1 behavior uDT46 vrf Vrf1" not in frr_config - appl_db_my_sids = duthost.command("sonic-db-cli APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] + appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that the APPL_DB entry gets cleaned correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" not in appl_db_my_sids From 0f9841bf0fd9254f6401a45707eb2aa315ba1b7a Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Fri, 17 Jan 2025 05:23:02 +0000 Subject: [PATCH 3/7] fix format errors --- tests/srv6/test_srv6_static_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 26140cd2253..42db30db0d3 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -1,5 +1,4 @@ import time -import logging import pytest pytestmark = [ @@ -8,6 +7,7 @@ WAIT_TIME = 5 + def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_index): duthost = duthosts[enum_frontend_dut_hostname] asic_index = enum_rand_one_asic_index @@ -82,7 +82,7 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i assert "locator loc1" in frr_config assert "sid fcbb:bbbb:1:2::/64 locator loc1 behavior uDT46 vrf Vrf1" in frr_config - appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*".format(cli_options))["stdout"] + appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids From 4f828be1c7276bb6b527aa176b716698692d9ad9 Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Fri, 17 Jan 2025 23:07:15 +0000 Subject: [PATCH 4/7] update the test case to adapt to the new CONFIG_DB schema and enhance the test case --- tests/srv6/test_srv6_static_config.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 42db30db0d3..6b06126471d 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -23,35 +23,36 @@ def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_inde # add a locator configuration entry duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uN sid configuration entry - duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1:: action uN") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1::/48 action uN decap_dscp_mode pipe") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd generates FRR config correctly assert "locator loc1" in frr_config - assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" in frr_config + assert "sid fcbb:bbbb:1::/48 locator loc1 behavior uN" in frr_config appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that APPL_DB gets programmed by FRR correctly - assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" in appl_db_my_sids + assert "SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1::" in appl_db_my_sids + assert "un" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1:: action")["stdout"] # delete the configurations duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") - duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:1::") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1::/48") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] # verify that bgpcfgd deletes relevant FRR config assert "locator loc1" not in frr_config - assert "sid fcbb:bbbb:1:1::/64 locator loc1 behavior uN" not in frr_config + assert "sid fcbb:bbbb:1::/48 locator loc1 behavior uN" not in frr_config appl_db_my_sids = duthost.command(sonic_db_cli + " APPL_DB keys SRV6_MY_SID_TABLE*")["stdout"] # verify that the APPL_DB entry gets cleaned correctly - assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:1::" not in appl_db_my_sids + assert "SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1::" not in appl_db_my_sids def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_index): @@ -73,7 +74,7 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i # add a locator configuration entry duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uDT46 sid configuration entry - duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2:: action uDT46 decap_vrf Vrf1") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::/64 action uDT46 decap_vrf Vrf1 decap_dscp_mode uniform") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] @@ -86,10 +87,12 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids + assert "udt46" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: action")["stdout"] + assert "Vrf1" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: vrf")["stdout"] # delete the configurations duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") - duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::") + duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::/64") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] @@ -104,4 +107,4 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" not in appl_db_my_sids # delete the Vrf config - duthost.command("config vrf del Vrf1") \ No newline at end of file + duthost.command("config vrf del Vrf1") From 23e6308d1e26494ad4b75640158e8c59ade18909 Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Sat, 18 Jan 2025 02:23:38 +0000 Subject: [PATCH 5/7] fix extra long lines --- tests/srv6/test_srv6_static_config.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 6b06126471d..1614da3bdca 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -23,7 +23,8 @@ def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_inde # add a locator configuration entry duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uN sid configuration entry - duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1::/48 action uN decap_dscp_mode pipe") + duthost.command(sonic_db_cli + + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1::/48 action uN decap_dscp_mode pipe") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] @@ -36,7 +37,8 @@ def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_inde # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1::" in appl_db_my_sids - assert "un" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1:: action")["stdout"] + assert "un" == duthost.command(sonic_db_cli + + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1:: action")["stdout"] # delete the configurations duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") @@ -74,7 +76,8 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i # add a locator configuration entry duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uDT46 sid configuration entry - duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::/64 action uDT46 decap_vrf Vrf1 decap_dscp_mode uniform") + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1:2::/64 \ + action uDT46 decap_vrf Vrf1 decap_dscp_mode uniform") time.sleep(WAIT_TIME) frr_config = duthost.command(vtysh_shell + " -c \"show running-config\"")["stdout"] @@ -87,8 +90,10 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids - assert "udt46" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: action")["stdout"] - assert "Vrf1" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: vrf")["stdout"] + assert "udt46" == duthost.command(sonic_db_cli + + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: action")["stdout"] + assert "Vrf1" == duthost.command(sonic_db_cli + + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: vrf")["stdout"] # delete the configurations duthost.command(sonic_db_cli + " CONFIG_DB DEL SRV6_MY_LOCATORS\\|loc1") From 3dc76a67315f31143ee5632d8ccfb66e58b9f43f Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Sat, 18 Jan 2025 02:29:00 +0000 Subject: [PATCH 6/7] remove trailing white spaces --- tests/srv6/test_srv6_static_config.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 1614da3bdca..5d17d6c1ef1 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -23,7 +23,7 @@ def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_inde # add a locator configuration entry duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_LOCATORS\\|loc1 prefix fcbb:bbbb:1::") # add a uN sid configuration entry - duthost.command(sonic_db_cli + + duthost.command(sonic_db_cli + " CONFIG_DB HSET SRV6_MY_SIDS\\|loc1\\|fcbb:bbbb:1::/48 action uN decap_dscp_mode pipe") time.sleep(WAIT_TIME) @@ -37,7 +37,7 @@ def test_uN_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_inde # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1::" in appl_db_my_sids - assert "un" == duthost.command(sonic_db_cli + + assert "un" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:0:0:fcbb:bbbb:1:: action")["stdout"] # delete the configurations @@ -90,9 +90,9 @@ def test_uDT46_config(duthosts, enum_frontend_dut_hostname, enum_rand_one_asic_i # verify that APPL_DB gets programmed by FRR correctly assert "SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2::" in appl_db_my_sids - assert "udt46" == duthost.command(sonic_db_cli + + assert "udt46" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: action")["stdout"] - assert "Vrf1" == duthost.command(sonic_db_cli + + assert "Vrf1" == duthost.command(sonic_db_cli + " APPL_DB hget SRV6_MY_SID_TABLE:32:16:16:0:fcbb:bbbb:1:2:: vrf")["stdout"] # delete the configurations From ac589145cbf45e204c34f3b43912475269c5e7b1 Mon Sep 17 00:00:00 2001 From: BYGX-wcr Date: Tue, 21 Jan 2025 18:40:28 +0000 Subject: [PATCH 7/7] add t1 in topo marker as well --- tests/srv6/test_srv6_static_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/srv6/test_srv6_static_config.py b/tests/srv6/test_srv6_static_config.py index 5d17d6c1ef1..5a87c3fdb3b 100644 --- a/tests/srv6/test_srv6_static_config.py +++ b/tests/srv6/test_srv6_static_config.py @@ -2,7 +2,7 @@ import pytest pytestmark = [ - pytest.mark.topology('t0') + pytest.mark.topology('t0', 't1') ] WAIT_TIME = 5