mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
test/e2e: remove SkipIfNetavarkVersionLessThan
We hard require netavark v2 to run with podman 6, as such it makes little sense to guard just a specific set of tests. Remove the helper to remove some code and skip the podman info call to also speed it up a bit. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
1fecb62b34
commit
d3e3b2f48b
3 changed files with 0 additions and 46 deletions
|
|
@ -1242,49 +1242,6 @@ func SkipIfConmonVersionLessThan(minVersion string) {
|
|||
}
|
||||
}
|
||||
|
||||
// SkipIfNetavarkVersionLessThan skips a test if the current network backend is
|
||||
// netavark and its version is less than the specified minimum version (e.g., "1.17.2").
|
||||
// The function is a no-op when netavark is not the active network backend.
|
||||
func SkipIfNetavarkVersionLessThan(minVersion string) {
|
||||
session := podmanTest.PodmanExitCleanly("info", "--format", "{{.Host.NetworkBackendInfo.Backend}}=={{.Host.NetworkBackendInfo.Version}}")
|
||||
out := strings.TrimSpace(session.OutputToString())
|
||||
|
||||
backend, rawVersion, ok := strings.Cut(out, "==")
|
||||
if !ok {
|
||||
Fail(fmt.Sprintf("[netavark]: unexpected podman info output: %q", out))
|
||||
}
|
||||
if backend != "netavark" {
|
||||
return
|
||||
}
|
||||
|
||||
rawVersion = strings.TrimSpace(rawVersion)
|
||||
if rawVersion == "" {
|
||||
Fail(fmt.Sprintf("[netavark]: unexpected empty version in podman info output: %q", out))
|
||||
}
|
||||
|
||||
parts := strings.Fields(rawVersion)
|
||||
if len(parts) == 0 {
|
||||
Fail(fmt.Sprintf("[netavark]: unexpected netavark version format: %q", rawVersion))
|
||||
}
|
||||
|
||||
versionStr := strings.TrimPrefix(parts[len(parts)-1], "v")
|
||||
|
||||
current, err := semver.Parse(versionStr)
|
||||
if err != nil {
|
||||
Fail(fmt.Sprintf("[netavark]: failed to parse netavark version %q: %v", rawVersion, err))
|
||||
}
|
||||
|
||||
minVersion = strings.TrimPrefix(strings.TrimSpace(minVersion), "v")
|
||||
minVer, err := semver.Parse(minVersion)
|
||||
if err != nil {
|
||||
Fail(fmt.Sprintf("[netavark]: failed to parse minimum version %q: %v", minVersion, err))
|
||||
}
|
||||
|
||||
if current.Compare(minVer) < 0 {
|
||||
Skip(fmt.Sprintf("[netavark]: need netavark >= %s; have %s", minVersion, versionStr))
|
||||
}
|
||||
}
|
||||
|
||||
// SkipIfNotActive skips a test if the given systemd unit is not active
|
||||
func SkipIfNotActive(unit string, reason string) {
|
||||
checkReason(reason)
|
||||
|
|
|
|||
|
|
@ -669,7 +669,6 @@ var _ = Describe("Podman network create", func() {
|
|||
|
||||
DescribeTable("podman network create with special route types",
|
||||
func(subnet string, route string, expectedDest string, expectedRouteType types.RouteType, expectedMetric *uint32) {
|
||||
SkipIfNetavarkVersionLessThan("2.0.0")
|
||||
netName := "subnet-" + stringid.GenerateRandomID()
|
||||
nc := podmanTest.Podman([]string{
|
||||
"network",
|
||||
|
|
|
|||
|
|
@ -1548,8 +1548,6 @@ options ndots:1
|
|||
|
||||
for _, tc := range multiIPTests {
|
||||
It(fmt.Sprintf("podman run container with %s", tc.name), func() {
|
||||
SkipIfNetavarkVersionLessThan("v1.17.3")
|
||||
|
||||
netName := "test-net-" + stringid.GenerateRandomID()
|
||||
netCreateArgs := []string{"network", "create"}
|
||||
for _, subnet := range tc.subnets {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue