Skip to content

Enable secondary subnet for topo_t0-118 and fix the issue of applying secondary subnet config#16864

Merged
StormLiangMS merged 6 commits intosonic-net:masterfrom
ZhaohuiS:ZhaohuiS/secondary_subnet
Feb 24, 2025
Merged

Enable secondary subnet for topo_t0-118 and fix the issue of applying secondary subnet config#16864
StormLiangMS merged 6 commits intosonic-net:masterfrom
ZhaohuiS:ZhaohuiS/secondary_subnet

Conversation

@ZhaohuiS
Copy link
Copy Markdown
Contributor

@ZhaohuiS ZhaohuiS commented Feb 8, 2025

Description of PR

Summary:
Fixes # (issue)
#10828 enabled secondary subnet for two vlan scenarios.
But it has some issues, even add secondary_subnet: 192.169.0.1/22, there is no secondary subnet in config_db.json found.
Also fix the failures of tests/generic_config_updater/test_dynamic_acl.py and tests/acl/null_route/test_null_route_helper.py

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

  1. Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
  2. Fix the issue of applying secondary subnet configuration.
  • vlan_config doesn't have secondary_subnet
  • ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"

How did you do it?

How did you verify/test it?

After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A

Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs

Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS
Copy link
Copy Markdown
Contributor Author

@prsunny @StormLiangMS could you please help reivew?

@ZhaohuiS ZhaohuiS force-pushed the ZhaohuiS/secondary_subnet branch from eadadf4 to a0c8bf5 Compare February 17, 2025 13:39
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

prsunny
prsunny previously approved these changes Feb 19, 2025
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS ZhaohuiS force-pushed the ZhaohuiS/secondary_subnet branch from f62dea4 to a0e3c36 Compare February 20, 2025 00:37
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Zhaohui Sun <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@ZhaohuiS
Copy link
Copy Markdown
Contributor Author

@StormLiangMS Prince Sunny's approval is stale, could you please help approve?
I also test it on 202405 and 202411

@ZhaohuiS
Copy link
Copy Markdown
Contributor Author

close and reopen to trigger PR test.

@ZhaohuiS ZhaohuiS closed this Feb 21, 2025
@ZhaohuiS ZhaohuiS reopened this Feb 21, 2025
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@StormLiangMS
Copy link
Copy Markdown
Collaborator

Hi @ZhaohuiS could you run test with 202405/202411 branch before cherrypick?

@StormLiangMS StormLiangMS merged commit 183d0f5 into sonic-net:master Feb 24, 2025
20 checks passed
@mssonicbld
Copy link
Copy Markdown
Collaborator

@ZhaohuiS PR conflicts with 202405 branch

@mssonicbld
Copy link
Copy Markdown
Collaborator

@ZhaohuiS PR conflicts with 202411 branch

@ZhaohuiS
Copy link
Copy Markdown
Contributor Author

Yes, already tested it. The test evidences are in the description.

ZhaohuiS added a commit to ZhaohuiS/sonic-mgmt that referenced this pull request Feb 24, 2025
… secondary subnet config (sonic-net#16864)

What is the motivation for this PR?
Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
Fix the issue of applying secondary subnet configuration.
vlan_config doesn't have secondary_subnet
ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"
How did you do it?
How did you verify/test it?
After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A
Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs
Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs
ZhaohuiS added a commit to ZhaohuiS/sonic-mgmt that referenced this pull request Feb 24, 2025
… secondary subnet config (sonic-net#16864)

What is the motivation for this PR?
Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
Fix the issue of applying secondary subnet configuration.
vlan_config doesn't have secondary_subnet
ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"
How did you do it?
How did you verify/test it?
After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A
Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs
Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs
StormLiangMS pushed a commit that referenced this pull request Feb 25, 2025
… secondary subnet config (#16864) (#17118)

What is the motivation for this PR?
Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
Fix the issue of applying secondary subnet configuration.
vlan_config doesn't have secondary_subnet
ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"
How did you do it?
How did you verify/test it?
After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A
Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs
Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs
StormLiangMS pushed a commit that referenced this pull request Feb 25, 2025
… secondary subnet config (#16864) (#17119)

What is the motivation for this PR?
Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
Fix the issue of applying secondary subnet configuration.
vlan_config doesn't have secondary_subnet
ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"
How did you do it?
How did you verify/test it?
After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A
Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs
Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs
@vivekverma-arista
Copy link
Copy Markdown
Contributor

This breaks topologies with single VLAN subnet

28/02/2025 16:40:42 __init__._fixture_func_decorator         L0073 ERROR  |               
AttributeError("'AnsibleUnsafeText' object has no attribute 'get'")
Traceback (most recent call last):
  File "/data/tests/common/plugins/log_section_start/__init__.py", line 71, in _fixture_func_decorator
    return fixture_func(*args, **kargs)
  File "/data/tests/generic_config_updater/test_dynamic_acl.py", line 227, in setup  
    if config_facts['VLAN_INTERFACE'][vlan_name][vlan_ip_address].get("secondary"):
AttributeError: 'AnsibleUnsafeText' object has no attribute 'get'

nnelluri-cisco pushed a commit to nnelluri-cisco/sonic-mgmt that referenced this pull request Mar 15, 2025
… secondary subnet config (sonic-net#16864)

What is the motivation for this PR?
Enable secondary subnet in topo_t0-118 to cover secondary subnet testing
Fix the issue of applying secondary subnet configuration.
vlan_config doesn't have secondary_subnet
ipaddr('secondary_subnet') throw error: "AnsibleFilterError: ipaddr: unknown filter type: secondary_subnet"
How did you do it?
How did you verify/test it?
After deploy-mg, secondary subnet was configured into config_db.json successfully.

admin@bjw-can-7260-11:/etc/sonic$ sudo redis-cli -n 4 keys "VLAN_INTERFACE*"
1) "VLAN_INTERFACE|Vlan1000"
2) "VLAN_INTERFACE|Vlan2000|192.168.0.129/25"
3) "VLAN_INTERFACE|Vlan1000|192.168.0.1/25"
4) "VLAN_INTERFACE|Vlan1000|192.169.0.1/22"
5) "VLAN_INTERFACE|Vlan1000|fc02:1000::1/64"
6) "VLAN_INTERFACE|Vlan2000|fc02:1000:0:1::1/64"
7) "VLAN_INTERFACE|Vlan2000"
admin@bjw-can-7260-11:/etc/sonic$ sudo zgrep "192.169" *
config_db.json:        "Vlan1000|192.169.0.1/22": {
minigraph.xml:          <SecondarySubnets>192.169.0.0/22</SecondarySubnets>
minigraph.xml:          <Prefix>192.169.0.1/22</Prefix>
admin@bjw-can-7260-11:/etc/sonic$ sudo vim minigraph.xml
admin@bjw-can-7260-11:/etc/sonic$ show ip interface
Interface       Master    IPv4 address/mask    Admin/Oper    BGP Neighbor    Neighbor IP
--------------  --------  -------------------  ------------  --------------  -------------
Loopback0                 10.1.0.32/32         up/up         N/A             N/A
PortChannel101            10.0.0.32/31         up/up         ARISTA01T1      10.0.0.33
PortChannel102            10.0.0.34/31         up/up         ARISTA02T1      10.0.0.35
PortChannel103            10.0.0.36/31         up/up         ARISTA03T1      10.0.0.37
PortChannel104            10.0.0.38/31         up/up         ARISTA04T1      10.0.0.39
Vlan1000                  192.168.0.1/25       up/up         N/A             N/A
                          192.169.0.1/22                     N/A             N/A
Vlan2000                  192.168.0.129/25     up/up         N/A             N/A
docker0                   240.127.1.1/24       up/down       N/A             N/A
eth0                      10.150.22.157/23     up/up         N/A             N/A
lo                        127.0.0.1/16         up/up         N/A             N/A
Test evidence of test_null_route_helper for 202405 with single vlan:

------------------------------------------------------------------------------------------------------------------- live log sessionfinish --------------------------------------------------------------------------------------------------------------------
08:42:15 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================= 1 passed, 57 warnings in 201.96s (0:03:21) ==========================================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_null_route_helper>
INFO:root:Can not get Allure report URL. Please check logs
Test evidence of test_dynamic_acl for 202411 on dualtor:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------
11:56:28 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
======================================================================================= 12 passed, 123 warnings in 2943.09s (0:49:03) =======================================================================================
DEBUG:tests.conftest:[log_custom_msg] item: <Function test_gcu_acl_nonexistent_table_removal[default-Vlan1000]>
INFO:root:Can not get Allure report URL. Please check logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants