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
;
21 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
22 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
23 my $client2 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
25 $port = $server->RandomPort ();
26 $TARGETHOSTNAME = $server->HostName ();
28 my $iorbase = "test.ior";
29 my $server_iorfile = $server->LocalFile ($iorbase);
30 my $client_iorfile = $client->LocalFile ($iorbase);
31 $server->DeleteFile($iorbase);
32 $client->DeleteFile($iorbase);
34 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level " .
35 "-ORBEndpoint iiop://$TARGETHOSTNAME:$port " .
36 "-o $server_iorfile");
38 $CL = $client->CreateProcess ("client",
40 "-k file://$client_iorfile");
41 $CL2 = $client2->CreateProcess ("client",
42 "-x -i $iterations " .
43 "-k corbaloc::$TARGETHOSTNAME:$port/Simple_Server");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR
"ERROR: server returned $server_status\n";
51 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
64 if ($client->PutFile ($iorbase) == -1) {
65 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
70 print STDERR
"==== Running first test, using full IORs\n";
72 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
74 if ($client_status != 0) {
75 print STDERR
"ERROR: client returned $client_status\n";
79 print STDERR
"==== Running second test, using corbaloc IORs ($port)\n";
81 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
83 if ($client_status != 0) {
84 print STDERR
"ERROR: client returned $client_status\n";
88 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
90 if ($server_status != 0) {
91 print STDERR
"ERROR: server returned $server_status\n";
95 $server->DeleteFile($iorbase);
96 $client->DeleteFile($iorbase);