summaryrefslogtreecommitdiff
path: root/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl')
-rwxr-xr-xACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl58
1 files changed, 58 insertions, 0 deletions
diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl b/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl
new file mode 100755
index 00000000000..0ba137a10e1
--- /dev/null
+++ b/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl
@@ -0,0 +1,58 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib "$ENV{ACE_ROOT}/bin";
+use PerlACE::TestTarget;
+
+$status = 0;
+
+$synchbase = "ready";
+my $target1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $target2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $host = $target1->HostName();
+my $port = $target1->RandomPort ();
+$synchfile = $target1->LocalFile ("$synchbase");
+
+my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile");
+
+$target1->DeleteFile ($synchbase);
+$target2->DeleteFile ($synchbase);
+
+$SV->Spawn ();
+
+if ($target1->WaitForFileTimed ($synchbase,
+ $target1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$synchfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$target1->DeleteFile ($synchbase);
+
+my $CL = $target2->CreateProcess ("client", " -h $host -p $port");
+
+$client = $CL->SpawnWaitKill ($target2->ProcessStartWaitInterval() + 285);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill ($target1->ProcessStopWaitInterval());
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+$target1->GetStderrLog();
+$target2->GetStderrLog();
+
+$target1->DeleteFile ($synchbase);
+$target2->DeleteFile ($synchbase);
+
+exit $status;