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.unused";
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 $client->DeleteFile($ior1file);
38 $SV1 = $server1->CreateProcess ("server",
39 "-ORBdebuglevel $debug_level " .
40 "-o $server1_ior1file");
42 $SV2 = $server2->CreateProcess ("server",
43 "-ORBdebuglevel $debug_level " .
44 "-o $server2_ior2file");
46 $CL = $client->CreateProcess ("client",
47 "-k file://$ior1file");
49 $server_status = $SV1->Spawn ();
51 if ($server_status != 0) {
52 print STDERR
"ERROR: server returned $server_status\n";
56 $server_status = $SV2->Spawn ();
58 if ($server_status != 0) {
59 print STDERR
"ERROR: server returned $server_status\n";
64 $SV1->Kill (); $SV1->TimedWait (1);
65 $SV2->Kill (); $SV2->TimedWait (1);
68 if ($server1->WaitForFileTimed ($ior1file,
69 $server1->ProcessStartWaitInterval()) == -1) {
70 print STDERR
"ERROR: cannot find file <$server1_ior1file>\n";
75 if ($server2->WaitForFileTimed ($ior2file,
76 $server2->ProcessStartWaitInterval()) == -1) {
77 print STDERR
"ERROR: cannot find file <$server2_ior2file>\n";
82 if ($server1->GetFile ($ior1file) == -1) {
83 print STDERR
"ERROR: cannot retrieve file <$server1_ior1file>\n";
87 if ($client->PutFile ($ior1file) == -1) {
88 print STDERR
"ERROR: cannot set file <$client_ior1file>\n";
93 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
95 if ($client_status != 0) {
96 print STDERR
"ERROR: client returned $client_status\n";
100 $server_status = $SV1->WaitKill ($server1->ProcessStopWaitInterval());
102 if ($server_status != 0) {
103 print STDERR
"ERROR: server returned $server_status\n";
107 $server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
109 if ($server_status != 0) {
110 print STDERR
"ERROR: server returned $server_status\n";
114 $server1->DeleteFile($ior1file);
115 $server2->DeleteFile($ior2file);
116 $client->DeleteFile($ior1file);