summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorSeth Chisamore <schisamo@chef.io>2018-11-01 14:51:26 -0400
committerGitHub <noreply@github.com>2018-11-01 14:51:26 -0400
commit91bae4d97cabfd849501a254720f01cfc177ec64 (patch)
tree3e80d4feec0f470eb1e85f8b5ccdf02744aa3b4d /ci
parentba0838c32e2673803165ab7b9c399913aa3d660d (diff)
parent2ec72e1aad0eda1722211c8d68551d79c69114c2 (diff)
downloadchef-91bae4d97cabfd849501a254720f01cfc177ec64.tar.gz
Merge pull request #7845 from chef/schisamo/cleanup-rpmdb
Automatically rebuild RPM database on EL6 testers
Diffstat (limited to 'ci')
-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