Skip to content

Commit

Permalink
test/upgrade: fix tests when netavark uses nftables
Browse files Browse the repository at this point in the history
Old netavark version only supported iptables, however a new version on
th ehost might use nftables. This breaks the networking tests here as
they are not compatible and you would need to reboot to fix that.

Because this is not possible for our tests make sure we force the
iptables driver always to keep the test working.

Signed-off-by: Paul Holzinger <[email protected]>
  • Loading branch information
Luap99 committed Jul 11, 2024
1 parent 5856adb commit 926547f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/upgrade/test-upgrade.bats
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ setup() {
# skip_mount_home=true is required so we can share the storage mounts between host and container,
# the default c/storage behavior is to make the mount propagation private.
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"

# Old netavark used iptables but newer versions might uses nftables.
# Networking can only work correctly if both use the same firewall driver so force iptables.
printf "[network]\nfirewall_driver=\"iptables\"\n" > $PODMAN_UPGRADE_WORKDIR/containers.conf
export CONTAINERS_CONF_OVERRIDE=$PODMAN_UPGRADE_WORKDIR/containers.conf
}

###############################################################################
Expand Down Expand Up @@ -180,6 +185,7 @@ EOF
--net=host \
--cgroupns=host \
--pid=host \
--env CONTAINERS_CONF_OVERRIDE \
$v_sconf \
-v /dev/fuse:/dev/fuse \
-v /run/crun:/run/crun \
Expand Down

0 comments on commit 926547f

Please sign in to comment.