mirror of https://github.com/BOINC/boinc.git
parent
b1ec8bf541
commit
1d75d0f451
|
@ -10,7 +10,7 @@
|
||||||
//
|
//
|
||||||
// See doc/test.html for details
|
// See doc/test.html for details
|
||||||
|
|
||||||
define("RESULT_STATE_DONE", 4);
|
define("RESULT_STATE_OVER", 5);
|
||||||
|
|
||||||
ob_end_flush(); // let us see what's going on
|
ob_end_flush(); // let us see what's going on
|
||||||
|
|
||||||
|
@ -577,8 +577,8 @@ class Project {
|
||||||
$result = mysql_query("select * from result");
|
$result = mysql_query("select * from result");
|
||||||
while ($x = mysql_fetch_object($result)) {
|
while ($x = mysql_fetch_object($result)) {
|
||||||
$n++;
|
$n++;
|
||||||
if ($result->state != null && $result->state != $x->state) {
|
if ($result->server_state != null && $result->server_state != $x->server_state) {
|
||||||
echo "ERROR: result $x->id: unexpected state $x->state\n";
|
echo "ERROR: result $x->id: unexpected state $x->server_state\n";
|
||||||
}
|
}
|
||||||
if ($result->stderr_out != null) {
|
if ($result->stderr_out != null) {
|
||||||
if (substr($result->stderr_out, $x->stderr_out)==0) {
|
if (substr($result->stderr_out, $x->stderr_out)==0) {
|
||||||
|
@ -752,7 +752,8 @@ class Host {
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_file_present($project, $filename) {
|
function check_file_present($project, $filename) {
|
||||||
$enc_url = replace($project->master_url, "/", "_");
|
$enc_url = str_replace("http://", "", $project->master_url);
|
||||||
|
$enc_url = str_replace("/", "_", $enc_url);
|
||||||
$path= "$this->host_dir/projects/$enc_url/$filename";
|
$path= "$this->host_dir/projects/$enc_url/$filename";
|
||||||
if (!file_exists($path)) {
|
if (!file_exists($path)) {
|
||||||
echo "ERROR: file $path doesn't exist\n";
|
echo "ERROR: file $path doesn't exist\n";
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
$project1->stop();
|
$project1->stop();
|
||||||
$project2->stop();
|
$project2->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$project1->check_results(5, $result);
|
$project1->check_results(5, $result);
|
||||||
$project1->compare_file("uc_wu_0_0", "uc_correct_output");
|
$project1->compare_file("uc_wu_0_0", "uc_correct_output");
|
||||||
$project1->compare_file("uc_wu_1_0", "uc_correct_output");
|
$project1->compare_file("uc_wu_1_0", "uc_correct_output");
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
sleep(5);
|
sleep(5);
|
||||||
|
|
||||||
// *** DO TESTS HERE
|
// *** DO TESTS HERE
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(101, $result);
|
$project->check_results(101, $result);
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@
|
||||||
$work->install($project);
|
$work->install($project);
|
||||||
|
|
||||||
$project->start_servers();
|
$project->start_servers();
|
||||||
$host->run("-exit_when_idle");
|
$host->run("-exit_when_idle -skip_cpu_benchmarks");
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
$project->compare_file("concat_wu_0_0", "concat_correct_output");
|
$project->compare_file("concat_wu_0_0", "concat_correct_output");
|
||||||
$project->compare_file("concat_wu_1_0", "concat_correct_output");
|
$project->compare_file("concat_wu_1_0", "concat_correct_output");
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
pcntl_waitpid($pid, $status, 0);
|
pcntl_waitpid($pid, $status, 0);
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
$project->install(); // must install projects before adding to hosts
|
$project->install(); // must install projects before adding to hosts
|
||||||
|
|
||||||
$host->log_flags = "log_flags.xml";
|
$host->log_flags = "log_flags.xml";
|
||||||
$host->add_project($project);
|
$host->add_user($user,$project);
|
||||||
$host->install();
|
$host->install();
|
||||||
|
|
||||||
echo "adding work\n";
|
echo "adding work\n";
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
pcntl_waitpid($pid,$status,0);
|
pcntl_waitpid($pid,$status,0);
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
pcntl_waitpid($pid,$status,0);
|
pcntl_waitpid($pid,$status,0);
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -139,7 +139,7 @@ while(1)
|
||||||
|
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -15,9 +15,10 @@
|
||||||
$project->add_app($app);
|
$project->add_app($app);
|
||||||
$project->add_app_version($app_version);
|
$project->add_app_version($app_version);
|
||||||
$project->install(); // must install projects before adding to hosts
|
$project->install(); // must install projects before adding to hosts
|
||||||
|
$project->install_feeder();
|
||||||
|
|
||||||
$host->log_flags = "log_flags.xml";
|
$host->log_flags = "log_flags.xml";
|
||||||
$host->add_project($project);
|
$host->add_user($user,$project);
|
||||||
$host->install();
|
$host->install();
|
||||||
|
|
||||||
echo "adding work\n";
|
echo "adding work\n";
|
||||||
|
@ -31,10 +32,10 @@
|
||||||
array_push($work->input_files, "input");
|
array_push($work->input_files, "input");
|
||||||
$work->install($project);
|
$work->install($project);
|
||||||
|
|
||||||
$project->start_feeder();
|
$project->start_servers();
|
||||||
$host->run("-exit_when_idle");
|
$host->run("-exit_when_idle -skip_cpu_benchmarks");
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$project->check_results(0, $result);
|
$project->check_results(0, $result);
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
pcntl_waitpid($pid,$status,0);
|
pcntl_waitpid($pid,$status,0);
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
$project->add_app($app);
|
$project->add_app($app);
|
||||||
$project->add_app_version($app_version);
|
$project->add_app_version($app_version);
|
||||||
$project->install(); // must install projects before adding to hosts
|
$project->install(); // must install projects before adding to hosts
|
||||||
|
$project->install_feeder();
|
||||||
|
|
||||||
$host->log_flags = "log_flags.xml";
|
$host->log_flags = "log_flags.xml";
|
||||||
$host->add_project($project);
|
$host->add_user($user,$project);
|
||||||
$host->install();
|
$host->install();
|
||||||
|
|
||||||
echo "adding work\n";
|
echo "adding work\n";
|
||||||
|
@ -28,17 +29,17 @@
|
||||||
array_push($work->input_files, "input");
|
array_push($work->input_files, "input");
|
||||||
$work->install($project);
|
$work->install($project);
|
||||||
|
|
||||||
$project->start_feeder();
|
$project->start_servers();
|
||||||
$host->run("-exit_when_idle");
|
$host->run("-exit_when_idle -skip_cpu_benchmarks");
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
$project->compare_file("uc_wu_0_0", "uc_correct_output");
|
$project->compare_file("uc_wu_sticky_0_0", "uc_correct_output");
|
||||||
$project->compare_file("uc_wu_1_0", "uc_correct_output");
|
$project->compare_file("uc_wu_sticky_1_0", "uc_correct_output");
|
||||||
|
|
||||||
// make sure result files are still there
|
// make sure result files are still there
|
||||||
$host->check_file_present($project, "uc_wu_0_0");
|
$host->check_file_present($project, "uc_wu_sticky_0_0");
|
||||||
$host->check_file_present($project, "uc_wu_1_0");
|
$host->check_file_present($project, "uc_wu_sticky_1_0");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -3,15 +3,26 @@
|
||||||
//Run the comprehensive suite of tests
|
//Run the comprehensive suite of tests
|
||||||
//
|
//
|
||||||
|
|
||||||
PassThru("test_1sec.php", $retval);
|
passthru("test_1sec.php", $retval);
|
||||||
if($retval) printf("test_1sec.php did not run correctly\n");
|
if($retval) printf("test_1sec.php did not run correctly\n");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
|
PassThru("test_backend.php", $retval);
|
||||||
|
if($retval) printf("test_backend.php did not run correctly\n");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
PassThru("test_concat.php", $retval);
|
PassThru("test_concat.php", $retval);
|
||||||
if($retval) printf("test_concat.php did not run correctly\n");
|
if($retval) printf("test_concat.php did not run correctly\n");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
PassThru("test_rsc.php", $retval);
|
PassThru("test_rsc.php", $retval);
|
||||||
if($retval) printf("test_rsc.php did not run correctly\n");
|
if($retval) printf("test_rsc.php did not run correctly\n");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
PassThru("test_uc.php", $retval);
|
PassThru("test_sticky.php", $retval);
|
||||||
|
if($retval) printf("test_sticky.php did not run correctly\n");
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
|
passthru("test_uc.php", $retval);
|
||||||
if($retval) printf("test_uc.php did not run correctly\n");
|
if($retval) printf("test_uc.php did not run correctly\n");
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
$host->run("-exit_when_idle");
|
$host->run("-exit_when_idle");
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$project->check_results(1, $result);
|
$project->check_results(1, $result);
|
||||||
$project->compare_file("uccpu_wu_0_0", "uc_small_correct_output");
|
$project->compare_file("uccpu_wu_0_0", "uc_small_correct_output");
|
||||||
$client_time = $host->read_cpu_time_file("client_time");
|
$client_time = $host->read_cpu_time_file("client_time");
|
||||||
|
|
|
@ -56,10 +56,10 @@
|
||||||
|
|
||||||
$project->stop();
|
$project->stop();
|
||||||
$project->validate($app, 2);
|
$project->validate($app, 2);
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(10, $result);
|
||||||
$project->compare_file("uc_wu_0_0", "uc_correct_output");
|
$project->compare_file("uc_wu_0_0", "uc_correct_output");
|
||||||
$project->compare_file("uc_wu_1_0", "uc_correct_output");
|
$project->compare_file("uc_wu_1_0", "uc_correct_output");
|
||||||
|
|
||||||
|
|
|
@ -10,31 +10,37 @@
|
||||||
$host = new Host($user);
|
$host = new Host($user);
|
||||||
$app = new App("upper_case");
|
$app = new App("upper_case");
|
||||||
$app_version = new App_Version($app);
|
$app_version = new App_Version($app);
|
||||||
$app_version->platform_name = "windows_intelx86";
|
$platform->name = "windows_intelx86";
|
||||||
|
$platform->user_friendly_name = "Windows";
|
||||||
|
$app_version->platform = $platform;
|
||||||
$app_version->exec_name = "upper_case.exe";
|
$app_version->exec_name = "upper_case.exe";
|
||||||
|
|
||||||
$project->add_user($user);
|
|
||||||
$project->add_app($app);
|
|
||||||
$project->add_app_version($app_version);
|
|
||||||
$project->add_platform("windows_intelx86");
|
|
||||||
$project->install(); // must install projects before adding to hosts
|
|
||||||
|
|
||||||
echo "adding work\n";
|
|
||||||
|
|
||||||
$work = new Work($app);
|
$work = new Work($app);
|
||||||
$work->wu_template = "uc_wu";
|
$work->wu_template = "uc_wu";
|
||||||
$work->result_template = "uc_result";
|
$work->result_template = "uc_result";
|
||||||
$work->redundancy = 2;
|
$work->redundancy = 2;
|
||||||
array_push($work->input_files, "input");
|
array_push($work->input_files, "input");
|
||||||
|
|
||||||
|
$project->add_user($user);
|
||||||
|
$project->add_app($app);
|
||||||
|
$project->add_app_version($app_version);
|
||||||
|
$project->add_platform($platform);
|
||||||
|
$project->install();
|
||||||
|
$project->install_feeder();
|
||||||
|
$project->install_make_work($work,20,5);
|
||||||
|
|
||||||
|
echo "adding work\n";
|
||||||
$work->install($project);
|
$work->install($project);
|
||||||
|
|
||||||
$project->start_feeder();
|
$project->start_servers();
|
||||||
|
|
||||||
echo "go run the client\n";
|
echo "Go run the client\n";
|
||||||
|
/*echo "Hit any key to stop the server\n";
|
||||||
|
|
||||||
//$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
//$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
//$project->compare_file("uc_wu_0_0", "uc_correct_output");
|
$project->compare_file("uc_wu_0_0", "uc_correct_output");
|
||||||
//$project->compare_file("uc_wu_1_0", "uc_correct_output");
|
$project->compare_file("uc_wu_1_0", "uc_correct_output");
|
||||||
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
pcntl_waitpid($pid, $status,0);
|
pcntl_waitpid($pid, $status,0);
|
||||||
$project->stop();
|
$project->stop();
|
||||||
|
|
||||||
$result->state = RESULT_STATE_DONE;
|
$result->server_state = RESULT_STATE_OVER;
|
||||||
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
$result->stderr_out = "APP: upper_case: starting, argc 1";
|
||||||
$result->exit_status = 0;
|
$result->exit_status = 0;
|
||||||
$project->check_results(2, $result);
|
$project->check_results(2, $result);
|
||||||
|
|
|
@ -7,10 +7,8 @@
|
||||||
<sticky/>
|
<sticky/>
|
||||||
</file_info>
|
</file_info>
|
||||||
<result>
|
<result>
|
||||||
<name><RESULT_NAME/></name>
|
|
||||||
<wu_name><WU_NAME/></wu_name>
|
|
||||||
<file_ref>
|
<file_ref>
|
||||||
<file_name><OUTFILE_0/></file_name>
|
<file_name><OUTFILE_0/></file_name>
|
||||||
<fd>1</fd>
|
<open_name>out</open_name>
|
||||||
</file_ref>
|
</file_ref>
|
||||||
</result>
|
</result>
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
<file_info>
|
<file_info>
|
||||||
<name><INFILE_0/></name>
|
<number>0</number>
|
||||||
<url><DOWNLOAD_URL/><INFILE_0/></url>
|
|
||||||
<md5_cksum><MD5_0/></md5_cksum>
|
|
||||||
<sticky/>
|
<sticky/>
|
||||||
</file_info>
|
</file_info>
|
||||||
<workunit>
|
<workunit>
|
||||||
<name><WU_NAME/></name>
|
|
||||||
<app_name>upper_case</app_name>
|
|
||||||
<file_ref>
|
<file_ref>
|
||||||
<file_name><INFILE_0/></file_name>
|
<file_number>0</file_number>
|
||||||
<fd>0</fd>
|
<open_name>in</open_name>
|
||||||
</file_ref>
|
</file_ref>
|
||||||
</workunit>
|
</workunit>
|
||||||
|
|
Loading…
Reference in New Issue