diff options
Diffstat (limited to 'ACE/protocols')
-rw-r--r-- | ACE/protocols/ace/HTBP/HTBP_Session.cpp | 2 | ||||
-rw-r--r-- | ACE/protocols/tests/HTBP/README | 4 | ||||
-rwxr-xr-x | ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl | 40 | ||||
-rw-r--r-- | ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp | 2 | ||||
-rwxr-xr-x | ACE/protocols/tests/HTBP/Send_Large_Msg/run_test.pl | 38 | ||||
-rw-r--r-- | ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp | 2 | ||||
-rw-r--r-- | ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp | 8 | ||||
-rwxr-xr-x | ACE/protocols/tests/HTBP/Send_Recv_Tests/run_test.pl | 40 | ||||
-rw-r--r-- | ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp | 8 | ||||
-rwxr-xr-x | ACE/protocols/tests/HTBP/ping/run_test.pl | 39 | ||||
-rwxr-xr-x | ACE/protocols/tests/RMCast/run_test.pl | 15 |
11 files changed, 100 insertions, 98 deletions
diff --git a/ACE/protocols/ace/HTBP/HTBP_Session.cpp b/ACE/protocols/ace/HTBP/HTBP_Session.cpp index 3abbfbb6c42..cb1dc421250 100644 --- a/ACE/protocols/ace/HTBP/HTBP_Session.cpp +++ b/ACE/protocols/ace/HTBP/HTBP_Session.cpp @@ -172,7 +172,7 @@ ACE::HTBP::Session::reconnect_i (ACE::HTBP::Channel *s) if (conn.connect (s->ace_stream(),*this->proxy_addr_) == -1) { ACE_TCHAR buffer[128]; - this->proxy_addr_->addr_to_string(buffer,128, 0); + this->proxy_addr_->addr_to_string(buffer, 128, 0); ACE_ERROR ((LM_ERROR, ACE_TEXT("(%P|%t) ACE::HTBP::Session::reconnect") ACE_TEXT(" failed to %s, %p\n"), diff --git a/ACE/protocols/tests/HTBP/README b/ACE/protocols/tests/HTBP/README index 65a2bde0320..3dea5658db7 100644 --- a/ACE/protocols/tests/HTBP/README +++ b/ACE/protocols/tests/HTBP/README @@ -1,8 +1,8 @@ $Id$ Test cases for the HTTP Tunneling Bidirectional Protocol. For more -information on the protocol itself, refer to ace/HTBP/README. These -tests are adaptations of essential ACE SOCK tests, with the minimal +information on the protocol itself, refer to protocols/ace/HTBP/README. +These tests are adaptations of essential ACE SOCK tests, with the minimal changes to support using HTBP rather than SOCK. Contained in this directory: diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl b/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl index eda33881a66..13aafef2d43 100755 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/run_test.pl @@ -6,40 +6,34 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; -use Sys::Hostname; +use PerlACE::TestTarget; $status = 0; -$host = hostname(); -$port = PerlACE::random_port(); $synchbase = "ready"; -$synchfile = PerlACE::LocalFile ("$synchbase"); +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"); -if (PerlACE::is_vxworks_test()) { - $host = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-p $port -o $synchbase"); -} -else { - $SV = new PerlACE::Process ("server", "-p $port -o $synchfile"); -} +my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile"); + +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); -unlink $synchfile; $SV->Spawn (); -if (PerlACE::waitforfile_timed ($synchfile, - $PerlACE::wait_interval_for_process_creation) == -1) { +if ($target1->WaitForFileTimed ($synchbase, + $target1->ProcessStartWaitInterval()) == -1) { print STDERR "ERROR: cannot find file <$synchfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; } -unlink $synchfile; +$target1->DeleteFile ($synchbase); -# The client code should later be modified to get the hostname -# using ACE_OS::hostname so the same script can be run on all -# hosts without havng to reset the host where it has to be run. -$CL = new PerlACE::Process ("client", "-h $host -p $port"); +my $CL = $target2->CreateProcess ("client", " -h $host -p $port"); $client = $CL->SpawnWaitKill (300); @@ -55,4 +49,10 @@ if ($server != 0) { $status = 1; } +$target1->GetStderrLog(); +$target2->GetStderrLog(); + +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); + exit $status; diff --git a/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp b/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp index 7bc3d8ac0ee..af9f211c48c 100644 --- a/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp +++ b/ACE/protocols/tests/HTBP/Reactor_Tests/server.cpp @@ -149,7 +149,7 @@ Accept_Handler::handle_input (ACE_HANDLE h) if ((*ch)->state() == ACE::HTBP::Channel::Data_Queued) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) Server Accept_Handler::handle_input \n"), + ACE_TEXT ("(%P|%t) Server Accept_Handler::handle_input\n"), ACE_TEXT ("Issuing notification on handler\n"))); this->reactor()->notify (session->handler(), ACE_Event_Handler::READ_MASK); diff --git a/ACE/protocols/tests/HTBP/Send_Large_Msg/run_test.pl b/ACE/protocols/tests/HTBP/Send_Large_Msg/run_test.pl index a1bfaafb77f..6b5255794d9 100755 --- a/ACE/protocols/tests/HTBP/Send_Large_Msg/run_test.pl +++ b/ACE/protocols/tests/HTBP/Send_Large_Msg/run_test.pl @@ -6,40 +6,33 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; -use Sys::Hostname; +use PerlACE::TestTarget; $status = 0; -$host = hostname(); -$port = PerlACE::random_port(); $synchbase = "ready"; -$synchfile = PerlACE::LocalFile ("$synchbase"); +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"; +$synchfile = $target1->LocalFile ("$synchbase"); +my $port = $target1->RandomPort (); +my $host = $target1->HostName(); -if (PerlACE::is_vxworks_test()) { - $host = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-p $port -o $synchbase"); -} -else { - $SV = new PerlACE::Process ("server", "-p $port -o $synchfile"); -} +my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile"); +my $CL = $target2->CreateProcess ("client", " -h $host -p $port"); -# The client code should later be modified to get the hostname -# using ACE_OS::hostname so the same script can be run on all -# hosts without having to reset the host where it has to be run. -$CL = new PerlACE::Process ("client", "-h $host -p $port"); +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); -unlink $synchfile; $SV->Spawn (); -if (PerlACE::waitforfile_timed ($synchfile, - $PerlACE::wait_interval_for_process_creation) == -1) { +if ($target1->WaitForFileTimed ($synchbase, + $target1->ProcessStartWaitInterval()) == -1) { print STDERR "ERROR: cannot find file <$synchfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; } -unlink $synchfile; +$target1->DeleteFile ($synchbase); $client = $CL->SpawnWaitKill (300); @@ -55,5 +48,10 @@ if ($server != 0) { $status = 1; } +$target1->GetStderrLog(); +$target2->GetStderrLog(); + +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); exit $status; diff --git a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp index 34f037148c5..724a14b2da3 100644 --- a/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Large_Msg/server.cpp @@ -140,7 +140,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, ACE_TEXT("(%P|%t) Server: ") - ACE_TEXT("received %b \n"),total_recv)); + ACE_TEXT("received %b\n"),total_recv)); ACE_OS::strcpy (buffer,"I hear you !"); diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp index c8d224c9380..2ad433e70ea 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/client.cpp @@ -128,10 +128,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) remote.get_port_number())); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) connected to %s\n"), - ACE_TEXT_CHAR_TO_TCHAR(remote.get_host_name ()))); + ACE_TEXT ("(%P|%t) connected to %C\n"), + remote.get_host_name ())); - ACE_DEBUG ((LM_DEBUG, "(%P) ***** client TEST 1 ***** \n")); + ACE_DEBUG ((LM_DEBUG, "(%P) ***** client TEST 1 *****\n")); //******************* TEST 1 ****************************** // @@ -184,7 +184,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } // ACE_OS::sleep (10); - ACE_DEBUG ((LM_DEBUG, "(%P) ***** client TEST 2 ***** \n")); + ACE_DEBUG ((LM_DEBUG, "(%P) ***** client TEST 2 *****\n")); //******************* TEST 2 ****************************** // diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/run_test.pl b/ACE/protocols/tests/HTBP/Send_Recv_Tests/run_test.pl index 5a7fb2b3289..a5175909548 100755 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/run_test.pl +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/run_test.pl @@ -6,38 +6,32 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; -use Sys::Hostname; +use PerlACE::TestTarget; $status = 0; -$host = hostname(); -$port = PerlACE::random_port(); $synchbase = "ready"; -$synchfile = PerlACE::LocalFile ("$synchbase"); +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"; +$synchfile = $target1->LocalFile ("$synchbase"); +my $port = $target1->RandomPort (); +my $host = $target1->HostName(); -if (PerlACE::is_vxworks_test()) { - $host = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-p $port -o $synchbase"); -} -else { - $SV = new PerlACE::Process ("server", "-p $port -o $synchfile"); -} +my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile"); +my $CL = $target2->CreateProcess ("client", " -h $host -p $port"); -# The client code should later be modified to get the hostname -# using ACE_OS::hostname so the same script can be run on all -# hosts without havng to reset the host where it has to be run. -$CL = new PerlACE::Process ("client", "-h $host -p $port"); +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); -unlink $synchfile; $SV->Spawn (); -if (PerlACE::waitforfile_timed ($synchfile, - $PerlACE::wait_interval_for_process_creation) == -1) { + +if ($target1->WaitForFileTimed ($synchbase, + $target1->ProcessStartWaitInterval()) == -1) { print STDERR "ERROR: cannot find file <$synchfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; } -unlink $synchfile; +$target1->DeleteFile ($synchbase); $client = $CL->SpawnWaitKill (300); @@ -53,4 +47,10 @@ if ($server != 0) { $status = 1; } +$target1->GetStderrLog(); +$target2->GetStderrLog(); + +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); + exit $status; diff --git a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp index 758fdc90a21..aec607eb629 100644 --- a/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp +++ b/ACE/protocols/tests/HTBP/Send_Recv_Tests/server.cpp @@ -178,12 +178,12 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE::HTBP::Stream stream (session); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) client %s connected from %d\n"), - ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()), + ACE_TEXT ("(%P|%t) client %C connected from %d\n"), + cli_addr.get_host_name (), cli_addr.get_port_number ())); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%P) ***** server TEST 1 ***** \n"))); + ACE_TEXT("(%P) ***** server TEST 1 *****\n"))); //******************* TEST 1 ****************************** // // Do a iovec recvv - the client should send 255 bytes, which we @@ -232,7 +232,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%P) ***** server TEST 2 ***** \n"))); + ACE_TEXT("(%P) ***** server TEST 2 *****\n"))); //******************* TEST 2 ****************************** // diff --git a/ACE/protocols/tests/HTBP/ping/run_test.pl b/ACE/protocols/tests/HTBP/ping/run_test.pl index b769c37757e..7269c8fcbfc 100755 --- a/ACE/protocols/tests/HTBP/ping/run_test.pl +++ b/ACE/protocols/tests/HTBP/ping/run_test.pl @@ -6,41 +6,34 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # -*- perl -*- use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::Run_Test; -use Sys::Hostname; +use PerlACE::TestTarget; $status = 0; -$host = hostname(); -$port = PerlACE::random_port(); $synchbase = "ready"; -$synchfile = PerlACE::LocalFile ("$synchbase"); +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"; +$synchfile = $target1->LocalFile ("$synchbase"); +my $port = $target1->RandomPort (); +my $host = $target1->HostName(); print "port = $port\n"; -if (PerlACE::is_vxworks_test()) { - $host = $ENV{'ACE_RUN_VX_TGTHOST'}; - $SV = new PerlACE::ProcessVX ("server", "-p $port -o $synchbase"); -} -else { - $SV = new PerlACE::Process ("server", "-p $port -o $synchfile"); -} -# The client code should later be modified to get the hostname -# using ACE_OS::hostname so the same script can be run on all -# hosts without havng to reset the host where it has to be run. -$CL = new PerlACE::Process ("client", " -h $host -p $port"); +my $SV = $target1->CreateProcess("server", "-p $port -o $synchfile"); +my $CL = $target2->CreateProcess ("client", " -h $host -p $port"); -unlink $synchfile; +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); $SV->Spawn (); -if (PerlACE::waitforfile_timed ($synchfile, - $PerlACE::wait_interval_for_process_creation) == -1) { +if ($target1->WaitForFileTimed ($synchbase, + $target1->ProcessStartWaitInterval()) == -1) { print STDERR "ERROR: cannot find file <$synchfile>\n"; $SV->Kill (); $SV->TimedWait (1); exit 1; } -unlink $synchfile; +$target1->DeleteFile ($synchbase); $client = $CL->SpawnWaitKill (300); @@ -56,4 +49,10 @@ if ($server != 0) { $status = 1; } +$target1->GetStderrLog(); +$target2->GetStderrLog(); + +$target1->DeleteFile ($synchbase); +$target2->DeleteFile ($synchbase); + exit $status; diff --git a/ACE/protocols/tests/RMCast/run_test.pl b/ACE/protocols/tests/RMCast/run_test.pl index 6c21971afe2..abee8b0594c 100755 --- a/ACE/protocols/tests/RMCast/run_test.pl +++ b/ACE/protocols/tests/RMCast/run_test.pl @@ -5,20 +5,22 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -use lib '../../../bin'; -use PerlACE::Run_Test; +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; $status = 0; -$sender = new PerlACE::Process ("sender", "224.1.2.3:12345"); -$receiver = new PerlACE::Process ("receiver", "224.1.2.3:12345"); +my $target1 = PerlACE::TestTarget::create_target (1); +my $target2 = PerlACE::TestTarget::create_target (1); +my $sender = $target1->CreateProcess("sender", "224.1.2.3:12345"); +my $receiver = $target2->CreateProcess("receiver", "224.1.2.3:12345"); $receiver->Spawn (); # Wait for receiver to start. # -sleep ($PerlACE::wait_interval_for_process_creation); +sleep ($target1->ProcessStartWaitInterval()); $sender->Spawn (); @@ -31,4 +33,7 @@ if ($status != 0) { $sender->Kill (); +$target1->GetStderrLog(); +$target2->GetStderrLog(); + exit $status; |