diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-14 08:28:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 08:28:37 -0500 |
commit | ab3e566d747551492dac8410c3023915491e2540 (patch) | |
tree | ebde6d829422168f9a7b2a6593e72879385858a9 /test/utils/utils.go | |
parent | b0a445e3545d66ba449f2e3e81bde3a2c5db4896 (diff) | |
parent | a6fbfd47c9d11c8e98dd4fc668af86f2554996d0 (diff) | |
download | podman-ab3e566d747551492dac8410c3023915491e2540.tar.gz podman-ab3e566d747551492dac8410c3023915491e2540.tar.bz2 podman-ab3e566d747551492dac8410c3023915491e2540.zip |
Merge pull request #13216 from cevich/ci_updates
[4.0] Enable Netavark/Aardvark-DNS CI Testing
Diffstat (limited to 'test/utils/utils.go')
-rw-r--r-- | test/utils/utils.go | 39 |
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...) } |