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 $nslist_path = "$ENV{ACE_ROOT}/bin/tao_nslist";
21 ## The two test targets will communicate over shared memory (SHMIOP) so they
22 ## can't be 32-bit and 64-bit executables on the same host.
23 my $target_ns_list = 2;
24 if (exists $ENV{'DOC_TEST_2_EXE_SUBDIR'} && $ENV{'DOC_TEST_2_OS'} eq 'local' &&
25 $ENV{'DOC_TEST_2_EXE_SUBDIR'} ne $PerlACE::Process
::ExeSubDir
) {
29 my $ns_service = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
30 my $ns_list = PerlACE
::TestTarget
::create_target
($target_ns_list) || die "Create target $target_ns_list failed\n";
32 my $iorbase = "ns.ior";
33 my $ns_service_iorfile = $ns_service->LocalFile ($iorbase);
34 my $ns_list_iorfile = $ns_list->LocalFile ($iorbase);
35 $ns_service->DeleteFile($iorbase);
36 $ns_list->DeleteFile($iorbase);
38 $NS = $ns_service->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
39 "-ORBdebuglevel $debug_level -o $ns_service_iorfile ".
40 "-ORBObjRefStyle URL -ORBEndpoint shmiop:// -ORBSvcConfDirective ".
41 "\"dynamic SHMIOP_Factory Service_Object ".
42 "*TAO_Strategies:_make_TAO_SHMIOP_Protocol_Factory () ''\"");
44 $NSL = $ns_list->CreateProcess ($nslist_path, "-ORBSvcConfDirective \"dynamic SHMIOP_Factory Service_Object ".
45 "*TAO_Strategies:_make_TAO_SHMIOP_Protocol_Factory () ''\" ".
46 "-ORBInitRef NameService=file://$ns_list_iorfile --ior --ctxior ".
47 "--node \"\" --tree \"\"");
49 $process_status = $NS->Spawn ();
51 if ($process_status != 0) {
52 print STDERR
"ERROR: naming service returned $process_status\n";
56 if ($ns_service->WaitForFileTimed ($iorbase,
57 $ns_service->ProcessStartWaitInterval()) == -1) {
58 print STDERR
"ERROR: cannot find file <$ns_service_iorfile>\n";
59 $NS->Kill (); $NS->TimedWait (1);
63 if ($ns_service->GetFile ($iorbase) == -1) {
64 print STDERR
"ERROR: cannot retrieve file <$ns_service_iorfile>\n";
65 $NS->Kill (); $NS->TimedWait (1);
69 if ($ns_list->PutFile ($iorbase) == -1) {
70 print STDERR
"ERROR: cannot set file <$ns_list_iorfile>\n";
71 $NS->Kill (); $NS->TimedWait (1);
75 $process_status = $NSL->SpawnWaitKill ($ns_list->ProcessStartWaitInterval() + 285);
77 if ($process_status != 0) {
78 print STDERR
"ERROR: Regression - tao_nslist returned $process_status\n";
82 $process_status = $NS->TerminateWaitKill ($ns_service->ProcessStopWaitInterval());
84 if ($process_status != 0) {
85 print STDERR
"ERROR: naming service TerminateWaitKill returned $process_status\n";
89 $ns_service->DeleteFile($iorbase);
90 $ns_list->DeleteFile($iorbase);
93 print "Test passed !!\n";