From ada18d1d469d0898a58da37bce57b445a77e7d86 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 9 Oct 2002 04:56:41 +0000 Subject: [PATCH] make work svn path=/trunk/boinc/; revision=481 --- checkin_notes | 38 ++++++++++++ client/http.C | 5 +- db/db.h | 1 + db/db_mysql.C | 7 +++ html/ops/index.html | 27 ++++---- sched/Makefile.in | 12 +++- sched/feeder.C | 16 +++-- sched/file_upload_handler.C | 5 ++ sched/handle_request.C | 87 +++++++++++++++++++------- sched/main.C | 9 +-- sched/make_work.C | 107 ++++++++++++++++++++++++++++++++ test/1sec_result | 2 - test/1sec_wu | 1 - test/concat_result | 2 - test/concat_wu | 1 - test/make_project.php | 2 +- test/sah_result | 2 - test/sah_wu | 1 - test/test.inc | 18 ++++-- test/test_1sec.php | 4 +- test/test_concat.php | 2 +- test/test_loop.php | 43 +++++++++++++ test/test_prefs.php | 2 +- test/test_rsc.php | 2 +- test/test_sticky.php | 2 +- test/test_time.php | 2 +- test/test_uc.php | 2 +- test/test_uc_slow.php | 2 +- test/test_uc_win.php | 2 +- test/uc_result | 2 - test/uc_wu | 1 - test/ucs_result | 2 - test/ucs_wu | 1 - tools/backend_lib.C | 12 +--- tools/backend_lib.h | 2 +- tools/process_result_template.C | 20 +----- 36 files changed, 327 insertions(+), 119 deletions(-) create mode 100644 sched/make_work.C create mode 100644 test/test_loop.php diff --git a/checkin_notes b/checkin_notes index 214af96631..5f57991777 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2077,3 +2077,41 @@ David Oct 3 2002 David Oct 3 2002 - updated test scripts to use new framework - got rid of some obsolete scripts + +David Oct 8 2002 + - progress getting "make_work" (dummy work generator) to work. + Removed the element from workunit XML, + and the and elements from result XML; + instead, the scheduler server inserts these as it sends them. + + This simplifies things a little in work generation, + and removes some redundancy. + + Everything seems to work now except that the file upload signature + ends up being wrong, which is expected, + and it shows that the security mechanism works. + - added test_loop.php, which simulates a system that is complete + except for the validation process. + + client/ + http.C + db/ + db.h + db_mysql.C + html_ops/ + index.html + sched/ + Makefile.in + feeder.C + file_upload_handler.C + handle_request.C + main.C + make_work.C (new) + test/ + *_result + *_wu + *.php + test_loop.php (new) + tools/ + backend_lib.C,h + process_result_template.C diff --git a/client/http.C b/client/http.C index 202bdcd041..cd45e169d6 100644 --- a/client/http.C +++ b/client/http.C @@ -482,9 +482,8 @@ bool HTTP_OP_SET::poll() { break; case HTTP_OP_POST: retval = unlink(htp->outfile); - if (retval) { - printf("ERROR: unlink %d\n", retval); - } + // no error check here because file need not already exist + // // fall through case HTTP_OP_GET: htp->http_op_state = HTTP_STATE_REPLY_BODY; diff --git a/db/db.h b/db/db.h index 62dcd1cbbb..d5dcd90a0f 100644 --- a/db/db.h +++ b/db/db.h @@ -315,5 +315,6 @@ extern int db_result_update(RESULT& p); extern int db_result_lookup_name(RESULT& p); extern int db_result_enum_to_send(RESULT&, int); extern int db_result_enum_wuid(RESULT&); +extern int db_result_count_state(int state, int&); #endif diff --git a/db/db_mysql.C b/db/db_mysql.C index f506a4a8f9..853ffcb82d 100644 --- a/db/db_mysql.C +++ b/db/db_mysql.C @@ -637,3 +637,10 @@ int db_result_enum_wuid(RESULT& p) { if (!e.active) sprintf(buf, "where workunitid=%d", p.workunitid); return db_enum(e, &p, TYPE_RESULT, buf); } + +int db_result_count_state(int state, int& n) { + char buf[256]; + + sprintf(buf, " where state=%d", state); + return db_count(&n, "*", TYPE_RESULT, buf); +} diff --git a/html/ops/index.html b/html/ops/index.html index 14acf2156c..1cc6cf2ae1 100644 --- a/html/ops/index.html +++ b/html/ops/index.html @@ -1,24 +1,19 @@ - - -Operational Interface - - -Project Information +BOINC Project Management Interface +

BOINC Project Management Interface

+Project Information

-Platform Information +Platform Information

-Application Information +Application Information

-Application Version Information +Application Version Information

-User Information +User Information

-Team Information +Team Information

-Host Information +Host Information

-Workunit Information +Workunit Information

-Result Information - - +Result Information diff --git a/sched/Makefile.in b/sched/Makefile.in index c74fd05e60..0bfe5312ce 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -16,7 +16,7 @@ CC = g++ $(CFLAGS) CLIBS = @LIBS@ -PROGS = cgi feeder show_shmem file_upload_handler validate_test +PROGS = cgi feeder show_shmem file_upload_handler validate_test make_work all: $(PROGS) @@ -66,6 +66,13 @@ VALIDATE_OBJS = \ ../db/mysql_util.o \ ../lib/parse.o +MAKE_WORK_OBJS = \ + make_work.o \ + config.o \ + ../db/db_mysql.o \ + ../db/mysql_util.o \ + ../lib/parse.o + FCGI_OBJS = \ handle_request.fcgi.o \ main.fcgi.o \ @@ -116,6 +123,9 @@ file_upload_handler: $(FILE_UPLOAD_OBJS) validate_test: $(VALIDATE_OBJS) $(CC) $(VALIDATE_OBJS) $(MYSQL_LIBS) $(CLIBS) -o validate_test +make_work: $(MAKE_WORK_OBJS) + $(CC) $(MAKE_WORK_OBJS) $(MYSQL_LIBS) $(CLIBS) -o make_work + fcgi: $(FCGI_OBJS) $(CC) $(FCGI_OBJS) $(MYSQL_LIBS) $(CLIBS) $(FCGI_LIBS) \ -o fcgi diff --git a/sched/feeder.C b/sched/feeder.C index 56d0528264..15ffb73b70 100644 --- a/sched/feeder.C +++ b/sched/feeder.C @@ -55,7 +55,7 @@ #include "sched_shmem.h" #define RESULTS_PER_ENUM 100 -#define TRIGGER_FILENAME "feeder_trigger" +#define TRIGGER_FILENAME "stop_server" CONFIG config; @@ -70,7 +70,6 @@ int check_trigger(SCHED_SHMEM* ssp) { if (!strcmp(buf, "\n")) { detach_shmem((void*)ssp); destroy_shmem(config.shmem_key); - unlink(TRIGGER_FILENAME); exit(0); } else if (!strcmp(buf, "\n")) { ssp->init(); @@ -79,7 +78,6 @@ int check_trigger(SCHED_SHMEM* ssp) { fprintf(stderr, "feeder: unknown command in trigger file: %s\n", buf); exit(0); } - unlink(TRIGGER_FILENAME); return 0; } @@ -129,6 +127,7 @@ void feeder_loop(SCHED_SHMEM* ssp) { retval = db_result_enum_to_send(result, RESULTS_PER_ENUM); printf("feeder: restarting enumeration: %d\n", retval); if (retval) { + printf("feeder: enumeration returned nothing\n"); no_wus = true; break; } @@ -144,9 +143,12 @@ void feeder_loop(SCHED_SHMEM* ssp) { } } if (!collision) { - printf("feeder: adding result %d\n", result.id); + printf("feeder: adding result %d in slot %d\n", result.id, i); retval = db_workunit(result.workunitid, wu); - if (retval) continue; + if (retval) { + printf("feeder: can't read workunit %d\n", result.workunitid); + continue; + } ssp->wu_results[i].result = result; ssp->wu_results[i].workunit = wu; ssp->wu_results[i].present = true; @@ -155,6 +157,7 @@ void feeder_loop(SCHED_SHMEM* ssp) { } } if (nadditions == 0) { + printf("feeder: no results added\n"); sleep(1); } else { printf("feeder: added %d results to array\n", nadditions); @@ -167,6 +170,7 @@ void feeder_loop(SCHED_SHMEM* ssp) { printf("feeder: some results already in array - sleeping\n"); sleep(5); } + fflush(stdout); check_trigger(ssp); ssp->ready = true; } @@ -178,6 +182,8 @@ int main(int argc, char** argv) { bool asynch = false; void* p; + unlink(TRIGGER_FILENAME); + retval = config.parse_file(); if (retval) { fprintf(stderr, "feeder: can't parse config file\n"); diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 46c7e72dd3..321becf98b 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -133,11 +133,16 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) { return retval; } bytes_left = nbytes - offset; + if (bytes_left == 0) { + fprintf(stderr, "file_upload_handler: offset == nbytes!! %f\n", nbytes); + return 0; + } while (1) { m = BLOCK_SIZE; if (m > bytes_left) m = (int)bytes_left; n = fread(buf, 1, m, in); if (n <= 0) { + fprintf(stderr, "file_upload_handler: fread: asked for %d, return %d\n", m, n); print_status(-1, "can't fread socket"); return -1; } diff --git a/sched/handle_request.C b/sched/handle_request.C index b7add00db6..edf20819e3 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -46,31 +46,47 @@ bool wu_is_feasible(WORKUNIT& wu, HOST& host) { } // estimate the time that a WU will take on a host +// TODO: improve this. take memory bandwidth into account // double estimate_duration(WORKUNIT& wu, HOST& host) { - if (host.p_fpops <= 0) host.p_fpops = 1; - if (host.p_iops <= 0) host.p_iops = 1; - if (wu.rsc_fpops <= 0) wu.rsc_fpops = 1; - if (wu.rsc_iops <= 0) wu.rsc_iops = 1; + if (host.p_fpops <= 0) host.p_fpops = 1e9; + if (host.p_iops <= 0) host.p_iops = 1e9; + if (wu.rsc_fpops <= 0) wu.rsc_fpops = 1e12; + if (wu.rsc_iops <= 0) wu.rsc_iops = 1e12; return wu.rsc_fpops/host.p_fpops + wu.rsc_iops/host.p_iops; } -// insert an element in xml_doc with an estimation of how many seconds -// a workunit will take to complete +// insert "text" right after "after" in the given buffer // -int insert_time_tag(WORKUNIT& wu, double seconds) { - char *location; +int insert_after(char* buffer, char* after, char* text) { + char* p; + char temp[MAX_BLOB_SIZE]; - location = strstr(wu.xml_doc, ""); - if ((location - wu.xml_doc) > (MAX_BLOB_SIZE - 64)) { - return -1; //not enough space to include time info - } - sprintf(location, - " %f\n" - "\n", + if (strlen(buffer) + strlen(text) > MAX_BLOB_SIZE-1) return -1; + p = strstr(buffer, after); + if (!p) return -1; + p += strlen(after); + strcpy(temp, p); + strcpy(p, text); + strcat(p, temp); + return 0; +} + +// add elements in xml_doc: +// WU name, and estimation of how many seconds it will take +// +int insert_wu_tags(WORKUNIT& wu, double seconds) { + char buf[256]; + int retval; + + sprintf(buf, + " %f\n", seconds ); - return 0; + retval = insert_after(wu.xml_doc, "\n", buf); + if (retval) return retval; + sprintf(buf, " %s\n", wu.name); + return insert_after(wu.xml_doc, "\n", buf); } // add the given workunit to a reply. @@ -84,6 +100,7 @@ int add_wu_to_reply( APP* app; APP_VERSION* app_version; int retval; + WORKUNIT wu2; app = ss.lookup_app(wu.appid); if (!app) return -1; @@ -98,9 +115,10 @@ int add_wu_to_reply( // add time estimate to reply // - retval = insert_time_tag(wu, seconds_to_complete); + wu2 = wu; // make copy since we're going to modify its XML field + retval = insert_wu_tags(wu2, seconds_to_complete); if (retval) return retval; - reply.insert_workunit_unique(wu); + reply.insert_workunit_unique(wu2); return 0; } @@ -278,6 +296,11 @@ int handle_results( for (i=0; iname, sizeof(result.name)); retval = db_result_lookup_name(result); if (retval) { @@ -325,15 +348,23 @@ int handle_results( retval = db_workunit_update(wu); } } - - // acknowledge the result even if we couldn't find it -- - // don't want it to keep coming back - // - reply.result_acks.push_back(*rp); } return 0; } +int insert_name_tags(RESULT& result, WORKUNIT& wu) { + char buf[256]; + int retval; + + sprintf(buf, "%s\n", result.name); + retval = insert_after(result.xml_doc_in, "\n", buf); + if (retval) return retval; + sprintf(buf, "%s\n", wu.name); + retval = insert_after(result.xml_doc_in, "\n", buf); + if (retval) return retval; + return 0; +} + int send_work( SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, PLATFORM& platform, SCHED_SHMEM& ss @@ -363,14 +394,22 @@ int send_work( ) { continue; } + wu = ss.wu_results[i].workunit; result = ss.wu_results[i].result; ss.wu_results[i].present = false; - + retval = add_wu_to_reply(wu, reply, platform, ss, estimate_duration(wu, reply.host) ); if (retval) continue; + + fprintf(stderr, "sending result name %s, id %d\n", result.name, result.id); + + retval = insert_name_tags(result, wu); + if (retval) { + fprintf(stderr, "send_work: can't insert name tags\n"); + } reply.insert_result(result); seconds_to_fill -= (int)estimate_duration(wu, reply.host); diff --git a/sched/main.C b/sched/main.C index 9fb71d2d17..0230689289 100644 --- a/sched/main.C +++ b/sched/main.C @@ -35,13 +35,8 @@ using namespace std; #include "handle_request.h" #include "main.h" -#if 1 -#define REQ_FILE_PREFIX "/tmp/boinc_req_" -#define REPLY_FILE_PREFIX "/tmp/boinc_reply_" -#else -#define REQ_FILE_PREFIX "/disks/milkyway/a/users/anderson/boinc_cvs/boinc/sched/boinc_req_" -#define REPLY_FILE_PREFIX "/disks/milkyway/a/users/anderson/boinc_cvs/boinc/sched/boinc_reply_" -#endif +#define REQ_FILE_PREFIX "boinc_req_" +#define REPLY_FILE_PREFIX "boinc_reply_" PROJECT gproject; CONFIG config; diff --git a/sched/make_work.C b/sched/make_work.C new file mode 100644 index 0000000000..7907be66b8 --- /dev/null +++ b/sched/make_work.C @@ -0,0 +1,107 @@ +// make_work.C +// +// Create result records as needed to maintain a pool to send +// +// This reads a result record from the DB, then makes clones of it. +// Assumes the result has a single output file, +// so overwrites the first element with a new name + +#include +#include +#include +#include +#include + +#include "db.h" +#include "config.h" + +#define TRIGGER_FILENAME "stop_server" + +void check_trigger() { + FILE* f = fopen(TRIGGER_FILENAME, "r"); + if (!f) return; + exit(0); +} + +void replace_element(char* buf, char* start, char* end, char* replacement) { + char temp[MAX_BLOB_SIZE], *p, *q; + + p = strstr(buf, start); + p += strlen(start); + q = strstr(p, end); + strcpy(temp, q); + strcpy(p, replacement); + strcat(p, temp); +} + +void make_work() { + CONFIG config; + RESULT result; + int retval, i=time(0), n; + char buf[256]; + + retval = config.parse_file(); + if (retval) { + fprintf(stderr, "make_work: can't read config file\n"); + exit(1); + } + + retval = db_open(config.db_name, config.db_passwd); + if (retval) { + fprintf(stderr, "make_work: can't open db\n"); + exit(1); + } + + retval = db_result(1, result); + if (retval) { + fprintf(stderr, "make_work: can't read result\n"); + exit(1); + } + + while (true) { + fflush(stdout); + retval = db_result_count_state(RESULT_STATE_UNSENT, n); + if (retval) { + fprintf(stderr, "make_work: can't counts results\n"); + exit(1); + } + printf("make_work: %d results\n", n); + if (n > 10) { + sleep(1); + continue; + } + result.id = 0; + result.create_time = time(0); + sprintf(result.name, "result_%d", i++); + result.state = RESULT_STATE_UNSENT; + result.validate_state = VALIDATE_STATE_INITIAL; + replace_element(result.xml_doc_in, "", "", result.name); + replace_element(result.xml_doc_in, "", "", result.name); + retval = db_result_new(result); + if (retval) { + fprintf(stderr, "make_work: can't create result\n"); + exit(1); + } + printf("make_work: added a result\n"); + } +} + +int main(int argc, char** argv) { + bool asynch = false; + int i; + + unlink(TRIGGER_FILENAME); + for (i=1; i100000 - - out diff --git a/test/1sec_wu b/test/1sec_wu index fcf9aab814..7afa9822d2 100644 --- a/test/1sec_wu +++ b/test/1sec_wu @@ -1,4 +1,3 @@ - 1sec diff --git a/test/concat_result b/test/concat_result index 89ef62c693..f4a2b7fa37 100644 --- a/test/concat_result +++ b/test/concat_result @@ -6,8 +6,6 @@ 120000 - - out diff --git a/test/concat_wu b/test/concat_wu index 937158aa1d..2db68e077b 100644 --- a/test/concat_wu +++ b/test/concat_wu @@ -9,7 +9,6 @@ - concat diff --git a/test/make_project.php b/test/make_project.php index 984fdb8ab3..01218aa7f7 100644 --- a/test/make_project.php +++ b/test/make_project.php @@ -13,5 +13,5 @@ $project->add_app($app); $project->add_app_version($app_version); $project->install(); - $project->start(); + $project->start_feeder(); ?> diff --git a/test/sah_result b/test/sah_result index 4e403f98dc..fb78b1d779 100644 --- a/test/sah_result +++ b/test/sah_result @@ -6,8 +6,6 @@ 100000 - - outfile.sah diff --git a/test/sah_wu b/test/sah_wu index aec9cbd3d7..efea48a109 100644 --- a/test/sah_wu +++ b/test/sah_wu @@ -4,7 +4,6 @@ - setiathome-3.06 diff --git a/test/test.inc b/test/test.inc index 69fc8fdfc2..19e4946579 100644 --- a/test/test.inc +++ b/test/test.inc @@ -128,7 +128,8 @@ class Project { $this->master_url = get_env_var("BOINC_HTML_URL")."/".$this->name."/html_user/index.html"; PassThru("rm -rf $this->project_dir"); PassThru("mkdir $this->project_dir"); - PassThru("mkdir $this->project_dir/cgi"); + // make the CGI writeable in case scheduler writes req/reply files + PassThru("mkdir $this->project_dir/cgi; chmod uog+w $this->project_dir/cgi"); PassThru("mkdir $this->project_dir/upload; chmod uog+w $this->project_dir/upload"); PassThru("mkdir $this->project_dir/download"); PassThru("mkdir $this->project_dir/keys"); @@ -174,11 +175,12 @@ class Project { run_tool("add app_version -db_name $this->db_name -app_name $app->name -platform_name $platform -version $app_version->version -download_dir $this->project_dir/download -download_url $this->download_url -code_sign_keyfile $this->key_dir/code_sign_private -exec_dir $source_dir/apps -exec_files $app_version->exec_name"); } - // copy the CGI programs and feeder to the project dir, + // copy the server programs to the project /cgi dir, // and make a config file there // PassThru("cp $source_dir/sched/cgi $this->project_dir/cgi/"); PassThru("cp $source_dir/sched/file_upload_handler $this->project_dir/cgi/"); + PassThru("cp $source_dir/sched/make_work $this->project_dir/cgi/"); PassThru("cp $source_dir/sched/feeder $this->project_dir/cgi/"); $f = fopen("$this->project_dir/cgi/config.xml", "w"); fputs($f, "\n"); @@ -227,16 +229,20 @@ class Project { // show the URLs for user and admin sites // echo "The master URL for project $this->name is $this->master_url\n"; - $admin_url = $html_url.$this->name."/html_ops/index.html"; + $admin_url = $html_url."/".$this->name."/html_ops/index.html"; echo "The admin URL for project $this->name is $admin_url\n"; } - function start(){ + function start_feeder(){ PassThru("cd $this->project_dir/cgi; feeder -asynch > feeder_out"); } + function start_make_work(){ + PassThru("cd $this->project_dir/cgi; make_work -asynch > make_work_out"); + } + function stop() { - $f = fopen($this->project_dir."/cgi/feeder_trigger", "w"); + $f = fopen($this->project_dir."/cgi/stop_server", "w"); fputs($f, "\n"); fclose($f); } @@ -358,7 +364,7 @@ class Host { echo "Running core client\n"; $source_dir = get_env_var("BOINC_SRC_DIR"); $platform = get_env_var("BOINC_PLATFORM"); - PassThru("cd $this->host_dir; $source_dir/client/boinc_1_$platform $args"); + PassThru("cd $this->host_dir; $source_dir/client/boinc_1_$platform $args> client.out"); } // read a CPU time file written by the client. diff --git a/test/test_1sec.php b/test/test_1sec.php index 3353b49e74..a58a6b872f 100644 --- a/test/test_1sec.php +++ b/test/test_1sec.php @@ -40,8 +40,8 @@ $work->install($project1); $work->install($project2); - $project1->start(); - $project2->start(); + $project1->start_feeder(); + $project2->start_feeder(); $host->run("-exit_when_idle"); $project1->stop(); $project2->stop(); diff --git a/test/test_concat.php b/test/test_concat.php index 4e3a938870..415f825eb9 100644 --- a/test/test_concat.php +++ b/test/test_concat.php @@ -27,7 +27,7 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start(); + $project->start_feeder(); $host->run("-exit_when_idle"); $project->stop(); diff --git a/test/test_loop.php b/test/test_loop.php new file mode 100644 index 0000000000..c59348133a --- /dev/null +++ b/test/test_loop.php @@ -0,0 +1,43 @@ +#! /usr/local/bin/php +add_user($user); + $project->add_app($app); + $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 = "uc_wu"; + $work->result_template = "uc_result"; + $work->nresults = 2; + array_push($work->input_files, "input"); + $work->install($project); + + $project->start_feeder(); + $project->start_make_work(); + $host->run(""); + //$project->stop(); + + //$result->state = RESULT_STATE_DONE; + //$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"); +?> diff --git a/test/test_prefs.php b/test/test_prefs.php index 574d965835..17c568eef5 100644 --- a/test/test_prefs.php +++ b/test/test_prefs.php @@ -29,7 +29,7 @@ array_push($work->input_files, "small_input"); $work->install($project); - $project->start(); + $project->start_feeder(); echo "Now run the client manually; start and stop it a few times.\n"; diff --git a/test/test_rsc.php b/test/test_rsc.php index f01afefc2a..df17497521 100644 --- a/test/test_rsc.php +++ b/test/test_rsc.php @@ -30,7 +30,7 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start(); + $project->start_feeder(); $host->run("-exit_when_idle"); $project->stop(); diff --git a/test/test_sticky.php b/test/test_sticky.php index aedf22d179..649dfb70d4 100644 --- a/test/test_sticky.php +++ b/test/test_sticky.php @@ -28,7 +28,7 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start(); + $project->start_feeder(); $host->run("-exit_when_idle"); $project->stop(); diff --git a/test/test_time.php b/test/test_time.php index e12d3ba53a..942d430f69 100644 --- a/test/test_time.php +++ b/test/test_time.php @@ -28,7 +28,7 @@ array_push($work->input_files, "small_input"); $work->install($project); - $project->start(); + $project->start_feeder(); $app_time = 0; $host->run("-exit_after 400"); $app_time += $host->read_cpu_time_file("app.time"); diff --git a/test/test_uc.php b/test/test_uc.php index e0aab22724..7665758b4a 100644 --- a/test/test_uc.php +++ b/test/test_uc.php @@ -29,7 +29,7 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start(); + $project->start_feeder(); $host->run("-exit_when_idle"); $project->stop(); diff --git a/test/test_uc_slow.php b/test/test_uc_slow.php index 5446012716..322063f53b 100644 --- a/test/test_uc_slow.php +++ b/test/test_uc_slow.php @@ -29,7 +29,7 @@ array_push($work->input_files, "small_input"); $work->install($project); - $project->start(); + $project->start_feeder(); echo "Now run the client manually; start and stop it a few times\n"; //compare_file("ucs_wu_0_0", "uc_small_correct_output"); ?> diff --git a/test/test_uc_win.php b/test/test_uc_win.php index e06bf90c13..51fa414611 100644 --- a/test/test_uc_win.php +++ b/test/test_uc_win.php @@ -25,7 +25,7 @@ array_push($work->input_files, "input"); $work->install($project); - $project->start(); + $project->start_feeder(); echo "go run the client\n"; diff --git a/test/uc_result b/test/uc_result index 78761e281d..c8e23f43d1 100644 --- a/test/uc_result +++ b/test/uc_result @@ -6,8 +6,6 @@ - - out diff --git a/test/uc_wu b/test/uc_wu index 1362d6c9a1..73e050eca7 100644 --- a/test/uc_wu +++ b/test/uc_wu @@ -4,7 +4,6 @@ - upper_case diff --git a/test/ucs_result b/test/ucs_result index 2be46c987e..854f54a040 100644 --- a/test/ucs_result +++ b/test/ucs_result @@ -6,8 +6,6 @@ 100000 - - out diff --git a/test/ucs_wu b/test/ucs_wu index ce3640c64a..e40ebe575e 100644 --- a/test/ucs_wu +++ b/test/ucs_wu @@ -4,7 +4,6 @@ - upper_case diff --git a/tools/backend_lib.C b/tools/backend_lib.C index a51367516f..715a695a24 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -30,8 +30,6 @@ #define INFILE_MACRO "" -#define RESULT_NAME_MACRO "" #define OUTFILE_MACRO "" #define DOWNLOAD_URL_MACRO "" @@ -57,7 +55,6 @@ int read_filename(char* path, char* buf) { // replace INFILE_x with filename from array, // MD5_x with checksum of file, -// WU_NAME with WU name // static int process_wu_template( char* wu_name, char* tmplate, char* out, @@ -122,13 +119,6 @@ static int process_wu_template( strcpy(p, md5); strcat(p, buf); } - p = strstr(out, WU_NAME_MACRO); - if (p) { - found = true; - strcpy(buf, p+strlen(WU_NAME_MACRO)); - strcpy(p, wu_name); - strcat(p, buf); - } if (!found) break; } return 0; @@ -161,7 +151,7 @@ int create_result( result_template_file, tempfile, key, - base_outfile_name, wu.name, r.name, + base_outfile_name, upload_url, download_url ); rewind(tempfile); diff --git a/tools/backend_lib.h b/tools/backend_lib.h index 751ce1fc6a..e26ed35549 100644 --- a/tools/backend_lib.h +++ b/tools/backend_lib.h @@ -22,7 +22,7 @@ extern int process_result_template( FILE* in, FILE* out, R_RSA_PRIVATE_KEY& key, - char* base_filename, char* wu_name, char* result_name, + char* base_filename, char* upload_url, char* download_url ); diff --git a/tools/process_result_template.C b/tools/process_result_template.C index 28c3d2fac0..b29b918b5d 100644 --- a/tools/process_result_template.C +++ b/tools/process_result_template.C @@ -32,8 +32,6 @@ #include "parse.h" #include "crypt.h" -#define WU_NAME_MACRO "" -#define RESULT_NAME_MACRO "" #define OUTFILE_MACRO "" #define DOWNLOAD_URL_MACRO "" @@ -41,7 +39,7 @@ int process_result_template( FILE* in, FILE* out, R_RSA_PRIVATE_KEY& key, - char* base_filename, char* wu_name, char* result_name, + char* base_filename, char* upload_url, char* download_url ) { char* p,*q, *signed_xml=strdup(""); @@ -55,8 +53,6 @@ int process_result_template( assert(in!=NULL); assert(out!=NULL); assert(base_filename!=NULL); - assert(wu_name!=NULL); - assert(result_name!=NULL); while (fgets(buf, 256, in)) { // when we reach the end of a element, @@ -113,20 +109,6 @@ int process_result_template( strcpy(p, download_url); strcat(p, temp); } - p = strstr(buf, WU_NAME_MACRO); - if (p) { - found = true; - strcpy(temp, p+strlen(WU_NAME_MACRO)); - strcpy(p, wu_name); - strcat(p, temp); - } - p = strstr(buf, RESULT_NAME_MACRO); - if (p) { - found = true; - strcpy(temp, p+strlen(RESULT_NAME_MACRO)); - strcpy(p, result_name); - strcat(p, temp); - } if (!found) break; } strcatdup(signed_xml, buf);