feat(lwtunnel): Add lwtunnel_bpf LISA test for Linux kernel lwtunnel functionality#4298
Merged
LiliDeng merged 8 commits intomicrosoft:mainfrom Mar 13, 2026
Merged
feat(lwtunnel): Add lwtunnel_bpf LISA test for Linux kernel lwtunnel functionality#4298LiliDeng merged 8 commits intomicrosoft:mainfrom
LiliDeng merged 8 commits intomicrosoft:mainfrom
Conversation
Create test suite that validates LWTUNNEL and LWTUNNEL_BPF kernel functionality: - Check CONFIG_LWTUNNEL and CONFIG_LWTUNNEL_BPF kernel configs - Compile a minimal BPF program with clang - Attach it to a route via 'ip route encap bpf' - Verify the BPF encap route is created successfully The test properly skips when kernel configs are not enabled or when required tooling (clang/llvm) is unavailable. Co-authored-by: binnacle-bot <noreply@binnacle.bot>
LiliDeng
reviewed
Feb 26, 2026
LiliDeng
reviewed
Feb 26, 2026
Since clang and kernel headers are verified beforehand now, a compile failure is a genuine test failure, not a missing prerequisite.
Replace manual ip.run + SkippedException with ip.create_virtual_interface, which handles existence checks and failure assertions internally.
No BPF program is pinned to /sys/fs/bpf/ in this test, so the variable and its cleanup were dead code.
LiliDeng
reviewed
Mar 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new LISA network functional test suite to validate Linux LWTUNNEL/LWTUNNEL_BPF by compiling a minimal BPF program and attaching it to a route using ip route encap bpf, with the suite gated to AzureLinux 3.0+.
Changes:
- Add
LwtunnelSuitewith an AzureLinux-only gate inbefore_case. - Add
verify_lwtunnel_bpf_supportto validate required kernel configs, compile a minimal BPF program, and verify a BPF-encap route can be created.
You can also share your feedback on Copilot code review. Take the survey.
Define ls, ip, rm, and tee just before they are first used instead of all at once at the top of the method.
PurePath is host-OS dependent and would produce a WindowsPath on a Windows controller, breaking file writes on the Linux target.
Files are under /tmp which is world-writable, so root is not needed. This aligns with the non-sudo clang presence check and avoids mismatches when sudo uses a restricted secure_path.
LiliDeng
approved these changes
Mar 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create test suite that validates LWTUNNEL and LWTUNNEL_BPF kernel functionality:
Additional features
Tested on AzureLinux 3.0 VMs. (Note this is not currently supported so the test will skip until microsoft/azurelinux#15607 is merged)