Skip to content

Commit

Permalink
Merge pull request #149 from cevich/never_packages
Browse files Browse the repository at this point in the history
Fix dnf update installing netavark/aardvark-dns
  • Loading branch information
cevich authored Jul 15, 2022
2 parents c4b1e45 + 5a59173 commit 7731369
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
16 changes: 13 additions & 3 deletions cache_images/fedora-netavark_packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,26 @@ INSTALL_PACKAGES=(\
zip
)

EXARG="--exclude=netavark --exclude=aardvark-dns --exclude=cargo --exclude=rust"
EXARG="--exclude=cargo --exclude=rust"

msg "Installing general build/test dependencies"
bigto $SUDO dnf install -y $EXARG "${INSTALL_PACKAGES[@]}"

# It was observed in F33, dnf install doesn't always get you the latest/greatest
lilto $SUDO dnf update -y
# It was observed in F33, dnf install doesn't always get you the latest/greatest.
lilto $SUDO dnf update -y $EXARG

msg "Initializing upstream rust environment."
export CARGO_HOME="/var/cache/cargo" # must match .cirrus.yml in netavark repo
$SUDO mkdir -p $CARGO_HOME
# CI Runtime takes care of recovering $CARGO_HOME/env
curl https://sh.rustup.rs -sSf | $SUDO env CARGO_HOME=$CARGO_HOME sh -s -- -y

# Downstream users of this image are specifically testing netavark & aardvark-dns
# code changes. We want to start with using the RPMs because they deal with any
# dependency issues. However, we don't actually want the binaries present on
# the system, because:
# 1) They will be compiled from source at runtime
# 2) The file locations may change
# 3) We never want testing ambiguity WRT which binary is under test.
msg "Clobbering netavark & aardvark RPM files"
remove_netavark_aardvark_files
2 changes: 2 additions & 0 deletions get_ci_vm/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ mock_gcevm_workflow() {
}
# Don't confuse the actual repo. by nesting another repo inside
tar -xzf "$GOOD_TEST_REPO/dot_git.tar.gz" -C "$GOOD_TEST_REPO" .git
# Ignore ownership security checks
git config --system --add safe.directory $GOOD_TEST_REPO
# Setup should tarball new files in the repo.
echo "testing" > "$GOOD_TEST_REPO/uncommited_file"
# Setup should tarball changed files in the repo.
Expand Down
20 changes: 20 additions & 0 deletions lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,26 @@ get_pr_labels() {
echo -n "$labels"
}

remove_netavark_aardvark_files() {
req_env_vars OS_RELEASE_ID
# OS_RELEASE_ID is defined by automation-library
# shellcheck disable=SC2154
if [[ "$OS_RELEASE_ID" =~ "ubuntu" ]]
then
die "Ubuntu netavark/aardvark-dns testing is not supported"
fi

LISTING_CMD="rpm -ql podman"

# yum/dnf/dpkg may list system directories, only remove files
rpm -ql netavark aardvark-dns | while read fullpath
do
# Sub-directories may contain unrelated/valuable stuff
if [[ -d "$fullpath" ]]; then continue; fi
sudo rm -vf "$fullpath"
done
}

# Warning: DO NOT USE the following functions willy-nilly!
# They are only intended to be called by other setup scripts, as the very
# last step during the build process. They're purpose is to "reset" the
Expand Down

0 comments on commit 7731369

Please sign in to comment.