From be075a9bdd37b3770394eb33d81226be80bb1d40 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Thu, 8 Nov 2012 14:29:42 +0100 Subject: [PATCH] be more verbose --- liveboot_testdeploy.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/liveboot_testdeploy.sh b/liveboot_testdeploy.sh index a3700d3..fd6f24e 100755 --- a/liveboot_testdeploy.sh +++ b/liveboot_testdeploy.sh @@ -17,7 +17,7 @@ MAILTO=liveboot-announce@profitbricks.com # check if we have a LIVEBOOT_ID # if [ "$LIVEBOOT_ID" != "" ] ; then - echo "Ok, got LIVEBOOT_ID=$LIVEBOOT_ID" + echo "Ok, got LIVEBOOT_ID=$LIVEBOOT_ID, which is valid." else echo "Fail, no LIVEBOOT_ID set." exit 1 @@ -27,6 +27,7 @@ fi # if [ -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ ] ; then SOURCE_DIR=$(ls -d /srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/) + echo "Ok, found directory $SOURCE_DIR" else figlet "Failure:" echo "/srv/mirror/liveboot/liveboot-????????-${LIVEBOOT_ID}/ does not exist." @@ -42,21 +43,36 @@ fi # # reboot TESTSERVER # +echo "Scheduling hard-reset of $TESTSERVER via IPMI on $TESTSERVER_MGMT_IP" cat $TESTSERVER_MGMT_PASSWD_FILE | ipmitool -H $TESTSERVER_MGMT_IP -U ADMIN -a chassis power reset +# +# Test if it's gone +# +sleep 3 +if $(ping -c 1 $TESTSERVER >/dev/null) ; then + figlet "Warning:" + echo "$TESTSERVER responds to pings, even though it was reseted 3secs ago, this should not happen, please investigate manually." + exit 1 +fi + # # check for 10min whether it's up again # +echo -n "Pinging $TESTSERVER..." for i in $(seq 1 60) ; do sleep 10 + echo -n "." if $(ping -c 1 $TESTSERVER >/dev/null) ; then echo - echo "Ok, pings again..." + echo + echo "$TESTSERVER pings again, so we assume it's up." break fi done if ! $(ping -c 1 $TESTSERVER >/dev/null) ; then - figlet "Warning" + echo + figlet "Failure:" echo "$TESTSERVER still down, please investigate." exit 1 fi @@ -66,16 +82,16 @@ fi # MAIL=$SOURCE_DIR/mail.txt if [ ! -e $MAIL ] ; then - figlet "Warning" + figlet "Warning:" echo "$MAIL does not exist, something wrong with liveboot-web?" exit 1 fi -cat $MAIL | /usr/sbin/sendmail $MAILTO && echo "Mail to $MAILTO send." +cat $MAIL | /usr/sbin/sendmail $MAILTO && echo "Ok, mail to $MAILTO send." # # finish # figlet Ok -echo "$TESTSERVER pings again, so we assume it's up." +echo echo "Please continue manual testing of $(basename $SOURCE_DIR)" -- 2.39.5