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 $server->AddLibPath ('../Generic_Servant/.');
14 $client->AddLibPath ('../Generic_Servant/.');
25 for ($i = 0; $i <= $#ARGV; $i++) {
26 if ($ARGV[$i] eq "-h" || $ARGV[$i] eq "-?") {
27 print "run_test [-h] [-i iterations] [-o] [-f ior file]\n";
29 print "-h -- prints this information\n";
30 print "-f -- ior file\n";
31 print "-i iterations -- specifies iterations\n";
32 print "-o -- call issued are oneways\n";
35 elsif ($ARGV[$i] eq "-o") {
38 elsif ($ARGV[$i] eq "-i") {
39 $iterations = $ARGV[$i + 1];
42 elsif ($ARGV[$i] eq "-f") {
43 $iorbase = $ARGV[$i + 1];
47 $extra_args .= " " . $ARGV[$i];
51 $iorfile_1 = $iorbase."_1";
52 $iorfile_2 = $iorbase."_2";
53 $iorfile_3 = $iorbase."_3";
55 $server->DeleteFile($iorfile_1);
56 $server->DeleteFile($iorfile_2);
57 $server->DeleteFile($iorfile_3);
58 $client->DeleteFile($iorfile_1);
59 $client->DeleteFile($iorfile_2);
60 $client->DeleteFile($iorfile_3);
62 $iorfile_server = $server->LocalFile ("$iorbase");
64 $SV = $server->CreateProcess ("server", "-f $iorfile_server $extra_args");
65 $CL = $client->CreateProcess ("../Generic_Servant/client");
67 $server_status = $SV->Spawn ();
69 if ($server_status != 0) {
70 print STDERR
"ERROR: server returned $server\n";
74 if ($server->WaitForFileTimed ($iorfile_1,
75 $server->ProcessStartWaitInterval()) == -1) {
76 print STDERR
"ERROR: cannot find file <$iorfile_1>\n";
81 if ($server->WaitForFileTimed ($iorfile_2,
82 $server->ProcessStartWaitInterval()) == -1) {
83 print STDERR
"ERROR: cannot find file <$iorfile_2>\n";
88 if ($server->WaitForFileTimed ($iorfile_3,
89 $server->ProcessStartWaitInterval()) == -1) {
90 print STDERR
"ERROR: cannot find file <$iorfile_3>\n";
95 $iorfile_client1 = $client->LocalFile ("$iorfile_1");
96 $iorfile_client2 = $client->LocalFile ("$iorfile_2");
97 $iorfile_client3 = $client->LocalFile ("$iorfile_3");
99 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client1");
101 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
103 if ($client_status != 0) {
104 print STDERR
"ERROR: client 1 returned $client_status\n";
108 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client2");
110 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
112 if ($client_status != 0) {
113 print STDERR
"ERROR: client 2 returned $client_status\n";
117 $CL->Arguments ("$extra_args $oneway -i $iterations -k file://$iorfile_client3 -x");
119 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
121 if ($client_status != 0) {
122 print STDERR
"ERROR: client 3 returned $client_status\n";
126 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
128 if ($server_status != 0) {
129 print STDERR
"ERROR: server returned $server_status\n";
133 $server->GetStderrLog();
134 $client->GetStderrLog();
136 $server->DeleteFile($iorfile_1);
137 $server->DeleteFile($iorfile_2);
138 $server->DeleteFile($iorfile_3);
139 $client->DeleteFile($iorfile_1);
140 $client->DeleteFile($iorfile_2);
141 $client->DeleteFile($iorfile_3);