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 $ns = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $ls = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $cli = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
23 $nsiorfile = "ns.ior";
25 my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
26 my $ls_nsiorfile = $ls->LocalFile ($nsiorfile);
27 my $cli_nsiorfile = $cli->LocalFile ($nsiorfile);
28 $ns->DeleteFile ($nsiorfile);
29 $ls->DeleteFile ($nsiorfile);
30 $cli->DeleteFile ($nsiorfile);
33 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
35 $LS = $ls->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Logging_Service/Basic_Logging_Service/tao_tls_basic",
36 " -ORBInitRef NameService=file://$ls_nsiorfile");
37 $CLI = $cli->CreateProcess ("client",
38 "-ORBInitRef NameService=file://$cli_nsiorfile");
40 print STDERR
"Starting Naming Service\n";
42 $NS_status = $NS->Spawn ();
44 if ($NS_status != 0) {
45 print STDERR
"ERROR: Name Service returned $NS_status\n";
49 if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) {
50 print STDERR
"ERROR: cannot find file <$ns_nsiorfile>\n";
51 $NS->Kill (); $NS->TimedWait (1);
55 if ($ns->GetFile ($nsiorfile) == -1) {
56 print STDERR
"ERROR: cannot retrieve file <$ns_nsiorfile>\n";
57 $NS->Kill (); $NS->TimedWait (1);
60 if ($ls->PutFile ($nsiorfile) == -1) {
61 print STDERR
"ERROR: cannot set file <$ls_nsiorfile>\n";
62 $NS->Kill (); $NS->TimedWait (1);
65 if ($cli->PutFile ($nsiorfile) == -1) {
66 print STDERR
"ERROR: cannot set file <$cli_nsiorfile>\n";
67 $NS->Kill (); $NS->TimedWait (1);
71 print STDERR
"Starting Logging Service\n";
73 $LS_status = $LS->Spawn ();
75 if ($LS_status != 0) {
76 print STDERR
"ERROR: LOgging Service returned $LS_status\n";
77 $LS->Kill (); $LS->TimedWait (1);
78 $NS->Kill (); $NS->TimedWait (1);
82 # Give time for logging service to initialize and install its object
83 # reference in the nameing service.
86 print STDERR
"Starting client\n";
88 $CLI_status = $CLI->Spawn ();
89 if ($CLI_status != 0) {
90 print STDERR
"ERROR: Client returned $CLI_status\n";
94 $CLI_status = $CLI->WaitKill ($cli->ProcessStopWaitInterval());
95 if ($CLI_status != 0) {
96 print STDERR
"ERROR: Client returned $CLI_status\n";
100 $LS_status = $LS->TerminateWaitKill ($ls->ProcessStopWaitInterval());
102 if ($LS_status != 0) {
103 print STDERR
"ERROR: Logging Service returned $LS_status\n";
107 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
109 if ($NS_status != 0) {
110 print STDERR
"ERROR: Name Service returned $NS_status\n";
114 $ns->DeleteFile ($nsiorfile);
115 $ls->DeleteFile ($nsiorfile);
116 $cli->DeleteFile ($nsiorfile);