ltp
ltp copied to clipboard
containers: netns: load veth module
Most of regular distributions are shipping the virtual ethernet driver as a kernel module. The test assumes it's built-in. Attempt to load the veth module in the netns_setup() function. It will allow to get the tests running on a distro kernel and avoid to build a custom kernel for LTP purpose.
Signed-off-by: Fathi Boudra [email protected]
Also I wonder if we should attempt to remove the module at the end if it wasn't loaded when the test was started. We probably should in order to restore the environment to the same state as it was before the test.
I don't have a strong opinion, the other tests don't seem to save/restore the state of the modules. I'm fine to update the PR if it's required. At the moment, it seems an open question.
@fboudra Could you please add code which would remove module in cleanup function in case it wasn't loaded?
@fboudra I pushed your original version as it's a fix. Would you do like to implement the cleanup of veth in case it's not loaded (+ use -q for modprobe).
Thanks for your work.
@pevik thanks. I'll follow up with the suggestion about -q for modprobe.
@fboudra + removing module if it's not loaded, please (ip_tests.sh has quite nice example).
@fboudra please do you plan to work on it?