summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-01 14:15:16 -0700
committerGitHub <noreply@github.com>2018-11-01 14:15:16 -0700
commit7d7a7eea99972b5bef8184d75dc3e7377255fb00 (patch)
treef545a441a1a7d5505870cce946f6d5098618de8f
parent20bb55aa84440778c7f7a0ec99739b3ef10ea423 (diff)
parenta318d66266a0c0f49398ea306fccf0000f55e3a9 (diff)
downloadchef-7d7a7eea99972b5bef8184d75dc3e7377255fb00.tar.gz
Merge pull request #7850 from chef/rhel6_tester_fixes
Backport: Avoid rhel 6 DB corruption in jenkins RHEL 6 boxes
-rwxr-xr-xci/verify-chef.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh
index 3db37a5cf6..b6dafa33e4 100755
--- a/ci/verify-chef.sh
+++ b/ci/verify-chef.sh
@@ -2,6 +2,20 @@
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*
+ sudo db_verify /var/lib/rpm/Packages
+ sudo rpm --rebuilddb
+ sudo yum clean all
+ fi
+fi
+
# Set up a custom tmpdir, and clean it up before and after the tests
TMPDIR="${TMPDIR:-/tmp}/cheftest"
export TMPDIR