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
;
11 ## Save the starting directory
14 my $test = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
16 # Variables for command-line arguments to client and server
18 $ns_orb_port = 12000 + $test->RandomPort();
21 $persistence_dir = "NameService";
23 #Files which used by test
24 my $test_iorfile = $test->LocalFile ($iorfile);
26 # clean up from a previous test run, or from this run
29 $test->DeleteFile($iorfile);
30 if ( ! -d
$persistence_dir ) {
31 mkdir ($persistence_dir, 0777);
34 chdir $persistence_dir;
35 opendir(THISDIR
, ".");
36 @allfiles = grep(!/^\.\.?$/, readdir(THISDIR
));
38 foreach $tmp (@allfiles){
39 $test->DeleteFile ($tmp);
48 my $args = "-ORBCollocation no -ORBListenEndpoints iiop://$hostname:$ns_orb_port -o $test_iorfile -n 5 -u $persistence_dir";
49 my $prog = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming";
51 $SV = $test->CreateProcess ("$prog", "$args");
54 if ($test->WaitForFileTimed ($iorfile,
55 $test->ProcessStartWaitInterval()) == -1) {
56 print STDERR
"ERROR: cannot find file <$test_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
64 my $args = "--ns file://$test_iorfile "."@_"." ";
65 my $prog = "$ENV{ACE_ROOT}/bin/tao_nsadd";
67 $CL = $test->CreateProcess ("$prog", "$args");
69 $client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval());
71 if ($client_status != 0) {
72 print STDERR
"ERROR: ns_add returned $client_status\n";
78 #1. use the tao_nsadd command add a cyclical reference to the root context
79 #2. use the tao_nsadd command to add a binding that traverses the cycle
80 #3. verify that step 2 does not hang
81 #4. clean up old references
83 @opts = ("--name recurse --ior file://$test_iorfile --ctx",
84 "--name recurse/recurse/recurse/dummy --ior file://$test_iorfile");
86 $hostname = $test->HostName ();
88 @comments = ("Create naming context cycle: \n",
89 "bind reference through cycle: \n",
94 print "INFO: Running the test in ", getcwd
(), "\n";
101 print STDERR
"$comments[$test_number]\n";
112 rmdir ($persistence_dir);