Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #103 from opscode/lcg/omnitruck-install-de-bourne-…
Browse files Browse the repository at this point in the history
…fixes

port client-test fixes into install-test
  • Loading branch information
lamont-granquist committed Oct 22, 2013
2 parents d8e2536 + 039747d commit 1cc6455
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions jenkins/install-test
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,16 @@ env
sleep $SLEEP_TIME

# Check whether a command exists - returns 0 if it does, 1 if it does not
exists()
{
if command -v $1 >/dev/null 2>&1
then
exists() {
if command -v $1 >/dev/null 2>&1; then
return 0
else
return 1
fi
}

# SmartOS builds in /opt/local instead
is_smartos()
{
is_smartos() {
uname -v | grep "^joyent" 2>&1 >/dev/null
}

Expand All @@ -39,29 +36,25 @@ else
fi

# remove the chef package / clobber the files
if exists dpkg;
then
if exists dpkg; then
sudo dpkg -P chef || true
elif exists rpm;
then
elif exists rpm; then
sudo rpm -ev chef || true
elif exists pkgadd;
then
elif exists pkgadd; then
cat <<EOF > /tmp/nocheck
conflict=nocheck
action=nocheck
EOF
if ! sudo pkgrm -a /tmp/nocheck -n chef; then
echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
echo "The postrm script from the *prior* installation has broken on Solaris."
echo "Removing that script so that subsequent pkgadd's will succeed."
echo "The fact that you can run this again and it does not break does not necessarily"
echo "mean that you can ignore this warning. This test will flap red and green even"
echo "though the postremove script is always broken. Investigate the postremove script"
echo "and determine WHY it failed, and make sure you use 20th century /bin/sh to test it."
echo "WARNING WARNING WARNING WARNING WARNING WARNING WARNING"
if sudo pkgrm -a /tmp/nocheck -n chef; then
:
else
echo "WARNING: a 'no package to deinstall' error is normal here"
echo "WARNING: attempting to fix busted postremove anyway because I'm dumb..."
echo "WARNING: if this is really a busted postremove you should fix that..."
echo "WARNING: (but that should have been caught in the client-test script)"
sudo rm -f /var/sadm/pkg/chef/install/postremove || true
exit 1
sudo pkgrm -a /tmp/nocheck -n chef || true
echo "WARNING: a 'no package to deinstall error' is normal here"
fi
else # makeself installer
:
Expand All @@ -78,8 +71,7 @@ sudo rm -f $PREFIX/bin/knife || true
sudo rm -f $PREFIX/bin/shef || true
sudo rm -f $PREFIX/bin/ohai || true

if exists curl;
then
if exists curl; then
curl -L "${OMNITRUCK_BASE_URL}/chef/install.sh" | sudo bash -s -- -v $INSTALL_CHEF_VERSION
else
wget -qO- "${OMNITRUCK_BASE_URL}/chef/install.sh" | sudo bash -s -- -v $INSTALL_CHEF_VERSION
Expand Down

0 comments on commit 1cc6455

Please sign in to comment.