-
Notifications
You must be signed in to change notification settings - Fork 45
test: add Ginkgo-based integration test framework for vpp-manager component #840
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: master
Are you sure you want to change the base?
Conversation
fd955e4 to
cec41af
Compare
sknat
left a comment
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.
Thanks for taking a stab at it @aritrbas !
A few comments on the structure. Tell me if you want to discuss it in more details
| } | ||
|
|
||
| // ConfigureUplink configures a TAP interface as uplink with the specified configuration | ||
| func (v *VppInstance) ConfigureUplink(config *UplinkConfig) (uint32, error) { |
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.
Maybe we could call vpp_runner.go:configureVppUplinkInterface() directly instead of having a custom logic for tests
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.
Ran into some issues while trying to test VppRunner.configureVppUplinkInterface() directly.
It creates a TAP with HostNamespace:"pid:1" that requires access to the host's PID 1 network namespace. In a Docker container, pid:1 refers to the container's init process, not the host, causing the Linux-side tap setup to fail.
For now, I have added a very basic uplink interface test that only verifies the VPP-side operations performed in configureVppUplinkInterface() - (i) VRF allocation (via allocateStaticVRFs()) (ii) Interface address configuration (via AddInterfaceAddress()) (iii) Interface state management (via InterfaceAdminUp())
Need to discuss how we can test the entire VppRunner.configureVppUplinkInterface() functionality using this framework, maybe handle it as a part of a separate task/PR?
d63bedd to
2bbd152
Compare
Signed-off-by: Aritra Basu <[email protected]>
2bbd152 to
6517f90
Compare
Summary
This PR introduces Ginkgo based tests for
vpp-managercomponent.Architecture
Environment Variables
VPP_IMAGEVPP_BINARY/usr/bin/vppTest Structure
Test Coverage
VppRunner.allocateStaticVRFspunt-tableandcalico-podsVRFs are created for IPv4/IPv6VppRunner.AllocatePhysicalNetworkVRFsconfig.InforegistrationVPP Configurationuplink Interfaceuplinkinterface addresses and VRFs configurationTAP InterfaceTAPinterface creationAF_PACKET InterfaceAF_PACKETinterface creation onvethpairsmemif Interfacememifinterface creationRunning Tests
make testThe tests are integrated into the main
make testtarget:go test