Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=1142
  • Loading branch information
eheien committed Apr 29, 2003
1 parent b1bb168 commit d79dfcf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 26 deletions.
30 changes: 18 additions & 12 deletions test/test_backend.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#! /usr/local/bin/php
<?php
// End to end test. Tests make_work, feeder, scheduling server, client,
// file_upload_handler, validator, assimilator, and file_deleter on a
// large batch of workunits. Confirms that credit is correctly granted
// and that unneeded files are deleted
// file_upload_handler, validator, assimilator, timeout_check, and
// file_deleter on a large batch of workunits. Confirms that credit
// is correctly granted and that unneeded files are deleted

include_once("test.inc");

$retval = 0;

$project = new Project;
$user = new User();
$host = new Host($user);
Expand All @@ -16,15 +18,15 @@
$work = new Work($app);
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->redundancy = 4;
$work->delay_bound = 86400;
$work->redundancy = 5;
$work->delay_bound = 7;
array_push($work->input_files, "input");

$project->add_user($user);
$project->add_app($app);
$project->add_app_version($app_version);
$project->install(); // must install projects before adding to hosts
$project->install_make_work($work, 100, 5);
$project->install_make_work($work, 499, 5);

$host->log_flags = "log_flags.xml";
$host->add_user($user,$project);
Expand All @@ -36,9 +38,9 @@

$project->start_servers();

// Start by generating a batch of 100 results
echo "Generating 100 results... ";
while( $project->num_wus_left() < 100 ) sleep(1);
// Start by generating a batch of 500 results
echo "Generating 500 results... ";
while( $project->num_wus_left() < 500 ) sleep(1);
echo "done.\n";

// Stop the project, deinstall make_work, and install the normal backend components
Expand All @@ -48,6 +50,7 @@
$project->install_file_delete();
$project->install_validate($app, 5);
$project->install_feeder();
$project->install_timeout_check($app, 5, 5, 0);

while (($pid=exec("pgrep -n make_work")) != null) sleep(1);

Expand All @@ -58,13 +61,16 @@
// Run the client until there's no more work
$host->run("-exit_when_idle -skip_cpu_benchmarks");

sleep(5);
// Give the server 15 seconds to finish assimilating/deleting
sleep(15);

// *** DO TESTS HERE
// *** DO CHECKS HERE
$result->server_state = RESULT_STATE_OVER;
$result->exit_status = 0;
$project->check_results(101, $result);
$project->check_results(500, $result);

// Stop the server
$project->stop();

exit($retval);
?>
17 changes: 6 additions & 11 deletions test/test_download_backoff.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/local/bin/php
<?php
//This tests the exponential backoff mechanism on the client in case of downloadURLs going down
//This test is not automated. It has to be run, and then client.out (in the host directory) must be looked at to examine wether everything is working correctly.
// Tests the exponential backoff mechanism on the client for failed downloads
// This test is not automated. It has to be run, and then client.out (in the host directory) must be looked at to examine wether everything is working correctly.
include_once("test.inc");

$project = new Project;
Expand All @@ -11,20 +11,15 @@
$app = new App("upper_case");
$app_version = new App_Version($app);

// the following is optional (makes client web download possible)
$core_app = new App("core client");
$core_app_version = new App_Version($core_app);
$project->add_app($core_app);
$project->add_app_version($core_app_version);

$project->add_user($user);
$project->add_app($app);
$project->add_app_version($app_version);

$project->install(); // must install projects before adding to hosts
$project->install_feeder();

$host->log_flags = "log_flags.xml";
$host->add_project($project);
$host->add_user($user, $project);
$host->install();

echo "adding work\n";
Expand All @@ -33,13 +28,13 @@
$work->wu_template = "uc_wu";
$work->result_template = "uc_result";
$work->redundancy = 2;
$work->delay_bound = 10;
array_push($work->input_files, "input");
$work->install($project);

$project->start_feeder();
//delete the download_dir immediately
$project->delete_downloaddir();

$project->start_servers();
$pid = $host->run_asynch("-exit_when_idle");
echo "sleeping 100 secs\n";
sleep(100);
Expand Down
4 changes: 4 additions & 0 deletions test/test_rsc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

include_once("test.inc");

$retval = 0;

$project = new Project;
$user = new User();
$host = new Host($user);
Expand Down Expand Up @@ -38,4 +40,6 @@

$result->server_state = RESULT_STATE_OVER;
$project->check_results(0, $result);

exit($retval);
?>
22 changes: 19 additions & 3 deletions test/test_uc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

include_once("test.inc");

$retval = 0;

$project = new Project;

$app = new App("upper_case");
Expand Down Expand Up @@ -55,16 +57,30 @@
$host->run("-exit_when_idle -skip_cpu_benchmarks");

$project->stop();
$project->restart();
$project->validate($app, 2);
$result->server_state = RESULT_STATE_OVER;
$result->stderr_out = "APP: upper_case: starting, argc 1";
$result->exit_status = 0;
$project->check_results(10, $result);
$project->check_results(2, $result);
$project->compare_file("uc_wu_0_0", "uc_correct_output");
$project->compare_file("uc_wu_1_0", "uc_correct_output");

$project->file_delete();
// input file should be gone here
$project->assimilate($app);
$project->file_delete();
if (file_exists("$project->project_dir/download/input")) {
echo "ERROR: File $project->project_dir/download/input still there\n";
$retval = -1;
}
if (file_exists("$project->project_dir/upload/uc_wu_0_0")) {
echo "ERROR: File $project->project_dir/upload/uc_wu_0_0 still there\n";
$retval = -1;
}
if (file_exists("$project->project_dir/upload/uc_wu_1_0")) {
echo "ERROR: File $project->project_dir/upload/uc_wu_1_0 still there\n";
$retval = -1;
}
$project->stop();

exit($retval);
?>

0 comments on commit d79dfcf

Please sign in to comment.