summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Property/run_test.pl
blob: d242c8dbd95e7410296d77772c086827c1395f0f (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
56
57
# $Id$
# -*- perl -*-
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

$tao_root = $ENV{TAO_ROOT};
# This is a Perl script that runs the Naming Service, client and servers

unshift @INC, '../../../../bin';
require Process;
require Uniqueid;

# amount of delay between running the servers

$sleeptime = 6;

# variables for parameters

$nsport = 20000 + uniqueid ();
sub name_server
{
    my $args = "-ORBnameserviceport $nsport";
    my $prog = "$tao_root/orbsvcs/Naming_Service/Naming_Service"
	.$Process::EXE_EXT;
    print ("\nNaming_Service: $prog$Process::EXE_EXT $args\n");
    $NS = Process::Create ($prog, $args);
}


sub server
{
    my $args = "-ORBnameserviceport $nsport";
    print ("\nServer: server$Process::EXE_EXT $args\n");
    $SV = Process::Create ("server$Process::EXE_EXT", $args);
}


sub client
{
    my $args = "-ORBnameserviceport $nsport";
    print ("\nclient: client $args\n");
    $CL = Process::Create ("client$Process::EXE_EXT", $args);
}

name_server ();
sleep $sleeptime;

server ();
sleep $sleeptime;

client ();
sleep $sleeptime;

$NS->Kill ();
$SV->Kill ();