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
;
13 my $server1 = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
14 my $server2 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $server3 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
16 my $client = PerlACE
::TestTarget
::create_target
(4) || die "Create target 4 failed\n";
18 $port = $server1->RandomPort () + 10001; # This can't be 10000 on Chorus 4.0
20 $naming_ior = "NameService.ior";
22 $server1_naming_ior = $server1->LocalFile ($naming_ior);
23 $server2_naming_ior = $server2->LocalFile ($naming_ior);
24 $server3_naming_ior = $server3->LocalFile ($naming_ior);
25 $client_naming_ior = $client->LocalFile ($naming_ior);
27 $server1->DeleteFile ($naming_ior);
28 $server2->DeleteFile ($naming_ior);
29 $server3->DeleteFile ($naming_ior);
30 $client->DeleteFile ($naming_ior);
33 $SV1 = $server1->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
34 "-ORBNameServicePort $port " .
35 "-o $server1_naming_ior");
37 $SV2 = $server2->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Event_Service/tao_rtevent",
38 "-ORBInitRef NameService=file://$server2_naming_ior");
40 $SV3 = $server3->CreateProcess ("ECM_Supplier",
41 "-ORBInitRef NameService=file://$server3_naming_ior");
43 $CL = $client->CreateProcess ("ECM_Consumer",
44 "-ORBInitRef NameService=file://$client_naming_ior");
46 $server_status = $SV1->Spawn ();
48 if ($server_status != 0) {
49 print STDERR
"ERROR: server returned $server_status\n";
50 $SV1->Kill (); $SV1->TimedWait (1);
53 if ($server1->WaitForFileTimed ($naming_ior,
54 $server1->ProcessStartWaitInterval()) == -1) {
55 print STDERR
"ERROR: cannot find file <$server1_naming_ior>\n";
56 $SV1->Kill (); $SV1->TimedWait (1);
60 if ($server1->GetFile ($naming_ior) == -1) {
61 print STDERR
"ERROR: cannot retrieve file <$server1_naming_ior>\n";
62 $SV1->Kill (); $SV1->TimedWait (1);
66 if ($server2->PutFile ($naming_ior) == -1) {
67 print STDERR
"ERROR: cannot set file <$server2_naming_ior>\n";
68 $SV1->Kill (); $SV1->TimedWait (1);
71 if ($server3->PutFile ($naming_ior) == -1) {
72 print STDERR
"ERROR: cannot set file <$server3_naming_ior>\n";
73 $SV1->Kill (); $SV1->TimedWait (1);
77 if ($client->PutFile ($naming_ior) == -1) {
78 print STDERR
"ERROR: cannot set file <$client_naming_ior>\n";
79 $SV1->Kill (); $SV1->TimedWait (1);
83 $server_status = $SV2->Spawn ();
85 if ($server_status != 0) {
86 print STDERR
"ERROR: server returned $server_status\n";
87 $SV1->Kill (); $SV1->TimedWait (1);
88 $SV2->Kill (); $SV2->TimedWait (1);
94 $client_status = $CL->Spawn ();
96 if ($client_status != 0) {
97 print STDERR
"ERROR: client returned $client_status\n";
98 $SV1->Kill (); $SV1->TimedWait (1);
99 $SV2->Kill (); $SV2->TimedWait (1);
100 $CL->Kill (); $CL->TimedWait (1);
106 $server_status = $SV3->Spawn ();
108 if ($server_status != 0) {
109 print STDERR
"ERROR: server returned $server_status\n";
110 $SV1->Kill (); $SV1->TimedWait (1);
111 $SV2->Kill (); $SV2->TimedWait (1);
112 $SV3->Kill (); $SV3->TimedWait (1);
113 $CL->Kill (); $CL->TimedWait (1);
117 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval() + 45);
118 if ($client_status != 0) {
119 print STDERR
"ERROR: client returned $client_status\n";
123 $server_status = $SV3->WaitKill ($server3->ProcessStopWaitInterval() + 45);
124 if ($server_status != 0) {
125 print STDERR
"ERROR: server returned $server_status\n";
129 $server_status = $SV2->TerminateWaitKill ($server2->ProcessStopWaitInterval());
131 if ($server_status != 0) {
132 print STDERR
"ERROR: server returned $server_status\n";
137 $server_status = $SV1->TerminateWaitKill ($server1->ProcessStopWaitInterval());
139 if ($server_status != 0) {
140 print STDERR
"ERROR: server returned $server_status\n";
144 $server1->DeleteFile ($naming_ior);
145 $server2->DeleteFile ($naming_ior);
146 $server3->DeleteFile ($naming_ior);
147 $client->DeleteFile ($naming_ior);