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 $imr = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $act = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $ti = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
22 my $srv = PerlACE
::TestTarget
::create_target
(4) || die "Create target 4 failed\n";
23 my $cli = PerlACE
::TestTarget
::create_target
(5) || die "Create target 5 failed\n";
25 my $imriorfile = "imr.ior";
26 my $actiorfile = "act.ior";
27 my $srviorfile = "server.ior";
29 my $imr_imriorfile = $imr->LocalFile ($imriorfile);
30 my $act_imriorfile = $act->LocalFile ($imriorfile);
31 my $ti_imriorfile = $ti->LocalFile ($imriorfile);
32 my $srv_imriorfile = $srv->LocalFile ($imriorfile);
33 my $act_actiorfile = $act->LocalFile ($actiorfile);
34 my $srv_srviorfile = $srv->LocalFile ($srviorfile);
35 my $cli_srviorfile = $cli->LocalFile ($srviorfile);
36 $imr->DeleteFile ($imriorfile);
37 $act->DeleteFile ($imriorfile);
38 $ti->DeleteFile ($imriorfile);
39 $srv->DeleteFile ($imriorfile);
40 $act->DeleteFile ($actiorfile);
41 $srv->DeleteFile ($srviorfile);
42 $cli->DeleteFile ($srviorfile);
44 $IMR = $imr->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_locator",
45 "-o $imr_imriorfile");
46 $ACT = $act->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_activator",
47 "-o $act_actiorfile ".
48 "-ORBInitRef ImplRepoService=file://$act_imriorfile");
49 $TI = $ti->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_imr");
50 $CLI = $cli->CreateProcess ("client",
51 "-k file://$cli_srviorfile -ORBDebugLevel $debug_level");
52 $SRV = $srv->CreateProcess ("server");
54 my $server_cmd = $SRV->Executable();
55 my $srv_server_cmd = $imr->LocalFile ($server_cmd);
57 $TI->Arguments ("-ORBInitRef ImplRepoService=file://$ti_imriorfile ".
58 "add test_server -c \"$srv_server_cmd ".
59 "-ORBInitRef ImplRepoService=file://$imr_imriorfile ".
60 "-ORBUseIMR 1 -ORBDebugLevel $debug_level ".
61 "-o $srv_srviorfile\"");
64 # We want the tao_imr executable to be found exactly in the path
65 # given, without being modified by the value of -ExeSubDir.
66 # So, we tell its Process object to ignore the setting of -ExeSubDir.
67 $TI->IgnoreExeSubDir(1);
69 $IMR_status = $IMR->Spawn ();
71 if ($IMR_status != 0) {
72 print STDERR
"ERROR: ImplRepo Service returned $IMR_status\n";
76 if ($imr->WaitForFileTimed ($imriorfile,$imr->ProcessStartWaitInterval()) == -1) {
77 print STDERR
"ERROR: cannot find file <$imr_imriorfile>\n";
78 $IMR->Kill (); $IMR->TimedWait (1);
81 if ($imr->GetFile ($imriorfile) == -1) {
82 print STDERR
"ERROR: cannot retrieve file <$imr_imriorfile>\n";
83 $IMR->Kill (); $IMR->TimedWait (1);
86 if ($act->PutFile ($imriorfile) == -1) {
87 print STDERR
"ERROR: cannot set file <$act_imriorfile>\n";
88 $IMR->Kill (); $IMR->TimedWait (1);
91 if ($ti->PutFile ($imriorfile) == -1) {
92 print STDERR
"ERROR: cannot set file <$ti_imriorfile>\n";
93 $IMR->Kill (); $IMR->TimedWait (1);
96 if ($srv->PutFile ($imriorfile) == -1) {
97 print STDERR
"ERROR: cannot set file <$srv_imriorfile>\n";
98 $IMR->Kill (); $IMR->TimedWait (1);
102 $ACT_status = $ACT->Spawn ();
103 if ($ACT_status != 0) {
104 print STDERR
"ERROR: IMR Activator Service returned $ACT_status\n";
107 if ($act->WaitForFileTimed ($actiorfile,$act->ProcessStartWaitInterval()) == -1) {
108 print STDERR
"ERROR: cannot find file <$act_actiorfile>\n";
109 $ACT->Kill (); $ACT->TimedWait (1);
110 $IMR->Kill (); $IMR->TimedWait (1);
114 $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
115 if ($TI_status != 0) {
116 print STDERR
"ERROR: TAO IMR returned $TI_status\n";
117 $ACT->Kill (); $ACT->TimedWait (1);
118 $IMR->Kill (); $IMR->TimedWait (1);
122 $TI->Arguments("-ORBInitRef ImplRepoService=file://$ti_imriorfile" . ' start test_server');
124 $TI_status = $TI->SpawnWaitKill ($ti->ProcessStartWaitInterval());
125 if ($TI_status != 0) {
126 print STDERR
"ERROR: TAO IMR returned $TI_status\n";
127 $ACT->Kill (); $ACT->TimedWait (1);
128 $IMR->Kill (); $IMR->TimedWait (1);
132 if ($srv->GetFile ($srviorfile) == -1) {
133 print STDERR
"ERROR: cannot retrieve file <$srv_srviorfile>\n";
134 $ACT->Kill (); $ACT->TimedWait (1);
135 $IMR->Kill (); $IMR->TimedWait (1);
138 if ($cli->PutFile ($srviorfile) == -1) {
139 print STDERR
"ERROR: cannot set file <$cli_srviorfile>\n";
140 $ACT->Kill (); $ACT->TimedWait (1);
141 $IMR->Kill (); $IMR->TimedWait (1);
146 $CLI_status = $CLI->SpawnWaitKill ($cli->ProcessStartWaitInterval());
147 if ($CLI_status != 0) {
148 print STDERR
"ERROR: client returned $CLI_status\n";
152 $ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval());
154 if ($ACT_status != 0) {
155 print STDERR
"ERROR: IMR Activator returned $ACT_status\n";
159 $IMR_status = $IMR->TerminateWaitKill ($imr->ProcessStopWaitInterval());
161 if ($IMR_status != 0) {
162 print STDERR
"ERROR: ImplRepo Service returned $IMR_status\n";
166 $imr->DeleteFile ($imriorfile);
167 $act->DeleteFile ($imriorfile);
168 $ti->DeleteFile ($imriorfile);
169 $srv->DeleteFile ($imriorfile);
170 $act->DeleteFile ($actiorfile);
171 $srv->DeleteFile ($srviorfile);
172 $cli->DeleteFile ($srviorfile);