Skip to content

Commit

Permalink
Skip SNMP IPv6 testcases in 2022xx 2023xx branches (sonic-net#10097)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
Skip SNMP IPv6 related test cases in 202211,202205 and 202305 branches until the approach to fix IPv6 issue is fixed.
PR contains details of the issue and approach sonic-net/SONiC#1457

How did you do it?
Skip single asic IPv6 SNMP loopback test case and link local test case in branches with the testcase added.

How did you verify/test it?
Tested on 202205 single asic VS image
  • Loading branch information
SuvarnaMeenakshi authored Sep 28, 2023
1 parent 14afe5a commit a72a4db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
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 @@ -1050,15 +1050,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

0 comments on commit a72a4db

Please sign in to comment.