2003-03-29 07:25:12 +00:00
|
|
|
#! /usr/local/bin/php
|
|
|
|
<?php
|
|
|
|
// End to end test. Tests make_work, feeder, scheduling server, client,
|
2003-04-29 17:51:58 +00:00
|
|
|
// 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
|
2003-03-29 07:25:12 +00:00
|
|
|
|
|
|
|
include_once("test.inc");
|
|
|
|
|
2003-04-29 17:51:58 +00:00
|
|
|
$retval = 0;
|
|
|
|
|
2003-03-29 07:25:12 +00:00
|
|
|
$project = new Project;
|
|
|
|
$user = new User();
|
|
|
|
$host = new Host($user);
|
|
|
|
$app = new App("upper_case");
|
|
|
|
$app_version = new App_Version($app);
|
|
|
|
|
|
|
|
$work = new Work($app);
|
|
|
|
$work->wu_template = "uc_wu";
|
|
|
|
$work->result_template = "uc_result";
|
2003-04-29 17:51:58 +00:00
|
|
|
$work->redundancy = 5;
|
2003-06-03 18:10:30 +00:00
|
|
|
$work->delay_bound = 70;
|
2003-03-29 07:25:12 +00:00
|
|
|
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
|
2003-04-29 17:51:58 +00:00
|
|
|
$project->install_make_work($work, 499, 5);
|
2003-03-29 07:25:12 +00:00
|
|
|
|
|
|
|
$host->log_flags = "log_flags.xml";
|
|
|
|
$host->add_user($user,$project);
|
|
|
|
$host->install();
|
|
|
|
|
|
|
|
echo "adding work\n";
|
|
|
|
|
|
|
|
$work->install($project);
|
|
|
|
|
|
|
|
$project->start_servers();
|
|
|
|
|
2003-04-29 17:51:58 +00:00
|
|
|
// Start by generating a batch of 500 results
|
|
|
|
echo "Generating 500 results... ";
|
|
|
|
while( $project->num_wus_left() < 500 ) sleep(1);
|
2003-03-29 07:25:12 +00:00
|
|
|
echo "done.\n";
|
|
|
|
|
|
|
|
// Stop the project, deinstall make_work, and install the normal backend components
|
|
|
|
$project->stop();
|
|
|
|
$project->deinstall_make_work();
|
|
|
|
$project->install_assimilator($app);
|
|
|
|
$project->install_file_delete();
|
|
|
|
$project->install_validate($app, 5);
|
|
|
|
$project->install_feeder();
|
2003-04-29 17:51:58 +00:00
|
|
|
$project->install_timeout_check($app, 5, 5, 0);
|
2003-03-29 07:25:12 +00:00
|
|
|
|
|
|
|
while (($pid=exec("pgrep -n make_work")) != null) sleep(1);
|
|
|
|
|
|
|
|
// Restart the server
|
|
|
|
$project->restart();
|
|
|
|
$project->start_servers();
|
|
|
|
|
|
|
|
// Run the client until there's no more work
|
2003-04-01 03:28:37 +00:00
|
|
|
$host->run("-exit_when_idle -skip_cpu_benchmarks");
|
2003-03-29 07:25:12 +00:00
|
|
|
|
2003-06-03 18:10:30 +00:00
|
|
|
// Give the server 30 seconds to finish assimilating/deleting
|
|
|
|
sleep(30);
|
2003-03-29 07:25:12 +00:00
|
|
|
|
2003-04-29 17:51:58 +00:00
|
|
|
// *** DO CHECKS HERE
|
2003-06-11 23:09:11 +00:00
|
|
|
$result->server_state = RESULT_SERVER_STATE_OVER;
|
2003-03-29 07:25:12 +00:00
|
|
|
$result->exit_status = 0;
|
2003-04-29 17:51:58 +00:00
|
|
|
$project->check_results(500, $result);
|
2003-03-29 07:25:12 +00:00
|
|
|
|
|
|
|
// Stop the server
|
|
|
|
$project->stop();
|
2003-04-29 17:51:58 +00:00
|
|
|
|
|
|
|
exit($retval);
|
2003-03-29 07:25:12 +00:00
|
|
|
?>
|