diff options
author | Chris Evich <cevich@redhat.com> | 2019-09-10 13:27:02 -0400 |
---|---|---|
committer | Chris Evich <cevich@redhat.com> | 2019-09-10 16:22:15 -0400 |
commit | a58ac7be7b746855baa84932a49f71114e51655e (patch) | |
tree | 633d73d2676d9731a1038b9d75828d4650cfcac3 | |
parent | c1761ba1ac4155bab82fb9b847ccf96489b98265 (diff) | |
download | podman-a58ac7be7b746855baa84932a49f71114e51655e.tar.gz podman-a58ac7be7b746855baa84932a49f71114e51655e.tar.bz2 podman-a58ac7be7b746855baa84932a49f71114e51655e.zip |
Cirrus: Prevent resident pollution
When constructing VM cache-images, the latest/greatest podman package is
installed to ensure all necessary dependencies are met. Prior to
testing source-built binaries, most of of the packaged files are removed.
However, if the `io.podman` service or socket is enabled/running, it
could cause the packaged podman and varlink binaries to be both resident
and cached. Since this condition would cause very difficult to diagnose
behaviors, add preventative measures to ensure these services are absent
prior to removing packaged podman files.
Signed-off-by: Chris Evich <cevich@redhat.com>
-rw-r--r-- | contrib/cirrus/lib.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index cd8b2ef61..f26eec87f 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -345,6 +345,21 @@ install_test_configs(){ remove_packaged_podman_files(){ echo "Removing packaged podman files to prevent conflicts with source build and testing." req_env_var OS_RELEASE_ID + + # If any binaries are resident they could cause unexpected pollution + for unit in io.podman.service io.podman.socket + do + for state in enabled active + do + if systemctl --quiet is-$state $unit + then + echo "Warning: $unit found $state prior to packaged-file removal" + systemctl --quiet disable $unit || true + systemctl --quiet stop $unit || true + fi + done + done + if [[ "$OS_RELEASE_ID" =~ "ubuntu" ]] then LISTING_CMD="sudo -E dpkg-query -L podman" @@ -359,6 +374,9 @@ remove_packaged_podman_files(){ if [[ -d "$fullpath" ]] || [[ $(basename "$fullpath") == "conmon" ]] ; then continue; fi ooe.sh sudo rm -vf "$fullpath" done + + # Be super extra sure and careful vs performant and completely safe + sync && echo 3 > /proc/sys/vm/drop_caches } systemd_banish(){ |