diff options
author | Seth Chisamore <schisamo@chef.io> | 2018-11-01 14:20:30 -0400 |
---|---|---|
committer | Seth Chisamore <schisamo@chef.io> | 2018-11-01 14:23:52 -0400 |
commit | 2ec72e1aad0eda1722211c8d68551d79c69114c2 (patch) | |
tree | 3e80d4feec0f470eb1e85f8b5ccdf02744aa3b4d /ci | |
parent | ba0838c32e2673803165ab7b9c399913aa3d660d (diff) | |
download | chef-2ec72e1aad0eda1722211c8d68551d79c69114c2.tar.gz |
Automatically rebuild RPM database on EL6 testersschisamo/cleanup-rpmdb
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>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/verify-chef.sh | 12 |
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 |