Skip to content

Commit

Permalink
upgrade test: check that network backend is cni
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luap99 committed Jan 12, 2022
1 parent 918890a commit 85f9cf3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/upgrade/test-upgrade.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 85f9cf3

Please sign in to comment.