summaryrefslogtreecommitdiff
path: root/test/utils
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2022-01-05 13:10:56 -0600
committerBrent Baude <bbaude@redhat.com>2022-02-02 13:03:45 -0600
commit7d3ad6081f6598b8fa6385409e5109f11f29254f (patch)
treee68f74bfc0393443ee322380fee4940ca043aba3 /test/utils
parentc2d0011b723428c622b99cf633439f84c4bf901a (diff)
downloadpodman-7d3ad6081f6598b8fa6385409e5109f11f29254f.tar.gz
podman-7d3ad6081f6598b8fa6385409e5109f11f29254f.tar.bz2
podman-7d3ad6081f6598b8fa6385409e5109f11f29254f.zip
netavark e2e tests
enabled e2e tests for netavark Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'test/utils')
-rw-r--r--test/utils/utils.go39
1 files changed, 32 insertions, 7 deletions
diff --git a/test/utils/utils.go b/test/utils/utils.go
index 1f5067950..14092a2a5 100644
--- a/test/utils/utils.go
+++ b/test/utils/utils.go
@@ -12,12 +12,34 @@ import (
"strings"
"time"
+ "github.com/sirupsen/logrus"
+
"github.com/containers/storage/pkg/parsers/kernel"
. "github.com/onsi/ginkgo" //nolint:golint,stylecheck
. "github.com/onsi/gomega" //nolint:golint,stylecheck
. "github.com/onsi/gomega/gexec" //nolint:golint,stylecheck
)
+type NetworkBackend int
+
+const (
+ // Container Networking backend
+ CNI NetworkBackend = iota
+ // Netavark network backend
+ Netavark NetworkBackend = iota
+)
+
+func (n NetworkBackend) ToString() string {
+ switch n {
+ case CNI:
+ return "cni"
+ case Netavark:
+ return "netavark"
+ }
+ logrus.Errorf("unknown network backend: %q", n)
+ return ""
+}
+
var (
DefaultWaitTimeout = 90
OSReleasePath = "/etc/os-release"
@@ -34,17 +56,18 @@ type PodmanTestCommon interface {
// PodmanTest struct for command line options
type PodmanTest struct {
- PodmanMakeOptions func(args []string, noEvents, noCache bool) []string
+ ImageCacheDir string
+ ImageCacheFS string
+ NetworkBackend NetworkBackend
PodmanBinary string
- TempDir string
- RemoteTest bool
+ PodmanMakeOptions func(args []string, noEvents, noCache bool) []string
+ RemoteCommand *exec.Cmd
RemotePodmanBinary string
RemoteSession *os.Process
RemoteSocket string
RemoteSocketLock string // If not "", should be removed _after_ RemoteSocket is removed
- RemoteCommand *exec.Cmd
- ImageCacheDir string
- ImageCacheFS string
+ RemoteTest bool
+ TempDir string
}
// PodmanSession wraps the gexec.session so we can extend it
@@ -73,8 +96,10 @@ func (p *PodmanTest) PodmanAsUserBase(args []string, uid, gid uint32, cwd string
if p.RemoteTest {
podmanBinary = p.RemotePodmanBinary
}
-
runCmd := append(wrapper, podmanBinary)
+ if p.NetworkBackend == Netavark {
+ runCmd = append(runCmd, []string{"--network-backend", "netavark"}...)
+ }
if p.RemoteTest {
podmanOptions = append([]string{"--remote", "--url", p.RemoteSocket}, podmanOptions...)
}