1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 # This is a Perl script that runs some Naming Service tests.
8 # It runs all the tests that will run with min CORBA.
9 # It starts all the servers and clients as necessary.
11 use lib
"$ENV{ACE_ROOT}/bin";
12 use PerlACE
::TestTarget
;
23 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
24 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
26 my $orb_port = $server->RandomPort();
27 my $host = $server->HostName();
28 my $iorbase = "test.ior";
29 my $server_iorfile = $server->LocalFile ($iorbase);
30 $server->DeleteFile($iorbase);
32 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
33 "-ORBEndpoint iiop://$host:$orb_port -o $server_iorfile");
34 $CL = $client->CreateProcess ("TimeServer",
35 "-ORBInitRef NameService=corbaloc:iiop:$host:$orb_port/NameService");
37 $server_status = $SV->Spawn ();
39 if ($server_status != 0) {
40 print STDERR
"ERROR: server returned $server_status\n";
44 if ($server->WaitForFileTimed ($iorbase,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
51 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
53 if ($client_status != 0) {
54 print STDERR
"ERROR: client returned $client_status\n";
60 $server->DeleteFile($iorbase);