summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Chisamore <schisamo@chef.io>2018-11-01 14:20:30 -0400
committerTim Smith <tsmith@chef.io>2018-11-01 13:54:42 -0700
commitd797b1ec1fc6ca77f599972d84de36fd31e47b4a (patch)
tree3d3314f331022bc193649dd6c4f767d2d4600fb8
parent20bb55aa84440778c7f7a0ec99739b3ef10ea423 (diff)
downloadchef-d797b1ec1fc6ca77f599972d84de36fd31e47b4a.tar.gz
Automatically rebuild RPM database on EL6 testers
Our tests hammer YUM pretty hard and the EL6 testers get corrupted after some period of time. Rebuilding the RPM database clears up the underlying corruption. We'll do this each test run just to be safe. Signed-off-by: Seth Chisamore <schisamo@chef.io>
-rwxr-xr-xci/verify-chef.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh
index 3db37a5cf6..a171f3428b 100755
--- a/ci/verify-chef.sh
+++ b/ci/verify-chef.sh
@@ -2,6 +2,18 @@
set -evx
+# Our tests hammer YUM pretty hard and the EL6 testers get corrupted
+# after some period of time. Rebuilding the RPM database clears
+# up the underlying corruption. We'll do this each test run just to
+# be safe.
+if [ -f /etc/redhat-release ]; then
+ major_version=`sed 's/^.\+ release \([0-9]\+\).*/\1/' /etc/redhat-release`
+ if [ "$major_version" -lt "7" ]; then
+ sudo rm -rf /var/lib/rpm/__db.00*
+ sudo rpm --rebuilddb
+ fi
+fi
+
# Set up a custom tmpdir, and clean it up before and after the tests
TMPDIR="${TMPDIR:-/tmp}/cheftest"
export TMPDIR