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 $con = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
22 my $sup = PerlACE
::TestTarget
::create_target
(4) || die "Create target 4 failed\n";
24 $nsiorfile = "ns.ior";
26 my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
27 my $ls_nsiorfile = $ls->LocalFile ($nsiorfile);
28 my $con_nsiorfile = $con->LocalFile ($nsiorfile);
29 my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
30 $ns->DeleteFile ($nsiorfile);
31 $ls->DeleteFile ($nsiorfile);
32 $con->DeleteFile ($nsiorfile);
33 $sup->DeleteFile ($nsiorfile);
35 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
37 $LS = $ls->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Logging_Service/Notify_Logging_Service/tao_tls_notify",
38 " -ORBInitRef NameService=file://$ls_nsiorfile");
39 $CON = $con->CreateProcess ("Notify_Consumer",
40 "-ORBInitRef NameService=file://$con_nsiorfile");
41 $SUP = $sup->CreateProcess ("Notify_Supplier",
42 "-ORBInitRef NameService=file://$sup_nsiorfile");
44 print STDERR
"Starting Naming Service\n";
45 $NS_status = $NS->Spawn ();
47 if ($NS_status != 0) {
48 print STDERR
"ERROR: Name Service returned $NS_status\n";
52 if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) {
53 print STDERR
"ERROR: cannot find file <$ns_nsiorfile>\n";
54 $NS->Kill (); $NS->TimedWait (1);
58 if ($ns->GetFile ($nsiorfile) == -1) {
59 print STDERR
"ERROR: cannot retrieve file <$ns_nsiorfile>\n";
60 $NS->Kill (); $NS->TimedWait (1);
63 if ($ls->PutFile ($nsiorfile) == -1) {
64 print STDERR
"ERROR: cannot set file <$ls_nsiorfile>\n";
65 $NS->Kill (); $NS->TimedWait (1);
68 if ($con->PutFile ($nsiorfile) == -1) {
69 print STDERR
"ERROR: cannot set file <$con_nsiorfile>\n";
70 $NS->Kill (); $NS->TimedWait (1);
73 if ($sup->PutFile ($nsiorfile) == -1) {
74 print STDERR
"ERROR: cannot set file <$sup_nsiorfile>\n";
75 $NS->Kill (); $NS->TimedWait (1);
79 print STDERR
"Starting Logging Service\n";
81 $LS_status = $LS->Spawn ();
83 if ($LS_status != 0) {
84 print STDERR
"ERROR: Logging Service returned $LS_status\n";
85 $LS->Kill (); $LS->TimedWait (1);
86 $NS->Kill (); $NS->TimedWait (1);
90 # Give time for logging service to initialize and install its object
91 # reference in the naming service.
94 print STDERR
"Starting Consumer\n";
96 $CON_status = $CON->Spawn ();
97 if ($CON_status != 0) {
98 print STDERR
"ERROR: Notify Consumer returned $CON_status\n";
99 $CON->Kill (); $CON->TimedWait (1);
100 $LS->Kill (); $LS->TimedWait (1);
101 $NS->Kill (); $NS->TimedWait (1);
107 print STDERR
"Starting Supplier\n";
109 $SUP_status = $SUP->Spawn ();
110 if ($SUP_status != 0) {
111 print STDERR
"ERROR: Notify Supplier returned $SUP_status\n";
115 $SUP_status = $SUP->WaitKill ($sup->ProcessStopWaitInterval());
116 if ($SUP_status != 0) {
117 print STDERR
"ERROR: Notify Supplier returned $SUP_status\n";
121 $CON_status = $CON->TerminateWaitKill ($con->ProcessStopWaitInterval());
123 if ($CON_status != 0) {
124 print STDERR
"ERROR: Notify Consumer returned $CON_status\n";
128 $LS_status = $LS->TerminateWaitKill ($ls->ProcessStopWaitInterval());
130 if ($LS_status != 0) {
131 print STDERR
"ERROR: Logging Service returned $LS_status\n";
135 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
137 if ($NS_status != 0) {
138 print STDERR
"ERROR: Name Service returned $NS_status\n";
143 $ns->DeleteFile ($nsiorfile);
144 $ls->DeleteFile ($nsiorfile);
145 $con->DeleteFile ($nsiorfile);
146 $sup->DeleteFile ($nsiorfile);