diff options
author | Chris Evich <cevich@redhat.com> | 2022-01-11 13:53:53 -0500 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2022-01-24 11:06:55 -0500 |
commit | b381d7565a17a939bfe5ba3e650729b5cfd76a24 (patch) | |
tree | 40b8cd106223069d70c1a92b7eaf3c87aff2513b /contrib/cirrus/setup_environment.sh | |
parent | b75d6baf074a61f2119b8619c86bd2fae1cb2833 (diff) | |
download | podman-b381d7565a17a939bfe5ba3e650729b5cfd76a24.tar.gz podman-b381d7565a17a939bfe5ba3e650729b5cfd76a24.tar.bz2 podman-b381d7565a17a939bfe5ba3e650729b5cfd76a24.zip |
Cirrus: Add e2e task w/ upstream netavark
This PR adds the CI mechanisms to obtain the latest upstream netavark
binary, and set a magic env-var to indicate e2e tests should execute
podman with `--network-driver=netavark`. A future commit implement
this functionality within the e2e tests.
Due to the way the new environment is enabled, the standard task name
is too long for github to display without adding ellipsis. Force the
custom task name `Netavark Integration` to workaround this. At some
future point, when netavark is more mainstream/widely supported, this
custom task and upstream binary install can simply be removed - i.e.
netavark will simply be used by default in the normal e2e tasks.
Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/setup_environment.sh')
-rwxr-xr-x | contrib/cirrus/setup_environment.sh | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index 03b954a5b..15cf8805b 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -130,7 +130,7 @@ esac # Required to be defined by caller: The environment where primary testing happens # shellcheck disable=SC2154 case "$TEST_ENVIRON" in - host) + host*) # The e2e tests wrongly guess `--cgroup-manager` option # shellcheck disable=SC2154 if [[ "$CG_FS_TYPE" == "cgroup2fs" ]] || [[ "$PRIV_NAME" == "root" ]] @@ -141,6 +141,35 @@ case "$TEST_ENVIRON" in warn "Forcing CGROUP_MANAGER=cgroupfs" echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment fi + # TODO: For the foreseeable future, need to support running tests + # with and without the latest netavark. Once netavark is more + # stable and widely supported in Fedora, it can be pre-installed + # from its RPM at VM image build-time. + if [[ "$TEST_ENVIRON" =~ netavark ]]; then + req_env_vars NETAVARK_BRANCH NETAVARK_URL NETAVARK_DEBUG + msg "Downloading latest netavark from upstream branch '$NETAVARK_BRANCH'" + curl --fail --location -o /tmp/netavark.zip "${NETAVARK_URL}" + + # Needs to be in a specific location + # ref: https://github.com/containers/common/blob/main/pkg/config/config_linux.go#L39 + _nvdir=/usr/local/libexec/podman + mkdir -p $_nvdir + cd $_nvdir + msg "$PWD" + unzip /tmp/netavark.zip + if ((NETAVARK_DEBUG)); then + warn "Using debug netavark binary" + mv netavark.debug netavark + else + rm netavark.debug + fi + cd - + + chmod 0755 $_nvdir/netavark + restorecon -F -v $_nvdir + msg "Forcing NETWORK_BACKEND=netavark in all subsequent environments." + echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment + fi ;; container) if ((CONTAINER==0)); then # not yet inside a container @@ -247,7 +276,7 @@ case "$TEST_FLAVOR" in # Use existing host bits when testing is to happen inside a container # since this script will run again in that environment. # shellcheck disable=SC2154 - if [[ "$TEST_ENVIRON" == "host" ]]; then + if [[ "$TEST_ENVIRON" =~ host ]]; then if ((CONTAINER)); then die "Refusing to config. host-test in container"; fi @@ -259,7 +288,7 @@ case "$TEST_FLAVOR" in make install PREFIX=/usr ETCDIR=/etc fi else - die "Invalid value for $$TEST_ENVIRON=$TEST_ENVIRON" + die "Invalid value for \$TEST_ENVIRON=$TEST_ENVIRON" fi install_test_configs |