diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 36c183a3c1..a4edfa5a6a 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -993,6 +993,14 @@ show_techsupport/test_techsupport.py::test_techsupport: ####################################### ##### snmp ##### ####################################### +snmp/test_snmp_link_local.py: + skip: + reason: "SNMP over IPv6 support not present in release branches." + conditions: + - 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: reason: "M0/MX topo does not support test_snmp_pfc_counters" diff --git a/tests/snmp/test_snmp_loopback.py b/tests/snmp/test_snmp_loopback.py index 825d064e4b..a4ed8baaf3 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('any'), @@ -8,7 +10,9 @@ ] -def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, nbrhosts, tbinfo, localhost, creds_all_duts): +@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, ip_version): """ Test SNMP query to DUT over loopback IP - Send SNMP query over loopback IP from one of the BGP Neighbors @@ -25,6 +29,13 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, nbrh for ip in config_facts[u'LOOPBACK_INTERFACE'][u'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'