2004-06-09 19:09:16 +00:00
|
|
|
<?php
|
2005-02-12 01:26:46 +00:00
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Test framework for BOINC developers (not intended for general use)");
|
2004-06-09 19:09:16 +00:00
|
|
|
echo "
|
2004-12-15 07:08:54 +00:00
|
|
|
See the section on testing in <a href=build.php>Software Prerequisites</a>.
|
2004-02-15 19:22:01 +00:00
|
|
|
Note that a web server with PHP is required for
|
2003-09-04 05:54:55 +00:00
|
|
|
running a real server, but that requires a lot of path and permissions
|
|
|
|
configuration so we opt not to use them in testing.
|
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
<h2>Python testing framework</h2>
|
2003-06-18 03:01:37 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
The <code>test/</code> directory contains a library of Python modules that
|
2004-02-15 19:22:01 +00:00
|
|
|
make end-to-end testing of BOINC easy.
|
|
|
|
See the <a href=python.php>Python framework</a>.
|
2002-10-03 18:33:46 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
<h2>Quick start</h2>
|
|
|
|
Single test:
|
|
|
|
<blockquote>
|
|
|
|
<code> cd boinc/test && ./test_uc.py </code>
|
|
|
|
</blockquote>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
Full test suite:
|
|
|
|
<blockquote>
|
|
|
|
<code> cd boinc/test && make check </code>
|
|
|
|
</blockquote>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
|
|
|
|
2004-06-09 19:09:16 +00:00
|
|
|
After two or three minutes you should see 'Passed Test'.
|
2004-02-15 19:22:01 +00:00
|
|
|
During the test you should see various progress status indicators
|
|
|
|
(resize your window so that the status indicator line fits on one line).
|
2003-08-22 01:37:21 +00:00
|
|
|
|
|
|
|
<h2>Goals of the testing framework</h2>
|
|
|
|
|
2004-02-15 19:22:01 +00:00
|
|
|
The goal of the framework is to support automated testing of BOINC
|
|
|
|
and BOINC applications.
|
|
|
|
Each test is performed by a Python program that
|
2003-08-22 01:37:21 +00:00
|
|
|
initializes the system to a deterministic state, executes the system, detects
|
|
|
|
termination, and returns success or failure depending on the final state.
|
|
|
|
|
2002-10-03 20:41:23 +00:00
|
|
|
<p>
|
2003-08-22 01:37:21 +00:00
|
|
|
|
2004-02-15 19:22:01 +00:00
|
|
|
Many BOINC features involve multiple projects and/or multiple hosts.
|
|
|
|
It would be prohibitively complex to do automated testing on multiple
|
|
|
|
physical hosts.
|
2003-08-22 01:37:21 +00:00
|
|
|
Fortunately the BOINC architecture makes it possible for multiple projects and
|
2004-02-15 19:22:01 +00:00
|
|
|
(virtual) hosts to reside on a single physical host.
|
|
|
|
So the testing framework uses this approach.
|
2002-10-03 20:41:23 +00:00
|
|
|
|
|
|
|
<p>
|
2002-10-04 00:16:41 +00:00
|
|
|
The framework lets you test systems with any of the following attributes:
|
2002-10-03 20:41:23 +00:00
|
|
|
<ul>
|
|
|
|
<li> Multiple projects
|
|
|
|
<li> Multiple applications per project
|
|
|
|
<li> Multiple participants per project
|
|
|
|
<li> Multiple hosts, with arbitrary enrollment in projects
|
|
|
|
</ul>
|
2002-10-04 00:16:41 +00:00
|
|
|
The following system attributes are planned but not implemented yet:
|
|
|
|
<ul>
|
|
|
|
<li> Multiple data servers or scheduling servers per project.
|
|
|
|
<li> Simulated failures of servers and network connections.
|
|
|
|
<li> Simulations of various host conditions
|
|
|
|
(out of disk space, crash/reboot, etc.).
|
|
|
|
</ul>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
2004-02-15 19:22:01 +00:00
|
|
|
<p>
|
|
|
|
TODO: Directory structure
|
2003-08-22 01:37:21 +00:00
|
|
|
|
2004-02-15 19:22:01 +00:00
|
|
|
<p>
|
|
|
|
TODO: Modules/ Classes
|
2003-08-22 01:37:21 +00:00
|
|
|
|
2004-02-15 19:22:01 +00:00
|
|
|
<p>
|
|
|
|
TODO: Example script
|
2003-08-22 01:37:21 +00:00
|
|
|
|
|
|
|
<h2>Test applications</h2>
|
|
|
|
The <code>apps</code> directory contains the following test applications:
|
|
|
|
<ul>
|
2004-02-15 19:22:01 +00:00
|
|
|
<li><code>upper_case</code>: converts a file to upper case.
|
|
|
|
<li><code>concat</code>: concatenates its input files.
|
|
|
|
<li><code>1sec</code>: uses 1 second of CPU time.
|
2003-08-22 01:37:21 +00:00
|
|
|
</ul>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
<h2>Test cases</h2>
|
|
|
|
The <code>test/</code> directory contains various python scripts named with
|
2004-02-15 19:22:01 +00:00
|
|
|
prefix <code>test_</code>.
|
|
|
|
Each of these is a test case which runs an end-to-end test of BOINC
|
|
|
|
(creates directory structure for project(s) and
|
2003-08-22 01:37:21 +00:00
|
|
|
host(s), starts a web server, server daemons, host client(s), and checks
|
|
|
|
output is as expected).
|
|
|
|
<table border=1>
|
|
|
|
<tr><td><code>test_uc.py</code></td>
|
|
|
|
<td>The basic test using <code>uppercase</code></td></tr>
|
|
|
|
<tr><td><code>test_concat.py</code></td>
|
|
|
|
<td> tests command-line arguments and
|
|
|
|
filenames</tr>
|
|
|
|
<tr><td><code>test_uc_slow.py</code></td>
|
|
|
|
<td> tests checkpoint/restart mechanism</tr>
|
|
|
|
<tr><td><code>test_prefs.py</code></td>
|
|
|
|
<td> tests some aspects of preferences.</tr>
|
|
|
|
<tr><td><code>test_water.py</code></td>
|
|
|
|
<td> tests some aspects of water marks.</tr>
|
|
|
|
<tr><td><code>test_rsc.py</code></td>
|
|
|
|
<td> tests that scheduling server only sends
|
|
|
|
feasible work units.</tr>
|
|
|
|
<tr><td><code>test_pers.py</code></td>
|
|
|
|
<td> tests the persistent file transfers for
|
|
|
|
download and upload. It interrupts them in the middle and makes sure
|
|
|
|
that the filesize never decreases along interrupted transfers.</tr>
|
|
|
|
<tr><td><code>test_masterurl_failure.py</code></td>
|
|
|
|
<td> tests the exponential backoff
|
2004-03-02 03:46:04 +00:00
|
|
|
mechanism on the client in case of master URL failures. This test is
|
2003-08-22 01:37:21 +00:00
|
|
|
not automated. It has to be run, and then client.out (in the host
|
|
|
|
directory) must be looked at to examine whether everything is working
|
|
|
|
correctly.</tr>
|
|
|
|
<tr><td><code>test_sched_failure.py</code></td>
|
|
|
|
<td>tests the exponential backoff mechanism
|
|
|
|
on the client in case of scheduling server failures.
|
|
|
|
This test is not automated.
|
|
|
|
It has to be run, and then client.out (in the host
|
|
|
|
directory) must be looked at to examine whether everything
|
|
|
|
is working correctly.</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<h2>Appendix: Optional Environment Variables</h2>
|
|
|
|
The following environment variables are optional and apply whatever web server
|
|
|
|
you use:
|
2002-10-03 20:41:23 +00:00
|
|
|
<p>
|
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
<code>BOINC_TEST_USER_NAME</code>
|
|
|
|
<blockquote>
|
2004-02-15 19:22:01 +00:00
|
|
|
User name to use for setting up database name.
|
2004-06-12 19:14:40 +00:00
|
|
|
Defaults to <code>\$USER</code>
|
2003-08-22 01:37:21 +00:00
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
<code>BOINC_TEST_VERBOSE</code>
|
|
|
|
<blockquote>
|
|
|
|
Verbosity level.
|
|
|
|
<table border=1>
|
|
|
|
<tr><td><code>0</code></td><td>print nothing</td></tr>
|
2004-02-15 19:22:01 +00:00
|
|
|
<tr><td><code>1</code> [default]</td><td>print some.
|
|
|
|
If output is a tty, overwrite lines.</td>
|
2003-08-22 01:37:21 +00:00
|
|
|
<tr><td><code>2</code></td><td>print all</td>
|
|
|
|
</table>
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
<code>BOINC_TEST_DELETE</code>
|
|
|
|
<blockquote>
|
2004-02-15 19:22:01 +00:00
|
|
|
Specifies whether or not to delete testbed after the test finishes.
|
|
|
|
Only relevant when BOINC_TEST_AUTO_SETUP=0.
|
|
|
|
Possible values (case doesn't matter):
|
2003-08-22 01:37:21 +00:00
|
|
|
<table border=1>
|
|
|
|
<tr><td><code>No</code></td></tr>
|
|
|
|
<tr><td><code>If-Successful</code> [default]</td></tr>
|
|
|
|
<tr><td><code>Always</code></td></tr>
|
|
|
|
</table>
|
|
|
|
</blockquote>
|
|
|
|
<code>BOINC_TEST_INSTALL_METHOD</code>
|
|
|
|
<blockquote>
|
2004-02-15 19:22:01 +00:00
|
|
|
Specifies how to install html/php, CGI from source directories to testbed
|
2003-08-22 01:37:21 +00:00
|
|
|
location.
|
|
|
|
<table border=1>
|
|
|
|
<tr><td><code>link</code> </td><td>hardlink</td></tr>
|
|
|
|
<tr><td><code>symlink</code> [default]</td><td>symbolic link</td></tr>
|
|
|
|
<tr><td><code>copy</code> </td><td>copy</td></tr>
|
|
|
|
</table>
|
|
|
|
Copying is useful because it preserves what version of the file was used
|
|
|
|
in a particular test run and hardlinking is best because compiled cgi and
|
|
|
|
scheduler programs are not disrupted by parallel builds.
|
|
|
|
</blockquote>
|
|
|
|
|
|
|
|
<h2>Appendix: Web Server</h2>
|
|
|
|
|
|
|
|
By default, the test script will use a custom web server that has no security
|
2004-02-15 19:22:01 +00:00
|
|
|
and minimal cgi/php capability.
|
|
|
|
You can also use Apache or some other web server with manually
|
|
|
|
initialized directories by setting these environment variables:
|
2003-08-22 01:37:21 +00:00
|
|
|
|
|
|
|
<blockquote>
|
2002-10-03 20:41:23 +00:00
|
|
|
<pre>
|
2003-08-22 01:37:21 +00:00
|
|
|
BOINC_TEST_AUTO_SETUP=0 [default=1]
|
|
|
|
BOINC_TEST_KEY_DIR
|
|
|
|
BOINC_TEST_PROJECTS_DIR
|
|
|
|
BOINC_TEST_CGI_URL
|
|
|
|
BOINC_TEST_HTML_URL
|
|
|
|
BOINC_TEST_CGI_DIR
|
|
|
|
BOINC_TEST_HTML_DIR
|
|
|
|
BOINC_TEST_HOSTS_DIR
|
2002-10-03 20:41:23 +00:00
|
|
|
</pre>
|
2003-08-22 01:37:21 +00:00
|
|
|
</blockquote>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
<h3>Example setup</h3>
|
|
|
|
Bourne shell:
|
2002-10-03 18:33:46 +00:00
|
|
|
<pre>
|
2003-08-22 01:37:21 +00:00
|
|
|
QHOME=/disks/philmor/a/users/quarl/proj
|
2004-06-12 19:14:40 +00:00
|
|
|
TOP=\$QHOME/test-boinc
|
2003-08-22 01:37:21 +00:00
|
|
|
URL=http://milhouse.ssl.berkeley.edu/quarl
|
|
|
|
|
2004-06-12 19:14:40 +00:00
|
|
|
export BOINC_TEST_PROJECTS_DIR=\$TOP/projects
|
2003-08-22 01:37:21 +00:00
|
|
|
export BOINC_TEST_USER_NAME=quarl
|
2004-06-12 19:14:40 +00:00
|
|
|
export BOINC_TEST_SRC_DIR=\$QHOME/boinc
|
|
|
|
export BOINC_TEST_CGI_DIR=\$TOP/boinc_cgi
|
|
|
|
export BOINC_TEST_CGI_URL=\$URL/boinc_cgi
|
|
|
|
export BOINC_TEST_HTML_DIR=\$TOP/boinc_html
|
|
|
|
export BOINC_TEST_HTML_URL=\$URL/boinc_html
|
2003-08-22 01:37:21 +00:00
|
|
|
export BOINC_TEST_SHMEM_KEY=0x1717f00f
|
2004-06-12 19:14:40 +00:00
|
|
|
export BOINC_TEST_KEY_DIR=\$TOP/keys
|
|
|
|
export BOINC_TEST_HOSTS_DIR=\$TOP/host
|
2002-10-03 18:33:46 +00:00
|
|
|
</pre>
|
2002-10-03 20:41:23 +00:00
|
|
|
|
2003-08-22 01:37:21 +00:00
|
|
|
Apache configuration:
|
2002-10-03 20:41:23 +00:00
|
|
|
<pre>
|
2003-08-22 01:37:21 +00:00
|
|
|
<Directory /disks/philmor/a/users/quarl/proj/test-boinc>
|
|
|
|
AllowOverride FileInfo AuthConfig Limit
|
|
|
|
Options Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI
|
|
|
|
<Limit GET POST OPTIONS PROPFIND>
|
|
|
|
Order allow,deny
|
|
|
|
Allow from all
|
|
|
|
</Limit>
|
|
|
|
</Directory>
|
|
|
|
|
2004-06-09 19:09:16 +00:00
|
|
|
ScriptAlias /quarl/boinc_cgi/ \"/disks/philmor/a/users/quarl/proj/test-boinc/boinc_cgi/\"
|
|
|
|
Alias /quarl/ \"/disks/philmor/a/users/quarl/proj/test-boinc/\"
|
2002-10-03 20:41:23 +00:00
|
|
|
</pre>
|
|
|
|
|
2004-06-09 19:09:16 +00:00
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
?>
|