Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Bug_2702_Regression / run_test.pl
blob7abc7488cf7ec44a233191f767dc4edb7ae1eef6
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;
12 # Usually the primary component to run on targets (if any) is the server;
13 # this time it's the client.
14 my $client = PerlACE::TestTarget::create_target(1) || die "Create target 1 failed\n";
15 my $server = PerlACE::TestTarget::create_target(2) || die "Create target 2 failed\n";
17 my $iorbase = "server_on_localhost_1192.ior";
18 my $logfile = "client.log";
20 my $client_iorfile = $client->LocalFile($iorbase);
21 my $client_logfile = $client->LocalFile($logfile);
22 my $server_logfile = $server->LocalFile($logfile);
23 $client->DeleteFile($logfile);
25 ## Get the perl interpreter that invoked us and remove any
26 ## executable extension (if there is one).
27 my($perl) = $^X;
28 $perl =~ s/\.exe$//i;
29 $perl =~ s/000000\///g if ($^O eq 'VMS');
31 $SV = $server->CreateProcess ($perl, "fakeserver2.pl");
32 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile ".
33 "-ORBdebuglevel 1 ".
34 "-ORBlogfile $client_logfile");
36 $SV->IgnoreExeSubDir(1);
37 $SV->IgnoreHostRoot(1);
39 $server_status = $SV->Spawn ();
41 sleep(1); # give the server a chance to come up
43 if ($server_status != 0) {
44 print STDERR "ERROR: server returned $server_status\n";
45 exit 1;
48 if ($server->WaitForFileTimed ($iorbase,
49 $server->ProcessStartWaitInterval()) == -1) {
50 print STDERR "ERROR: cannot find file <$iorbase>\n";
51 $SV->Kill (); $SV->TimedWait (1);
52 exit 1;
55 if ($client->PutFile ($iorbase) == -1) {
56 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
58 exit 1;
61 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
63 if ($client_status != 0) {
64 print STDERR "ERROR: client returned $client_status\n";
65 $status = 1;
68 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
70 if ($server_status != 0) {
71 print STDERR "ERROR: server returned $server_status\n";
72 $status = 1;
75 open (LOG, $server_logfile) or die "Couldn't open server log file $server_logfile: $!\n";
76 while (<LOG>) {
77 $ccmsgfound = 1 if (/process_parsed_messages, received CloseConnection message/);
79 close (LOG);
80 if (not $ccmsgfound) {
81 print STDERR "ERROR: didn't find CloseConnection debug message in client log.\n";
82 $status = 1;
85 exit $status;