Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / ACE / protocols / tests / HTBP / ping / run_test.pl
bloba7c7ffb0e32ee3913947b71f6866917db83d1e92
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 $synchbase = "ready";
12 my $target1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
13 my $target2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
14 $synchfile = $target1->LocalFile ("$synchbase");
15 my $port = $target1->RandomPort ();
16 my $host = $target1->HostName();
18 print "port = $port\n";
20 my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile");
21 my $CL = $target2->CreateProcess ("client", " -h $host -p $port");
23 $target1->DeleteFile ($synchbase);
24 $target2->DeleteFile ($synchbase);
26 $server_status = $SV->Spawn ();
28 if ($server_status != 0) {
29 print STDERR "ERROR: server returned $server_status\n";
30 exit 1;
33 if ($target1->WaitForFileTimed ($synchbase,
34 $target1->ProcessStartWaitInterval()) == -1) {
35 print STDERR "ERROR: cannot find file <$synchfile>\n";
36 $SV->Kill (); $SV->TimedWait (1);
37 exit 1;
40 $target1->DeleteFile ($synchbase);
42 $client = $CL->SpawnWaitKill ($target2->ProcessStartWaitInterval() + 285);
44 if ($client != 0) {
45 print STDERR "ERROR: client returned $client\n";
46 $status = 1;
49 $server = $SV->WaitKill ($target1->ProcessStopWaitInterval());
51 if ($server != 0) {
52 print STDERR "ERROR: server returned $server\n";
53 $status = 1;
56 $target1->GetStderrLog();
57 $target2->GetStderrLog();
59 $target1->DeleteFile ($synchbase);
60 $target2->DeleteFile ($synchbase);
62 exit $status;