summaryrefslogtreecommitdiff
path: root/TAO/tests/Smart_Proxies
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-30 10:03:58 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-11-30 10:03:58 +0000
commite6cc67104d57669f906094582911e63de87028e5 (patch)
tree1e31bb7fc2ab61eeaf2b980abaefab91a7952292 /TAO/tests/Smart_Proxies
parent93f5c2373f105917e4a4c560a1e1dfd7bbbabc0e (diff)
downloadATCD-e6cc67104d57669f906094582911e63de87028e5.tar.gz
Mon Nov 30 10:01:49 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/default_configuration.pl: * orbsvcs/performance-tests/LoadBalancing/LBPerf/RPS/run_test.pl: * orbsvcs/performance-tests/LoadBalancing/LBPerf/CPU/default_configuration.pl: * orbsvcs/tests/Simple_Naming/run_test.pl: * orbsvcs/tests/Security/InsecureReferences/run_test.pl: * orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl: * orbsvcs/tests/Security/Bug_1107_Regression/run_test.pl: * orbsvcs/tests/Security/Crash_Test/run_test.pl: * orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl: * orbsvcs/tests/Security/MT_SSLIOP/run_test_heavy.pl: * orbsvcs/tests/Security/MT_SSLIOP/run_test.pl: * orbsvcs/tests/AVStreams/Component_Switching/run_test.pl: * orbsvcs/tests/AVStreams/Full_Profile/run_test.pl: * orbsvcs/tests/AVStreams/Bidirectional_Flows/run_test.pl: * orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl: * orbsvcs/tests/AVStreams/Latency/run_test.pl: * orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl: * orbsvcs/tests/AVStreams/Pluggable/run_test.pl: * orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl: * orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl: * orbsvcs/tests/AVStreams/Multiple_Flows/run_test.pl: * orbsvcs/tests/AVStreams/Multicast/run_test.pl: * orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl: * orbsvcs/tests/AVStreams/Modify_QoS/run_test.pl: * orbsvcs/tests/AVStreams/Pluggable_Flow_Protocol/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_all.pl: * orbsvcs/tests/Notify/performance-tests/RedGreen/run_test.pl: * orbsvcs/tests/Notify/XML_Persistence/run_test.pl: * orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl: * orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: * orbsvcs/tests/InterfaceRepo/Duplicate_Typedef_Test/run_test.pl: * orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl: * orbsvcs/tests/InterfaceRepo/IFR_Self_Recursive_IDL_Test/run_test.pl: * performance-tests/POA/Implicit_Activation/run_test.pl: * performance-tests/RTCorba/Multiple_Endpoints/Single_Endpoint/run-test.pl: * performance-tests/RTCorba/Multiple_Endpoints/Orb_Per_Priority/run-test.pl: * performance-tests/Callback/run_test.pl: * performance-tests/Latency/AMH_Single_Threaded/run_test.pl: * performance-tests/Cubit/TAO/MT_Cubit/run_test.pl: * performance-tests/Cubit/TAO/DII_Cubit/run_test.pl: * performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl: * tests/Big_Twoways/run_test.pl: * tests/Bug_2918_Regression/run_test.pl: * tests/Strategies/run_test.pl: * tests/Bug_1482_Regression/run_test.pl: * tests/Portable_Interceptors/Benchmark/run_test.pl: * tests/Xt_Stopwatch/run_test.pl: * tests/Multiple/run_test.pl: * tests/CSD_Strategy_Tests/Broken/run_test.pl: * tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl: * tests/Oneway_Timeouts/client.cpp: * tests/Oneway_Timeouts/server.cpp: * tests/Oneway_Timeouts/run_test.pl: * tests/Smart_Proxies/Policy/server.cpp: * tests/Smart_Proxies/Policy/run_test.pl: * tests/Bug_1270_Regression/run_test.pl: * tests/Parallel_Connect_Strategy/run_test.pl: * tests/Muxed_GIOP_Versions/run_test.pl: * tests/Connect_Strategy_Test/run_test.pl: * tests/Big_Oneways/run_test.pl: * tests/Bug_1627_Regression/server.cpp: * tests/Bug_1627_Regression/run_test.pl: * tests/InterOp-Naming/run_test.pl: * tests/Nested_Upcall_Crash/run_test.pl: * tests/Bug_1269_Regression/client.cpp: * tests/Bug_1269_Regression/run_test.pl: Test are converted to use new test framework and added to fuzz build.
Diffstat (limited to 'TAO/tests/Smart_Proxies')
-rwxr-xr-xTAO/tests/Smart_Proxies/Policy/run_test.pl219
-rw-r--r--TAO/tests/Smart_Proxies/Policy/server.cpp6
2 files changed, 158 insertions, 67 deletions
diff --git a/TAO/tests/Smart_Proxies/Policy/run_test.pl b/TAO/tests/Smart_Proxies/Policy/run_test.pl
index 19d44e96cee..916f26c202c 100755
--- a/TAO/tests/Smart_Proxies/Policy/run_test.pl
+++ b/TAO/tests/Smart_Proxies/Policy/run_test.pl
@@ -1,122 +1,213 @@
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
- & eval 'exec perl -S $0 $argv:q'
- if 0;
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
# $Id$
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
$status = 0;
-$iorfile1base = "test1.ior";
-$iorfile1 = PerlACE::LocalFile ("$iorfile1base");
-$iorfile2 = PerlACE::LocalFile ("test2.ior");
+$debug_level = '0';
-unlink $iorfile1;
-unlink $iorfile2;
-
-if (PerlACE::is_vxworks_test()) {
-$SV1 = new PerlACE::ProcessVX ("server", "-o $iorfile1base");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
}
-else {
-$SV1 = new PerlACE::Process ("server", "-o $iorfile1");
+
+my $server1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $server2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $client = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+
+my $iorbase1 = "server1.ior";
+my $iorbase2 = "server2.ior";
+my $server1_iorfile = $server1->LocalFile ($iorbase1);
+my $server2_iorfile = $server2->LocalFile ($iorbase2);
+my $client_iorfile1 = $client->LocalFile ($iorbase1);
+my $client_iorfile2 = $client->LocalFile ($iorbase2);
+$server1->DeleteFile($iorbase1);
+$server2->DeleteFile($iorbase2);
+$client->DeleteFile($iorbase1);
+$client->DeleteFile($iorbase2);
+
+$SV1 = $server1->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server1_iorfile");
+$SV2 = $server2->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server2_iorfile");
+$CL = $client->CreateProcess ("client",
+ "-i file://$client_iorfile1 ".
+ "-j file://$client_iorfile2");
+
+print STDERR "\nrunning Smart Proxy test consisting of the client and ".
+ "two servers with <one-shot> policy\n\n";
+
+$server_status = $SV1->Spawn ();
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ exit 1;
}
-$SV2 = new PerlACE::Process ("server", "-o $iorfile2");
-$CL = new PerlACE::Process ("client", "-i file://$iorfile1 -j file://$iorfile2");
-print STDERR "\nrunning Smart Proxy test consisting of the client and two servers with <one-shot> policy\n\n";
+if ($server1->WaitForFileTimed ($iorbase1,
+ $server1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server1_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
-$SV1->Spawn ();
+$server_status = $SV2->Spawn ();
-if (PerlACE::waitforfile_timed ($iorfile1,
- $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile1>\n";
- $SV1->Kill ();
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
exit 1;
}
-$SV2->Spawn ();
+if ($server2->WaitForFileTimed ($iorbase2,
+ $server2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server2_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($iorfile2,
- $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile2>\n";
- $SV1->Kill ();
- $SV2->Kill ();
+if ($server1->GetFile ($iorbase1) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server1_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($iorbase1) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile1>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($server2->GetFile ($iorbase2) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server2_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile2>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
exit 1;
}
-$client = $CL->SpawnWaitKill (60);
+$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
$status = 1;
}
-$server = $SV1->WaitKill (15);
+$server_status = $SV1->WaitKill ($server1->ProcessStopWaitInterval());
-if ($server != 0) {
- print STDERR "ERROR: server 1 returned $server\n";
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
$status = 1;
}
-unlink $iorfile1;
-
-$server = $SV2->WaitKill (15);
+$server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
-if ($server != 0) {
- print STDERR "ERROR: server 2 returned $server\n";
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
$status = 1;
}
-unlink $iorfile2;
+$server1->DeleteFile($iorbase1);
+$server2->DeleteFile($iorbase2);
+$client->DeleteFile($iorbase1);
+$client->DeleteFile($iorbase2);
-print STDERR "\nrunning Smart Proxy test consisting of the client and two servers with <one-shot> policy disabled\n\n";
+print STDERR "\nrunning Smart Proxy test consisting of the client and ".
+ "two servers with <one-shot> policy disabled\n\n";
-$SV1->Spawn ();
+$server_status = $SV1->Spawn ();
-if (PerlACE::waitforfile_timed ($iorfile1,
- $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile1>\n";
- $SV1->Kill ();
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
exit 1;
}
-$SV2->Spawn ();
+if ($server1->WaitForFileTimed ($iorbase1,
+ $server1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server1_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($iorfile2,
- $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile2>\n";
- $SV1->Kill ();
- $SV2->Kill ();
+$server_status = $SV2->Spawn ();
+
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
exit 1;
}
-$CL->Arguments ("-f0 -i file://$iorfile1 -j file://$iorfile2");
+if ($server2->WaitForFileTimed ($iorbase2,
+ $server2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$server2_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
-$client = $CL->SpawnWaitKill (60);
+if ($server1->GetFile ($iorbase1) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server1_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($iorbase1) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile1>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($server2->GetFile ($iorbase2) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$server2_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+if ($client->PutFile ($iorbase) == -1) {
+ print STDERR "ERROR: cannot set file <$client_iorfile2>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
+
+$CL->Arguments ("-f 0 -i file://$client_iorfile1 ".
+ "-j file://$client_iorfile2");
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
+
+$client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
+
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
$status = 1;
}
-$server = $SV1->WaitKill (15);
+$server_status = $SV1->WaitKill ($server1->ProcessStopWaitInterval());
-if ($server != 0) {
- print STDERR "ERROR: server 1 returned $server\n";
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
$status = 1;
}
-unlink $iorfile1;
-
-$server = $SV2->WaitKill (15);
+$server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
-if ($server != 0) {
- print STDERR "ERROR: server 2 returned $server\n";
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
$status = 1;
}
-unlink $iorfile2;
+$server1->DeleteFile($iorbase1);
+$server2->DeleteFile($iorbase2);
+$client->DeleteFile($iorbase1);
+$client->DeleteFile($iorbase2);
exit $status;
diff --git a/TAO/tests/Smart_Proxies/Policy/server.cpp b/TAO/tests/Smart_Proxies/Policy/server.cpp
index 145b9e42cfc..dd5846f3797 100644
--- a/TAO/tests/Smart_Proxies/Policy/server.cpp
+++ b/TAO/tests/Smart_Proxies/Policy/server.cpp
@@ -95,12 +95,12 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
try
{
- if (parse_args (argc, argv) != 0)
- return 1;
-
CORBA::ORB_var orb = CORBA::ORB_init (argc,
argv);
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
Test_i servant (orb.in ());
// Obtain RootPOA.
CORBA::Object_var object =