Merge pull request #2301 from sonndinh/remove-dup-reactor-functions
[ACE_TAO.git] / TAO / tests / Bug_2289_Regression / run_test.pl
blobef1e3f3c51cb40c3aa531f5833ca3e50a8aaaaad
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
12 $dotted_decimal_addresses = '1';
14 foreach $i (@ARGV) {
15 if ($i eq '-debug') {
16 $debug_level = '10';
20 # We want the server to run on a fixed port
21 $port = PerlACE::uniqueid () + 10001;
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 $iorbase = "server.ior";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 $server->DeleteFile($iorbase);
30 $SV = $server->CreateProcess ("server",
31 "-ORBdebuglevel $debug_level " .
32 "-ORBEndpoint iiop://:$port " .
33 "-o $server_iorfile " .
34 "-ORBDottedDecimalAddresses $dotted_decimal_addresses ");
36 $hostname = $server->HostName();
38 $CL = $client->CreateProcess ("client",
39 "-k corbaloc::$hostname:$port/collocated_ior_bound_in_remote_iortable " .
40 "-ORBCollocationStrategy thru_poa " .
41 "-ORBDottedDecimalAddresses $dotted_decimal_addresses ");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR "ERROR: server returned $server_status\n";
47 exit 1;
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
54 exit 1;
57 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
59 if ($client_status != 0) {
60 print STDERR "ERROR: Bug 2289 Regression failed. Client returned $client_status\n";
61 $status = 1;
64 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
67 if ($server_status != 0) {
68 print STDERR "ERROR: server returned $server_status\n";
69 $status = 1;
72 $server->DeleteFile($iorbase);
73 $client->DeleteFile($iorbase);
75 exit $status;