Skip to content

Commit a72a4db

Browse files
Skip SNMP IPv6 testcases in 2022xx 2023xx branches (sonic-net#10097)
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
1 parent 14afe5a commit a72a4db

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,15 +1050,11 @@ show_techsupport/test_techsupport.py::test_techsupport:
10501050
#######################################
10511051
snmp/test_snmp_link_local.py:
10521052
skip:
1053-
reason: "SNMP over IPv6 support not present in 202211 release."
1053+
reason: "SNMP over IPv6 support not present in release branches."
10541054
conditions:
1055-
- "release in ['202211']"
1056-
1057-
snmp/test_snmp_loopback.py:
1058-
skip:
1059-
reason: "SNMP over Loopback IPv6 support not present in 202211 release."
1060-
conditions:
1061-
- "release in ['202211']"
1055+
- https://github.com/sonic-net/sonic-buildimage/issues/6108
1056+
- "is_multi_asic==False"
1057+
- "release in ['202205', '202211', '202305']"
10621058

10631059
snmp/test_snmp_pfc_counters.py:
10641060
skip:

tests/snmp/test_snmp_loopback.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import pytest
2+
import ipaddress
23
from tests.common.helpers.snmp_helpers import get_snmp_facts, get_snmp_output
34
from tests.common.devices.eos import EosHost
5+
from tests.common.utilities import skip_release
46

57
pytestmark = [
68
pytest.mark.topology('t0', 't1', 't2', 'm0', 'mx'),
79
pytest.mark.device_type('vs')
810
]
911

1012

13+
@pytest.mark.parametrize('ip_version', [ipaddress.IPv4Address, ipaddress.IPv6Address])
1114
def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
12-
nbrhosts, tbinfo, localhost, creds_all_duts):
15+
nbrhosts, tbinfo, localhost, creds_all_duts, ip_version):
1316
"""
1417
Test SNMP query to DUT over loopback IP
1518
- 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,
2932

3033
for ip in config_facts['LOOPBACK_INTERFACE']['Loopback0']:
3134
loip = ip.split('/')[0]
35+
ipaddr = ipaddress.ip_address(loip)
36+
if not isinstance(ipaddr, ip_version):
37+
continue
38+
if isinstance(ipaddr, ipaddress.IPv6Address):
39+
# SNMP over IPv6 not supported in single-asic
40+
if not duthost.is_multi_asic:
41+
skip_release(duthost, ["202211", "202205", "202305"])
3242
result = get_snmp_output(loip, duthost, nbr, creds_all_duts)
3343
assert result is not None, 'No result from snmpget'
3444
assert len(result['stdout_lines']) > 0, 'No result from snmpget'

0 commit comments

Comments
 (0)