sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
194 stars 712 forks source link

[Bug]: test_algorithm_config run into failure with non nVidia platform #14109

Open StormLiangMS opened 1 month ago

StormLiangMS commented 1 month ago

Issue Description

test_algorithm_config run into failure with non nVidia platform

Results you see

=================================== FAILURES =================================== _ test_hashcapability

duthost = global_hash_capabilities = {'ecmp': 'not supported', 'ecmp_algo': 'N/A', 'lag': 'not supported', 'lag_algo': 'N/A'}

def test_hash_capability(duthost, global_hash_capabilities):  # noqa:F811
    """
    Test case to verify the 'show switch-hash capabilities' command.
    Args:
        duthost (AnsibleHost): Device Under Test (DUT)
        global_hash_capabilities: module level fixture to get the dut hash capabilities
    """
    with allure.step('Check the dut hash capabilities are as expected'):
        ecmp_hash_capability, lag_hash_capability = global_hash_capabilities['ecmp'], global_hash_capabilities['lag']
        asic_type = duthost.facts["asic_type"]
        expected_hash_capabilities = HASH_CAPABILITIES.get(asic_type, HASH_CAPABILITIES['default'])
        expected_ecmp_hash_capability = expected_hash_capabilities['ecmp']
        expected_lag_hash_capability = expected_hash_capabilities['lag']
      pytest_assert(sorted(ecmp_hash_capability) == sorted(expected_ecmp_hash_capability),

'The ecmp hash capability is not as expected.') E Failed: The ecmp hash capability is not as expected.

asic_type = 'broadcom' duthost = ecmp_hash_capability = 'not supported' expected_ecmp_hash_capability = ['IN_PORT', 'SRC_MAC', 'DST_MAC', 'ETHERTYPE', 'VLAN_ID', 'IP_PROTOCOL', ...] expected_hash_capabilities = {'ecmp': ['IN_PORT', 'SRC_MAC', 'DST_MAC', 'ETHERTYPE', 'VLAN_ID', 'IP_PROTOCOL', ...], 'lag': ['IN_PORT', 'SRC_MAC', 'DST_MAC', 'ETHERTYPE', 'VLAN_ID', 'IP_PROTOCOL', ...]} expected_lag_hash_capability = ['IN_PORT', 'SRC_MAC', 'DST_MAC', 'ETHERTYPE', 'VLAN_ID', 'IP_PROTOCOL', ...] global_hash_capabilities = {'ecmp': 'not supported', 'ecmp_algo': 'N/A', 'lag': 'not supported', 'lag_algo': 'N/A'} lag_hash_capability = 'not supported'

Results you expected to see

the test can pass

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

StormLiangMS commented 1 month ago

Hi @prsunny this test failed with new change of Enhance generic hash test cases by echuawu · Pull Request #12564 · sonic-net/sonic-mgmt (github.com)? which is done by nVidia team, but doesn't pass on Arista platform, could you suggest if we should enable the test case on platform other than nVidia?

I will put related failure cases into xfail for now.