summaryrefslogtreecommitdiff
path: root/omnibus/omnibus-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'omnibus/omnibus-test.sh')
-rwxr-xr-x[-rw-r--r--]omnibus/omnibus-test.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/omnibus/omnibus-test.sh b/omnibus/omnibus-test.sh
index 47b21ae431..83c64ff2a6 100644..100755
--- a/omnibus/omnibus-test.sh
+++ b/omnibus/omnibus-test.sh
@@ -21,7 +21,9 @@ sudo rm -rf "$TMPDIR"
mkdir -p "$TMPDIR"
# Verify that we kill any orphaned test processes. Kill any orphaned rspec processes.
-sudo kill -9 $(ps ax | grep 'rspec' | grep -v grep | awk '{ print $1 }') || true
+if [[ $(ps ax | grep 'rspec' | grep -v grep | awk '{ print $1 }') ]]; then
+ sudo kill -9 $(ps ax | grep 'rspec' | grep -v grep | awk '{ print $1 }') || true
+fi
export PATH="/opt/chef/bin:$PATH"
export BIN_DIR="/opt/chef/bin"
@@ -117,5 +119,17 @@ fi
export CHEF_LICENSE=accept-no-persist
cd "$chef_gem"
-sudo -E bundle install --jobs=3 --retry=3
-sudo -E bundle exec rspec --profile -f progress
+
+# only add -E if not on centos 6
+sudo_path="$(command -v sudo)"
+# cspell:disable-next-line
+rhel_sudo="/opt/rh/devtoolset-7/root/usr/bin/sudo"
+sudo_args=""
+if [[ "$sudo_path" != "$rhel_sudo" ]]; then
+ echo "HERE"
+ sudo -E bundle install --jobs=3 --retry=3
+ sudo -E bundle exec rspec --profile -f progress
+else
+ sudo bundle install --jobs=3 --retry=3
+ sudo bundle exec rspec --profile -f progress
+fi