From b791dfb5588acd17c0244ae3539c57e4cb42c701 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Tue, 1 Oct 2024 08:22:55 -0600 Subject: [PATCH] CI: require and test CI_DESIRED_NETWORK on RHEL Although podman has moved on from CNI, RHEL has not. Make sure that builds on RHEL test the desired network backend(s). Effective immediately, gating.yaml on all RHEL branches must set CI_DESIRED_NETWORK (=cni or =netavark) Signed-off-by: Ed Santiago --- test/system/005-info.bats | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/system/005-info.bats b/test/system/005-info.bats index c4ad5c32f8..1e1b9f0e49 100644 --- a/test/system/005-info.bats +++ b/test/system/005-info.bats @@ -83,8 +83,24 @@ host.slirp4netns.executable | $expr_path } @test "podman info - confirm desired network backend" { + if [[ -z "$CI_DESIRED_NETWORK" ]]; then + # When running on RHEL, CI_DESIRED_NETWORK *must* be defined + # in gating.yaml because some versions of RHEL use CNI, some + # use netavark. + local osrelease=/etc/os-release + if [[ -e $osrelease ]]; then + local osname=$(source $osrelease; echo $NAME) + if [[ $osname =~ Red.Hat ]]; then + die "CI_DESIRED_NETWORK must be set in gating.yaml for RHEL testing" + fi + fi + + # Everywhere other than RHEL, the only supported network is netavark + CI_DESIRED_NETWORK="netavark" + fi + run_podman info --format '{{.Host.NetworkBackend}}' - is "$output" "netavark" "netavark backend" + is "$output" "$CI_DESIRED_NETWORK" ".Host.NetworkBackend" } @test "podman info - confirm desired database" {