[CalendarServer-changes] [7407] CalendarServer/trunk/contrib/performance/benchlib.sh

source_changes at macosforge.org source_changes at macosforge.org
Tue May 3 10:53:54 PDT 2011


Revision: 7407
          http://trac.macosforge.org/projects/calendarserver/changeset/7407
Author:   exarkun at twistedmatrix.com
Date:     2011-05-03 10:53:53 -0700 (Tue, 03 May 2011)
Log Message:
-----------
Add extra checks for the existence of configuration state and either exit or skip a step (as appropriate) if it is missing; this makes the benchmarks/profiler more robust against different CalendarServer working copy states.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/benchlib.sh

Modified: CalendarServer/trunk/contrib/performance/benchlib.sh
===================================================================
--- CalendarServer/trunk/contrib/performance/benchlib.sh	2011-05-02 21:01:24 UTC (rev 7406)
+++ CalendarServer/trunk/contrib/performance/benchlib.sh	2011-05-03 17:53:53 UTC (rev 7407)
@@ -60,11 +60,20 @@
   popd
 }
 
+# Ensure that the required configuration file is present, exit if not.
+function check_conf() {
+  if [ ! -e $CONF ]; then
+    echo "Configuration file $CONF is missing."
+    exit 1
+  fi
+}
+
 # Start a CalendarServer in the current directory.  Only return after
 # the specified number of slave processes have written their PID files
 # (which is only a weak metric for "the server is ready to use").
 function start() {
   NUM_INSTANCES=$1
+  check_conf
   PIDDIR=$SOURCE/$($EXTRACT $CONF ServerRoot)/$($EXTRACT $CONF RunRoot)
 
   shift
@@ -81,6 +90,9 @@
 # Stop the CalendarServer in the current directory.  Only return after
 # it has exited.
 function stop() {
+  if [ ! -e $CONF ]; then
+    return
+  fi
   PIDFILE=$SOURCE/$($EXTRACT $CONF ServerRoot)/$($EXTRACT $CONF RunRoot)/$($EXTRACT $CONF PIDFile)
   ./run -k || true
   while :; do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110503/d6049b98/attachment.html>


More information about the calendarserver-changes mailing list