Skip to content

[lldp] Add test_lldp_after_config_reload to verify LLDP recovery#22428

Closed
sonicly1g wants to merge 1 commit intosonic-net:masterfrom
sonicly1g:test/lldp-config-reload
Closed

[lldp] Add test_lldp_after_config_reload to verify LLDP recovery#22428
sonicly1g wants to merge 1 commit intosonic-net:masterfrom
sonicly1g:test/lldp-config-reload

Conversation

@sonicly1g
Copy link
Copy Markdown
Contributor

Why I did it

Fixes #22376.

Adds a new test case to cover the regression scenario described in sonic-net/sonic-buildimage#25436, where lldpd fails to detect all interfaces during boot due to a race condition between RTM_GETLINK dumps and RTM_NEWLINK messages on the same socket.

How I did it

Added test_lldp_after_config_reload to tests/lldp/test_lldp.py that:

  1. Records all LLDP neighbors and interface status before config reload
  2. Performs config reload
  3. Waits for critical services and LLDP neighbors to be restored
  4. Verifies all pre-reload LLDP neighbor entries are present
  5. Verifies Chassis ID type is mac (not hostname — which indicates eth0 wasn't found)
  6. Verifies all interfaces appear in lldpcli show interfaces
  7. Checks syslog for cannot find port / ERR lldp#lldpmgrd errors (warning, not hard fail)

How to verify it

Run on any topology (t0, t1, t2, m0, mx, m1):

pytest tests/lldp/test_lldp.py::test_lldp_after_config_reload -v

On a system without the sonic-buildimage#25436 fix applied (with many interfaces), this test should catch missing LLDP neighbors after config reload.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Feb 15, 2026

CLA Not Signed

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sonicly1g sonicly1g force-pushed the test/lldp-config-reload branch from 4ff95dd to 079f984 Compare February 16, 2026 00:35
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@sonicly1g sonicly1g force-pushed the test/lldp-config-reload branch from 079f984 to 8ef0dbc Compare February 16, 2026 01:12
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Fixes sonic-net#22376.

Adds a new test case that verifies LLDP neighbors are correctly restored
after config reload, catching regressions where lldpd fails to detect all
interfaces during boot (e.g. the race condition fixed in
sonic-net/sonic-buildimage#25436).

The test validates:
1. All LLDP neighbor entries present before reload are restored after
2. Chassis ID type is 'mac' (not hostname fallback from missing eth0)
3. All interfaces appear in 'lldpcli show interfaces'
4. Checks syslog for 'cannot find port' / lldpmgrd errors (warning only)

Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
Signed-off-by: Sonicly1G <sonicly1g@users.noreply.github.com>
@sonicly1g sonicly1g force-pushed the test/lldp-config-reload branch from 8ef0dbc to eb36cd2 Compare February 17, 2026 23:54
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@rustiqly
Copy link
Copy Markdown
Contributor

Closing to re-submit from rustiqly account (CLA already signed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[test gap] check lldp neighbors after config reload

3 participants