Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/common/plugins/conditional_mark/tests_mark_conditions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 11 additions & 1 deletion tests/snmp/test_snmp_loopback.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
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'),
pytest.mark.device_type('vs')
]


@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
Expand All @@ -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'
Expand Down