Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Test for linksInContainer = false
This commit introduces a new test case that tests the code flow when the linksInContainer parameter is set to false, indicating that links start in a different namespace instead of the pod namespace. This scenario requires a different setup than usual, involving the addition of dummy links to a different namespace rather than the pod namespace. 1. Created a function (addLinksInNS) responsible for adding links during namespace setup for each test. This function is needed for the new test, where dummy links are added to the init namespace. 2. Added an option to modify the linksInContainer setting in the string config used across all tests. This change allows each test to set the linksInContainer option to true or false as needed. 3. Introduced a test case that verifies the correct addition and deletion of the plugin while links are active in the host network namespace. To avoid redundancy, new functions (validateBondIFConf, validateBondSlavesConf) were added. 4. Included a missing netNs.Close() statement in the bond code's setLinksinNetNs function to properly close the pod namespace. 5. Also changed the setLinksinNetNs function. Previous versions didn't include transfer of the namespace back to the current namespace after function execution. In this commit instead of using ns.netNs.Set function, ns.netNs.Do was used, including the transfer to the initial namespace. This change also included creation of a move links from namespace function for a more readable implementation. Signed-off-by: Alina Sudakov <[email protected]>
- Loading branch information