From 365f1d60aa09b44691e9440665581a99f4f8fd9d Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 22 Oct 2013 14:07:33 -0700 Subject: [PATCH 1/2] port client-test fixes into install-test - the pkgrm logic is no longer really necessary, client-test makes sure that a pkgrm works and will fail the build if it doesn't - also some style fixes --- jenkins/install-test | 36 ++++++++++++------------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/jenkins/install-test b/jenkins/install-test index 95facf015..5f21ed535 100755 --- a/jenkins/install-test +++ b/jenkins/install-test @@ -16,10 +16,8 @@ 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 @@ -27,8 +25,7 @@ exists() } # SmartOS builds in /opt/local instead -is_smartos() -{ +is_smartos() { uname -v | grep "^joyent" 2>&1 >/dev/null } @@ -39,29 +36,21 @@ 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 < /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: CLEANING UP BROKEN POSTRM FROM PRIOR INSTALLATION!!!!!!!!!!!!!!!!!!!!!!" sudo rm -f /var/sadm/pkg/chef/install/postremove || true - exit 1 + sudo pkgrm -a /tmp/nocheck -n chef || true fi else # makeself installer : @@ -78,8 +67,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 From 039747dfba20104447f86c6047d2b4c1e7b91f9a Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 22 Oct 2013 14:22:50 -0700 Subject: [PATCH 2/2] better warning message - still confusing --- jenkins/install-test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jenkins/install-test b/jenkins/install-test index 5f21ed535..834de6e37 100755 --- a/jenkins/install-test +++ b/jenkins/install-test @@ -48,9 +48,13 @@ EOF if sudo pkgrm -a /tmp/nocheck -n chef; then : else - echo "WARNING: CLEANING UP BROKEN POSTRM FROM PRIOR INSTALLATION!!!!!!!!!!!!!!!!!!!!!!" + 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 sudo pkgrm -a /tmp/nocheck -n chef || true + echo "WARNING: a 'no package to deinstall error' is normal here" fi else # makeself installer :