summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl
blob: 8a020f784def7c8ee7fc5054668a43090c21c4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

# This is a Perl script that runs some Naming Service tests.
# It runs all the tests that will run with min CORBA.
# It starts all the servers and clients as necessary.

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;

# Variables for command-line arguments to client and server
# executables.
$ns_orb_port = 12002 + PerlACE::uniqueid ();

$ior_file = "test.ior";


$status = 0;

my $args = "-ORBEndpoint iiop://127.0.0.1:$ns_orb_port -o $ior_file";
my $prog = "../../Naming_Service/Naming_Service";
$NS = new PerlACE::Process ($prog, $args);

$NS->Spawn ();

if (PerlACE::waitforfile_timed ($ior_file,
                                $PerlACE::wait_interval_for_process_creation) == -1) {
    print STDERR "ERROR: cannot find file <$ior_file>\n";
    $NS->Kill (); $NS->TimedWait (1);
    exit 1;
} 

my $new_args = "-ORBInitRef NameService=corbaloc:iiop:127.0.0.1:$ns_orb_port/NameService";
my $new_prog = "TimeServer";

print " ARGS are == $new_args \n";

$CL = new PerlACE::Process ($new_prog, $new_args);

$client = $CL->SpawnWaitKill (300);

if ($client != 0) {
    print STDERR "ERROR: client returned $client\n";
    $status = 1;
}


$NS->Kill ();
unlink $ior_file;

exit $status;