Cirrus: Also download aardvark-dns binary

This involves a minor code-change so the download/install can run in a
loop for the two different repositories and binaries.  Given everything
is exactly the same except the URLs and names.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2022-01-18 16:58:04 -05:00
parent b381d7565a
commit 8842dab686
2 changed files with 30 additions and 20 deletions

View File

@ -9,6 +9,8 @@ env:
DEST_BRANCH: "main" DEST_BRANCH: "main"
# Netavark branch to use when TEST_ENVIRON=host-netavark # Netavark branch to use when TEST_ENVIRON=host-netavark
NETAVARK_BRANCH: "main" NETAVARK_BRANCH: "main"
# Aardvark branch to use
AARDVARK_BRANCH: "main"
# Overrides default location (/tmp/cirrus) for repo clone # Overrides default location (/tmp/cirrus) for repo clone
GOPATH: &gopath "/var/tmp/go" GOPATH: &gopath "/var/tmp/go"
GOBIN: "${GOPATH}/bin" GOBIN: "${GOPATH}/bin"
@ -528,6 +530,8 @@ netavark_integration_test_task:
TEST_ENVIRON: host-netavark TEST_ENVIRON: host-netavark
NETAVARK_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/netavark/success/binary.zip?branch=${NETAVARK_BRANCH}" NETAVARK_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/netavark/success/binary.zip?branch=${NETAVARK_BRANCH}"
NETAVARK_DEBUG: 0 # set non-zero to use the debug-mode binary NETAVARK_DEBUG: 0 # set non-zero to use the debug-mode binary
AARDVARK_URL: "https://api.cirrus-ci.com/v1/artifact/github/containers/aardvark-dns/success/binary.zip?branch=${AARDVARK_BRANCH}"
AARDVARK_DEBUG: 0 # set non-zero to use the debug-mode binary
clone_script: *noop # Comes from cache clone_script: *noop # Comes from cache
gopath_cache: *ro_gopath_cache gopath_cache: *ro_gopath_cache
setup_script: *setup setup_script: *setup

View File

@ -142,30 +142,36 @@ case "$TEST_ENVIRON" in
echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment echo "CGROUP_MANAGER=cgroupfs" >> /etc/ci_environment
fi fi
# TODO: For the foreseeable future, need to support running tests # TODO: For the foreseeable future, need to support running tests
# with and without the latest netavark. Once netavark is more # with and without the latest netavark/aardvark. Once they're more
# stable and widely supported in Fedora, it can be pre-installed # stable and widely supported in Fedora, they can be pre-installed
# from its RPM at VM image build-time. # from its RPM at VM image build-time.
if [[ "$TEST_ENVIRON" =~ netavark ]]; then if [[ "$TEST_ENVIRON" =~ netavark ]]; then
req_env_vars NETAVARK_BRANCH NETAVARK_URL NETAVARK_DEBUG for info in "netavark $NETAVARK_BRANCH $NETAVARK_URL $NETAVARK_DEBUG" \
msg "Downloading latest netavark from upstream branch '$NETAVARK_BRANCH'" "aardvark-dns $AARDVARK_BRANCH $AARDVARK_URL $AARDVARK_DEBUG"; do
curl --fail --location -o /tmp/netavark.zip "${NETAVARK_URL}"
# Needs to be in a specific location read _name _branch _url _debug <<<"$info"
# ref: https://github.com/containers/common/blob/main/pkg/config/config_linux.go#L39 req_env_vars _name _branch _url _debug
_nvdir=/usr/local/libexec/podman msg "Downloading latest $_name from upstream branch '$_branch'"
mkdir -p $_nvdir # Use identifiable archive filename in of a get_ci_env.sh environment
cd $_nvdir curl --fail --location -o /tmp/$_name.zip "$_url"
msg "$PWD"
unzip /tmp/netavark.zip # Needs to be in a specific location
if ((NETAVARK_DEBUG)); then # ref: https://github.com/containers/common/blob/main/pkg/config/config_linux.go#L39
warn "Using debug netavark binary" _pdir=/usr/local/libexec/podman
mv netavark.debug netavark mkdir -p $_pdir
else cd $_pdir
rm netavark.debug msg "$PWD"
fi unzip /tmp/$_name.zip
cd - if ((_debug)); then
warn "Using debug $_name binary"
mv $_name.debug $_name
else
rm $_name.debug
fi
chmod 0755 $_pdir/$_name
cd -
done
chmod 0755 $_nvdir/netavark
restorecon -F -v $_nvdir restorecon -F -v $_nvdir
msg "Forcing NETWORK_BACKEND=netavark in all subsequent environments." msg "Forcing NETWORK_BACKEND=netavark in all subsequent environments."
echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment echo "NETWORK_BACKEND=netavark" >> /etc/ci_environment