1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
10 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
11 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
13 my $svc_conf = 'svc.conf';
15 # copy the configuation files
16 if ($server->PutFile ($svc_conf) == -1) {
17 print STDERR
"ERROR: cannot set file <".$server->LocalFile ($svc_conf).">\n";
20 if ($server->PutFile ($svc_conf.'.xml') == -1) {
21 print STDERR
"ERROR: cannot set file <".$server->LocalFile ($svc_conf.'.xml').">\n";
24 if ($client->PutFile ($svc_conf) == -1) {
25 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf).">\n";
28 if ($client->PutFile ($svc_conf.'.xml') == -1) {
29 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf.'.xml').">\n";
33 $number_of_clients = 4;
39 description
=> "Invoking methods on servant in default thread pool",
42 description
=> "Invoking methods on servant in first RT thread pool (without lanes)",
45 description
=> "Invoking methods on servant in second RT thread pool (with lanes)",
49 for $test (@configurations) {
50 $server->DeleteFile ($test->{file
});
51 $client->DeleteFile ($test->{file
});
61 for ($i = 0; $i < $clients; $i++) {
62 $CL[$i] = $client->CreateProcess ("client", $arg);
66 for ($i = 0; $i < $clients; $i++) {
67 $client_status = $CL[$i]->WaitKill ($client->ProcessStopWaitInterval () + 120);
68 if ($client_status != 0) {
69 print STDERR
"ERROR: client returned $client_status\n";
74 print STDERR
"Finished running clients";
77 $SV = $server->CreateProcess ("server");
81 for $test (@configurations) {
82 if ($server->WaitForFileTimed ($test->{file
},
83 $server->ProcessStartWaitInterval()) == -1) {
84 $server_status = $SV->TimedWait (1);
85 if ($server_status == 2) {
86 # Mark as no longer running to avoid errors on exit.
91 print STDERR
"ERROR: cannot find ior file: $test->{file}\n";
98 for $test (@configurations) {
99 print STDERR
"\n*************************************************************\n";
100 print STDERR
"$test->{description}\n";
101 print STDERR
"*************************************************************\n\n";
103 $iorfile = $client->LocalFile ($test->{file
});
104 run_clients
("-k file://$iorfile", $number_of_clients);
105 print STDERR
"Prepare next cycle";
108 print STDERR
"\n************************\n";
109 print STDERR
"Shutting down the server\n";
110 print STDERR
"************************\n\n";
112 $client_iorfile = $client->LocalFile ($configurations[0]->{file
});
113 run_clients
("-k file://$client_iorfile -i 0 -x", 1);
117 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval () + $number_of_clients * 100);
119 if ($server_status != 0) {
120 print STDERR
"ERROR: server returned $server_status\n";
124 for $test (@configurations) {
125 $client->DeleteFile ($test->{file
});
126 $server->DeleteFile ($test->{file
});