Skip to content

Commit 26cd01e

Browse files
committed
Do not test CNI in CI
CNI is deprecated and is build tagged out for 5.0. Don't test it in our CI. This commit also disables upgrade tests for now - those need more work since the old version of Podman only uses CNI. Upgrade tests will be re-vamped in a later commit. Signed-off-by: Ashley Cui <[email protected]>
1 parent ee92335 commit 26cd01e

File tree

6 files changed

+6
-146
lines changed

6 files changed

+6
-146
lines changed

.cirrus.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,11 @@ build_task:
105105
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
106106
# ID for re-use of build output
107107
CI_DESIRED_RUNTIME: crun
108-
CI_DESIRED_NETWORK: netavark
109108
- env:
110109
DISTRO_NV: ${PRIOR_FEDORA_NAME}
111110
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
112111
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
113112
CI_DESIRED_RUNTIME: crun
114-
CI_DESIRED_NETWORK: cni
115113
CI_DESIRED_DATABASE: boltdb
116114
CI_DESIRED_STORAGE: vfs
117115
# Catch invalid "TMPDIR == /tmp" assumptions; PR #19281
@@ -125,7 +123,6 @@ build_task:
125123
DISTRO_NV: ${DEBIAN_NAME}
126124
VM_IMAGE_NAME: ${DEBIAN_CACHE_IMAGE_NAME}
127125
CI_DESIRED_RUNTIME: runc
128-
CI_DESIRED_NETWORK: netavark
129126
env:
130127
TEST_FLAVOR: build
131128
# NOTE: The default way Cirrus-CI clones is *NOT* compatible with
@@ -186,7 +183,6 @@ build_aarch64_task:
186183
VM_IMAGE_NAME: ${FEDORA_AARCH64_AMI}
187184
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
188185
CI_DESIRED_RUNTIME: crun
189-
CI_DESIRED_NETWORK: netavark
190186
TEST_FLAVOR: build
191187
clone_script: *full_clone
192188
prebuild_script: *prebuild
@@ -682,13 +678,11 @@ container_integration_test_task:
682678
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
683679
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
684680
CI_DESIRED_RUNTIME: crun
685-
CI_DESIRED_NETWORK: netavark
686681
- env:
687682
DISTRO_NV: ${PRIOR_FEDORA_NAME}
688683
VM_IMAGE_NAME: ${PRIOR_FEDORA_CACHE_IMAGE_NAME}
689684
CTR_FQIN: ${PRIOR_FEDORA_CONTAINER_FQIN}
690685
CI_DESIRED_RUNTIME: crun
691-
CI_DESIRED_NETWORK: cni
692686
CI_DESIRED_DATABASE: boltdb
693687
gce_instance: *standardvm
694688
timeout_in: 50m
@@ -746,7 +740,6 @@ podman_machine_task:
746740
PRIV_NAME: "rootless" # intended use-case
747741
DISTRO_NV: "${FEDORA_NAME}"
748742
VM_IMAGE_NAME: "${FEDORA_AMI}"
749-
CI_DESIRED_NETWORK: netavark
750743
clone_script: *get_gosrc
751744
setup_script: *setup
752745
main_script: *main
@@ -772,7 +765,6 @@ podman_machine_aarch64_task:
772765
PRIV_NAME: "rootless" # intended use-case
773766
DISTRO_NV: "${FEDORA_AARCH64_NAME}"
774767
VM_IMAGE_NAME: "${FEDORA_AARCH64_AMI}"
775-
CI_DESIRED_NETWORK: netavark
776768
clone_script: *get_gosrc_aarch64
777769
setup_script: *setup
778770
main_script: *main
@@ -922,7 +914,6 @@ rootless_remote_system_test_task:
922914
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
923915
CTR_FQIN: ${FEDORA_CONTAINER_FQIN}
924916
CI_DESIRED_RUNTIME: crun
925-
CI_DESIRED_NETWORK: netavark
926917
<<: *local_system_test_task
927918
alias: rootless_remote_system_test
928919
gce_instance: *standardvm
@@ -1007,37 +998,6 @@ buildah_bud_test_task:
1007998
main_script: *main
1008999
always: *int_logs_artifacts
10091000

1010-
upgrade_test_task:
1011-
name: "Upgrade test: from $PODMAN_UPGRADE_FROM"
1012-
alias: upgrade_test
1013-
# Docs: ./contrib/cirrus/CIModes.md
1014-
only_if: *not_tag_magic
1015-
depends_on:
1016-
- build
1017-
- local_system_test
1018-
matrix:
1019-
- env:
1020-
PODMAN_UPGRADE_FROM: v2.1.1
1021-
CI_DESIRED_NETWORK: cni
1022-
- env:
1023-
PODMAN_UPGRADE_FROM: v3.1.2
1024-
CI_DESIRED_NETWORK: cni
1025-
- env:
1026-
PODMAN_UPGRADE_FROM: v3.4.4
1027-
CI_DESIRED_NETWORK: cni
1028-
gce_instance: *standardvm
1029-
env:
1030-
TEST_FLAVOR: upgrade_test
1031-
DISTRO_NV: ${FEDORA_NAME}
1032-
VM_IMAGE_NAME: ${FEDORA_CACHE_IMAGE_NAME}
1033-
# FIXME: remove this once we have VMs with podman >= 4.8
1034-
CI_DESIRED_DATABASE: boltdb
1035-
clone_script: *get_gosrc
1036-
setup_script: *setup
1037-
main_script: *main
1038-
always: *logs_artifacts
1039-
1040-
10411001
# This task is critical. It updates the "last-used by" timestamp stored
10421002
# in metadata for all VM images. This mechanism functions in tandem with
10431003
# an out-of-band pruning operation to remove disused VM images.
@@ -1111,7 +1071,6 @@ success_task:
11111071
- minikube_test
11121072
- farm_test
11131073
- buildah_bud_test
1114-
- upgrade_test
11151074
- meta
11161075
container: &smallcontainer
11171076
image: ${CTR_FQIN}

contrib/cirrus/lib.sh

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ EPOCH_TEST_COMMIT="$CIRRUS_BASE_SHA"
9595
# contexts, such as host->container or root->rootless user
9696
#
9797
# List of envariables which must be EXACT matches
98-
PASSTHROUGH_ENV_EXACT='CGROUP_MANAGER|DEST_BRANCH|DISTRO_NV|GOCACHE|GOPATH|GOSRC|NETWORK_BACKEND|OCI_RUNTIME|ROOTLESS_USER|SCRIPT_BASE|SKIP_USERNS|EC2_INST_TYPE|PODMAN_DB|STORAGE_FS'
98+
PASSTHROUGH_ENV_EXACT='CGROUP_MANAGER|DEST_BRANCH|DISTRO_NV|GOCACHE|GOPATH|GOSRC|OCI_RUNTIME|ROOTLESS_USER|SCRIPT_BASE|SKIP_USERNS|EC2_INST_TYPE|PODMAN_DB|STORAGE_FS'
9999

100100
# List of envariable patterns which must match AT THE BEGINNING of the name.
101101
PASSTHROUGH_ENV_ATSTART='CI|LANG|LC_|TEST'
@@ -202,61 +202,6 @@ install_test_configs() {
202202
install -v -D -m 644 ./test/registries.conf /etc/containers/
203203
}
204204

205-
use_cni() {
206-
req_env_vars OS_RELEASE_ID PACKAGE_DOWNLOAD_DIR SCRIPT_BASE
207-
# Defined by common automation library
208-
# shellcheck disable=SC2154
209-
if [[ "$OS_RELEASE_ID" =~ "debian" ]]; then
210-
# Supporting it involves swapping the rpm & dnf commands below
211-
die "Testing debian w/ CNI networking currently not supported"
212-
fi
213-
214-
msg "Forcing NETWORK_BACKEND=cni for all subsequent environments."
215-
echo "NETWORK_BACKEND=cni" >> /etc/ci_environment
216-
export NETWORK_BACKEND=cni
217-
# While it's possible a user may want both installed, for CNI CI testing
218-
# purposes we only care about backward-compatibility, not forward.
219-
# If both CNI & netavark are present, in some situations where --root
220-
# is used it's possible for podman to pick the "wrong" networking stack.
221-
msg "Force-removing netavark and aardvark-dns"
222-
# Other packages depend on nv/av, but we're testing with podman
223-
# binaries built from source, so it's safe to ignore these deps.
224-
#
225-
# Do not fail when netavark and aardvark-dns are not installed.
226-
for pkg in aardvark-dns netavark
227-
do
228-
[ -z "$(rpm -qa | grep $pkg)" ] && echo "$pkg not installed" || rpm -e --nodeps $pkg
229-
done
230-
msg "Installing default CNI configuration"
231-
showrun dnf install -y $PACKAGE_DOWNLOAD_DIR/podman-plugins*
232-
cd $GOSRC || exit 1
233-
rm -rvf /etc/cni/net.d
234-
mkdir -p /etc/cni/net.d
235-
showrun install -v -D -m 644 ./cni/87-podman-bridge.conflist \
236-
/etc/cni/net.d/
237-
# This config must always sort last in the list of networks (podman picks
238-
# first one as the default). This config prevents allocation of network
239-
# address space used by default in google cloud.
240-
# https://cloud.google.com/vpc/docs/vpc#ip-ranges
241-
showrun install -v -D -m 644 $SCRIPT_BASE/99-do-not-use-google-subnets.conflist \
242-
/etc/cni/net.d/
243-
}
244-
245-
use_netavark() {
246-
req_env_vars OS_RELEASE_ID PRIOR_FEDORA_NAME DISTRO_NV
247-
local magickind repokind
248-
msg "Unsetting NETWORK_BACKEND for all subsequent environments."
249-
echo "export -n NETWORK_BACKEND" >> /etc/ci_environment
250-
echo "unset NETWORK_BACKEND" >> /etc/ci_environment
251-
export -n NETWORK_BACKEND
252-
unset NETWORK_BACKEND
253-
msg "Removing any/all CNI configuration"
254-
showrun rm -rvf /etc/cni/net.d/*
255-
# N/B: The CNI packages are still installed and available. This is
256-
# on purpose, since CI needs to verify the selection mechanisms are
257-
# functional when both are available.
258-
}
259-
260205
# Remove all files provided by the distro version of podman.
261206
# All VM cache-images used for testing include the distro podman because (1) it's
262207
# required for podman-in-podman testing and (2) it somewhat simplifies the task

contrib/cirrus/setup_environment.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,6 @@ case "$OS_RELEASE_ID" in
158158
*) die_unknown OS_RELEASE_ID
159159
esac
160160

161-
# Networking: force CNI or Netavark as requested in .cirrus.yml
162-
# (this variable is mandatory).
163-
# shellcheck disable=SC2154
164-
showrun echo "about to set up for CI_DESIRED_NETWORK [=$CI_DESIRED_NETWORK]"
165-
case "$CI_DESIRED_NETWORK" in
166-
netavark) use_netavark ;;
167-
cni) use_cni ;;
168-
*) die_unknown CI_DESIRED_NETWORK ;;
169-
esac
170-
171161
# Database: force SQLite or BoltDB as requested in .cirrus.yml.
172162
# If unset, will default to SQLite.
173163
# shellcheck disable=SC2154

test/e2e/info_test.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,23 +152,15 @@ var _ = Describe("Podman Info", func() {
152152
})
153153

154154
It("Podman info: check desired network backend", func() {
155-
// defined in .cirrus.yml
156-
want := os.Getenv("CI_DESIRED_NETWORK")
157-
if want == "" {
158-
if os.Getenv("CIRRUS_CI") == "" {
159-
Skip("CI_DESIRED_NETWORK is not set--this is OK because we're not running under Cirrus")
160-
}
161-
Fail("CIRRUS_CI is set, but CI_DESIRED_NETWORK is not! See #16389")
162-
}
163155
session := podmanTest.Podman([]string{"info", "--format", "{{.Host.NetworkBackend}}"})
164156
session.WaitWithDefaultTimeout()
165157
Expect(session).To(ExitCleanly())
166-
Expect(session.OutputToString()).To(Equal(want))
158+
Expect(session.OutputToString()).To(Equal("netavark"))
167159

168160
session = podmanTest.Podman([]string{"info", "--format", "{{.Host.NetworkBackendInfo.Backend}}"})
169161
session.WaitWithDefaultTimeout()
170162
Expect(session).To(ExitCleanly())
171-
Expect(session.OutputToString()).To(Equal(want))
163+
Expect(session.OutputToString()).To(Equal("netavark"))
172164
})
173165

174166
It("Podman info: check desired database backend", func() {

test/system/005-info.bats

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,8 @@ host.slirp4netns.executable | $expr_path
8282
}
8383

8484
@test "podman info - confirm desired network backend" {
85-
if [[ -z "$CI_DESIRED_NETWORK" ]]; then
86-
# When running in Cirrus, CI_DESIRED_NETWORK *must* be defined
87-
# in .cirrus.yml so we can double-check that all CI VMs are
88-
# using netavark or cni as desired.
89-
if [[ -n "$CIRRUS_CI" ]]; then
90-
die "CIRRUS_CI is set, but CI_DESIRED_NETWORK is not! See #16389"
91-
fi
92-
93-
# Not running under Cirrus (e.g., gating tests, or dev laptop).
94-
# Totally OK to skip this test.
95-
skip "CI_DESIRED_NETWORK is unset--OK, because we're not in Cirrus"
96-
fi
97-
9885
run_podman info --format '{{.Host.NetworkBackend}}'
99-
is "$output" "$CI_DESIRED_NETWORK" "CI_DESIRED_NETWORK (from .cirrus.yml)"
86+
is "$output" "netavark" "netavark backend"
10087
}
10188

10289
@test "podman info - confirm desired database" {

test/upgrade/test-upgrade.bats

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ while :;do
125125
echo STOPPING
126126
podman \$opts stop -t 0 myrunningcontainer || true
127127
podman \$opts rm -f myrunningcontainer || true
128-
# sigh, network rm fails with exec: "ip": executable file not found in $PATH
129-
# we cannot change the images afterwards so we remove it manually (#11403)
130-
# hardcode /etc/cni/net.d dir for now
131-
podman \$opts network rm -f mynetwork || rm -f /etc/cni/net.d/mynetwork.conflist
132128
exit 0
133129
fi
134130
sleep 0.5
@@ -143,10 +139,7 @@ EOF
143139
# Also use --network host to prevent any netavark/cni conflicts
144140
$PODMAN run --rm --network host $OLD_PODMAN true
145141

146-
# Podman 4.0 might no longer use cni so /run/cni and /run/containers will no be created in this case
147-
# Create directories manually to fix this. Also running with netavark can
148-
# cause connectivity issues since cni and netavark should never be mixed.
149-
mkdir -p /run/netns /run/cni /run/containers /var/lib/cni /etc/cni/net.d
142+
mkdir -p /run/netns
150143

151144
# Containers-common around release 1-55 no-longer supplies this file
152145
sconf=/etc/containers/storage.conf
@@ -165,7 +158,6 @@ EOF
165158
#
166159
# mount /etc/containers/storage.conf to use the same storage settings as on the host
167160
# mount /dev/shm because the container locks are stored there
168-
# mount /var/lib/cni, /run/cni and /etc/cni/net.d for cni networking
169161
# mount /run/containers for the dnsname plugin
170162
#
171163
$PODMAN run -d --name podman_parent --pid=host \
@@ -178,9 +170,6 @@ EOF
178170
-v /run/crun:/run/crun \
179171
-v /run/netns:/run/netns:rshared \
180172
-v /run/containers:/run/containers \
181-
-v /run/cni:/run/cni \
182-
-v /var/lib/cni:/var/lib/cni \
183-
-v /etc/cni/net.d:/etc/cni/net.d \
184173
-v /dev/shm:/dev/shm \
185174
-v $pmroot:$pmroot:rshared \
186175
$OLD_PODMAN $pmroot/setup
@@ -200,10 +189,8 @@ EOF
200189
}
201190

202191
@test "info" {
203-
# check network backend, since this is an old version we should use CNI
204-
# when we start testing from 4.0 we should have netavark as backend
205192
run_podman info --format '{{.Host.NetworkBackend}}'
206-
is "$output" "cni" "correct network backend"
193+
is "$output" "netavark" "correct network backend"
207194
}
208195

209196
@test "images" {

0 commit comments

Comments
 (0)