Skip to content

[mpls][sonic-vpp] Enable MPLS data-plane tests on the VPP t1-lag testbed - #26619

Open
augusdn wants to merge 3 commits into
sonic-net:masterfrom
augusdn:augusdn/vpp-mpls-25782-tests
Open

[mpls][sonic-vpp] Enable MPLS data-plane tests on the VPP t1-lag testbed#26619
augusdn wants to merge 3 commits into
sonic-net:masterfrom
augusdn:augusdn/vpp-mpls-25782-tests

Conversation

@augusdn

@augusdn augusdn commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Fixes sonic-net/sonic-buildimage#25782

Enables the MPLS data-plane tests (tests/mpls/test_mpls.py) on the sonic-vpp KVM
testbed (t1-lag-vpp). test_pop_label, test_swap_label and test_swap_labelstack
pass; test_push_label stays skipped for the reason described below.

Important

Depends on sonic-net/sonic-sairedis#2008, which adds the VPP SAI MPLS backend
(INSEG disposition + IP-route label imposition). Merge only after that change has
landed and been picked up into the sonic-vpp image - otherwise the newly enabled
tests have no backend to talk to and mpls/test_mpls.py fails by design.

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

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): N/A - no backport requested.
Failure type: other (new platform enablement, not a regression)

Tested branch

  • master
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • N/A

Test result

  • master: image SONiC.master-28652.1177040-4e2ccc26c (a throwaway sonic-buildimage
    build carrying [vpp] Add MPLS data-plane support (INSEG + IP-route push) sonic-sairedis#2008) on the converged vms-kvm-vpp-t1-lag
    testbed, ElasticTest plan 6a69da68f481df03c4e59c5e - SUCCESS, 22 tests, 17 passed /
    5 skipped / 0 failed / 0 errors
    :

    test_pretest.py     13 tests,  9 passed, 4 skipped
    mpls/test_mpls.py    4 tests,  3 passed, 1 skipped
    test_posttest.py     5 tests,  5 passed
    

    That run proved PR A's backend and PR B's test code together, pre-merge.

    Two changes were made to this PR after that run - the mpls FEATURE registration
    moved from enabled to disabled (which let three shared global files be reverted,
    see below), and the mpls_router modprobe replaced a LogAnalyzer ignore. Both were
    re-validated on the same vms-kvm-vpp-t1-lag testbed:

    mpls/test_mpls.py                       3 passed, 1 skipped, 0 failed
    A/B vs a clean master worktree, same DUT, identical scope:
        clean master : 14 passed, 4 skipped, 0 failed
        this PR      : 14 passed, 4 skipped, 0 failed
    

Approach

What is the motivation for this PR?

MPLS was never exercised on sonic-vpp - mpls/test_mpls.py was skipped outright for the
vpp asic. With the VPP SAI backend in the pre-requisite PR the disposition path works, so
the tests can be turned on and give us real MPLS coverage on a KVM testbed.

How did you do it?

5 files, +68 / -13. No shared global test file is modified.

File Change
tests/mpls/conftest.py Gate on topology type instead of name; resolve PortChannel L3 interfaces to member PTF port ids; skip cleanly when a topology has no T2-facing or no T0-facing interface; load the mpls_router kernel module in setup.
tests/mpls/test_mpls.py Pass the dst PTF port-id list straight to verify_packet_any_port (ports=dst_pid); drop a duplicated mask.Mask() wrap in the pop expected-packet helper.
tests/common/plugins/conditional_mark/tests_mark_conditions_sonic_vpp.yaml Replace the blanket mpls/test_mpls.py skip with a skip for test_push_label only.
ansible/library/generate_golden_config_db.py Register an mpls FEATURE on sonic-vpp testbeds, with state: disabled (the state matters - see below).
.azure-pipelines/pr_test_scripts.yaml Add mpls/test_mpls.py to the t1-lag-vpp set so the vpp PR checker runs it.

Notes on the individual changes:

  • Topology gate. The old check was name not in ('t1'), which compares against a
    string rather than a tuple, so every topology except a plain t1 was skipped -
    including t1-lag.
  • PortChannel resolution. On t1-lag the spine/tor facing interfaces are
    PortChannels, which are not present in minigraph_port_indices. A physical interface
    resolves to a single-element list.
  • Empty-interface guard. Some t1 variants (t1-backend, whose neighbors are all
    BT0) have no T2 peer, and the old name-based check happened to exclude them; without
    this the module would fail with an IndexError from random.choice([]).
  • mpls_router modprobe. Enabling MPLS on an interface makes intfmgrd run
    sysctl -w net.mpls.conf.<intf>.input=1, which needs that module. It ships in the
    image but nothing loads it, so the sysctl fails and is logged as an ERR. Loading it
    removes the cause rather than suppressing the symptom, and lets SONiC's own
    config interface mpls add complete as designed. sonic-swss's own MPLS test
    (tests/test_mpls.py, setup_mpls) loads it the same way, and sonic-mgmt already
    modprobes in tests/console/conftest.py and tests/test_pktgen.py. The module is
    left loaded on teardown: modprobe is idempotent, the module ships in the image,
    unloading could disrupt anything else using MPLS, and it touches no CONFIG_DB state.

Why the mpls FEATURE is registered as disabled and not enabled:
the tests are gated by the 'mpls' not in feature_status condition in
tests_mark_conditions.yaml, and mpls is present in neither init_cfg.json nor the
minigraph-derived config, so the key has to exist somewhere for the tests to run at all.
That condition is a key-membership test, so disabled is enough to un-skip them.
Registering it as enabled is actively wrong here: mpls is a config flag, not a
containerized service, and there is no mpls docker. With state: enabled the image's
own monit container_checker reports

container_checker    Status failed
Expected containers not running: mpls

which fails the pre-test sanity check for every test on this platform. The
frr_bmp exemption for the same class of containerless feature lives in
sonic-buildimage's /usr/bin/container_checker, so it cannot be worked around from
sonic-mgmt. Using disabled keeps monit healthy, keeps the tests un-skipped, and needs
no image change. Verified on a live DUT: feature still listed by show feature status,
container_checker exits 0, monit reports container_checker OK.

Choosing disabled also let an earlier revision of this PR be simplified: the
pre-test/post-test/dut_utils guards it previously needed became dead code and were
reverted, so this PR now touches no shared global test files.

On test_push_label: it exercises IP-to-label imposition and does not work end to
end. The test injects the push route straight into ROUTE_TABLE, and orchagent does not
install that route into ASIC_DB, so it never reaches the SAI backend. That is a route
management gap rather than anything specific to VPP, so the test is skipped with that
reason recorded.

One thing worth flagging for reviewers: mpls/test_mpls.py is already listed under
t1-lag (and onboarding_t1_multi_asic) in pr_test_scripts.yaml, but the topology
check described above silently skipped it there. Fixing that check means the tests now
run wherever the mpls feature is registered. On images without the feature they stay
skipped by the existing feature_status condition, so the practical blast radius is
limited to vpp. The impacted-area-kvmtest-t1-lag and multi-asic-t1 PR checks both
passed with this change in place.

How did you verify/test it?

See the Test result section above for the image version, ElasticTest plan id and
counts. In summary: the combined pre-merge ElasticTest run was green (17 passed /
5 skipped / 0 failed / 0 errors), and the two later changes were re-validated on the
same testbed, including an A/B against a clean master worktree on the same DUT with
identical scope, which produced identical results (14 passed / 4 skipped / 0 failed on
both sides) - i.e. no regression to the surrounding framework tests.

The dependency on sonic-net/sonic-sairedis#2008 was verified rather than assumed: the
green run above used a throwaway image built with that PR in it, and the t1-lag-vpp PR
check on an image without it fails mpls/test_mpls.py, which is the expected merge-order
behaviour described in the callout at the top.

DUT was healthy throughout: VPP bonds up with l34-inner, all 24 BGP sessions
established, container_checker OK.

Any platform specific information?

sonic-vpp only. The conditional_mark change is confined to
tests_mark_conditions_sonic_vpp.yaml, and the golden-config change is gated on the
sonic-vpp testbeds, so no other ASIC or platform is affected. The one cross-platform
effect is the tests/mpls/conftest.py topology-gate fix described above, which is a
correctness fix to a comparison that was silently skipping t1-lag; on images that do
not register the mpls feature the tests remain skipped by the existing
feature_status condition.

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

Not a new test case - this enables an existing module on an additional platform.
Verified on t1-lag-vpp. The conftest gate accepts t1 topology types generally.

Documentation

No documentation change needed - this enables an existing test module on an additional
platform.

Copilot AI lite review requested due to automatic review settings July 28, 2026 08:22
@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.

@github-actions

Copy link
Copy Markdown

@StormLiangMS @wangxin @yxieca A user wants to merge changes to the conditional mark files into master. Please review.

@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enables MPLS data-plane test coverage on the SONiC-VPP KVM t1-lag-vpp testbed by unblocking previously over-broad topology gating, adapting the tests to PortChannel-based topologies, and wiring the test module into the VPP PR CI selection.

Changes:

  • Fix MPLS testbed gating to rely on topology type (t1) and resolve PortChannel interfaces to underlying PTF member port indices.
  • Update MPLS tests to pass a list of destination PTF port IDs directly into verify_packet_any_port, and remove a duplicate mask.Mask() wrapper.
  • Enable the mpls feature for VPP golden configs, narrow the VPP conditional skip to test_push_label only, and add mpls/test_mpls.py to the t1-lag-vpp PR test set.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/mpls/test_mpls.py Adjust packet verification to support multi-egress (PortChannel member) destination ports; minor mask cleanup.
tests/mpls/conftest.py Fix topology gating and map PortChannel DUT interfaces to PTF member port IDs for t1-lag.
tests/common/plugins/conditional_mark/tests_mark_conditions_sonic_vpp.yaml Replace blanket MPLS skip on VPP with a targeted skip of only test_push_label and a documented reason.
ansible/library/generate_golden_config_db.py Enable mpls feature in generated golden config for VPP testbeds so MPLS tests aren’t skipped by feature gating.
.azure-pipelines/pr_test_scripts.yaml Add mpls/test_mpls.py into the t1-lag-vpp CI test selection.

Comment thread tests/mpls/conftest.py
Comment on lines +25 to +30
portchannels = mg_facts.get('minigraph_portchannels', {})
if dut_port in portchannels:
members = portchannels[dut_port]['members']
else:
members = [dut_port]
return [mg_facts['minigraph_port_indices'][member] for member in members]
Copilot AI review requested due to automatic review settings July 29, 2026 10:46
@augusdn
augusdn force-pushed the augusdn/vpp-mpls-25782-tests branch from 5969ce6 to e90f906 Compare July 29, 2026 10:46
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@github-actions
github-actions Bot requested a review from rawal01 July 29, 2026 10:47
@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

@augusdn

augusdn commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

CI status on build 1178163 (commit e90f906)

Two Elastictest jobs are red. Neither is a defect in this PR — details below so reviewers aren't misled.


1. impacted-area-kvmtest-t1-lag-vpp — expected until sonic-sairedis#2008 merges

Plan 6a69dd2a101ed2146e809527mpls/test_mpls.py failed for RUN_TEST_CASE_FAILED.

This PR adds mpls/test_mpls.py to the t1-lag-vpp list in .azure-pipelines/pr_test_scripts.yaml, so CI now runs it against the stock master sonic-vs/vpp image, which does not yet contain the VPP MPLS data-plane backend. That backend is sonic-net/sonic-sairedis#2008, which is still open. This job cannot go green until #2008 merges and mssonicbld bumps src/sonic-sairedis in sonic-buildimage.

It has already been validated end-to-end pre-merge. Using a throwaway sonic-buildimage PR that pinned both submodules (build 1177040), the combined run is green:

  • Plan 6a69da68f481df03c4e59c5eSUCCESS, 22 tests, 17 passed / 5 skipped, 0 failed
    • test_pretest.py — 13 tests, 9 passed / 4 skipped
    • mpls/test_mpls.py — 4 tests, 3 passed / 1 skipped (test_mpls_push_label, skipped via tests_mark_conditions_sonic_vpp.yaml)
    • test_posttest.py — 5 tests, 5 passed

This PR is therefore kept in draft until #2008 lands.


2. impacted-area-kvmtest-t0-sonic — pre-existing, unrelated to this PR

Plan 6a69dcfcf481df03c4e59c61 → the only failing module is
macsec/test_macsec_recovery.py::test_dirty_container_kill_preserves_sak_consistency[256_XPN_SCI].

It is a LogAnalyzer teardown ERROR, not a test assertion failure — the test's own cases pass, then teardown trips on an unignored syslog line:

E   Failed: Got matched syslog in processes "analyze_logs--<MultiAsicSonicHost vlab-02>" exit code:"1"
E   match: 1, expected_match: 0
E   2026 Jul 29 12:10:45 vlab-02 ERR macsec#wpa_supplicant[92]: KaY: Reject distributed SAK since I'm a key server

The test deliberately kills the macsec container, and the resulting wpa_supplicant ERR is not in the test's LogAnalyzer ignore list.

Why it is not attributable to this PR:

  • It was added upstream on 2026-07-22 by [macsec] Add dirty-restart SAK regression test #24903 (f335de7a8, [macsec] Add dirty-restart SAK regression test), seven days before this run.
  • This PR touches no macsec, LogAnalyzer, or syslog code. Full diff is 7 files: pr_test_scripts.yaml, generate_golden_config_db.py, tests_mark_conditions_sonic_vpp.yaml, tests/mpls/conftest.py, tests/mpls/test_mpls.py, tests/test_pretest.py, tests/test_posttest.py.
  • In the very same t0-sonic plan, test_pretest.py PASSED on both testbeds, and the other five macsec modules (test_interop_protocol, test_macsec_pfc, test_dataplane, test_deployment, test_fault_handling) all passed — so the changes to the shared test_pretest.py / test_posttest.py are benign here.

The reason this PR runs macsec at all is that it modifies the shared tests/test_pretest.py and tests/test_posttest.py, which widens the impacted-area test set relative to a typical feature PR.

For completeness, the change to those two shared files is a two-line guard that skips the mpls FEATURE, mirroring the existing frr_bmp skip immediately above it — mpls is enabled as a FEATURE in CONFIG_DB for vpp topologies but has no corresponding docker container, so modify_syslog_rate_limit()'s docker exec -i mpls fails with No such container: mpls. On t0-sonic the mpls FEATURE is not enabled, so the guard is inert.

Copilot AI review requested due to automatic review settings August 2, 2026 06:53
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@augusdn

augusdn commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 15489cc9c. Two substantive changes since the previous revision, plus a note on three things whose real root cause sits outside this repo.

What changed

1. The mpls FEATURE is now registered as disabled, not enabled.

This is the important one. Registering it as enabled was verified on a live DUT to break the platform:

$ sudo monit summary | grep container_checker
 container_checker    Status failed    Program
$ sudo /usr/bin/container_checker
Expected containers not running: mpls

mpls is a config flag, not a containerized service — there is no mpls docker. With state: enabled the image's own monit container_checker fails permanently, which fails the pre-test sanity check for every test on this platform, not just the MPLS ones. The exemption for the same class of containerless feature (frr_bmp) is hardcoded in sonic-buildimage's /usr/bin/container_checker, so it can't be worked around from sonic-mgmt.

The conditional_mark gate is "'mpls' not in feature_status" — a key-membership test — so disabled is sufficient to un-skip the tests. Verified: feature still listed by show feature status, container_checker exits 0, monit reports container_checker OK.

2. tests/test_pretest.py and tests/test_posttest.py are no longer touched at all.

Those guards only existed because the feature was enabled. Both loops already skip features whose state isn't enabled, so with disabled they became dead code. Reverting them removes this PR's footprint on shared, global test files entirely — which also narrows the impacted-area test set.

3. Skip cleanly when the topology has no T2-facing or no T0-facing interface.

Gating on topology type correctly admits t1-lag, but it also admits t1 variants with no T2 peer. Enumerating all 41 t1-type topologies, four have none: t1-backend (all BT0), t1-isolated-d128, t1-isolated-d32, t1-isolated-v6-d128. Those would have failed with an IndexError from random.choice([]).

4. LogAnalyzer ignore for the kernel-MPLS error — see (a) below.

Three things whose root cause is upstream of this PR

Flagging these explicitly rather than leaving them to be discovered.

(a) intfmgrd kernel-MPLS error — mitigated here, not fixed.
Configuring MPLS on an interface makes intfmgrd run sysctl -w net.mpls.conf.<intf>.input=1, which needs the mpls_router kernel module. No SONiC image loads that module (nothing in /etc/modules-load.d/ references it), so the command fails and is logged as an ERR:

ERR swss#intfmgrd: :- setIntfMpls: Command 'sysctl -w net.mpls.conf.Ethernet76.input=1' failed with rc 1

On sonic-vpp this is genuinely benign — MPLS forwarding is done by VPP in userspace via the SAI INSEG entries, so the kernel data path is unused. That's why the ignore is gated on asic_type == 'vpp' rather than applied globally: on a platform that does rely on the kernel path, this error would be meaningful and shouldn't be masked. The real fix belongs in sonic-buildimage (load the module) or sonic-swss (don't log an ERR where the kernel path isn't used).

(b) test_push_label is skipped, not fixed.
It injects the push route straight into ROUTE_TABLE, and orchagent doesn't install that route into ASIC_DB, so it never reaches the SAI backend. That's a route-management gap in sonic-swss (or an unsupported test method), not something specific to VPP. Pre-existing — it isn't a regression from this change.

(c) config interface mpls remove doesn't restore CONFIG_DB.
It writes mpls: disable rather than deleting the field, so an interface that had no mpls key before the test has one after:

"Ethernet84":     {"mpls": "disable"}
"PortChannel111": {"mpls": "disable"}

core_dump_and_config_check notices and auto-runs restore_config_db_and_config_reload, so it's non-fatal — the full run below is green. The behaviour is sonic-utilities CLI semantics in pre-existing test code, so I've left it rather than paper over it in the teardown, but I'm happy to add a restore here if reviewers would prefer the test be strictly idempotent on its own.

Verification

Full suite on vms-kvm-vpp-t1-lag with the pre-requisite backend (sonic-net/sonic-sairedis#2008) installed:

test_pretest.py + mpls/test_mpls.py + test_posttest.py
17 passed, 5 skipped, 0 failed, 0 errors

A/B against a clean master worktree on the same DUT, identical scope, to confirm no regression:

clean master : 14 passed, 4 skipped, 0 failed
this PR      : 14 passed, 4 skipped, 0 failed

This stays a draft until #2008 merges and the submodule bump reaches the sonic-vpp image — until then kvmtest-t1-lag-vpp can't pass, because the newly enabled tests have no backend to talk to.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 3, 2026 08:29
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

@augusdn

augusdn commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 8971943db. One change since the last revision, plus the local validation results.

Replaced the LogAnalyzer ignore with a root-cause fix

The previous revision suppressed this error with a LogAnalyzer ignore:

ERR swss#intfmgrd: :- setIntfMpls: Command 'sysctl -w net.mpls.conf.Ethernet76.input=1' failed with rc 1

That was treating the symptom. The actual cause is that sysctl -w net.mpls.conf.<intf>.input=1 needs the mpls_router kernel module, which ships in the image but is never loaded — nothing in /etc/modules-load.d/ references it, so /proc/sys/net/mpls doesn't exist at all:

# before
$ ls /proc/sys/net/mpls
ls: cannot access '/proc/sys/net/mpls': No such file or directory

# after modprobe mpls_router
conf  default_ttl  ip_ttl_propagate  platform_labels
$ sysctl -w net.mpls.conf.Ethernet0.input=1
net.mpls.conf.Ethernet0.input = 1        <- the exact command intfmgrd runs, now succeeds

So the fixture now loads the module instead of hiding the error. SONiC's own config interface mpls add then completes as designed rather than half-failing. This follows sonic-swss's own MPLS test, which does modprobe mpls_router in setup_mpls, and sonic-mgmt already modprobes in tests/console/conftest.py and tests/test_pktgen.py.

Verified from a clean baseline (module rmmod'ed first, /proc/sys/net/mpls confirmed absent), with no LogAnalyzer ignore in place:

mpls/test_mpls.py  3 passed, 1 skipped
setIntfMpls errors: 0
LogAnalyzer match failures: 0

The module is deliberately left loaded on teardown — modprobe is idempotent, the module ships in the image, unloading could disrupt anything else using MPLS, and it touches no CONFIG_DB state.

The durable fix still belongs upstream (sonic-buildimage loading the module, or sonic-swss not logging an ERR where the kernel MPLS path is unused), but this no longer depends on that.

Local validation

The dev VM's build environment was repaired so the full sairedis build and test suite could be run locally against the pre-requisite backend before pushing:

check result
dpkg-buildpackage rc=0, all 9 debs produced
make checktests All 11 tests passed (aspellcheck.pl, conflictnames.pl, checksaiapi.sh, checkwhitespace.sh, swsslogentercheck.sh, platform .pl tests, testdash_gtest)
make checkmeta / lib / vslib / unittest/vslib PASS
ASAN build + vslib tests under ASAN clean, 0 findings (leaks, UAF, stack-use-after-return all enabled)
sonic-mgmt Markers Check PASS (737 scripts, 0 without topology markers)
flake8 / YAML / whitespace clean
test_pretest + mpls + test_posttest on vms-kvm-vpp-t1-lag 17 passed, 5 skipped, 0 failed
A/B against a clean master worktree, same DUT, same scope identical (14 passed / 4 skipped both)

Still a draft until sonic-net/sonic-sairedis#2008 merges and the submodule bump reaches the sonic-vpp image — until then kvmtest-t1-lag-vpp cannot pass, because the newly enabled tests have no backend to talk to.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@azure-pipelines

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

@augusdn

augusdn commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Marking this ready for review. Summary of the current CI state so the one red check isn't a surprise:

22 checks pass, 1 fails. The single failure is Test impacted-area-kvmtest-t1-lag-vpp by Elastictest, and it is the expected merge-order dependency rather than a defect:

mpls/test_mpls.py|||2 failed for RUN_TEST_CASE_FAILED

That job runs the whole t1-lag-vpp list (acl, arp, bfd, bgp, ...) against a stock sonic-vpp image, and mpls/test_mpls.py is the only failure in it. The tests this PR un-skips have no backend to talk to until sonic-net/sonic-sairedis#2008 lands and is picked up into the sonic-vpp image. It cannot go green before then.

The same tests pass once that backend is present - ElasticTest plan 6a69da68f481df03c4e59c5e on image SONiC.master-28652.1177040-4e2ccc26c (a throwaway build carrying #2008) returned 17 passed / 5 skipped / 0 failed / 0 errors for test_pretest.py + mpls/test_mpls.py + test_posttest.py. Details are in the PR description.

Everything else is green, including all eight other topology jobs (t0, t0-2vlans, t0-sonic, t1-lag, multi-asic-t1, t2, dualtor, dpu) and every Pre_test gate (Markers Check, Static Analysis, Validate Test Cases, Meta check, Dependency Check, skip_expiry, MMU probe).

Worth noting for review scope: this PR touches no shared global test files. An earlier revision needed guards in the pre-test/post-test/dut_utils paths; registering the mpls FEATURE as disabled instead of enabled made those unnecessary and they were reverted. The remaining change set is 5 files, +68/-13.

augusdn and others added 3 commits August 5, 2026 00:10
Enable tests/mpls on the sonic-vpp KVM testbed (t1-lag-vpp):

- conftest: support t1-lag by gating on the topology *type* ('t1') and
  resolving PortChannel spine/tor interfaces to their PTF member port
  ids (a physical interface resolves to a single-element list). The old
  check was `name not in ('t1')`, which compares against a string
  rather than a tuple, so anything other than a plain 't1' topology was
  skipped.
- test_mpls: pass the dst PTF port-id list directly to
  verify_packet_any_port (ports=dst_pid), and drop a duplicate
  mask.Mask() wrap in the pop expected-packet helper.
- conditional_mark: replace the blanket mpls/test_mpls.py vpp skip with
  a skip for test_push_label only. pop/swap/swap_labelstack run and pass
  on VPP; push is blocked by an orchagent ROUTE_TABLE MPLS-push install
  gap (tracked separately), not the VPP SAI backend.
- golden_config: enable the 'mpls' feature on sonic-vpp testbeds so the
  tests are not skipped by the "'mpls' not in feature_status" condition.
  The feature is absent from both init_cfg.json and the minigraph-derived
  config, so it has to be turned on somewhere for the tests to run.
- pre/posttest: skip 'mpls' when walking enabled features to toggle the
  rsyslog rate limit. Those loops assume every enabled feature has a
  container of the same name and run 'docker exec -i <feature>', but
  mpls is a config flag rather than a containerized service, so the
  exec fails with "No such container: mpls" and aborts the run. This
  mirrors the existing frr_bmp skip, which is there for the same reason.
- pr_test_scripts: add mpls/test_mpls.py to the t1-lag-vpp set so the
  vpp PR checker actually exercises it.

Note that mpls/test_mpls.py is already listed for t1-lag, where the
topology check above silently skipped it. With that check fixed the
tests run wherever the mpls feature is enabled; on images without the
feature they stay skipped by the existing feature_status condition.

Verified on vms-kvm-vpp-t1-lag: 3 passed, 1 skipped (push).

Signed-off-by: Augustine Lee <augustinelee@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…pology guard

Register the mpls FEATURE with state "disabled" instead of "enabled", and drop
the shared-file workarounds that only existed because it was enabled.

mpls is a config flag, not a containerized service, so there is no "mpls" docker.
With state "enabled" the image's own monit container_checker reports
"Expected containers not running: mpls", which fails the pre-test sanity check
for every test on this platform. The frr_bmp exemption for the same class of
containerless feature lives in sonic-buildimage's /usr/bin/container_checker, so
it cannot be worked around from sonic-mgmt.

The tests are gated by "'mpls' not in feature_status", which is a key-membership
test, so "disabled" is enough to un-skip them. Verified on a live DUT: the
feature is still listed by "show feature status", container_checker exits 0 and
monit reports container_checker OK.

Because the feature is no longer enabled, the guards added to test_pretest.py and
test_posttest.py are dead code - both loops already skip features whose state is
not enabled - so they are reverted. That removes this change's footprint on
shared, global test files entirely.

Also skip the module when the topology has no T2-facing or no T0-facing
interface. Gating on topology type instead of name correctly admits t1-lag, but
it also admits t1 variants that have no T2 peer at all (t1-backend, whose
neighbors are all BT0, plus t1-isolated-d128/d32 and the v6 variant). Those would
have failed with an IndexError from random.choice([]).

Ignore the kernel-MPLS error intfmgrd logs on sonic-vpp. Configuring MPLS on an
interface makes intfmgrd run "sysctl -w net.mpls.conf.<intf>.input=1", which
needs the mpls_router kernel module. No SONiC image loads that module, so the
command fails and is logged as an ERR. On sonic-vpp it is benign because MPLS
forwarding is done by VPP in userspace via the SAI INSEG entries, not by the
Linux kernel data path.

Signed-off-by: Augustine Lee <augustinelee@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 251d571f-a53b-47f8-9eb4-293dbc6ff7a4
…rror

Enabling MPLS on an interface makes intfmgrd run
"sysctl -w net.mpls.conf.<intf>.input=1", which needs the mpls_router kernel
module. The module ships in the image but nothing loads it, so the sysctl
fails and is logged as an ERR.

The previous revision suppressed that error with a LogAnalyzer ignore. Load
the module in the setup fixture instead, which removes the cause rather than
the symptom: the sysctl then succeeds and SONiC's own "config interface mpls
add" completes as designed. sonic-swss's own MPLS test (tests/test_mpls.py
setup_mpls) loads it the same way, and sonic-mgmt already modprobes in
tests/console/conftest.py and tests/test_pktgen.py.

Verified from a clean baseline (module rmmod'ed first): 3 passed, 1 skipped,
zero setIntfMpls errors, with no LogAnalyzer ignore in place.

The module is deliberately left loaded: modprobe is idempotent, the module
ships in the image, and unloading could disrupt anything else using MPLS. It
touches no CONFIG_DB state.

Signed-off-by: Augustine Lee <augustinelee@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 251d571f-a53b-47f8-9eb4-293dbc6ff7a4
Copilot AI review requested due to automatic review settings August 5, 2026 07:11
@augusdn
augusdn force-pushed the augusdn/vpp-mpls-25782-tests branch from 8971943 to 5e2f795 Compare August 5, 2026 07:11
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

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.

[sonic-vpp][Data Plane][t1-lag] MPLS - Enable data plane testing on VPP KVM testbed

3 participants