Skip to content

Commit 2ba0f99

Browse files
[IPv6][SNMP]: Remove skip of IPv6 loopback testing (#8824) (#9972)
Cherry-pick with conflict resolution of #8824 What is the motivation for this PR? SNMP over Loopback ipv6 is currently being skipped. sonic-net/sonic-buildimage#15487 -fixes snmp over ipv6. After the above fix, SNMP over Loopback and management should work. How did you do it? Remove skip of ipv6. How did you verify/test it? Test on vs testbed with single-asic image with sonic-buildimage 15487 fix. Prerequisite PRs: sonic-net/sonic-buildimage#15688 sonic-net/sonic-buildimage#15487 (cherry picked from commit bcf44a1)
1 parent 4d929f8 commit 2ba0f99

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

tests/common/helpers/snmp_helpers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ def get_snmp_output(ip, duthost, nbr, creds_all_duts, oid='.1.3.6.1.2.1.1.1.0'):
6262
ipaddr = ipaddress.ip_address(ip)
6363
iptables_cmd = "iptables"
6464

65-
# TODO : Fix snmp query over loopback v6 and remove this check and add IPv6 ACL table/rule.
6665
if isinstance(ipaddr, ipaddress.IPv6Address):
6766
iptables_cmd = "ip6tables"
68-
return None
6967

7068
ip_tbl_rule_add = "sudo {} -I INPUT 1 -p udp --dport 161 -d {} -j ACCEPT".format(
7169
iptables_cmd, ip)

tests/snmp/test_snmp_loopback.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import pytest
2-
import ipaddress
32
from tests.common.helpers.snmp_helpers import get_snmp_facts, get_snmp_output
43
from tests.common.devices.eos import EosHost
54

@@ -23,14 +22,9 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname, nbrh
2322
# Get first neighbor VM information
2423
nbr = nbrhosts[list(nbrhosts.keys())[0]]
2524

26-
# TODO: Fix snmp query over Management IPv6 adderess and add SNMP test over management IPv6 address.
2725

2826
for ip in config_facts[u'LOOPBACK_INTERFACE'][u'Loopback0']:
2927
loip = ip.split('/')[0]
30-
loip = ipaddress.ip_address(loip)
31-
# TODO: Fix SNMP query over IPv6 and remove the below check.
32-
if not isinstance(loip, ipaddress.IPv4Address):
33-
continue
3428
result = get_snmp_output(loip, duthost, nbr, creds_all_duts)
3529
assert result is not None, 'No result from snmpget'
3630
assert len(result['stdout_lines']) > 0, 'No result from snmpget'

0 commit comments

Comments
 (0)