<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[15355] CalendarServer/trunk/bin</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/15355">15355</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2015-12-02 12:26:20 -0800 (Wed, 02 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add scripts that launch the server and run various tests.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkbintestserver">CalendarServer/trunk/bin/testserver</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunkbintestpodssim">CalendarServer/trunk/bin/testpodssim</a></li>
<li><a href="#CalendarServertrunkbintestsim">CalendarServer/trunk/bin/testsim</a></li>
<li><a href="#CalendarServertrunkbintestsqlusage">CalendarServer/trunk/bin/testsqlusage</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkbintestpodssim"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/testpodssim (0 => 15355)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/testpodssim         (rev 0)
+++ CalendarServer/trunk/bin/testpodssim        2015-12-02 20:26:20 UTC (rev 15355)
</span><span class="lines">@@ -0,0 +1,169 @@
</span><ins>+#!/bin/sh
+# -*- sh-basic-offset: 2 -*-
+
+##
+# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+wd="$(cd "$(dirname "$0")/.." && pwd -L)";
+
+. "${wd}/bin/_build.sh";
+
+init_build > /dev/null;
+
+sim="${wd}/contrib/performance/loadtest/sim.py";
+
+##
+# Command line handling
+##
+
+ verbose="";
+ config="${wd}/contrib/performance/loadtest/config.plist";
+ clients="${wd}/contrib/performance/loadtest/clients.plist";
+ runtime="--runtime 300";
+
+usage ()
+{
+ program="$(basename "$0")";
+ echo "Usage: ${program} [-r RUNTIME]";
+ echo "Options:";
+ echo " -r Set the runtime";
+
+ if [ "${1-}" = "-" ]; then return 0; fi;
+ exit 64;
+}
+
+while getopts 'r:' option; do
+ case "$option" in
+ '?') usage; ;;
+ 'h') usage -; exit 0; ;;
+ 'r') runtime="--runtime ${OPTARG}"; ;;
+ esac;
+done;
+
+shift $((${OPTIND} - 1));
+
+if [ $# = 0 ]; then
+ set - "--all";
+fi;
+
+##
+# Do The Right Thing
+##
+
+do_setup="false";
+develop > /dev/null;
+
+# Set up sandbox
+
+sandboxdir="/tmp/sim_server_sandbox💣"
+sandboxdir_u="/tmp/sim_server_sandbox\ud83d\udca3"
+
+if [ -d "${sandboxdir}" ]; then
+ rm -rf "${sandboxdir}"
+fi;
+
+configdir="${sandboxdir}/Config"
+serverrootA="${sandboxdir}/podA"
+serverrootB="${sandboxdir}/podB"
+
+configdir_u="${sandboxdir_u}/Config"
+serverrootA_u="${sandboxdir_u}/podA"
+serverrootB_u="${sandboxdir_u}/podB"
+
+mkdir -p "${configdir}/auth"
+mkdir -p "${serverrootA}/Logs" "${serverrootA}/Run" "${serverrootA}/Data/Documents"
+mkdir -p "${serverrootB}/Logs" "${serverrootB}/Run" "${serverrootB}/Data/Documents"
+
+cp conf/caldavd-test.plist "${configdir}/caldavd-sim.plist"
+cp conf/caldavd-test-podA.plist "${configdir}/caldavd-sim-podA.plist"
+cp conf/caldavd-test-podB.plist "${configdir}/caldavd-sim-podB.plist"
+cp conf/auth/proxies-test-pod.xml "${configdir}/auth/proxies-sim.xml"
+cp conf/auth/resources-test-pod.xml "${configdir}/auth/resources-sim.xml"
+cp conf/auth/augments-test-pod.xml "${configdir}/auth/augments-sim.xml"
+cp conf/auth/accounts-test-pod.xml "${configdir}/auth/accounts-sim.xml"
+
+# Modify the plists
+
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/caldavd-sim.plist'); f['ConfigRoot'] = u'${configdir_u}'; f['RunRoot'] = 'Run'; f['Authentication']['Kerberos']['Enabled'] = False; plistlib.writePlist(f, '${configdir}/caldavd-sim.plist');"
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/caldavd-sim-podA.plist'); f['ImportConfig'] = u'${configdir_u}/caldavd-sim.plist'; f['ServerRoot'] = u'${serverrootA_u}'; f['ConfigRoot'] = u'${configdir_u}'; f['ProxyLoadFromFile'] = u'${configdir_u}/auth/proxies-sim.xml'; f['ResourceService']['params']['xmlFile'] = u'${configdir_u}/auth/resources-sim.xml'; f['DirectoryService']['params']['xmlFile'] = u'${configdir_u}/auth/accounts-sim.xml'; f['AugmentService']['params']['xmlFiles'] = [u'${configdir_u}/auth/augments-sim.xml']; plistlib.writePlist(f, '${configdir}/caldavd-sim-podA.plist');"
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/caldavd-sim-podB.plist'); f['ImportConfig'] = u'${configdir_u}/caldavd-sim.plist'; f['ServerRoot'] = u'${serverrootB_u}'; f['ConfigRoot'] = u'${configdir_u}'; f['ProxyLoadFromFile'] = u'${configdir_u}/auth/proxies-sim.xml'; f['ResourceService']['params']['xmlFile'] = u'${configdir_u}/auth/resources-sim.xml'; f['DirectoryService']['params']['xmlFile'] = u'${configdir_u}/auth/accounts-sim.xml'; f['AugmentService']['params']['xmlFiles'] = [u'${configdir_u}/auth/augments-sim.xml']; plistlib.writePlist(f, '${configdir}/caldavd-sim-podB.plist');"
+
+# Modify config to update ports and other bits
+
+cp "${config}" "${configdir}/sim-config.plist"
+config="${configdir}/sim-config.plist"
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/sim-config.plist'); f['servers']['PodB']['enabled'] = True; f['clientDataSerialization']['UseOldData'] = False; plistlib.writePlist(f, '${configdir}/sim-config.plist');"
+
+# Modify clients to update ports and other bits
+
+cp "${clients}" "${configdir}/sim-clients.plist"
+clients="${configdir}/sim-clients.plist"
+
+runpod() {
+        local podsuffix="$1"; shift;
+
+        # Start the server
+        
+        "${wd}/bin/run" -nd -c "${configdir}/caldavd-sim-${podsuffix}.plist"
+        
+        /bin/echo -n "Waiting for server ${podsuffix} to start up..."
+        
+        while [ ! -f "${sandboxdir}/${podsuffix}/Run/caldav-instance-0.pid" ]; do
+         sleep 1
+         /bin/echo -n "."
+        done;
+        
+        echo "Server ${podsuffix} has started"
+}
+
+stoppod() {
+        local podsuffix="$1"; shift;
+
+        echo "Stopping server ${podsuffix}"
+        "${wd}/bin/run" -nk -c "${configdir}/caldavd-sim-${podsuffix}.plist"
+}
+
+runpod "podA";
+runpod "podB";
+
+# Don't exit if sim.py fails, because we need to clean up afterwards.
+
+set +e
+
+# Run Sim
+
+echo ""
+echo "Starting Sim run"
+
+"${python}" "${sim}" --config "${config}" --clients "${clients}" ${runtime}
+
+# Capture exit status of sim.py to use as this script's exit status.
+
+STATUS=$?
+
+# Re-enable exit on failure incase run -nk fails
+
+set -e
+
+stoppod "podA";
+stoppod "podB";
+
+# Exit with the exit status of sim.py, to reflect the test suite's result
+
+exit $STATUS
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/testpodssim
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkbintestserver"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/bin/testserver (15354 => 15355)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/testserver        2015-12-02 19:25:57 UTC (rev 15354)
+++ CalendarServer/trunk/bin/testserver        2015-12-02 20:26:20 UTC (rev 15355)
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> configdir_u="${sandboxdir_u}/Config"
</span><span class="cx"> datadir_u="${sandboxdir_u}/Data"
</span><span class="cx">
</span><del>-mkdir -p "${configdir}/Config" "${sandboxdir}/Logs" "${sandboxdir}/Run" "${datadir}/Documents"
</del><ins>+mkdir -p "${sandboxdir}/Config" "${sandboxdir}/Logs" "${sandboxdir}/Run" "${datadir}/Documents"
</ins><span class="cx">
</span><span class="cx"> cp conf/caldavd-test.plist "${configdir}/caldavd-cdt.plist"
</span><span class="cx"> cp conf/auth/proxies-test.xml "${datadir}/proxies-cdt.xml"
</span></span></pre></div>
<a id="CalendarServertrunkbintestsim"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/testsim (0 => 15355)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/testsim         (rev 0)
+++ CalendarServer/trunk/bin/testsim        2015-12-02 20:26:20 UTC (rev 15355)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+#!/bin/sh
+# -*- sh-basic-offset: 2 -*-
+
+##
+# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+wd="$(cd "$(dirname "$0")/.." && pwd -L)";
+
+. "${wd}/bin/_build.sh";
+
+init_build > /dev/null;
+
+sim="${wd}/contrib/performance/loadtest/sim.py";
+
+##
+# Command line handling
+##
+
+ verbose="";
+ config="${wd}/contrib/performance/loadtest/config.plist";
+ clients="${wd}/contrib/performance/loadtest/clients.plist";
+ runtime="--runtime 300";
+
+usage ()
+{
+ program="$(basename "$0")";
+ echo "Usage: ${program} [-r RUNTIME]";
+ echo "Options:";
+ echo " -r Set the runtime";
+
+ if [ "${1-}" = "-" ]; then return 0; fi;
+ exit 64;
+}
+
+while getopts 'r:' option; do
+ case "$option" in
+ '?') usage; ;;
+ 'h') usage -; exit 0; ;;
+ 'r') runtime="--runtime ${OPTARG}"; ;;
+ esac;
+done;
+
+shift $((${OPTIND} - 1));
+
+##
+# Do The Right Thing
+##
+
+do_setup="false";
+develop > /dev/null;
+
+# Set up sandbox
+
+sandboxdir="/tmp/sim_server_sandbox💣"
+sandboxdir_u="/tmp/sim_server_sandbox\ud83d\udca3"
+
+if [ -d "${sandboxdir}" ]; then
+ rm -rf "${sandboxdir}"
+fi;
+
+configdir="${sandboxdir}/Config"
+datadir="${sandboxdir}/Data"
+
+configdir_u="${sandboxdir_u}/Config"
+datadir_u="${sandboxdir_u}/Data"
+
+mkdir -p "${sandboxdir}/Config" "${sandboxdir}/Logs" "${sandboxdir}/Run" "${datadir}/Documents"
+
+cp conf/caldavd-test.plist "${configdir}/caldavd-sim.plist"
+cp conf/auth/proxies-test.xml "${datadir}/proxies-sim.xml"
+cp conf/auth/resources-test.xml "${datadir}/resources-sim.xml"
+cp conf/auth/augments-test.xml "${datadir}/augments-sim.xml"
+cp conf/auth/accounts-test.xml "${datadir}/accounts-sim.xml"
+
+# Modify the plist
+
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/caldavd-sim.plist'); f['HTTPPort'] = 18008; f['BindHTTPPorts'] = [18008]; f['SSLPort'] = 18443; f['BindSSLPorts'] = [18443]; f['Notifications']['Services']['AMP']['Port'] = 62312; f['ServerRoot'] = u'${sandboxdir_u}'; f['ConfigRoot'] = 'Config'; f['RunRoot'] = 'Run'; f['ProxyLoadFromFile'] = u'${datadir_u}/proxies-sim.xml'; f['ResourceService']['params']['xmlFile'] = u'${datadir_u}/resources-sim.xml'; f['DirectoryService']['params']['xmlFile'] = u'${datadir_u}/accounts-sim.xml'; f['AugmentService']['params']['xmlFiles'] = [u'${datadir_u}/augments-sim.xml']; f['Authentication']['Kerberos']['Enabled'] = False; plistlib.writePlist(f, '${configdir}/caldavd-sim.plist');"
+
+# Modify config to update ports and other bits
+
+cp "${config}" "${configdir}/sim-config.plist"
+config="${configdir}/sim-config.plist"
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/sim-config.plist'); f['servers']['PodA']['uri'] = f['servers']['PodA']['uri'].rsplit(':', 1)[0] + ':18443'; f['clientDataSerialization']['UseOldData'] = False; f['servers']['PodA']['ampPushPort'] = 62312; plistlib.writePlist(f, '${configdir}/sim-config.plist');"
+
+# Modify clients to update ports and other bits
+
+cp "${clients}" "${configdir}/sim-clients.plist"
+clients="${configdir}/sim-clients.plist"
+
+# Start the server
+
+"${wd}/bin/run" -nd -c "${configdir}/caldavd-sim.plist"
+
+/bin/echo -n "Waiting for server to start up..."
+
+while [ ! -f "${sandboxdir}/Run/caldav-instance-0.pid" ]; do
+ sleep 1
+ /bin/echo -n "."
+done;
+
+echo "Server has started"
+
+# Don't exit if sim.py fails, because we need to clean up afterwards.
+
+set +e
+
+# Run Sim
+
+echo "Starting Sim run"
+
+"${python}" "${sim}" --config "${config}" --clients "${clients}" ${runtime}
+
+# Capture exit status of sim.py to use as this script's exit status.
+
+STATUS=$?
+
+# Re-enable exit on failure incase run -nk fails
+
+set -e
+
+echo "Stopping server"
+"${wd}/bin/run" -nk -c "${configdir}/caldavd-sim.plist"
+
+# Exit with the exit status of sim.py, to reflect the sim's result
+
+exit $STATUS
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/testsim
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkbintestsqlusage"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/testsqlusage (0 => 15355)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/testsqlusage         (rev 0)
+++ CalendarServer/trunk/bin/testsqlusage        2015-12-02 20:26:20 UTC (rev 15355)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+#!/bin/sh
+# -*- sh-basic-offset: 2 -*-
+
+##
+# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+wd="$(cd "$(dirname "$0")/.." && pwd -L)";
+
+. "${wd}/bin/_build.sh";
+
+init_build > /dev/null;
+
+sqlusage="${wd}/contrib/performance/sqlusage/sqlusage.py";
+
+##
+# Command line handling
+##
+
+usage ()
+{
+ program="$(basename "$0")";
+ echo "Usage: ${program}";
+ echo "Options:";
+
+ if [ "${1-}" = "-" ]; then return 0; fi;
+ exit 64;
+}
+
+while getopts 'r:' option; do
+ case "$option" in
+ '?') usage; ;;
+ 'h') usage -; exit 0; ;;
+ esac;
+done;
+
+shift $((${OPTIND} - 1));
+
+##
+# Do The Right Thing
+##
+
+do_setup="false";
+develop > /dev/null;
+
+# Set up sandbox
+
+sandboxdir="/tmp/sqlusage_sandbox💣"
+sandboxdir_u="/tmp/sqlusage_sandbox\ud83d\udca3"
+
+if [ -d "${sandboxdir}" ]; then
+ rm -rf "${sandboxdir}"
+fi;
+
+configdir="${sandboxdir}/Config"
+datadir="${sandboxdir}/Data"
+
+configdir_u="${sandboxdir_u}/Config"
+datadir_u="${sandboxdir_u}/Data"
+
+mkdir -p "${sandboxdir}/Config" "${sandboxdir}/Logs" "${sandboxdir}/Run" "${datadir}/Documents"
+
+cp conf/caldavd-test.plist "${configdir}/caldavd-sqlusage.plist"
+cp conf/auth/proxies-test.xml "${datadir}/proxies-sqlusage.xml"
+cp conf/auth/resources-test.xml "${datadir}/resources-sqlusage.xml"
+cp conf/auth/augments-test.xml "${datadir}/augments-sqlusage.xml"
+cp conf/auth/accounts-test.xml "${datadir}/accounts-sqlusage.xml"
+
+# Modify the plist
+
+python -c "import plistlib; f=plistlib.readPlist('${configdir}/caldavd-sqlusage.plist'); f['HTTPPort'] = 18008; f['BindHTTPPorts'] = [18008]; f['SSLPort'] = 18443; f['BindSSLPorts'] = [18443]; f['Notifications']['Services']['AMP']['Port'] = 62312; f['ServerRoot'] = u'${sandboxdir_u}'; f['ConfigRoot'] = 'Config'; f['RunRoot'] = 'Run'; f['ProxyLoadFromFile'] = u'${datadir_u}/proxies-sqlusage.xml'; f['ResourceService']['params']['xmlFile'] = u'${datadir_u}/resources-sqlusage.xml'; f['DirectoryService']['params']['xmlFile'] = u'${datadir_u}/accounts-sqlusage.xml'; f['AugmentService']['params']['xmlFiles'] = [u'${datadir_u}/augments-sqlusage.xml']; f['Authentication']['Kerberos']['Enabled'] = False; f['LogDatabase'] = {}; f['LogDatabase']['Statistics'] = True; plistlib.writePlist(f, '${configdir}/caldavd-sqlusage.plist');"
+
+# Start the server
+
+"${wd}/bin/run" -nd -c "${configdir}/caldavd-sqlusage.plist"
+
+/bin/echo -n "Waiting for server to start up..."
+
+while [ ! -f "${sandboxdir}/Run/caldav-instance-0.pid" ]; do
+ sleep 1
+ /bin/echo -n "."
+done;
+
+echo "Server has started"
+
+# Don't exit if sqlusage.py fails, because we need to clean up afterwards.
+
+set +e
+
+# Run sqlusage
+
+echo "Starting sqlusage run"
+
+"${python}" "${sqlusage}" --port 18008 --event --share "${sandboxdir}/Logs/sqlstats.log"
+
+# Capture exit status of sqlusage.py to use as this script's exit status.
+
+STATUS=$?
+
+# Re-enable exit on failure incase run -nk fails
+
+set -e
+
+echo "Stopping server"
+"${wd}/bin/run" -nk -c "${configdir}/caldavd-sqlusage.plist"
+
+# Exit with the exit status of sqlusage.py, to reflect the sqlusage result
+
+exit $STATUS
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/testsqlusage
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
</div>
</body>
</html>