Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / protocols / tests / HTBP / Send_Recv_Tests / run_test.pl
blob811218bd381c6e150f7de6eb0e65b03d218783e7
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 $synchbase = "ready";
13 my $target1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
14 my $target2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
15 $synchfile = $target1->LocalFile ("$synchbase");
16 my $port = $target1->RandomPort ();
17 my $host = $target1->HostName();
19 my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile");
20 my $CL = $target2->CreateProcess ("client", " -h $host -p $port");
22 $target1->DeleteFile ($synchbase);
23 $target2->DeleteFile ($synchbase);
25 $server_status = $SV->Spawn ();
27 if ($server_status != 0) {
28 print STDERR "ERROR: server returned $server_status\n";
29 exit 1;
32 if ($target1->WaitForFileTimed ($synchbase,
33 $target1->ProcessStartWaitInterval()) == -1) {
34 print STDERR "ERROR: cannot find file <$synchfile>\n";
35 $SV->Kill (); $SV->TimedWait (1);
36 exit 1;
38 $target1->DeleteFile ($synchbase);
40 $client = $CL->SpawnWaitKill ($target2->ProcessStartWaitInterval() + 285);
42 if ($client != 0) {
43 print STDERR "ERROR: client returned $client\n";
44 $status = 1;
47 $server = $SV->WaitKill ($target1->ProcessStopWaitInterval());
49 if ($server != 0) {
50 print STDERR "ERROR: server returned $server\n";
51 $status = 1;
54 $target1->GetStderrLog();
55 $target2->GetStderrLog();
57 $target1->DeleteFile ($synchbase);
58 $target2->DeleteFile ($synchbase);
60 exit $status;