Skip to content

Commit bcf44a1

Browse files
[IPv6][SNMP]: Remove skip of IPv6 loopback testing (#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
1 parent 25251f1 commit bcf44a1

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

tests/common/helpers/snmp_helpers.py

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

67-
# TODO : Fix snmp query over loopback v6 and remove this check and add IPv6 ACL table/rule.
6867
if isinstance(ipaddr, ipaddress.IPv6Address):
6968
iptables_cmd = "ip6tables"
70-
return None
7169

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

tests/snmp/test_snmp_loopback.py

Lines changed: 0 additions & 7 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

@@ -29,14 +28,8 @@ def test_snmp_loopback(duthosts, enum_rand_one_per_hwsku_frontend_hostname,
2928
# Get first neighbor VM information
3029
nbr = nbrhosts[list(nbrhosts.keys())[0]]
3130

32-
# TODO: Fix snmp query over Management IPv6 adderess and add SNMP test over management IPv6 address.
33-
3431
for ip in config_facts['LOOPBACK_INTERFACE']['Loopback0']:
3532
loip = ip.split('/')[0]
36-
loip = ipaddress.ip_address(loip)
37-
# TODO: Fix SNMP query over IPv6 and remove the below check.
38-
if not isinstance(loip, ipaddress.IPv4Address):
39-
continue
4033
result = get_snmp_output(loip, duthost, nbr, creds_all_duts)
4134
assert result is not None, 'No result from snmpget'
4235
assert len(result['stdout_lines']) > 0, 'No result from snmpget'

0 commit comments

Comments
 (0)