Skip to content

Fix failures of test_dynamic_acl on dualtor#17055

Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom
ZhaohuiS:ZhaohuiS/gcu_acl_dualtor
Feb 21, 2025
Merged

Fix failures of test_dynamic_acl on dualtor#17055
StormLiangMS merged 1 commit intosonic-net:masterfrom
ZhaohuiS:ZhaohuiS/gcu_acl_dualtor

Conversation

@ZhaohuiS
Copy link
Copy Markdown
Contributor

@ZhaohuiS ZhaohuiS commented Feb 20, 2025

Description of PR

Summary:
Fixes # (issue)
GCU test_dynamic_acl failed on dualtor after #16637

generic_config_updater/test_dynamic_acl.py::test_gcu_acl_arp_rule_creation[IPV4-str2-7050cx3-acs-06-None-default-Vlan1000] 
-------------------------------- live log setup --------------------------------
12:25:59 __init__._fixture_func_decorator         L0073 ERROR  | 
AddrFormatError("failed to detect a valid IP address from 'grat_arp'")
Traceback (most recent call last):
  File "/var/src/sonic-mgmt_vms24-dual-t0-7050-1_646f1405735219c3e54440f4/tests/common/plugins/log_section_start/__init__.py", line 71, in _fixture_func_decorator
    return fixture_func(*args, **kargs)
  File "/var/src/sonic-mgmt_vms24-dual-t0-7050-1_646f1405735219c3e54440f4/tests/generic_config_updater/test_dynamic_acl.py", line 223, in setup
    if netaddr.IPAddress(str(ip_address)).version == 6:
  File "/usr/local/lib/python3.8/dist-packages/netaddr/ip/__init__.py", line 341, in __init__
    raise AddrFormatError('failed to detect a valid IP ' 'address from %r' % addr)
netaddr.core.AddrFormatError: failed to detect a valid IP address from 'grat_arp'

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?

For dualtor, the content of config_facts['VLAN_INTERFACE'] is like:
grat_arp is not ip address, need to catch the exception and continue to loop the next one until to get ip address

 "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },

How did you do it?

Add try catch to avoid such kind of exception.

How did you verify/test it?

Run test_dynamic_acl on dualtor
Test evidence 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).

Copy link
Copy Markdown
Collaborator

@lolyu lolyu left a comment

Choose a reason for hiding this comment

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

LGTM

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 StormLiangMS merged commit ec7f646 into sonic-net:master Feb 21, 2025
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Feb 21, 2025
What is the motivation for this PR?
For dualtor, the content of config_facts['VLAN_INTERFACE'] is like:
grat_arp is not ip address, need to catch the exception and continue to loop the next one until to get ip address

 "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },
How did you do it?
Add try catch to avoid such kind of exception.

How did you verify/test it?
Run test_dynamic_acl on dualtor
Test evidence 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
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202405: #17081

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Feb 21, 2025
What is the motivation for this PR?
For dualtor, the content of config_facts['VLAN_INTERFACE'] is like:
grat_arp is not ip address, need to catch the exception and continue to loop the next one until to get ip address

 "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },
How did you do it?
Add try catch to avoid such kind of exception.

How did you verify/test it?
Run test_dynamic_acl on dualtor
Test evidence 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
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202411: #17082

mssonicbld pushed a commit that referenced this pull request Feb 21, 2025
What is the motivation for this PR?
For dualtor, the content of config_facts['VLAN_INTERFACE'] is like:
grat_arp is not ip address, need to catch the exception and continue to loop the next one until to get ip address

 "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },
How did you do it?
Add try catch to avoid such kind of exception.

How did you verify/test it?
Run test_dynamic_acl on dualtor
Test evidence 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
kperumalbfn pushed a commit that referenced this pull request Feb 21, 2025
Fix failures of test_dynamic_acl on dualtor
nnelluri-cisco pushed a commit to nnelluri-cisco/sonic-mgmt that referenced this pull request Mar 15, 2025
What is the motivation for this PR?
For dualtor, the content of config_facts['VLAN_INTERFACE'] is like:
grat_arp is not ip address, need to catch the exception and continue to loop the next one until to get ip address

 "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },
How did you do it?
Add try catch to avoid such kind of exception.

How did you verify/test it?
Run test_dynamic_acl on dualtor
Test evidence 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
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
### Why I did it

Fix flakiness of eventd UT - run sub after capture service starts

##### Work item tracking
- Microsoft ADO **(number only)**:25650744

#### How I did it

Run sub socket after capture socket is initialized

#### How to verify it

Pipeline
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.

4 participants