2002-11-22 23:25:19 +00:00
#! /usr/local/bin/php
< ? php
2003-04-29 17:51:58 +00:00
// 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.
2002-11-22 23:25:19 +00:00
include_once ( " test.inc " );
$project = new Project ;
$user = new User ();
$host = new Host ( $user );
$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 -> install (); // must install projects before adding to hosts
2003-04-29 17:51:58 +00:00
$project -> install_feeder ();
2002-11-22 23:25:19 +00:00
$host -> log_flags = " log_flags.xml " ;
2003-04-29 17:51:58 +00:00
$host -> add_user ( $user , $project );
2002-11-22 23:25:19 +00:00
$host -> install ();
echo " adding work \n " ;
$work = new Work ( $app );
$work -> wu_template = " uc_wu " ;
$work -> result_template = " uc_result " ;
2002-12-05 19:13:06 +00:00
$work -> redundancy = 2 ;
2002-11-22 23:25:19 +00:00
array_push ( $work -> input_files , " input " );
$work -> install ( $project );
//delete the download_dir immediately
$project -> delete_downloaddir ();
2003-04-29 17:51:58 +00:00
$project -> start_servers ();
2002-11-22 23:25:19 +00:00
$pid = $host -> run_asynch ( " -exit_when_idle " );
2002-12-24 03:03:45 +00:00
echo " sleeping 100 secs \n " ;
sleep ( 100 );
$project -> reinstall_downloaddir ( null );
2002-11-22 23:25:19 +00:00
$status = 0 ;
//wait until the host has stopped running
2002-12-24 03:03:45 +00:00
pcntl_waitpid ( $pid , $status , 0 );
2002-11-22 23:25:19 +00:00
$project -> stop ();
2003-06-11 23:09:11 +00:00
$result -> server_state = RESULT_SERVER_STATE_OVER ;
2002-11-22 23:25:19 +00:00
$result -> stderr_out = " APP: upper_case: starting, argc 1 " ;
$result -> exit_status = 0 ;
$project -> check_results ( 2 , $result );
2002-11-30 01:10:33 +00:00
$project -> compare_file ( " uc_wu_0_0 " , " uc_correct_output " );
$project -> compare_file ( " uc_wu_1_0 " , " uc_correct_output " );
2002-11-22 23:25:19 +00:00
?>