Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:13070] Modify snmp link local test to use config cli #14406

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

How did you do it?

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

How did you verify/test it?

Manual test:
admin@host:~$ sonic-db-cli CONFIG_DB keys "*SNMP*"
ACL_TABLE|SNMP_ACL
SNMP_AGENT_ADDRESS_CONFIG|10.1.1.1|161|
SNMP_AGENT_ADDRESS_CONFIG|fc00:2::32|161|
SNMP|LOCATION
SNMP_AGENT_ADDRESS_CONFIG|10.1.0.32|161|
SNMP_AGENT_ADDRESS_CONFIG|FC00:1::32|161|
SNMP_COMMUNITY|public

sudo config snmpagentaddress add fe80:1::32%eth0

admin@host:~$ sonic-db-cli CONFIG_DB keys "*SNMP*"
ACL_TABLE|SNMP_ACL
SNMP_AGENT_ADDRESS_CONFIG|10.1.1.1|161|
SNMP_AGENT_ADDRESS_CONFIG|fc00:2::32|161|
SNMP|LOCATION
SNMP_AGENT_ADDRESS_CONFIG|10.1.0.32|161|
SNMP_AGENT_ADDRESS_CONFIG|fe80:1::32%eth0||
SNMP_AGENT_ADDRESS_CONFIG|FC00:1::32|161|
SNMP_COMMUNITY|foo


admin@host:~$ docker exec -it snmp cat /etc/snmp/snmpd.conf | grep agentAddress
agentAddress udp:[10.1.0.32]:161
agentAddress udp:[10.1.1.1]:161
agentAddress udp6:[fc00:2::32]:161
agentAddress udp6:[FC00:1::32]:161
agentAddress udp:[fe80:1::32%eth0]

admin@host:~$ sudo netstat -tulnp | grep 161
udp 0 0 10.1.1.1:161 0.0.0.0:* 432467/snmpd 
udp 0 0 10.1.0.32:161 0.0.0.0:* 432467/snmpd 
udp6 0 0 fe80:1::32:161 :::* 432467/snmpd 
udp6 0 0 fc00:1::32:161 :::* 432467/snmpd 
udp6 0 0 fc00:2::32:161 :::* 432467/snmpd 

root@host:/# snmpget -v2c -c public fe80:1::32%eth0 1.3.6.1.2.1.1.1.0
iso.3.6.1.2.1.1.1.0 = STRING: "SONiC Software Version: SONiC.20231110.10 - HwSku: Arista-7260CX3-C64 - Distribution: Debian 11.9 - Kernel: 5.10.0-23-2-amd64"

admin@host:~$ sudo config snmpagentaddress del fe80:1::32%eth0

root@host:/# snmpget -v2c -c public fe80:1::32%eth0 1.3.6.1.2.1.1.1.0
Timeout: No Response from fe80:1::32%eth0.

Run sonic-mgmt test:
snmp/test_snmp_link_local.py::test_snmp_link_local_ip[host] PASSED [100%]

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

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 <sumeenak@microsoft.com>
@mssonicbld
Copy link
Collaborator Author

Original PR: #13070

@mssonicbld mssonicbld merged commit b65756f into sonic-net:202405 Sep 3, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants