[CalendarServer-changes] [13968] CalendarServer/trunk/bin
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 16 19:20:10 PDT 2014
Revision: 13968
http://trac.calendarserver.org//changeset/13968
Author: sagen at apple.com
Date: 2014-09-16 19:20:09 -0700 (Tue, 16 Sep 2014)
Log Message:
-----------
testserver now creates a "sandbox" for CDT to run the calendar server in (and also starts/stops the server)
Modified Paths:
--------------
CalendarServer/trunk/bin/run
CalendarServer/trunk/bin/testserver
Modified: CalendarServer/trunk/bin/run
===================================================================
--- CalendarServer/trunk/bin/run 2014-09-16 19:33:31 UTC (rev 13967)
+++ CalendarServer/trunk/bin/run 2014-09-17 02:20:09 UTC (rev 13968)
@@ -93,7 +93,7 @@
OPTIND=1;
print_path="false";
print_environment="false";
- while getopts "ahsfnpedkrK:i:I:b:t:S:P:R:" option; do
+ while getopts "ahsfnpedkrc:K:i:I:b:t:S:P:R:" option; do
case "${option}" in
'?') usage; ;;
'h') usage -; exit 0; ;;
@@ -102,6 +102,7 @@
'r') restart="true"; do_setup="false"; ;;
'd') daemonize=""; ;;
'P') plugin_name="${OPTARG}"; ;;
+ 'c') config="${OPTARG}"; ;;
'R') reactor="-R ${OPTARG}"; ;;
't') service_type="${OPTARG}"; ;;
'K') read_key="${OPTARG}"; ;;
Modified: CalendarServer/trunk/bin/testserver
===================================================================
--- CalendarServer/trunk/bin/testserver 2014-09-16 19:33:31 UTC (rev 13967)
+++ CalendarServer/trunk/bin/testserver 2014-09-17 02:20:09 UTC (rev 13968)
@@ -60,7 +60,7 @@
}
while getopts 'hvrozt:s:d:x:' option; do
- case "$option" in
+ case "$option" in
'?') usage; ;;
'h') usage -; exit 0; ;;
't') cdt="${OPTARG}"; serverinfo="${OPTARG}/scripts/server/serverinfo.xml"; ;;
@@ -87,5 +87,45 @@
do_setup="false";
develop > /dev/null;
+# Set up sandbox
+
+sandboxdir="/tmp/cdt_server_sandbox"
+
+if [ -d "${sandboxdir}" ]; then
+ rm -rf "${sandboxdir}"
+fi;
+
+mkdir -p "${sandboxdir}/Config" "${sandboxdir}/Data" "${sandboxdir}/Logs" "${sandboxdir}/Run"
+
+cp conf/caldavd-test.plist "${sandboxdir}/Config/caldavd-cdt.plist"
+cp conf/auth/proxies-test.xml "${sandboxdir}/Data/proxies-cdt.xml"
+cp conf/auth/resources-test.xml "${sandboxdir}/Data/resources-cdt.xml"
+cp conf/auth/augments-test.xml "${sandboxdir}/Data/augments-cdt.xml"
+cp conf/auth/accounts-test.xml "${sandboxdir}/Data/accounts-cdt.xml"
+
+# Modify the plist
+
+plutil -replace ServerRoot -string "${sandboxdir}" "${sandboxdir}/Config/caldavd-cdt.plist"
+plutil -replace ConfigRoot -string "Config" "${sandboxdir}/Config/caldavd-cdt.plist"
+plutil -replace ProxyLoadFromFile -string "${sandboxdir}/Data/proxies-cdt.xml" "${sandboxdir}/Config/caldavd-cdt.plist"
+plutil -replace ResourceService.params.xmlFile -string "${sandboxdir}/Data/resources-cdt.xml" "${sandboxdir}/Config/caldavd-cdt.plist"
+plutil -replace DirectoryService.params.xmlFile -string "${sandboxdir}/Data/accounts-cdt.xml" "${sandboxdir}/Config/caldavd-cdt.plist"
+plutil -replace AugmentService.params.xmlFile -xml "<array><string>${sandboxdir}/Data/augments-cdt.xml</string></array>" "${sandboxdir}/Config/caldavd-cdt.plist"
+
+# Start the server
+
+"${wd}/bin/run" -nd -c /tmp/cdt_server_sandbox/Config/caldavd-cdt.plist
+
+echo "Waiting 10 seconds for server to start up"
+sleep 10
+
+# Run CDT
+
+echo "Starting CDT run"
cd "${cdt}" && "${python}" testcaldav.py ${random} ${seed} ${ssl} --print-details-onfail ${printres} -s "${serverinfo}" ${subdir} "$@";
+# Stop the server -- FIXME: if the CDT test fails, for some reason the
+# following lines don't execute...
+
+echo "Stopping server"
+"${wd}/bin/run" -nk -c /tmp/cdt_server_sandbox/Config/caldavd-cdt.plist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140916/bd01abcf/attachment-0001.html>
More information about the calendarserver-changes
mailing list