*** empty log message ***

svn path=/trunk/boinc/; revision=2249
This commit is contained in:
Karl Chen 2003-09-04 05:54:55 +00:00
parent 6ba5f3c901
commit ab15527d57
8 changed files with 120 additions and 94 deletions

View File

@ -6086,7 +6086,7 @@ quarl 2003/09/03
- start and add.py know where config.xml and run_state.xml are
(customizable too)
- starting web documentation of python framework
- wrote documentation for python framework; revised other documentation
py/Boinc/ (added entire tree)
Makefile.am
@ -6111,3 +6111,5 @@ quarl 2003/09/03
doc/
python.php (added)
software.php
test.php

69
doc/python.php Normal file
View File

@ -0,0 +1,69 @@
<? // -*- html -*-
// $Id$
require_once("docutil.php");
page_head("Python Framework");
?>
See the section on Python in the <a href=software.php>Software
Prerequisites</a>.
<h1>Structure</h1>
The directory <code>boinc/py/Boinc</code> contains the <code>Boinc</code>
module. This means if you have <code>boinc/py/</code> in your python path you can
write for example:
<blockquote>
<code>from Boinc.setup_project import *</code>
</blockquote>
To ensure <code>boinc/py/</code> is in your python path:
<blockquote>
<code>import boinc_path_config</code>
</blockquote>
This is a special kludge module that <code>configure</code> places in relevant
directories which then modifies <code>sys.path</code> appropriately.
<h2>Project-specific settings</h2>
The module <code>boinc_project_path</code> is imported to get the paths
for <code>config.xml</code> and <code>run_state.xml</code>. The default
paths for these are the parent directory of the invocation script. You can
override these defaults
<ol>
<li> modify this file directly (if you have only one project on your server
or have separate copies for each)
<li> create a new boinc_project_path.py and place it earlier in PYTHONPATH
than the default one
<li> define environment variables
</ol>
Example <code>boinc_project_path.py</code>
<pre>
config_xml_filename = '/etc/boinc/yetiathome/config.xml'
run_state_xml_filename = '/var/lib/boinc/yetiathome/run_state.xml'
</pre>
See the source of file <code>boinc/py/Boinc/boinc_project_path.py</code> for
details.
<h2>Directories containing python scripts</h2>
<table border=1 width=100%>
<tr><td><code>boinc/py/</code></td><td> <code>Boinc/*.py</code> </td> <td>
Main BOINC python modules
</td></tr>
<tr><td><code>boinc/sched/</code></td><td> <code>start</code> </td> <td>
BOINC start / Super Cron program
</td></tr>
<tr><td><code>boinc/tools/</code></td><td> <code>add</code> </td> <td>
Adds objects to the database
</td></tr>
<tr><td><code>boinc/test/</code></td><td> <code>test*.py<br>cgiserver.py</code> </td> <td>
Test scripts: see the <a href=test.php>testing framework</a>.
</td></tr>
</table>
<?
page_tail();
?>

View File

@ -19,27 +19,36 @@ Required for <b>compiling</b>:
<li>Other standard development tools assumed: make, gzip, etc.
</ul>
Required to run automated tests, create a project and other various tools:
<ul>
<li><b>Python</b> 2.2+
<ul>
<li>Python module <a
href=http://sourceforge.net/projects/mysql-python><b>MySQLdb</b></a>
0.9.2 (0.9.1 currently won't work; see <a href=install_python_mysqldb.txt>installation instructions</a>)
<li>Python module <a href=http://pyxml.sourceforge.net/><b>xml</b></a> (part of most distributions)
</ul>
</ul>
Required on the <b>database</b> server:
<ul>
<li><b>MySQL server</b> 3.25+ or 4.0+: other SQL server can be ported.
<li><b>MySQL server</b> 3.23+ or 4.0+: other SQL server can be ported
(package <code>mysql-server</code>)
</ul>
Required on the <b>master/scheduler</b> server(s):
<ul>
<li><b>Apache</b> or other webserver
<li><b>PHP</b> 4.0
<li><b>Apache</b> or other webserver (package <code>apache2</code> or <code>apache</code>)
<li><b>PHP</b> 4.0 (package <code>php4</code>)
<li><b>MySQL client</b> (package <code>mysql-client</code>)
<li><b>Python</b> 2.2+ (package <code>python2.3</code> or <code>python2.2</code>)
<ul>
<li><a href=http://sourceforge.net/projects/mysql-python><b>Python module MySQLdb</b></a>
0.9.2 (0.9.1 currently won't work; see <a
href=install_python_mysqldb.txt>installation instructions</a>)
(package <code>python-mysqldb</code>)
<li><a href=http://pyxml.sourceforge.net/><b>Python module xml</b></a>
(part of most Python distributions; package <code>python-xml</code>)
</ul>
</ul>
The <a href=test.php>test suite</a> simulates all servers on a single machine
as well as a client, so to run <code>make check</code> you need most of the
usual server and client software:
<ul>
<li><b>MySQL server</b> with permissions to create databases
<li><b>MySQL client</b>
<li><b>Python</b> with modules as above
<li>Apache and PHP: can be used but not required
</ul>
Optional, required only if you change <code>*/Makefile.am</code>:
@ -52,7 +61,7 @@ Optional, required only if you change <code>*/Makefile.am</code>:
<small>
On Debian Linux you can install all of the above software using
<blockquote>
<code>apt-get install g++ python python-mysqldb python-xml mysql-server mysql-client apache php automake autoconf</code>
<code>apt-get install g++ python python-mysqldb python-xml mysql-server mysql-client apache php4 automake autoconf</code>
</blockquote>
</small>

View File

@ -3,10 +3,16 @@
page_head("Testing BOINC");
?>
See the section on testing in the <a href=software.php>Software
Prerequisites</a>. Note that a performance web server with PHP is required for
running a real server, but that requires a lot of path and permissions
configuration so we opt not to use them in testing.
<h2>Python testing framework</h2>
The <code>test/</code> directory contains a library of Python modules that
make end-to-end testing of BOINC easy.
make end-to-end testing of BOINC easy. See the <a href=python.php>Python
framework</a>.
<h2>Quick start</h2>
Single test:
@ -55,31 +61,6 @@ The following system attributes are planned but not implemented yet:
(out of disk space, crash/reboot, etc.).
</ul>
<h2>Software</h2>
<h3>Pre-requisites</h3>
<ol>
<li> <b>MySQL</b> installed and running with permissions for the test script
user to create databases. Currently the script expects it to be
running on localhost but that could be changed.
<li> <b>Python 2.2</b>, <a href=install_python_mysqldb.txt>Python module
MySQLdb</a>
</ol>
<h3>Other optional software</h3>
<ol>
<li> <b>PHPMyAdmin</b>: Useful for viewing database.
<li> <b>Apache</b> or other web server: normal the test system uses a custom
CGI/PHP web server based on the Python BaseHTTPServer module, but
a real web server could be used to test things like permissions and
throughput.
<li> <b>PHP</b>: Useful for viewing web server output, but not necessary
(otherwise a stub fake_php.py program is used)
</ol>
Note that a performance web server with PHP is required for running a real
server, but that requires a lot of path and permissions configuration so we
opt not to use them in testing.
<!-- TODO: Directory structure -->
<!-- TODO: Modules/ Classes -->

View File

@ -495,10 +495,14 @@ class Workunit(DatabaseObject):
'name',
'xml_doc',
'batch',
'rsc_fpops',
'rsc_iops',
'rsc_memory',
'rsc_disk',
# 'rsc_fpops',
# 'rsc_iops',
# 'rsc_memory',
# 'rsc_disk',
'rsc_fpops_est',
'rsc_fpops_bound',
'rsc_memory_bound',
'rsc_disk_bound',
'need_validate',
'canonical_resultid',
'canonical_credit',

View File

@ -2,6 +2,7 @@
# TODO: make things work if build_dir != src_dir
import boinc_path_config
import version
from boinc_db import *
import os, sys, glob, time, shutil, re, random
@ -177,10 +178,10 @@ def account_file_name(url):
return 'account_' + _url_to_filename(url) + '.xml'
def srcdir(*dirs):
return apply(os.path.join,(TOP_SRC_DIR,)+dirs)
return apply(os.path.join,(boinc_path_config.TOP_SOURCE_DIR,)+dirs)
def builddir(*dirs):
return apply(os.path.join,(TOP_BUILD_DIR,)+dirs)
return apply(os.path.join,(boinc_path_config.TOP_BUILD_DIR,)+dirs)
def run_tool(cmd):
verbose_shell_call(builddir('tools', cmd))
@ -271,7 +272,7 @@ class Platform:
class CoreVersion:
def __init__(self):
self.version = 1
self.platform = Platform(PLATFORM)
self.platform = Platform(version.PLATFORM)
self.exec_dir = builddir('client')
self.exec_name = options.client_bin_filename
@ -281,13 +282,13 @@ class App:
self.name = name
class AppVersion:
def __init__(self, app, version = 1, exec_names=None):
def __init__(self, app, appversion = 1, exec_names=None):
self.exec_names = []
self.exec_dir = builddir('apps')
self.exec_names = exec_names or [app.name]
self.app = app
self.version = 1
self.platform = Platform(PLATFORM)
self.version = appversion
self.platform = Platform(version.PLATFORM)
class Project:
def __init__(self,
@ -323,7 +324,7 @@ class Project:
self.core_versions = core_versions or [CoreVersion()]
self.app_versions = app_versions or [AppVersion(App(appname))]
self.apps = apps or unique(map(lambda av: av.app, self.app_versions))
self.platforms = [Platform(PLATFORM)]
self.platforms = [Platform(version.PLATFORM)]
# convenience vars:
self.app_version = self.app_versions[0]
self.app = self.apps[0]

View File

@ -1,2 +1,3 @@
version.inc
testproxy.log
run-*

View File

@ -1,41 +0,0 @@
# Generated by db_def_to_py on Wed Jul 2 17:30:40 PDT 2003
MAX_BLOB_SIZE = 4096
TEAM_TYPE_CLUB = 1
TEAM_TYPE_COMPANY = 2
TEAM_TYPE_PRIMARY = 3
TEAM_TYPE_SECONDARY = 4
TEAM_TYPE_JUNIOR_COLLEGE = 5
TEAM_TYPE_UNIVERSITY = 6
TEAM_TYPE_GOVERNMENT = 7
FILE_DELETE_INIT = 0
FILE_DELETE_READY = 1
FILE_DELETE_DONE = 2
ASSIMILATE_INIT = 0
ASSIMILATE_READY = 1
ASSIMILATE_DONE = 2
WU_ERROR_COULDNT_SEND_RESULT = 1
WU_ERROR_TOO_MANY_ERROR_RESULTS = 2
WU_ERROR_TOO_MANY_RESULTS = 4
RESULT_SERVER_STATE_INACTIVE = 1
RESULT_SERVER_STATE_UNSENT = 2
RESULT_SERVER_STATE_UNSENT_SEQ = 3
RESULT_SERVER_STATE_IN_PROGRESS = 4
RESULT_SERVER_STATE_OVER = 5
RESULT_OUTCOME_INIT = 0
RESULT_OUTCOME_SUCCESS = 1
RESULT_OUTCOME_COULDNT_SEND = 2
RESULT_OUTCOME_CLIENT_ERROR = 3
RESULT_OUTCOME_NO_REPLY = 4
RESULT_OUTCOME_DIDNT_NEED = 5
VALIDATE_STATE_INIT = 0
VALIDATE_STATE_VALID = 1
VALIDATE_STATE_INVALID = 2
WORKSEQ_STATE_UNASSIGNED = 0
WORKSEQ_STATE_ASSIGNED = 1
WORKSEQ_STATE_DONE = 2
RESULT_NEW = 0
RESULT_FILES_DOWNLOADING = 1
RESULT_FILES_DOWNLOADED = 2
RESULT_COMPUTE_DONE = 3
RESULT_FILES_UPLOADING = 4
RESULT_FILES_UPLOADED = 5