Skip to content

Commit 35e4e07

Browse files
SuvarnaMeenakshiarista-hpandya
authored andcommitted
Modify snmp link local test to use config cli (sonic-net#13070)
Modify snmp_link_local_test to test after configuring link local snmp agent address using config snmpagentaddress cli. Pre requisite: sonic-net/sonic-utilities#3215 Signed-off-by: Suvarna Meenakshi <[email protected]>
1 parent e114285 commit 35e4e07

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/snmp/test_snmp_link_local.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ def test_snmp_link_local_ip(duthosts,
2222
nbrhosts, tbinfo, localhost, creds_all_duts):
2323
"""
2424
Test SNMP query to DUT over link local IP
25-
- Send SNMP query over link local IP from one of the BGP Neighbors
25+
- configure eth0's link local IP as snmpagentaddress
26+
- Query over linklocal IP from within snmp docker
2627
- Get SysDescr from snmpfacts
2728
- compare result from snmp query over link local IP and snmpfacts
2829
"""
@@ -44,13 +45,9 @@ def test_snmp_link_local_ip(duthosts,
4445
link_local_ip = ip.split()[1]
4546
break
4647
# configure link local IP in config_db
47-
duthost.shell(
48-
'sonic-db-cli CONFIG_DB hset "MGMT_INTERFACE|eth0|{}" \
49-
"gwaddr" "fe80::1"'
50-
.format(link_local_ip))
5148
# Restart snmp service to regenerate snmpd.conf with
5249
# link local IP configured in MGMT_INTERFACE
53-
duthost.shell("systemctl restart snmp")
50+
duthost.shell("config snmpagentaddress add {}%eth0".format(link_local_ip))
5451
stdout_lines = duthost.shell("docker exec snmp snmpget \
5552
-v2c -c {} {}%eth0 {}"
5653
.format(creds_all_duts[duthost.hostname]

0 commit comments

Comments
 (0)