diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index c2cf4f3f8b8..f80d949ce49 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1042,15 +1042,11 @@ show_techsupport/test_techsupport.py::test_techsupport: ####################################### snmp/test_snmp_link_local.py: skip: - reason: "SNMP over IPv6 support not present in 202211 release." + reason: "SNMP over IPv6 support not present in release branches." conditions: - - "release in ['202211']" - -snmp/test_snmp_loopback.py: - skip: - reason: "SNMP over Loopback IPv6 support not present in 202211 release." - conditions: - - "release in ['202211']" + - https://github.com/sonic-net/sonic-buildimage/issues/6108 + - "is_multi_asic==False" + - "release in ['202205', '202211', '202305']" snmp/test_snmp_pfc_counters.py: skip: diff --git a/tests/snmp/test_snmp_loopback.py b/tests/snmp/test_snmp_loopback.py index a2ea073cee8..4a8feab2b59 100644 --- a/tests/snmp/test_snmp_loopback.py +++ b/tests/snmp/test_snmp_loopback.py @@ -1,6 +1,8 @@ import pytest +import ipaddress from tests.common.helpers.snmp_helpers import get_snmp_facts, get_snmp_output from tests.common.devices.eos import EosHost +from tests.common.utilities import skip_release pytestmark = [ pytest.mark.topology('t0', 't1', 't2', 'm0', 'mx'), @@ -8,8 +10,9 @@ ] +@pytest.mark.parametrize('ip_version', [ipaddress.IPv4Address, ipaddress.IPv6Address]) def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, - nbrhosts, tbinfo, localhost, creds_all_duts): + nbrhosts, tbinfo, localhost, creds_all_duts, ip_version): """ Test SNMP query to DUT over loopback IP - Send SNMP query over loopback IP from one of the BGP Neighbors @@ -29,6 +32,13 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, for ip in config_facts['LOOPBACK_INTERFACE']['Loopback0']: loip = ip.split('/')[0] + ipaddr = ipaddress.ip_address(loip) + if not isinstance(ipaddr, ip_version): + continue + if isinstance(ipaddr, ipaddress.IPv6Address): + # SNMP over IPv6 not supported in single-asic + if not duthost.is_multi_asic: + skip_release(duthost, ["202211", "202205", "202305"]) result = get_snmp_output(loip, duthost, nbr, creds_all_duts) assert result is not None, 'No result from snmpget' assert len(result['stdout_lines']) > 0, 'No result from snmpget'