Skip to content

tests/vlan: add static L2 forwarding tests (mac-learning, BUM flood, static FDB)#26476

Open
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:static-l2-forwarding-mgmt-test
Open

tests/vlan: add static L2 forwarding tests (mac-learning, BUM flood, static FDB)#26476
AnantKishorSharma wants to merge 1 commit into
sonic-net:masterfrom
AnantKishorSharma:static-l2-forwarding-mgmt-test

Conversation

@AnantKishorSharma

@AnantKishorSharma AnantKishorSharma commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Adds data-plane sonic-mgmt tests for config-driven static L2 forwarding (per-VLAN), covering the three independent sub-features:

  1. Per-VLAN MAC-learning disable (SAI_VLAN_ATTR_LEARN_DISABLE)
  2. Per-VLAN BUM flood disable (SAI_VLAN_ATTR_{UNKNOWN_UNICAST,UNKNOWN_MULTICAST,BROADCAST}_FLOOD_CONTROL_TYPE)
  3. Static FDB via CONFIG_DB (SAI_FDB_ENTRY_TYPE_STATIC)

Each sub-feature is toggled through the CONFIG_DB (the same path used by config apply-patch / gNMI / the config mac CLI) and verified from the data plane with PTF. Every test restores the default (learning on, flooding on, no static FDB) on teardown.

This is the test companion of the config-driven static L2 forwarding feature. HLD: sonic-net/SONiC#2468.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605

Tested branch

  • master

Test result

Validated on a t0 testbed with the companion swss changes deployed — 3 passed: test_mac_learning_disable, test_broadcast_flood_disable, test_static_fdb_forwarding.

Approach

What is the motivation for this PR?

Add sonic-mgmt data-plane coverage for the config-driven static L2 forwarding feature so the three per-VLAN sub-features are verified end-to-end (CONFIG_DB -> orchagent -> SAI -> data plane).

How did you do it?

Three test classes, one per sub-feature (TestVlanMacLearningDisable, TestVlanBumFloodDisable, TestVlanStaticFdb). Config is applied via sonic-db-cli CONFIG_DB; behavior is verified from the data plane with PTF (send / verify_packets / verify_no_packet_any) plus fdbshow. Each test restores the default state on teardown.

How did you verify/test it?

Ran on a t0 testbed with the companion swss changes deployed — all 3 tests passed. The test selects a VLAN with at least two untagged members and skips gracefully if none is available.

Any platform specific information?

None

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

t0

Documentation

No new documentation; the feature design is covered by the HLD (sonic-net/SONiC#2468).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Comment thread tests/vlan/test_static_l2_forwarding.py Fixed
…static FDB)

Signed-off-by: Anant Kishor Sharma <anant.kishor-sharma@hpe.com>
@AnantKishorSharma
AnantKishorSharma force-pushed the static-l2-forwarding-mgmt-test branch from e840edf to 10eebf2 Compare July 23, 2026 05:18
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

3 participants