<html><head><metahttp-equiv="Content-Type"content="text/html; charset=ISO-8859-1"><title>Automated Testing</title><metaname="generator"content="DocBook XSL Stylesheets V1.64.1"><linkrel="home"href="index.html"title="Automated Testing"><linkrel="next"href="install.html"title="Installation"><linkrel="stylesheet"href="openacs.css"type="text/css"></head><bodybgcolor="white"text="black"link="#0000FF"vlink="#840084"alink="#0000FF"><divclass="navheader"><ahref="http://openacs.org"><imgsrc="/doc/images/alex.jpg"border="0"alt="Alex logo"></a><tablewidth="100%"summary="Navigation header"border="0"><tr><tdwidth="20%"align="left"></td><thwidth="60%"align="center"></th><tdwidth="20%"align="right"><aaccesskey="n"href="install.html">Next</a></td></tr></table><hr></div><divclass="article"lang="en"><divclass="titlepage"><div><div><h2class="title"><aname="acs-automated-testing"></a>Automated Testing</h2></div></div><div></div><hr></div><divclass="toc"><p><b>Table of Contents</b></p><dl><dt><spanclass="sect1"><ahref="install.html">Installation</a></span></dt><dt><spanclass="sect1"><ahref="usage.html">Usage</a></span></dt><dt><spanclass="sect1"><ahref="requirements.html">Requirements</a></span></dt></dl></div></div><divclass="navfooter"><hr><tablewidth="100%"summary="Navigation footer"><tr><tdwidth="40%"align="left"></td><tdwidth="20%"align="center"></td><tdwidth="40%"align="right"><aaccesskey="n"href="install.html">Next</a></td></tr><tr><tdwidth="40%"align="left"></td><tdwidth="20%"align="center"></td><tdwidth="40%"align="right"> Installation</td></tr></table><hr><address><ahref="mailto:docs@openacs.org">docs@openacs.org</a></address></div><aname="comments"></a><center><ahref="http://openacs.org/doc/index.html#comments">View comments on this page at openacs.org</a></center></body></html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<metaname="generator"content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 15.15), see www.w3.org">
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><p>Automated Testing is part of acs-core, and therefore should already be installed in any OpenACS system. Individual automated tests are stored within each package in package/tcl/test.
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
</div><p>Here's the entire chain of code used to set up auto-rebuilding servers on test.openacs.org</p><div class="itemizedlist"><ul type="disc">
OpenACS docs are written by the named authors, and may be edited by
OpenACS documentation staff.</div><p>Here's the entire chain of code used to set up auto-rebuilding
servers on test.openacs.org</p><div class="itemizedlist"><ul type="disc">
<li>
<p>The master server shows the status of all other servers. For test.openacs.org, it listens on port 80.</p><div class="orderedlist"><ol type="1">
<li><p>The acs-automated-testing parameter <tt class="computeroutput">IsInstallReportServer</tt> is set to 1</p></li><li><p>The acs-automated-testing parameter <tt class="computeroutput">XMLReportDir</tt> is set to <tt class="computeroutput">/var/log/openacs-install</tt>. This is arbitrary - it just needs to be somewhere all the servers can write to.</p></li>
<p>The master server shows the status of all other servers. For
test.openacs.org, it listens on port 80.</p><div class="orderedlist"><ol type="1">
<li><p>The acs-automated-testing parameter <tt class="computeroutput">IsInstallReportServer</tt> is set to 1</p></li><li><p>The acs-automated-testing parameter <tt class="computeroutput">XMLReportDir</tt> is set to <tt class="computeroutput">/var/log/openacs-install</tt>. This is arbitrary -
it just needs to be somewhere all the servers can write to.</p></li>
</ol></div>
</li><li>
<p>For each server that will be monitored:</p><div class="orderedlist"><ol type="1">
<li><p>Suppose the first test server is <span class="replaceable"><span class="replaceable">service1</span></span>. Set up a dedicated user and <a href="http://openacs.org/doc/openacs-5-0-0/openacs.html#install-with-script" target="_top">automated install script</a>.</p></li><li>
<p>To run automated testing automatically each time the server is rebuilt, add this to /home/service1/install/install.tcl:</p><pre class="programlisting"> set do_tclapi_testing "yes"</pre>
<li><p>Suppose the first test server is <span class="replaceable"><span class="replaceable">service1</span></span>. Set
up a dedicated user and <a href="http://openacs.org/doc/openacs-5-0-0/openacs.html#install-with-script" target="_top">automated install script</a>.</p></li><li>
<p>To run automated testing automatically each time the server is
rebuilt, add this to /home/service1/install/install.tcl:</p><pre class="programlisting">
set do_tclapi_testing "yes"
</pre>
</li><li>
<p>Get the results of the automated tests dumped where the master server can see them - in this example, the same directory as above, <tt class="computeroutput">/var/log/openacs-install</tt>, by adding this to install.tcl (requires 5.1):</p><pre class="programlisting"> set install_xml_file "/var/lib/aolserver/service0/packages/acs-core-docs/www/files/install-autotest.xml"</pre><p>This will copy in the file <tt class="computeroutput">install-autotest.xml</tt>:</p><pre class="programlisting"><?xml version="1.0"?>
<p>Get the results of the automated tests dumped where the master
server can see them - in this example, the same directory as above,
<tt class="computeroutput">/var/log/openacs-install</tt>, by adding
this to install.tcl (requires 5.1):</p><pre class="programlisting">
set install_xml_file "/var/lib/aolserver/service0/packages/acs-core-docs/www/files/install-autotest.xml"
</pre><p>This will copy in the file <tt class="computeroutput">install-autotest.xml</tt>:</p><pre class="programlisting">
<?xml version="1.0"?>
<!-- This is an install.xml which can be used to configure servers for reporting their automated test results. Requires acs-automated-testing 5.1.0b2 or better -->
...
...
@@ -39,11 +48,14 @@
</actions>
</application>
</pre><p>which will, during install, configure that parameter in acs-automated-testing on the monitored server.</p>
</pre><p>which will, during install, configure that parameter in
acs-automated-testing on the monitored server.</p>
</li>
</ol></div>
</li><li>
<p>To enable the 'rebuild server' link, edit the file /usr/local/bin/rebuild-server.sh:</p><pre class="programlisting">#!/bin/sh
<p>To enable the 'rebuild server' link, edit the file
# hard-coding the valid server names here for some minimal security
...
...
@@ -55,16 +67,18 @@ case $1 in
exit;;
esac
sudo /home/$1/install/install.sh 2>&1</pre><p>and allow the <tt class="computeroutput">master</tt> user to execute this file as root (this is a limitation of the automatic install script, which must be root). In <tt class="computeroutput">/etc/sudoers</tt>, include a line:</p><pre class="programlisting">master ALL = NOPASSWD: /usr/local/bin/rebuild-server.sh</pre>
sudo /home/$1/install/install.sh 2>&1
</pre><p>and allow the <tt class="computeroutput">master</tt> user to
execute this file as root (this is a limitation of the automatic
install script, which must be root). In <tt class="computeroutput">/etc/sudoers</tt>, include a line:</p><pre class="programlisting">
master ALL = NOPASSWD: /usr/local/bin/rebuild-server.sh