# 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
#
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."
#
# 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
#
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)"