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
;
19 my $server1 = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $server2 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $client = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
23 my $ior1file = "server1.ior";
24 my $ior2file = "server2.ior";
26 #Files which used by server1
27 my $server1_ior1file = $server1->LocalFile ($ior1file);
28 $server1->DeleteFile($ior1file);
30 #Files which used by server2
31 my $server2_ior2file = $server2->LocalFile ($ior2file);
32 $server2->DeleteFile($ior2file);
34 #Files which used by server2
35 my $client_ior1file = $client->LocalFile ($ior1file);
36 my $client_ior2file = $client->LocalFile ($ior2file);
37 $client->DeleteFile($ior1file);
38 $client->DeleteFile($ior2file);
40 $SV1 = $server1->CreateProcess ("server",
41 "-ORBdebuglevel $debug_level " .
42 "-o $server1_ior1file");
44 $SV2 = $server2->CreateProcess ("server",
45 "-ORBdebuglevel $debug_level " .
46 "-o $server2_ior2file " .
49 $CL = $client->CreateProcess ("client",
50 "-k file://$ior1file " .
51 "-m file://$ior2file");
53 $server_status = $SV1->Spawn ();
55 if ($server_status != 0) {
56 print STDERR
"ERROR: server returned $server_status\n";
60 $server_status = $SV2->Spawn ();
62 if ($server_status != 0) {
63 print STDERR
"ERROR: server returned $server_status\n";
68 $SV1->Kill (); $SV1->TimedWait (1);
69 $SV2->Kill (); $SV2->TimedWait (1);
72 if ($server1->WaitForFileTimed ($ior1file,
73 $server1->ProcessStartWaitInterval()) == -1) {
74 print STDERR
"ERROR: cannot find file <$server1_ior1file>\n";
79 if ($server2->WaitForFileTimed ($ior2file,
80 $server2->ProcessStartWaitInterval()) == -1) {
81 print STDERR
"ERROR: cannot find file <$server2_ior2file>\n";
86 if ($server1->GetFile ($ior1file) == -1) {
87 print STDERR
"ERROR: cannot retrieve file <$server1_ior1file>\n";
91 if ($client->PutFile ($ior1file) == -1) {
92 print STDERR
"ERROR: cannot set file <$client_ior1file>\n";
97 if ($server2->GetFile ($ior2file) == -1) {
98 print STDERR
"ERROR: cannot retrieve file <$server2_ior2file>\n";
102 if ($client->PutFile ($ior2file) == -1) {
103 print STDERR
"ERROR: cannot set file <$client_ior2file>\n";
108 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
110 if ($client_status != 0) {
111 print STDERR
"ERROR: client returned $client_status\n";
115 $server_status = $SV1->WaitKill ($server1->ProcessStopWaitInterval());
117 if ($server_status != 0) {
118 print STDERR
"ERROR: server returned $server_status\n";
122 $server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
124 if ($server_status != 0) {
125 print STDERR
"ERROR: server returned $server_status\n";
130 $server1->DeleteFile($ior1file);
131 $server2->DeleteFile($ior2file);
132 $client->DeleteFile($ior1file);
133 $client->DeleteFile($ior2file);