[28443] in Source-Commits

home help back first fref pref prev next nref lref last post

scripts commit: Add a crontab and wrapper script

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Sep 24 16:47:06 2014

Date: Wed, 24 Sep 2014 16:46:59 -0400
From: Jonathan D Reed <jdreed@mit.edu>
Message-Id: <201409242046.s8OKkxki014133@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/scripts/commit/95cb01d4075ce846d6ba0d3ca3684e2e6978cf8a
commit 95cb01d4075ce846d6ba0d3ca3684e2e6978cf8a
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Tue Sep 23 09:46:05 2014 -0400

    Add a crontab and wrapper script
    
    - Check in a copy of the crontab in use and the wrapper script
      used to test all 3 cluster machine types.

 tests/installer/crontab                  |    3 ++
 tests/installer/test-cluster-machines.sh |   40 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/tests/installer/crontab b/tests/installer/crontab
new file mode 100644
index 0000000..8d9c9d8
--- /dev/null
+++ b/tests/installer/crontab
@@ -0,0 +1,3 @@
+MAILTO=debathena-install-test-errors@mit.edu
+0 8 * * * /home/tester/test-cluster-machines.sh beta
+0 20 * * * /home/tester/test-cluster-machines.sh
diff --git a/tests/installer/test-cluster-machines.sh b/tests/installer/test-cluster-machines.sh
new file mode 100755
index 0000000..f895cde
--- /dev/null
+++ b/tests/installer/test-cluster-machines.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+MACHINES="adjective-animal.mit.edu toy-story-character.mit.edu santa-cruz-operation.mit.edu"
+
+b=""
+betatxt=""
+if [ "$1" = "beta" ]; then
+  b="-b"
+  betatxt="(using the beta installer)"
+fi
+
+notify() {
+  if ! zwrite -q -d -c debathena -i tester \
+    -s "Automated install test" -m "$@"; then
+    echo "Couldn't send zephyr: $@" >&2
+  fi
+}
+
+zcolor() {
+  echo "@{@color($1) $2}"
+}
+
+test_machine() {
+  HOSTNAME="$1"
+  CLUSTER="$(getcluster -p -h "$HOSTNAME" $(lsb_release -sr) | awk '/^APT_RELEASE/ { print $2 }')"
+  [ -z "$CLUSTER" ] && CLUSTER="(unknown apt_release)"
+  LOGFILE="${HOME}/logs/$(uuidgen).log"
+  if /home/tester/install-test.sh $b -h "$HOSTNAME" -l "$LOGFILE"; then
+    notify "$(zcolor green Success:) $CLUSTER cluster machine ${betatxt}"
+  else
+    notify "$(zcolor red FAILED:) $CLUSTER cluster machine ${betatxt}
+Logs can be found in $LOGFILE"
+  fi
+}
+
+for m in $MACHINES; do
+  test_machine "$m"
+done
+
+exit 0

home help back first fref pref prev next nref lref last post