diff --git a/checkin_notes b/checkin_notes index 05356f0994..76a7150bff 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2065,6 +2065,9 @@ David Oct 3 2002 main.C validate.C validate_test.C + test/ + test.inc (new) + test_uc.php tools/ add.C backend_lib.C,h diff --git a/doc/client_data.html b/doc/client_data.html index 6b66dc073a..b709b9137a 100644 --- a/doc/client_data.html +++ b/doc/client_data.html @@ -57,11 +57,10 @@ and installs a pointer.
A similar approach is used when handling the reply -from an scheduling server RPC (CLIENT_STATE::handle_scheduler_reply). +from a scheduling server RPC (CLIENT_STATE::handle_scheduler_reply). The RPC returns a interconnected set of basic objects, represented in a SCHEDULER_REPLY object. For each of these basic objects, we see (e.g. lookup_app()) -if it's alread present in the CLIENT_STATE structure. +if it's already present in the CLIENT_STATE structure. If not, we create and insert a new object, -then link it (e.g., link_app()) to establish pointers to -associated objects in CLIENT_STATE. \ No newline at end of file +then link it (e.g., link_app()) to existing objects in CLIENT_STATE. diff --git a/doc/create_project.html b/doc/create_project.html index adba1260af..aba094a28f 100644 --- a/doc/create_project.html +++ b/doc/create_project.html @@ -53,10 +53,6 @@ Setting up a BOINC server
-To create a BOINC server you must have the following software installed: -
-Add the following environment variables (with appropriate changes) to your .tcshrc -
-# These 5 are used at compile time -setenv BOINC_DB_NAME boinc_barry -setenv BOINC_DB_PASSWD -setenv BOINC_KEY 0xdabacafe -setenv BOINC_KEY_DIR ~/keys -setenv BOINC_UPLOAD_DIR ~/upload - -# These 3 are used at runtime -setenv BOINC_DOWNLOAD_DIR ~/download -setenv BOINC_UPLOAD_URL http://maggie.ssl.berkeley.edu/barry/cgi/file_upload_handler -setenv BOINC_DOWNLOAD_URL http://maggie.ssl.berkeley.edu/barry/download - -# These 4 are for test scripts -setenv BOINC_PLATFORM sparc-sun-solaris2.7 -setenv BOINC_EMAIL barry@ssl.berkeley.edu -setenv BOINC_USER barry -setenv BOINC_MASTER_URL http:\\\\\/\\\\/maggie.ssl.berkeley.edu\\\\/~barry -- -Each time BOINC_DB_NAME, BOINC_DB_PASSWD, BOINC_KEY, BOINC_KEY_DIR, or BOINC_UPLOAD_DIR are -changed you must recompile the scheduler by going into the sched/ directory, typing -"make clean", "make", and "make install". - -
-After setting your necessary environment variables you must edit your httpd.conf to -configure Apache. - -Add the following lines (with appropriate changes) where aliases are placed. - -
-Alias /barry/ "/disks/philmor/a/users/barry/" - -<Directory> - Options Indexes FollowSymlinks MultiViews - AllowOverride None - Order allow,deny - Alias from all -</Directory> -- -This allows you to resolve URL's and path names that go to your home directory. -This way you can have your upload and download directories, key directory, and cgi -directory in your home directory and still have them reacheable through the web. -
-In addition add the following lines (with appropriate changes) where script -aliases are placed. - -
-ScriptAlias /barry-cgi/ "/disks/philmor/a/users/barry/cgi/" - -<Directory "/disks/philmor/a/users/barry/cgi/"> - AllowOverride None - Options None - Order allow,deny - Allow from all -</Directory> -- -This allows CGI files to be executed in the specified directory. You will put -your scheduler and file_upload_handler into this directory. -
-You must make a directory for downloads and a directory for uploads. Make sure -that the download directory is world readable. You must also make a directory to hold -the different necessary keys. -
-Now you are ready to install BOINC. -Unzip and untar the BOINC release. Type -"configure", "make", and "make install". "make" will compile all the source -code and "make install" will install a BOINC server in the INSTALL_DIR (currently -set to /usr/local/boinc/) specified in the Makefile. - -
-Go into the boinc/test directory, and type -
-Each project is publicly identified by a master URL. -The master page at this URL has two functions. -
-<scheduler>http://host.domain.edu/cgi/scheduler<scheduler> -<scheduler>http://host2.domain.edu/cgi/scheduler<scheduler> --that give the URLs of the project's scheduling servers. -These tags can be embedded within HTML comments. -The BOINC core client reads -and parses the master page to locate scheduling servers. -If at any point it is unable to -connect to any scheduling server for a project, -it rereads the master page. -This mechanism lets a project change the locations of its scheduling -servers, or add new servers. diff --git a/doc/security.html b/doc/security.html index 21b8dece8e..1af8168139 100644 --- a/doc/security.html +++ b/doc/security.html @@ -35,7 +35,7 @@ A project intentionally releases an application that abuses participant hosts, e.g. by stealing sensitive information stored in files.
+Many BOINC features involve multiple projects and/or multiple hosts. +It would be prohibitively complex to do automated testing +on multiple physical hosts. +Fortunately the BOINC architecture makes it possible for +multiple projects and (virtual) hosts to reside on a single physical host. +So the testing framework uses this approach. + +
+The framework lets you write scripts with any of the following attributes: +
+boinc_projects/ + proj1/ + cgi/ + download/ + html_ops/ + html_user/ + keys/ + upload/ + proj2/ + ... ++where proj1, proj2 etc. are the names of the projects in your scripts. + +
+Similarly, each virtual host has various files that must be kept separate. +You must designate a "BOINC hosts" directory on your test host. +The framework will create subdirectories as follows: +
+boinc_hosts/ + host1/ + projects/ + slots/ + client_state.xml + log_flags.xml + host2/ + ... ++where host1, host2 etc. are the names of the hosts in your scripts. + +
+class Project { // represents a project + var $name; // defaults to "test"; override if needed + function add_user($user); // add a User to project's DB + function add_app($app); // add an application + function add_app_version($app_version); // add an app version + function install(); // set up directories and DB + function start(); // start feeder + function stop(); // stop feeder + function check_results_done(); // verify that all results are in state DONE + function compare_file($out, $correct); // verify that a result file + // matches a known-correct file +} + +class User { // represents an account on a project + var $name; // override if needed + var $email_addr; + var $authenticator; +} + +class Host { // represents a (virtual) host + function Host($user); + function add_project($project); + function install(); + function run($flags); +} + +class App { // represents an application + function App($name); +} + +class App_Version { // represents an application version + var $version; // defaults to 1 + var $exec_name; // name of executable; default to app name + function App_Version($app); +} + +class Work { // represents a workunit and some results + var $wu_template; // name of workunit template file + var $result_template; // name of result template file + var $nresults; // number of results for this WU + var $input_files; // array of input file names + function Work($project, $app); + function install(); // install in DB and directories +} ++A test script instantiates one or more instances of +these classes, links them as needed, +installs them, starts the projects, runs the hosts. +It then checks the final state +(typically, that results are done and result files are correct). + +
setenv BOINC_PROJECTS_DIR /home/david/boinc_projects +# BOINC projects directory setenv BOINC_HOSTS_DIR /home/david/boinc_hosts +# BOINC hosts directory setenv BOINC_USER_NAME david +# prepended to web error log entries setenv BOINC_SRC_DIR /home/david/boinc_cvs/boinc +# BOINC source directory setenv BOINC_CGI_DIR /home/david/cgi-bin +# path of a CGI directory setenv BOINC_CGI_URL http://localhost/cgi-bin +# URL of that directory setenv BOINC_HTML_DIR /home/david/html +# path of a web-page directory setenv BOINC_HTML_URL http://localhost +# URL of that directory setenv BOINC_KEY_DIR /home/david/boinc_keys +# path of some pre-generated security keys setenv BOINC_PLATFORM i686-pc-linux-gnu +# platform name of this machine+
+#! /usr/local/bin/php +<?php + include_once("test.inc"); + + $project = new Project; + $user = new User(); + $host = new Host($user); + $app = new App("upper_case"); + $app_version = new App_Version($app); + + $project->add_user($user); + $project->add_app($app); + $project->add_app_version($app_version); + $project->install(); // must install projects before adding to hosts + + $host->add_project($project); + $host->install(); + + echo "adding work\n"; + + $work = new Work($project, $app); + $work->wu_template = "uc_wu"; + $work->result_template = "uc_result"; + $work->nresults = 2; + array_push($work->input_files, "input"); + $work->install(); + + $project->start(); + $host->run("-exit_when_idle"); + $project->stop(); + + $project->check_results_done(); + $project->compare_file("uc_wu_0_0", "uc_correct_output"); + $project->compare_file("uc_wu_1_0", "uc_correct_output"); +?> ++ +
The apps directory contains the following test applications:
The test directory contains PHP scripts, together with XML templates and sample input files, for initializing and testing the entire system: @@ -48,7 +232,7 @@ You have to run the client yourself, kill and restart it a few times. test_water.php: tests some aspects of water marks.
These scripts use functions defined in the PHP include file diff --git a/test/test.inc b/test/test.inc index 64a6d8da72..12a8515678 100644 --- a/test/test.inc +++ b/test/test.inc @@ -252,6 +252,7 @@ class Project { class User { var $name; + var $email_addr; var $authenticator; function User() {