Merge pull request #20167 from Luap99/e2e-netdefault

test/e2e: default to netavark
This commit is contained in:
OpenShift Merge Robot
2023-09-27 09:24:46 -04:00
committed by GitHub
3 changed files with 16 additions and 16 deletions

View File

@ -214,11 +214,9 @@ use_cni() {
die "Testing debian w/ CNI networking currently not supported"
fi
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
export -n NETWORK_BACKEND
unset NETWORK_BACKEND
msg "Forcing NETWORK_BACKEND=cni for all subsequent environments."
echo "NETWORK_BACKEND=cni" >> /etc/ci_environment
export NETWORK_BACKEND=cni
# While it's possible a user may want both installed, for CNI CI testing
# purposes we only care about backward-compatibility, not forward.
# If both CNI & netavark are present, in some situations where --root
@ -250,9 +248,11 @@ use_cni() {
use_netavark() {
req_env_vars OS_RELEASE_ID PRIOR_FEDORA_NAME DISTRO_NV
local magickind repokind
msg "Forcing NETWORK_BACKEND=netavark for all subsequent environments."
echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment
export NETWORK_BACKEND=netavark # needed for install_test_configs()
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
export -n NETWORK_BACKEND
unset NETWORK_BACKEND
msg "Removing any/all CNI configuration"
showrun rm -rvf /etc/cni/net.d/*
# N/B: The CNI packages are still installed and available. This is

View File

@ -87,7 +87,7 @@ The following environment variables are supported by the test setup:
- `QUADLET_BINARY`: path to the quadlet binary, defaults to `bin/quadlet` in the repository root.
- `CONMON_BINARY`: path to th conmon binary, defaults to `/usr/libexec/podman/conmon`.
- `OCI_RUNTIME`: which oci runtime to use, defaults to `crun`.
- `NETWORK_BACKEND`: the network backend, either `cni` (default) or `netavark`.
- `NETWORK_BACKEND`: the network backend, either `netavark` (default) or `cni`.
- `PODMAN_DB`: the database backend `boltdb` (default) or `sqlite`.
- `PODMAN_TEST_IMAGE_CACHE_DIR`: path were the container images should be cached, defaults to `/tmp`.

View File

@ -291,17 +291,17 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
dbBackend = "sqlite"
}
networkBackend := CNI
networkConfigDir := "/etc/cni/net.d"
networkBackend := Netavark
networkConfigDir := "/etc/containers/networks"
if isRootless() {
networkConfigDir = filepath.Join(os.Getenv("HOME"), ".config/cni/net.d")
networkConfigDir = filepath.Join(root, "etc", "networks")
}
if strings.ToLower(os.Getenv("NETWORK_BACKEND")) == "netavark" {
networkBackend = Netavark
networkConfigDir = "/etc/containers/networks"
if strings.ToLower(os.Getenv("NETWORK_BACKEND")) == "cni" {
networkBackend = CNI
networkConfigDir = "/etc/cni/net.d"
if isRootless() {
networkConfigDir = filepath.Join(root, "etc", "networks")
networkConfigDir = filepath.Join(os.Getenv("HOME"), ".config/cni/net.d")
}
}