From 384205c436ce0cbbd06fc2f90b6d9461e79b116c Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Wed, 5 Jul 2023 21:51:39 +0000 Subject: [PATCH 1/3] [IPv6][SNMP]: Remove skip of IPv6 loopback testing Signed-off-by: Suvarna Meenakshi --- tests/snmp/test_snmp_loopback.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/snmp/test_snmp_loopback.py b/tests/snmp/test_snmp_loopback.py index 5ae1d0e12a7..fe0b88acb3a 100644 --- a/tests/snmp/test_snmp_loopback.py +++ b/tests/snmp/test_snmp_loopback.py @@ -16,11 +16,8 @@ def get_snmp_output(ip, duthost, nbr, creds_all_duts): ipaddr = ipaddress.ip_address(ip) iptables_cmd = "iptables" - # TODO : Fix snmp query over loopback v6 and remove this check and add IPv6 ACL table/rule. if isinstance(ipaddr, ipaddress.IPv6Address): iptables_cmd = "ip6tables" - return None - ip_tbl_rule_add = "sudo {} -I INPUT 1 -p udp --dport 161 -d {} -j ACCEPT".format( iptables_cmd, ip) duthost.shell(ip_tbl_rule_add) @@ -60,10 +57,6 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, for ip in config_facts['LOOPBACK_INTERFACE']['Loopback0']: loip = ip.split('/')[0] - loip = ipaddress.ip_address(loip) - # TODO: Fix SNMP query over IPv6 and remove the below check. - if not isinstance(loip, ipaddress.IPv4Address): - continue 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 0f1093781e85ff131ebab81fa1660d13235d6a9f Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Wed, 5 Jul 2023 22:37:14 +0000 Subject: [PATCH 2/3] Remove comment Signed-off-by: Suvarna Meenakshi --- tests/snmp/test_snmp_loopback.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/snmp/test_snmp_loopback.py b/tests/snmp/test_snmp_loopback.py index fe0b88acb3a..e37bd9ea704 100644 --- a/tests/snmp/test_snmp_loopback.py +++ b/tests/snmp/test_snmp_loopback.py @@ -53,8 +53,6 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, # Get first neighbor VM information nbr = nbrhosts[list(nbrhosts.keys())[0]] - # TODO: Fix snmp query over Management IPv6 adderess and add SNMP test over management IPv6 address. - for ip in config_facts['LOOPBACK_INTERFACE']['Loopback0']: loip = ip.split('/')[0] result = get_snmp_output(loip, duthost, nbr, creds_all_duts) From 610002b0fc984bddc9e3d2d71f34bd9f075e0cbe Mon Sep 17 00:00:00 2001 From: Suvarna Meenakshi Date: Fri, 14 Jul 2023 18:29:38 +0000 Subject: [PATCH 3/3] Remove skip from helper function Signed-off-by: Suvarna Meenakshi --- tests/common/helpers/snmp_helpers.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/common/helpers/snmp_helpers.py b/tests/common/helpers/snmp_helpers.py index 907cec06d96..f89b7b7ab49 100644 --- a/tests/common/helpers/snmp_helpers.py +++ b/tests/common/helpers/snmp_helpers.py @@ -64,10 +64,8 @@ def get_snmp_output(ip, duthost, nbr, creds_all_duts, oid='.1.3.6.1.2.1.1.1.0'): ipaddr = ipaddress.ip_address(ip) iptables_cmd = "iptables" - # TODO : Fix snmp query over loopback v6 and remove this check and add IPv6 ACL table/rule. if isinstance(ipaddr, ipaddress.IPv6Address): iptables_cmd = "ip6tables" - return None ip_tbl_rule_add = "sudo {} -I INPUT 1 -p udp --dport 161 -d {} -j ACCEPT".format( iptables_cmd, ip)