From 32305b2521b9fedaf2965894ed3b373ae94b9f48 Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Thu, 21 Sep 2023 21:49:58 +0000 Subject: [PATCH 1/3] Skip SNMP IPv6 testcases in 2022xx 2023xx branches Signed-off-by: Suvarna Meenakshi --- .../conditional_mark/tests_mark_conditions.yaml | 8 +------- tests/snmp/test_snmp_loopback.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index c2cf4f3f8b8..54d618425d9 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1044,13 +1044,7 @@ snmp/test_snmp_link_local.py: skip: reason: "SNMP over IPv6 support not present in 202211 release." 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']" + - "(is_multi_asic==False) and (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' From 3cc20de4de420f383d4e912ec82cbb20f973baf6 Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Tue, 26 Sep 2023 22:03:23 +0000 Subject: [PATCH 2/3] Add github issue in condition Signed-off-by: Suvarna Meenakshi --- .../plugins/conditional_mark/tests_mark_conditions.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 54d618425d9..49cde66656b 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1042,9 +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: - - "(is_multi_asic==False) and (release in ['202205', '202211', '202305'])" + - 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: From abfba22361924b9323033fffc83c964cc477f797 Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Thu, 28 Sep 2023 19:38:29 +0000 Subject: [PATCH 3/3] Fix typo in condition Signed-off-by: Suvarna Meenakshi --- .../common/plugins/conditional_mark/tests_mark_conditions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index 49cde66656b..f80d949ce49 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -1046,7 +1046,7 @@ snmp/test_snmp_link_local.py: conditions: - https://github.com/sonic-net/sonic-buildimage/issues/6108 - "is_multi_asic==False" - - "release in ['202205', '202211', '202305'])" + - "release in ['202205', '202211', '202305']" snmp/test_snmp_pfc_counters.py: skip: