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

Modify snmp link local test to use config cli #13070

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

SuvarnaMeenakshi
Copy link
Contributor

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

Signed-off-by: Suvarna Meenakshi <sumeenak@microsoft.com>
Copy link
Contributor

@wsycqyz wsycqyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wangxin wangxin merged commit 9b3d5d8 into sonic-net:master Aug 12, 2024
14 checks passed
@Janetxxx
Copy link
Contributor

Janetxxx commented Sep 2, 2024

@yxieca @bingwang-ms Please help to approve the request labels.

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 3, 2024
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

Cherry-pick PR to 202405: #14406

mssonicbld pushed a commit that referenced this pull request Sep 3, 2024
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 pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 6, 2024
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

Cherry-pick PR to 202311: #14454

mssonicbld pushed a commit that referenced this pull request Sep 6, 2024
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>
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
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>
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
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>
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.

8 participants