Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / IORTable_Locator / run_test.pl
bloba01d538e7fc791c045cbc2a973226a1aaccabcae
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 $server_name = "server";
13 $async_opt = "";
15 foreach $i (@ARGV) {
16 if ($i eq '-debug') {
17 $debug_level = '10';
19 elsif ($i eq "-async_1") {
20 $server_name = "async_server";
22 elsif ($i eq "-async_2") {
23 $server_name = "async_server";
24 $async_opt = "-as";
26 elsif ($i eq "-async_3") {
27 $server_name = "async_server";
28 $async_opt = "-aa";
32 my $server = PerlACE::TestTarget::create_target (1) || die "Create failed\n";
33 my $client = PerlACE::TestTarget::create_target (2) || die "Create failed\n";
35 my $TARGETHOSTNAME = $client->HostName ();
36 my $port = $client->RandomPort ();
38 $server->DeleteFile($iorbase);
39 $client->DeleteFile($iorbase);
41 $SV = $server->CreateProcess ($server_name, "$async_opt -ORBdebuglevel $debug_level -ORBListenEndpoints iiop://$TARGETHOSTNAME:$port");
42 $CL = $client->CreateProcess ("client",
43 "-ORBdebuglevel $debug_level ".
44 "-a corbaloc:iiop:$TARGETHOSTNAME:$port/SIMPLE_TEST_KEY");
46 print "Starting $server_name $async_opt\n";
47 $server_status = $SV->Spawn ();
49 if ($server_status != 0) {
50 print STDERR "ERROR: server returned $server_status\n";
51 exit 1;
54 sleep(3);
56 print "Client\n";
57 $client_status = $CL->Spawn ();
59 if ($client_status != 0) {
60 print STDERR "ERROR: client returned $client_status\n";
61 $SV->Kill (); $SV->TimedWait (1);
62 exit 1;
65 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval());
67 if ($client_status != 0) {
68 print STDERR "ERROR: client returned $client_status\n";
69 $status = 1;
72 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
74 if ($server_status != 0) {
75 print STDERR "ERROR: server returned $server_status\n";
76 $status = 1;
79 $server->DeleteFile($iorbase);
80 $client->DeleteFile($iorbase);
82 exit $status;