2 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
3 & eval 'exec perl -S $0 $argv:q'
6 use lib
"$ENV{ACE_ROOT}/bin";
7 use PerlACE
::TestTarget
;
11 my $debug_level = '0';
13 foreach my $i (@ARGV) {
19 my $imr = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $si = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 my $implrepo_server = "$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_locator";
24 my $implrepo_ior = "implrepo.ior";
26 my $imr_imriorfile = $imr->LocalFile ($implrepo_ior);
27 my $si_imriorfile = $si->LocalFile ($implrepo_ior);
29 # Make sure the files are gone, so we can wait on them.
30 $imr->DeleteFile ($implrepo_ior);
31 $si->DeleteFile ($implrepo_ior);
33 my $SVR = $imr->CreateProcess ("server", "-ORBDebugLevel $debug_level " .
35 "-ORBInitRef ImplRepoService=file://$si_imriorfile");
37 my $IR = $imr->CreateProcess ($implrepo_server, "-d 1 -t 5 " .
38 "-o $imr_imriorfile");
39 print ">>> " . $IR->CommandLine() . "\n";
41 my $IR_status = $IR->Spawn ();
43 if ($IR_status != 0) {
44 print STDERR
"ERROR: ImplRepo Service returned $IR_status\n";
48 if ($imr->WaitForFileTimed ($implrepo_ior,$imr->ProcessStartWaitInterval()) == -1) {
49 print STDERR
"ERROR: cannot find file <$imr_imriorfile>\n";
50 $IR->Kill (); $IR->TimedWait (1);
54 if ($imr->GetFile ($implrepo_ior) == -1) {
55 print STDERR
"ERROR: cannot retrieve file <$imr_imriorfile>\n";
56 $IR->Kill (); $IR->TimedWait (1);
59 if ($si->PutFile ($implrepo_ior) == -1) {
60 print STDERR
"ERROR: cannot set file <$si_imriorfile>\n";
61 $IR->Kill (); $IR->TimedWait (1);
65 print ">>> " . $SVR->CommandLine() . "\n";
67 my $SVR_status = $SVR->SpawnWaitKill ($si->ProcessStartWaitInterval());
69 if ($SVR_status != 0) {
70 print STDERR
"ERROR: server returned $SVR_status\n";
71 $IR->Kill (); $IR->TimedWait (1);
76 $IR_status = $IR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
78 if ($IR_status != 0) {
79 print STDERR
"ERROR: ImplRepo Server returned $IR_status\n";
83 $imr->DeleteFile ($implrepo_ior);
84 $si->DeleteFile ($implrepo_ior);