blob: 2a542726cecda4ab4302bea211338bd0c041bca5 (
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
|
# $Id$
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# -*- perl -*-
use lib '../../../bin';
use PerlACE::Run_Test;
# The server IOR file
$server_ior_file = PerlACE::LocalFile ("server.ior");
# The client and server processes
$SERVER = new PerlACE::Process(PerlACE::LocalFile("server"));
$CLIENT = new PerlACE::Process(PerlACE::LocalFile("client"));
# We want the server to run on a fixed port
$port = PerlACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0
# We would normally have to specify the server port / host via -ORBEndpoint
# but we are testing the ability to define it as an environment property
$ENV {'TAO_ORBENDPOINT'} = "iiop://localhost:$port";
# Fire up the server
$SERVER->Spawn();
# We don't need the IOR file but we can wait on the file
if (PerlACE::waitforfile_timed ($server_ior_file, 10) == -1)
{
print STDERR "ERROR: cannot find $server_ior_file\n";
$SERVER->Kill();
exit 1;
}
# Try the corbaloc URL for the server. It's almost impossible that this will work
# if the endpoint hasn't been read from the environment so we call success a pass.
$CLIENT->Arguments("-k corbaloc:iiop:localhost:$port/Name-with-hyphens");
if ($CLIENT->SpawnWaitKill (30) != 0)
{
print STDERR "ERROR: Bug rt596 Regression failed. Endpoint was not read from environment\n";
$SERVER->Kill();
exit 1;
}
# Clean up and return
$SERVER->TerminateWaitKill (5);
unlink $server_ior_file;
exit 0;
|