Closed LionelJouin closed 1 month ago
Here is the second issue related to the VRF plugin:
Running tests
without coverage profile generation...
github.com/containernetworking/plugins/plugins/meta/vrf
=== RUN TestVRF
Running Suite: plugins/meta/vrf - containernetworking/plugins/plugins/meta/vrf
=======================================================================================================
Random Seed: 1728311452
Will run 1 of 1 specs
------------------------------
• [FAILED] [0.630 seconds]
vrf plugin [It] adds the interface and custom routing to new VRF
containernetworking/plugins/plugins/meta/vrf/vrf_test.go:183
Timeline >>
STEP: Setting custom routing first @ 10/07/24 16:30:52.644
[FAILED] in [It] - containernetworking/plugins/plugins/meta/vrf/vrf_test.go:269 @ 10/07/24 16:30:53.263
<< Timeline
[FAILED] Unexpected error:
<*errors.errorString | 0xc000228970>:
cmdAdd failed: could not add route '{Ifindex: 2 Dst: 1111:dddd::/80 Src: abcd:1234:ffff::cdde Gw: abcd:1234:ffff::1 Flags: [] Table: 1 Realm: 0}': invalid argument
{
s: "cmdAdd failed: could not add route '{Ifindex: 2 Dst: 1111:dddd::/80 Src: abcd:1234:ffff::cdde Gw: abcd:1234:ffff::1 Flags: [] Table: 1 Realm: 0}': invalid argument",
}
occurred
In [It] at: containernetworking/plugins/plugins/meta/vrf/vrf_test.go:269 @ 10/07/24 16:30:53.263
------------------------------
Summarizing 1 Failure:
[FAIL] vrf plugin [It] adds the interface and custom routing to new VRF
containernetworking/plugins/plugins/meta/vrf/vrf_test.go:269
Ran 1 of 1 Specs in 0.633 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped
--- FAIL: TestVRF (0.63s)
FAIL
FAIL github.com/containernetworking/plugins/plugins/meta/vrf 0.649s
FAIL
I am still investigating the issue. Adding a 100ms sleep time after this (plugins/meta/vrf/vrf.go#L130-L144) solves the problem.
In the tests:
IPv6 are added to an interface, and routes using that IPv6 is created. In order to create the route, we should wait for some IPv6 route to be created (created automatically by the kernel when adding the IPv6 to the interface). Without that route, the RouteAdd call in the tests will fail, for example:
Here is some job that have failed. https://github.com/containernetworking/plugins/actions/runs/10954784634/job/30417500257?pr=1092 https://github.com/containernetworking/plugins/actions/runs/11109122762/job/30863918356?pr=1082