Skip to content

Commit b19f822

Browse files
committed
Remove iptables references in upgrade tests
Signed-off-by: Mario Loriedo <[email protected]>
1 parent 67ace9e commit b19f822

File tree

3 files changed

+17
-31
lines changed

3 files changed

+17
-31
lines changed

.cirrus.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,9 @@ upgrade_test_task:
10901090
depends_on: *build
10911091
matrix:
10921092
- env:
1093-
PODMAN_UPGRADE_FROM: v4.8.0
1093+
PODMAN_UPGRADE_FROM: v5.4.0
1094+
- env:
1095+
PODMAN_UPGRADE_FROM: v5.6.2
10941096
gce_instance: *standardvm
10951097
env:
10961098
TEST_FLAVOR: upgrade_test

test/upgrade/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,19 @@ container image from quay.io/podman, uses it to create and run
2121
a number of containers, then uses new-podman to interact with
2222
those containers.
2323

24-
As of 2024-02-05 the available old-podman versions are:
24+
Testing updates from versions earlier than v5.3.1 fails. Testing updates from
25+
tags that do not respect semantic versioning fails too (e.g. v5.6.0-immutable or
26+
v5.6). As of 2025-11-18 the available old-podman versions to test against are:
2527

2628
```console
27-
$ bin/podman search --list-tags --limit=400 quay.io/podman/stable | awk '$2 ~ /^v/ { print $2}' | sort | column -c 75
28-
v1.4.2 v1.9.1 v3.2.0 v3.4.0 v4.1.0 v4.3.1 v4.5.1 v4.8
29-
v1.4.4 v2.0.2 v3.2.1 v3.4.1 v4.1.1 v4.4 v4.6 v4.8.0
30-
v1.5.0 v2.0.6 v3.2.2 v3.4.2 v4.2 v4.4.1 v4.6.1 v4.8.1
31-
v1.5.1 v2.1.1 v3.2.3 v3.4.4 v4.2.0 v4.4.2 v4.6.2 v4.8.2
32-
v1.6 v2.2.1 v3.3.0 v3.4.7 v4.2.1 v4.4.4 v4.7 v4.8.3
33-
v1.6.2 v3 v3.3.1 v4 v4.3 v4.5 v4.7.0 v4.9
34-
v1.9.0 v3.1.2 v3.4 v4.1 v4.3.0 v4.5.0 v4.7.2 v4.9.0
29+
$ bin/podman search --list-tags --limit=400 quay.io/podman/stable | awk '$2 ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print $2}' | sort | awk '/v5.3.1/,0' | column -c 75
30+
v5.3.1 v5.4.0 v5.4.2 v5.5.1 v5.6.0 v5.6.2
31+
v5.3.2 v5.4.1 v5.5.0 v5.5.2 v5.6.1
3532
```
3633

3734
Test invocation is:
3835
```console
39-
$ sudo env PODMAN=bin/podman PODMAN_UPGRADE_FROM=v4.1.0 PODMAN_UPGRADE_TEST_DEBUG= bats test/upgrade
36+
$ sudo env PODMAN=bin/podman PODMAN_UPGRADE_FROM=v5.3.1 PODMAN_UPGRADE_TEST_DEBUG= bats test/upgrade
4037
```
4138
(Path assumes you're cd'ed to top-level podman repo). `PODMAN_UPGRADE_FROM`
4239
can be any of the versions above. `PODMAN_UPGRADE_TEST_DEBUG` is empty

test/upgrade/test-upgrade.bats

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ setup() {
4949
# the default c/storage behavior is to make the mount propagation private.
5050
export _PODMAN_TEST_OPTS="--storage-opt=skip_mount_home=true --cgroup-manager=cgroupfs --root=$PODMAN_UPGRADE_WORKDIR/root --runroot=$PODMAN_UPGRADE_WORKDIR/runroot --tmpdir=$PODMAN_UPGRADE_WORKDIR/tmp"
5151

52-
# Old netavark used iptables but newer versions might uses nftables.
53-
# Networking can only work correctly if both use the same firewall driver so force iptables.
54-
printf "[network]\nfirewall_driver=\"iptables\"\n" > $PODMAN_UPGRADE_WORKDIR/containers.conf
52+
53+
# Starting with v6.0.0 we only test upgrade from versions that support nftables.
54+
printf "[network]\nfirewall_driver=\"nftables\"\n" > $PODMAN_UPGRADE_WORKDIR/containers.conf
5555
export CONTAINERS_CONF_OVERRIDE=$PODMAN_UPGRADE_WORKDIR/containers.conf
5656
}
5757

@@ -64,21 +64,6 @@ setup() {
6464
OLD_PODMAN=quay.io/podman/stable:$PODMAN_UPGRADE_FROM
6565
$PODMAN pull $OLD_PODMAN
6666

67-
# Can't mix-and-match iptables.
68-
# This can only fail when we bring in new CI VMs. If/when it does fail,
69-
# we'll need to figure out how to solve it. Until then, punt.
70-
iptables_old_version=$($PODMAN run --rm $OLD_PODMAN iptables -V)
71-
run -0 expr "$iptables_old_version" : ".*(\(.*\))"
72-
iptables_old_which="$output"
73-
74-
iptables_new_version=$(iptables -V)
75-
run -0 expr "$iptables_new_version" : ".*(\(.*\))"
76-
iptables_new_which="$output"
77-
78-
if [[ "$iptables_new_which" != "$iptables_old_which" ]]; then
79-
die "Cannot mix iptables; $PODMAN_UPGRADE_FROM container uses $iptables_old_which, host uses $iptables_new_which"
80-
fi
81-
8267
# Shortcut name, because we're referencing it a lot
8368
pmroot=$PODMAN_UPGRADE_WORKDIR
8469

@@ -223,8 +208,10 @@ EOF
223208

224209
@test "images" {
225210
run_podman images -a --format '{{.Names}}'
226-
assert "${lines[0]}" =~ "\[localhost/podman-pause:${PODMAN_UPGRADE_FROM##v}-.*\]" "podman images, line 0"
227-
assert "${lines[1]}" = "[$IMAGE]" "podman images, line 1"
211+
# Filter out the podman-pause image which isn't present for
212+
# versions >= 5.5.0
213+
run -0 grep -v "localhost/podman-pause" <<< "$output"
214+
assert "${lines[0]}" = "[$IMAGE]" "podman images, line 0"
228215
}
229216

230217
@test "ps : one container running" {

0 commit comments

Comments
 (0)