diff --git a/slave_scripts/wait_for_nova.sh b/slave_scripts/wait_for_nova.sh new file mode 100755 index 00000000..417f34f7 --- /dev/null +++ b/slave_scripts/wait_for_nova.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +URL=$1 + +echo "Jenkins: Waiting for Nova to start on infrastructure node" +RET=7 +while [ $RET != 0 ]; do + curl -s $URL >/dev/null + RET=$? + sleep 1 +done +echo "Jenkins: Nova is running." diff --git a/slave_scripts/wait_for_puppet.sh b/slave_scripts/wait_for_puppet.sh new file mode 100755 index 00000000..9f6bdd02 --- /dev/null +++ b/slave_scripts/wait_for_puppet.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# wait_for_pupet.sh LOGFILE HOSTNAME [HOSTNAME...] +# Search LOGFILE for puppet completion on each host + +FINISH_RE="puppet-agent\[.*\]: Finished catalog run in .* seconds" +LOGFILE=$1 +shift +HOSTS=$@ + +echo "Jenkins: Waiting for puppet to complete on all nodes" +DONE=0 +while [ $DONE != 1 ]; do + DONE=0 + for hostname in $HOSTS + do + if (grep "$hostname $FINISH_RE" $LOGFILE >/dev/null); then DONE=1; fi + done + sleep 5 +done +echo "Jenkins: Puppet is complete." diff --git a/slave_scripts/watch_deploy.py b/slave_scripts/watch_deploy.py deleted file mode 100755 index 2b326d6b..00000000 --- a/slave_scripts/watch_deploy.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -# Tail a syslog file printing each line while looking for indications -# that puppet has completed its initial run on each host. -# Once puppet is finished, wait 30 seconds (for any further interesting -# log entries), then exit. - -import re -import time -import sys - -HOSTS = set(['baremetal%02i'%(x+1) for x in range(4)]) -LOGFILE = "/var/log/deploy.log" -COMPLETE_RE = re.compile(r'^\w+ \w+ \d\d:\d\d:\d\d (\w+) puppet-agent\[\d+\]: Finished catalog run in \S+ seconds$') -EXIT_DELAY = 30 - -logf = open(LOGFILE) -completed_hosts = set() -exit_time = None - -while True: - now = time.time() - if exit_time and exit_time < now: - sys.exit(0) - - where = logf.tell() - line = logf.readline() - if not line: - time.sleep(1) - logf.seek(where) - continue - - sys.stdout.write(line) - sys.stdout.flush() - m = COMPLETE_RE.match(line) - if m: - completed_hosts |= set([m.group(1)]) - if completed_hosts == HOSTS: - exit_time = time.time() + EXIT_DELAY