$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->start_feeder = true; $project->start_make_work = true; $project->start_validate = true; $project->start_file_delete = true; $project->start_assimilator = true; $project->install(); // must install projects before adding to hosts $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"; $work->result_template = "uc_result"; $work->redundancy = 3; array_push($work->input_files, "input"); $work->install($project); $project->start_feeder(); $project->start_make_work($work); $project->start_validate($app, 3); $project->start_file_delete(); $project->start_assimilator($app); $project->start_stripchart(); //$project->start_servers(); $host->run(); $project->stop();
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(); $project->deinstall_make_work(); $project->install_assimilator($app); $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); } // Restart the server $project->restart(); $project->start_servers(); // Run the client until there's no more work $host->run("-exit_when_idle -skip_cpu_benchmarks"); // Give the server 30 seconds to finish assimilating/deleting sleep(30); // *** DO CHECKS HERE $result->server_state = RESULT_SERVER_STATE_OVER; $result->exit_status = 0; $project->check_results(500, $result); // Stop the server $project->stop(); test_done();
break; } if ($temp > $file_size) { print "\n filesize increased, it is : " . $temp; if ($temp > 20000 && $first == 0) { print "\n stopping and rerunning the client"; print "\nkilling {$client_pid}"; $host->kill($client_pid, null); $host->run_asynch("-exit_when_idle -limit_transfer_rate 2048"); $client_pid = $host->get_new_client_pid($client_pid); echo "\nnew client_pid is {$client_pid}"; $first++; } } $file_size = $temp; if ($file_size == filesize("{$source_dir}/test/uc_correct_output")) { print "\n all of the files has been uploaded"; print "\n stopping and rerunning the client"; $host->kill($client_pid, null); $host->run("-exit_when_idle"); break; } } } $project->stop(); $result->server_state = RESULT_SERVER_STATE_OVER; $result->stderr_out = "APP: upper_case: starting, argc 1"; $result->exit_status = 0; $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->add_app_version($app_version); $project->install(); // must install projects before adding to hosts $host->log_flags = "log_flags.xml"; $host->add_project($project); $host->install(); echo "adding work\n"; $work = new Work($app); $work->wu_template = "uccpu_wu"; $work->result_template = "uccpu_result"; $work->redundancy = 1; array_push($work->input_files, "small_input"); $work->install($project); $project->start_feeder(); $app_time = 0; $host->run("-exit_after_app_start 400"); $app_time += $host->read_cpu_time_file("app.time"); $host->run("-exit_when_idle"); $project->stop(); $result->server_state = RESULT_SERVER_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"); $x = mysql_query("select cpu_time from result where name='uccpu_wu_0'"); $result = mysql_fetch_object($x); $db_time = $result->cpu_time; if (abs($app_time - $client_time) > 0.01) { echo "time mismatch\n"; } if (abs($app_time - $db_time) > 0.01) { echo "time mismatch\n";
#!/usr/local/bin/php -q <?php // This tests whether the result abort mechanism is working include_once "test.inc"; test_msg("result abort mechanism (disk space limit)"); $project = new Project(); $project->add_app_and_version("upper_case"); $user = new User(); $project->add_user($user); $project->install(); // must install projects before adding to hosts $project->install_feeder(); $host = new Host(); $host->add_user($user, $project); $host->install(); $work = new Work(); $work->wu_template = "uc_wu"; $work->result_template = "abort_result"; $work->redundancy = 2; array_push($work->input_files, "input"); $work->install($project); $project->start_servers(); $host->run("-exit_when_idle -skip_cpu_benchmarks -sched_retry_delay_min 1 >& /dev/null"); $project->validate(2); $result->server_state = RESULT_SERVER_STATE_OVER; $project->check_results(2, $result); $project->assimilate(); $project->file_delete(); $project->stop(); test_done();