-
Notifications
You must be signed in to change notification settings - Fork 224
Introduce xfrm_interface tests #4155
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 introduces comprehensive test coverage for the xfrm_interface kernel module, which is used for IPsec VPN tunnels. The tests validate that the CONFIG_XFRM_INTERFACE kernel configuration option is properly enabled and functional on Azure Linux VMs.
Key Changes:
- New test suite for XFRM interface functionality with two test cases
- Validates kernel module loading, interface creation, and module load/unload operations
- Includes proper cleanup and error handling for test isolation
| ) | ||
| def verify_xfrm_interface_load_unload(self, node: Node) -> None: | ||
| kernel_config = node.tools[KernelConfig] | ||
| modprobe = node.tools[Modprobe] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
| # Skip if built-in (can't unload built-in modules) | ||
| if kernel_config.is_built_in("CONFIG_XFRM_INTERFACE"): | ||
| raise SkippedException( | ||
| "CONFIG_XFRM_INTERFACE is built-in, " "cannot test module load/unload" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"CONFIG_XFRM_INTERFACE is built-in, cannot test module load/unload"
| ).is_false() | ||
|
|
||
| # Reload the module to leave system in working state | ||
| modprobe.load("xfrm_interface") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to keep the original state, and decide to unload or load it to restore it into original state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Also updated in the verify_xfrm_interface function
Introduce xfrm_interface tests. This is to validate the config option
CONFIG_XFRM_INTERFACESteps:
1. Check if CONFIG_XFRM_INTERFACE is enabled in kernel config. (will skip if not)
2. Load the xfrm_interface module if not already loaded.
3. Verify the module is loaded successfully.
4. Create a test xfrm interface (xfrm0).
ip link add xfrm0 type xfrm dev eth0 if_id 1005. Verify the interface was created.
ip link show6. Clean up the test interface.
sudo ip link del xfrm0