summaryrefslogtreecommitdiff
path: root/contrib/cirrus/check_image.sh
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-27 03:31:35 +0200
committerGitHub <noreply@github.com>2019-06-27 03:31:35 +0200
commitfccf4ad50327d6b74b3d3fa54bce449ea93a85cf (patch)
tree5cf8fdd676243dae9e4618df5a6d644a3156148d /contrib/cirrus/check_image.sh
parent7705f99fe6cabe5028483e623b21177e25cc5d6f (diff)
parentcd78825be7e5006140a49a26146f9123aeafd1d3 (diff)
downloadpodman-fccf4ad50327d6b74b3d3fa54bce449ea93a85cf.tar.gz
podman-fccf4ad50327d6b74b3d3fa54bce449ea93a85cf.tar.bz2
podman-fccf4ad50327d6b74b3d3fa54bce449ea93a85cf.zip
Merge pull request #3193 from cevich/check_image
Cirrus: More tests to verify cache_images
Diffstat (limited to 'contrib/cirrus/check_image.sh')
-rwxr-xr-xcontrib/cirrus/check_image.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/cirrus/check_image.sh b/contrib/cirrus/check_image.sh
new file mode 100755
index 000000000..948039234
--- /dev/null
+++ b/contrib/cirrus/check_image.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -eo pipefail
+
+source $(dirname $0)/lib.sh
+
+RET=0
+echo "Validating VM image"
+
+MIN_SLASH_GIGS=50
+read SLASH_DEVICE SLASH_FSTYPE SLASH_SIZE JUNK <<<$(findmnt --df --first-only --noheadings / | cut -d '.' -f 1)
+SLASH_SIZE_GIGS=$(echo "$SLASH_SIZE" | sed -r -e 's/G|g//')
+item_test "Minimum available disk space" $SLASH_SIZE_GIGS -gt $MIN_SLASH_GIGS || let "RET+=1"
+
+MIN_MEM_MB=2000
+read JUNK TOTAL USED MEM_FREE JUNK <<<$(free -tm | tail -1)
+item_test 'Minimum available memory' $MEM_FREE -ge $MIN_MEM_MB || let "RET+=1"
+
+item_test "podman command NOT found on path" -z "$(type -P podman)" || let "RET+=1"
+
+MIN_ZIP_VER='3.0'
+VER_RE='.+([[:digit:]]+\.[[:digit:]]+).+'
+ACTUAL_VER=$(zip --version 2>&1 | egrep -m 1 "Zip$VER_RE" | sed -r -e "s/$VER_RE/\\1/")
+item_test "minimum zip version" "$MIN_ZIP_VER" = $(echo -e "$MIN_ZIP_VER\n$ACTUAL_VER" | sort -V | head -1) || let "RET+=1"
+
+for REQ_UNIT in google-accounts-daemon.service \
+ google-clock-skew-daemon.service \
+ google-instance-setup.service \
+ google-network-daemon.service \
+ google-shutdown-scripts.service \
+ google-startup-scripts.service
+do
+ item_test "required $REQ_UNIT enabled" \
+ "$(systemctl list-unit-files --no-legend $REQ_UNIT)" = "$REQ_UNIT enabled" || let "RET+=1"
+done
+
+exit $RET