test suite stuf

svn path=/trunk/boinc/; revision=1412
This commit is contained in:
Karl Chen 2003-06-11 23:47:36 +00:00
parent 8f536a9e56
commit b4a9325176
5 changed files with 45 additions and 44 deletions

View File

@ -2,11 +2,14 @@
include $(top_srcdir)/Makefile.incl
TESTS = test_sanity.php \
test_uc.php \
test_concat.php \
TESTS = test_sanity.php \
test_uc.php \
test_concat.php \
test_1sec.php \
test_rsc.php
test_rsc.php \
test_backend.php
# test_sticky.php
EXTRA_DIST = \
*.xml *.php *wu *result *output \

View File

@ -66,7 +66,7 @@ function verbose_echo($level, $line)
echo "$line\n";
} else if (VERBOSE == 1) {
echo "\r ";
echo "\r$line";
echo "\r$line ";
}
}
}
@ -969,7 +969,7 @@ class Host {
$enc_url = str_replace("/", "_", $enc_url);
$path= "$this->host_dir/projects/$enc_url/$filename";
if (!file_exists($path)) {
echo "ERROR: file $path doesn't exist\n";
error("file $path doesn't exist");
}
}
}

View File

@ -1,5 +1,7 @@
#! /usr/local/bin/php
<?php
#!/usr/local/bin/php -q
<?php {
// $Id$
// End to end test. Tests make_work, feeder, scheduling server, client,
// file_upload_handler, validator, assimilator, timeout_check, and
// file_deleter on a large batch of workunits. Confirms that credit
@ -7,7 +9,7 @@
include_once("test.inc");
$retval = 0;
test_msg("backend");
$project = new Project;
$user = new User();
@ -32,16 +34,18 @@
$host->add_user($user,$project);
$host->install();
echo "adding work\n";
$work->install($project);
$project->start_servers();
// Start by generating a batch of 500 results
echo "Generating 500 results... ";
while( $project->num_wus_left() < 500 ) sleep(1);
echo "done.\n";
$n = 0;
while($n < 500 ) {
$n = $project->num_wus_left();
verbose_echo(1, "Generating results [$n/500]");
sleep(1);
}
verbose_echo(1, "Generating results... 500 done");
// Stop the project, deinstall make_work, and install the normal backend components
$project->stop();
@ -72,5 +76,5 @@
// Stop the server
$project->stop();
exit($retval);
?>
test_done();
} ?>

View File

@ -1,27 +1,23 @@
#! /usr/local/bin/php
<?php
// test the sticky file mechanism
#!/usr/local/bin/php -q
<?php {
// $Id$
include_once("test.inc");
test_msg("sticky file mechanism");
$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->add_app_and_version("upper_case");
$project->install(); // must install projects before adding to hosts
$project->install_feeder();
$host->log_flags = "log_flags.xml";
$host->add_user($user,$project);
$host->install();
echo "adding work\n";
$work = new Work($app);
$work->wu_template = "uc_wu_sticky";
$work->result_template = "uc_result_sticky";
@ -42,4 +38,5 @@
$host->check_file_present($project, "uc_wu_sticky_0_0");
$host->check_file_present($project, "uc_wu_sticky_1_0");
?>
test_done();
} ?>

View File

@ -1,34 +1,31 @@
#! /usr/local/bin/php
<?php
// test the client checkpoint/restart mechanism,
#!/usr/local/bin/php -q
<?php {
// $Id$
include_once("test.inc");
test_msg("client checkpoint/restart mechanism");
$project = new Project;
$user = new User();
$host = new Host($user);
$app = new App("upper_case");
$app_version = new App_Version($app);
$host = new Host();
$project->add_user($user);
$project->add_app($app);
$project->add_app_version($app_version);
$project->add_app_and_version("upper_case");
$project->install(); // must install projects before adding to hosts
$host->log_flags = "log_flags.xml";
$host->add_project($project);
$host->add_user($user, $project);
$host->install();
echo "adding work\n";
$work = new Work($app);
$work = new Work();
$work->wu_template = "ucs_wu";
$work->result_template = "ucs_result";
array_push($work->input_files, "small_input");
$work->install($project);
$project->start_feeder();
echo "Now run the client manually; start and stop it a few times\n";
$project->install_feeder();
$project->start_servers();
verbose_echo(0, "Now run the client manually; start and stop it a few times");
//compare_file("ucs_wu_0_0", "uc_small_correct_output");
?>
} ?>