Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions tests/snmp/test_snmp_link_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def test_snmp_link_local_ip(duthosts,
nbrhosts, tbinfo, localhost, creds_all_duts):
"""
Test SNMP query to DUT over link local IP
- Send SNMP query over link local IP from one of the BGP Neighbors
- configure eth0's link local IP as snmpagentaddress
- Query over linklocal IP from within snmp docker
- Get SysDescr from snmpfacts
- compare result from snmp query over link local IP and snmpfacts
"""
Expand All @@ -44,13 +45,9 @@ def test_snmp_link_local_ip(duthosts,
link_local_ip = ip.split()[1]
break
# configure link local IP in config_db
duthost.shell(
'sonic-db-cli CONFIG_DB hset "MGMT_INTERFACE|eth0|{}" \
"gwaddr" "fe80::1"'
.format(link_local_ip))
# Restart snmp service to regenerate snmpd.conf with
# link local IP configured in MGMT_INTERFACE
duthost.shell("systemctl restart snmp")
duthost.shell("config snmpagentaddress add {}%eth0".format(link_local_ip))
stdout_lines = duthost.shell("docker exec snmp snmpget \
-v2c -c {} {}%eth0 {}"
.format(creds_all_duts[duthost.hostname]
Expand Down