From 85f9cf39039100f956e80b15f42b6ca7763d368a Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 7 Jan 2022 16:03:16 +0100 Subject: upgrade test: check that network backend is cni Since we test an update from an older version we should check the the network backend is correctly set to CNI. Signed-off-by: Paul Holzinger --- test/upgrade/test-upgrade.bats | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'test/upgrade/test-upgrade.bats') diff --git a/test/upgrade/test-upgrade.bats b/test/upgrade/test-upgrade.bats index c0d601586..5d2435ab9 100644 --- a/test/upgrade/test-upgrade.bats +++ b/test/upgrade/test-upgrade.bats @@ -113,6 +113,7 @@ while :;do echo STOPPING podman \$opts stop -t 0 myrunningcontainer || true podman \$opts rm -f myrunningcontainer || true + podman \$opts network rm -f mynetwork exit 0 fi sleep 0.5 @@ -132,6 +133,9 @@ EOF $PODMAN run --rm --mac-address 78:28:a6:8d:24:8a --network $netname $OLD_PODMAN true $PODMAN network rm -f $netname + # Podman 4.0 might no longer use cni so /run/cni and /run/containers will no be created in this case + mkdir -p /run/cni /run/containers + # # Use new-podman to run the above script under old-podman. @@ -177,6 +181,13 @@ EOF : } +@test "info" { + # check network backend, since this is a old version we should use CNI + # when we start testing from 4.0 we should have netavark as backend + run_podman info --format '{{.Host.NetworkBackend}}' + is "$output" "cni" "correct network backend" +} + @test "images" { run_podman images -a --format '{{.Names}}' is "$output" "\[$IMAGE\]" "podman images" @@ -329,8 +340,6 @@ failed | exited | 17 run_podman logs podman_parent run_podman rm -f podman_parent - run_podman network rm -f mynetwork - umount $PODMAN_UPGRADE_WORKDIR/root/overlay || true rm -rf $PODMAN_UPGRADE_WORKDIR -- cgit v1.2.3-54-g00ecf