From 1d75d0f45151afac5fc68db69ebcddd374fd93d7 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Tue, 1 Apr 2003 07:34:08 +0000 Subject: [PATCH] test fixes svn path=/trunk/boinc/; revision=1123 --- test/test.inc | 9 +++++---- test/test_1sec.php | 2 +- test/test_backend.php | 2 +- test/test_concat.php | 4 ++-- test/test_download_backoff.php | 2 +- test/test_loop.php | 2 +- test/test_masterurl_failure.php | 2 +- test/test_mdownload_backoff.php | 2 +- test/test_pers.php | 2 +- test/test_rsc.php | 9 +++++---- test/test_sched_failure.php | 2 +- test/test_sticky.php | 17 ++++++++-------- test/test_suite.php | 15 ++++++++++++-- test/test_time.php | 2 +- test/test_uc.php | 4 ++-- test/test_uc_win.php | 36 +++++++++++++++++++-------------- test/test_upload_backoff.php | 2 +- test/uc_result_sticky | 4 +--- test/uc_wu_sticky | 10 +++------ 19 files changed, 71 insertions(+), 57 deletions(-) diff --git a/test/test.inc b/test/test.inc index d63221caf5..877b034436 100644 --- a/test/test.inc +++ b/test/test.inc @@ -10,7 +10,7 @@ // // 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 @@ -577,8 +577,8 @@ class Project { $result = mysql_query("select * from result"); while ($x = mysql_fetch_object($result)) { $n++; - if ($result->state != null && $result->state != $x->state) { - echo "ERROR: result $x->id: unexpected state $x->state\n"; + if ($result->server_state != null && $result->server_state != $x->server_state) { + echo "ERROR: result $x->id: unexpected state $x->server_state\n"; } if ($result->stderr_out != null) { if (substr($result->stderr_out, $x->stderr_out)==0) { @@ -752,7 +752,8 @@ class Host { } 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"; if (!file_exists($path)) { echo "ERROR: file $path doesn't exist\n"; diff --git a/test/test_1sec.php b/test/test_1sec.php index f55903bb47..ef552403ab 100644 --- a/test/test_1sec.php +++ b/test/test_1sec.php @@ -56,7 +56,7 @@ $project1->stop(); $project2->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $project1->check_results(5, $result); $project1->compare_file("uc_wu_0_0", "uc_correct_output"); $project1->compare_file("uc_wu_1_0", "uc_correct_output"); diff --git a/test/test_backend.php b/test/test_backend.php index b9c26ae9dc..4c95fa9e8d 100644 --- a/test/test_backend.php +++ b/test/test_backend.php @@ -61,7 +61,7 @@ sleep(5); // *** DO TESTS HERE - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->exit_status = 0; $project->check_results(101, $result); diff --git a/test/test_concat.php b/test/test_concat.php index ddd57302b5..eaf4983352 100644 --- a/test/test_concat.php +++ b/test/test_concat.php @@ -30,10 +30,10 @@ $work->install($project); $project->start_servers(); - $host->run("-exit_when_idle"); + $host->run("-exit_when_idle -skip_cpu_benchmarks"); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $project->check_results(2, $result); $project->compare_file("concat_wu_0_0", "concat_correct_output"); $project->compare_file("concat_wu_1_0", "concat_correct_output"); diff --git a/test/test_download_backoff.php b/test/test_download_backoff.php index 36ebf53c4c..3faf5e4664 100644 --- a/test/test_download_backoff.php +++ b/test/test_download_backoff.php @@ -49,7 +49,7 @@ pcntl_waitpid($pid, $status, 0); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/test_loop.php b/test/test_loop.php index 642cac99e6..02e9c34722 100644 --- a/test/test_loop.php +++ b/test/test_loop.php @@ -22,7 +22,7 @@ $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"; diff --git a/test/test_masterurl_failure.php b/test/test_masterurl_failure.php index 6d0aa1f482..2b634f7022 100644 --- a/test/test_masterurl_failure.php +++ b/test/test_masterurl_failure.php @@ -47,7 +47,7 @@ pcntl_waitpid($pid,$status,0); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/test_mdownload_backoff.php b/test/test_mdownload_backoff.php index f1b3d2bf8a..084ba7b87a 100644 --- a/test/test_mdownload_backoff.php +++ b/test/test_mdownload_backoff.php @@ -49,7 +49,7 @@ pcntl_waitpid($pid,$status,0); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/test_pers.php b/test/test_pers.php index 1cb170751f..66fec374a8 100644 --- a/test/test_pers.php +++ b/test/test_pers.php @@ -139,7 +139,7 @@ while(1) $project->stop(); -$result->state = RESULT_STATE_DONE; +$result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/test_rsc.php b/test/test_rsc.php index 9509fb52b2..f29c41364b 100644 --- a/test/test_rsc.php +++ b/test/test_rsc.php @@ -15,9 +15,10 @@ $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"; @@ -31,10 +32,10 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start_feeder(); - $host->run("-exit_when_idle"); + $project->start_servers(); + $host->run("-exit_when_idle -skip_cpu_benchmarks"); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $project->check_results(0, $result); ?> diff --git a/test/test_sched_failure.php b/test/test_sched_failure.php index d7403c989a..7fe669dccb 100644 --- a/test/test_sched_failure.php +++ b/test/test_sched_failure.php @@ -48,7 +48,7 @@ pcntl_waitpid($pid,$status,0); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/test_sticky.php b/test/test_sticky.php index 46b6c2fed3..0f8a98fec7 100644 --- a/test/test_sticky.php +++ b/test/test_sticky.php @@ -14,9 +14,10 @@ $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"; @@ -28,17 +29,17 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start_feeder(); - $host->run("-exit_when_idle"); + $project->start_servers(); + $host->run("-exit_when_idle -skip_cpu_benchmarks"); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $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->compare_file("uc_wu_sticky_0_0", "uc_correct_output"); + $project->compare_file("uc_wu_sticky_1_0", "uc_correct_output"); // make sure result files are still there - $host->check_file_present($project, "uc_wu_0_0"); - $host->check_file_present($project, "uc_wu_1_0"); + $host->check_file_present($project, "uc_wu_sticky_0_0"); + $host->check_file_present($project, "uc_wu_sticky_1_0"); ?> diff --git a/test/test_suite.php b/test/test_suite.php index 96cc05d4f9..d1e69358bb 100644 --- a/test/test_suite.php +++ b/test/test_suite.php @@ -3,15 +3,26 @@ //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"); + 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); if($retval) printf("test_concat.php did not run correctly\n"); + sleep(3); PassThru("test_rsc.php", $retval); 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"); ?> diff --git a/test/test_time.php b/test/test_time.php index 7f4b890d15..89132c58ac 100644 --- a/test/test_time.php +++ b/test/test_time.php @@ -35,7 +35,7 @@ $host->run("-exit_when_idle"); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $project->check_results(1, $result); $project->compare_file("uccpu_wu_0_0", "uc_small_correct_output"); $client_time = $host->read_cpu_time_file("client_time"); diff --git a/test/test_uc.php b/test/test_uc.php index 6678770e26..e53bd7c1e9 100644 --- a/test/test_uc.php +++ b/test/test_uc.php @@ -56,10 +56,10 @@ $project->stop(); $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->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_1_0", "uc_correct_output"); diff --git a/test/test_uc_win.php b/test/test_uc_win.php index f7a2ecce79..51c15703cd 100644 --- a/test/test_uc_win.php +++ b/test/test_uc_win.php @@ -10,31 +10,37 @@ $host = new Host($user); $app = new App("upper_case"); $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"; - $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->wu_template = "uc_wu"; $work->result_template = "uc_result"; $work->redundancy = 2; 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); - $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->compare_file("uc_wu_0_0", "uc_correct_output"); - //$project->compare_file("uc_wu_1_0", "uc_correct_output"); + $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"); + */ ?> diff --git a/test/test_upload_backoff.php b/test/test_upload_backoff.php index 4ec08aa8d5..cdcaa7658c 100644 --- a/test/test_upload_backoff.php +++ b/test/test_upload_backoff.php @@ -49,7 +49,7 @@ pcntl_waitpid($pid, $status,0); $project->stop(); - $result->state = RESULT_STATE_DONE; + $result->server_state = RESULT_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $project->check_results(2, $result); diff --git a/test/uc_result_sticky b/test/uc_result_sticky index 9f115de165..7c03092c71 100644 --- a/test/uc_result_sticky +++ b/test/uc_result_sticky @@ -7,10 +7,8 @@ - - - 1 + out diff --git a/test/uc_wu_sticky b/test/uc_wu_sticky index b9b6da5bd6..4b0b2bad60 100644 --- a/test/uc_wu_sticky +++ b/test/uc_wu_sticky @@ -1,14 +1,10 @@ - - - + 0 - - upper_case - - 0 + 0 + in