Skip to content

Commit bf06131

Browse files
Merge pull request #20167 from Luap99/e2e-netdefault
test/e2e: default to netavark
2 parents d05c777 + 0b5ea1e commit bf06131

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

contrib/cirrus/lib.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,9 @@ use_cni() {
214214
die "Testing debian w/ CNI networking currently not supported"
215215
fi
216216

217-
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
218-
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
219-
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
220-
export -n NETWORK_BACKEND
221-
unset NETWORK_BACKEND
217+
msg "Forcing NETWORK_BACKEND=cni for all subsequent environments."
218+
echo "NETWORK_BACKEND=cni" >> /etc/ci_environment
219+
export NETWORK_BACKEND=cni
222220
# While it's possible a user may want both installed, for CNI CI testing
223221
# purposes we only care about backward-compatibility, not forward.
224222
# If both CNI & netavark are present, in some situations where --root
@@ -250,9 +248,11 @@ use_cni() {
250248
use_netavark() {
251249
req_env_vars OS_RELEASE_ID PRIOR_FEDORA_NAME DISTRO_NV
252250
local magickind repokind
253-
msg "Forcing NETWORK_BACKEND=netavark for all subsequent environments."
254-
echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment
255-
export NETWORK_BACKEND=netavark # needed for install_test_configs()
251+
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
252+
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
253+
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
254+
export -n NETWORK_BACKEND
255+
unset NETWORK_BACKEND
256256
msg "Removing any/all CNI configuration"
257257
showrun rm -rvf /etc/cni/net.d/*
258258
# N/B: The CNI packages are still installed and available. This is

test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The following environment variables are supported by the test setup:
8787
- `QUADLET_BINARY`: path to the quadlet binary, defaults to `bin/quadlet` in the repository root.
8888
- `CONMON_BINARY`: path to th conmon binary, defaults to `/usr/libexec/podman/conmon`.
8989
- `OCI_RUNTIME`: which oci runtime to use, defaults to `crun`.
90-
- `NETWORK_BACKEND`: the network backend, either `cni` (default) or `netavark`.
90+
- `NETWORK_BACKEND`: the network backend, either `netavark` (default) or `cni`.
9191
- `PODMAN_DB`: the database backend `boltdb` (default) or `sqlite`.
9292
- `PODMAN_TEST_IMAGE_CACHE_DIR`: path were the container images should be cached, defaults to `/tmp`.
9393

test/e2e/common_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,17 @@ func PodmanTestCreateUtil(tempDir string, remote bool) *PodmanTestIntegration {
291291
dbBackend = "sqlite"
292292
}
293293

294-
networkBackend := CNI
295-
networkConfigDir := "/etc/cni/net.d"
294+
networkBackend := Netavark
295+
networkConfigDir := "/etc/containers/networks"
296296
if isRootless() {
297-
networkConfigDir = filepath.Join(os.Getenv("HOME"), ".config/cni/net.d")
297+
networkConfigDir = filepath.Join(root, "etc", "networks")
298298
}
299299

300-
if strings.ToLower(os.Getenv("NETWORK_BACKEND")) == "netavark" {
301-
networkBackend = Netavark
302-
networkConfigDir = "/etc/containers/networks"
300+
if strings.ToLower(os.Getenv("NETWORK_BACKEND")) == "cni" {
301+
networkBackend = CNI
302+
networkConfigDir = "/etc/cni/net.d"
303303
if isRootless() {
304-
networkConfigDir = filepath.Join(root, "etc", "networks")
304+
networkConfigDir = filepath.Join(os.Getenv("HOME"), ".config/cni/net.d")
305305
}
306306
}
307307

0 commit comments

Comments
 (0)