summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-10 10:34:08 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-10 10:34:08 +0000
commit776a26c8a3fe8e95b5fc40081cd247e78d383655 (patch)
tree67142270959c9e85bfd500a6e6e04d0ac1d02c71
parentab61df574e8c4a0ccb0128ec639fab5c9efb4bdb (diff)
downloadATCD-776a26c8a3fe8e95b5fc40081cd247e78d383655.tar.gz
Thu Dec 10 10:32:56 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/tests/Bug_1436_Regression/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl: * orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl: * orbsvcs/tests/FT_App/run_test_demo.pl: * orbsvcs/tests/FT_App/run_test_fault_consumer.pl: * orbsvcs/tests/FT_App/run_test_detector.pl: * orbsvcs/tests/Event/Mcast/Complex/run_test.pl: * orbsvcs/tests/Bug_2248_Regression/client.cpp: * orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp: * orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl: * orbsvcs/tests/Bug_1437_Regression/run_test.pl: Tests are converted to use new test framework and added to fuzz build.
-rw-r--r--TAO/ChangeLog25
-rw-r--r--TAO/bin/tao_other_tests.lst6
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl187
-rwxr-xr-xTAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl191
-rw-r--r--TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp2
-rwxr-xr-xTAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl253
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_demo.pl652
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_detector.pl290
-rwxr-xr-xTAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl372
-rw-r--r--TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp14
-rwxr-xr-xTAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl161
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl293
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl291
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl270
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl267
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl305
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl306
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl129
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl137
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl131
-rwxr-xr-xTAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl270
21 files changed, 2806 insertions, 1746 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index c3048915575..f3d4d1aedd5 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,28 @@
+Thu Dec 10 10:32:56 UTC 2009 Denis Budko <denis.budko@remedy.nl>
+
+ * orbsvcs/tests/Bug_1436_Regression/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl:
+ * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl:
+ * orbsvcs/tests/FT_App/run_test_demo.pl:
+ * orbsvcs/tests/FT_App/run_test_fault_consumer.pl:
+ * orbsvcs/tests/FT_App/run_test_detector.pl:
+ * orbsvcs/tests/Event/Mcast/Complex/run_test.pl:
+ * orbsvcs/tests/Bug_2248_Regression/client.cpp:
+ * orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp:
+ * orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl:
+ * orbsvcs/tests/Bug_1437_Regression/run_test.pl:
+
+ Tests are converted to use new test framework
+ and added to fuzz build.
+
Wed Dec 9 21:16:38 UTC 2009 Yan Dai <dai_y@ociweb.com>
* tests/OBV/Indirection/MessengerClient.cpp:
diff --git a/TAO/bin/tao_other_tests.lst b/TAO/bin/tao_other_tests.lst
index 3f9f20fba13..f86effbc1ec 100644
--- a/TAO/bin/tao_other_tests.lst
+++ b/TAO/bin/tao_other_tests.lst
@@ -54,8 +54,8 @@ TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl: !MINIMUM !CORBA_E_C
TAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl: !ACE_FOR_TAO !CORBA_E_MICRO !DISTRIBUTED
TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO !WCHAR
TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl: !LynxOS !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !WCHAR
-TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO !VxWorks !VxWorks_RTP !LabVIEW_RT !WinCE !FUZZ !WCHAR
-TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !VxWorks !VxWorks_RTP !LabVIEW_RT !WinCE !FUZZ !WCHAR
+TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO !WCHAR !DISTRIBUTED
+TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !WCHAR
TAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl: !NO_IFR !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !WCHAR
TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !NO_MESSAGING
TAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO
@@ -96,7 +96,7 @@ TAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CO
TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !STATIC !ACE_FOR_TAO
TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO
TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO
-TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO !VxWorks !VxWorks_RTP !LabVIEW_RT !WinCE !FUZZ
+TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO !DISTRIBUTED
TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO
TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO
TAO/orbsvcs/tests/InterfaceRepo/Union_Forward_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !WCHAR !NO_IFR !ACE_FOR_TAO
diff --git a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
index 819b2375d59..eed9ffff0cc 100755
--- a/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl
@@ -2,88 +2,143 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
-# -*- perl -*-
# $Id$
+# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
+
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ifr_service = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $tao_ifr = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
# The location of the implementation repository binaries
-$ifr_bin_path = "../../IFR_Service";
+my $ifr_bin_path = "../../IFR_Service";
# The location of the tao_ifr IFR utility
-$tao_ifr_bin_path = "$ENV{ACE_ROOT}/bin";
+my $tao_ifr_bin_path = "$ENV{ACE_ROOT}/bin";
-# IOR file names
-$ifr_ior_file = PerlACE::LocalFile("ifr.ior");
+# IOR file
+my $ior_file = "ifr.ior";
# IDL File
-$idl_file = PerlACE::LocalFile("test.idl");
+my $idl_file = "test.idl";
#Log file
-$result_file = PerlACE::LocalFile("test_result.log");
-
-$IFRSERVICE = new PerlACE::Process("$ifr_bin_path/IFR_Service");
-$TAO_IFR = new PerlACE::Process("$tao_ifr_bin_path/tao_ifr");
-
-sub test_body
-{
- unlink $ifr_ior_file;
-
- # Start the IFR Service to generate an IOR file for the tao_ifr to use...
- $IFRSERVICE->Arguments("-o $ifr_ior_file ");
- $IFRSERVICE->Spawn ();
-
- if (PerlACE::waitforfile_timed ($ifr_ior_file, $PerlACE::wait_interval_for_process_creation) == -1)
- {
- print STDERR "ERROR: cannot find $ifr_ior_file\n";
- $IFRSERVICE->Kill ();
- return 1;
- }
-
- # Redirect STDERR to a log file so that
- # we can make sure that we got a warning
- open(SAVEERR, ">&STDERR");
- open(STDERR, ">$result_file");
-
- $TAO_IFR->Arguments("-ORBInitRef InterfaceRepository=file://$ifr_ior_file -Cw $idl_file");
- $TAO_IFR->SpawnWaitKill (30);
-
- # Close the log file and restore STDERR
- close(STDERR);
- open(STDERR, ">&SAVEERR");
-
- if (! -r $result_file) {
- print STDERR "ERROR: cannot find $result_file\n";
- $IFRSERVICE->Kill ();
- $TAO_IFR->Kill ();
- return 1;
- }
-
- $match = 0;
- open (FILE, $result_file) or return -1;
- while (<FILE>) {
- $match = /Warning - identifier spellings differ only in case:/;
- last if $match;
- }
- close FILE;
- # Tidy up
- $IFRSERVICE->TerminateWaitKill (5);
- return $match ? 0 : -1;
+my @result_files = ();
+for ($i = 0; $i < 2; $i++) {
+ $result_files[$i] = "test_result_$i.log";
+}
+
+#Files specification
+$tao_ifr_idlfile = $tao_ifr->LocalFile($idl_file);
+$tao_ifr_iorfile = $tao_ifr->LocalFile($ior_file);
+
+$ifr_service_iorfile = $ifr_service->LocalFile($ior_file);
+
+$tao_ifr->DeleteFile($ior_file);
+$ifr_service->DeleteFile($ior_file);
+
+$ifr_service_result_file = $ifr_service->LocalFile ($result_files[0]);
+$tao_ifr_result_file = $ifr_service->LocalFile ($result_files[1]);
+$ifr_service->DeleteFile ($result_files[0]);
+$tao_ifr->DeleteFile ($result_files[1]);
+
+$IFRSERVICE = $ifr_service->CreateProcess("$ifr_bin_path/IFR_Service", "-ORBdebuglevel $debug_level ".
+ "-ORBLogFile $ifr_service_result_file ".
+ "-o $ifr_service_iorfile");
+$TAOIFR = $tao_ifr->CreateProcess("$tao_ifr_bin_path/tao_ifr", "-ORBLogFile $tao_ifr_result_file ".
+ "-ORBInitRef InterfaceRepository=file://$tao_ifr_iorfile ".
+ "-Cw $tao_ifr_idlfile");
+
+sub analyse_results {
+ my $result_file = $_[0];
+
+ if (! -r $result_file) {
+ print STDERR "ERROR: cannot find $result_file\n";
+ return 1;
+ }
+
+ my $match = 0;
+ open (FILE, $result_file) or return -1;
+ while (<FILE>) {
+ $match = /Warning - identifier spellings differ only in case:/;
+ last if $match;
+ }
+ close FILE;
+
+ return $match ? 0 : -1;
+}
+
+sub test_body {
+ # Start the IFR Service to generate an IOR file for the tao_ifr to use...
+ $ifr_status = $IFRSERVICE->Spawn ();
+
+ if ($ifr_status != 0) {
+ print STDERR "ERROR: ifr_service Spawn returned $ifr_status\n";
+ return 1;
+ }
+
+ if ($ifr_service->WaitForFileTimed ($ior_file,
+ $ifr_service->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ifr_service_iorfile>\n";
+ $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
+ return 1;
+ }
+
+ if ($ifr_service->GetFile ($ior_file) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ifr_service_iorfile>\n";
+ $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
+ return 1;
+ }
+
+ if ($tao_ifr->PutFile ($ior_file) == -1) {
+ print STDERR "ERROR: cannot set file <$tao_ifr_iorfile>\n";
+ $IFRSERVICE->Kill (); $IFRSERVICE->TimedWait (1);
+ return 1;
+ }
+
+ $tao_status = $TAOIFR->SpawnWaitKill ($tao_ifr->ProcessStartWaitInterval() + 15);
+ if ($tao_status != 0) {
+ print STDERR "ERROR: tao_ifr returned $tao_status\n";
+ $status = 1;
+ }
+
+ $match = 0;
+# $match = analyse_results ($ifr_service_result_file); $ # this string is not currently needed
+ $match += analyse_results ($tao_ifr_result_file);
+
+ # Tidy up
+ $ifr_status = $IFRSERVICE->TerminateWaitKill ($ifr_service->ProcessStopWaitInterval());
+ if ($ifr_status != 0) {
+ print STDERR "ERROR: ifr_service TerminateWaitKill returned $ifr_status\n";
+ return 1;
+ }
+
+ return $match;
}
# Run regression for bug #1436
-$test_result = test_body();
+$status = test_body();
-if ($test_result != 0)
-{
- print STDERR "ERROR: Regression test for Bug #1436 failed\n";
+if ($status != 0) {
+ print STDERR "ERROR: Regression test for Bug #1436 failed\n";
}
-else
-{
- print "Regression test for Bug #1436 passed.\n";
+else {
+ print "Regression test for Bug #1436 passed.\n";
}
-unlink $ifr_ior_file;
-unlink $result_file;
-exit $test_result;
+$tao_ifr->DeleteFile($ior_file);
+$ifr_service->DeleteFile($ior_file);
+$ifr_service->DeleteFile ($result_files[0]);
+$tao_ifr->DeleteFile ($result_files[1]);
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
index 1a7e4ed3613..7f5a0a5b2c2 100755
--- a/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
+++ b/TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl
@@ -2,106 +2,135 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
-# -*- perl -*-
# $Id$
+# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
-# The location of the implementation repository binaries
-$imr_bin_path = "../../ImplRepo_Service";
+$status = 0;
+$debug_level = '0';
-# The location of the tao_imr IMR utility
-$tao_imr_bin_path = "$ENV{ACE_ROOT}/bin";
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
-# IOR file names
-$imr_ior_file = PerlACE::LocalFile("impl.ior");
-$activator_ior_file = PerlACE::LocalFile("activator.ior");
+my $locator = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $activator = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $tao_imr = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
-# Log file
-$log_file = PerlACE::LocalFile("test_result.log");
+# The location of the implementation repository binaries
+my $imr_bin_path = "";
+
+my $imr_ior = "impl.ior";
+my $activator_ior = "activator.ior";
-# The players in our little drama.
-$LOCATOR = new PerlACE::Process("$imr_bin_path/ImplRepo_Service");
-$ACTIVATOR = new PerlACE::Process("$imr_bin_path/ImR_Activator");
-$TAO_IMR = new PerlACE::Process("$tao_imr_bin_path/tao_imr");
+my $locator_imr_iorfile = $locator->LocalFile ($imr_ior);
+my $activator_iorfile = $activator->LocalFile ($activator_ior);
+my $activator_imr_iorfile = $activator->LocalFile ($imr_ior);
+my $tao_imr_imr_iorfile = $tao_imr->LocalFile ($imr_ior);
+$locator->DeleteFile ($imr_ior);
+$activator->DeleteFile ($activator_ior);
+$activator->DeleteFile ($imr_ior);
+$tao_imr->DeleteFile ($imr_ior);
# Run the IMR locator on a fixed port
-$port = PerlACE::uniqueid () + 10001; # This can't be 10000 for Chorus 4.0
-
-sub test_body
-{
- unlink $imr_ior_file;
- unlink $activator_ior_file;
- unlink $log_file;
-
- # Start the IMR locator to generate an IOR file for the server to use...
- $LOCATOR->Arguments("-o $imr_ior_file -ORBEndpoint iiop://:$port");
- $LOCATOR->Spawn ();
-
- if (PerlACE::waitforfile_timed ($imr_ior_file, $PerlACE::wait_interval_for_process_creation) == -1)
- {
- print STDERR "ERROR: cannot find $imr_ior_file\n";
- $LOCATOR->Kill ();
- return 1;
- }
-
- # Set the activator arguments
- $activator_arguments = "-o $activator_ior_file -ORBInitRef ImplRepoService=file://$imr_ior_file";
-
- # Start up the activator
- $ACTIVATOR->Arguments ($activator_arguments);
- $ACTIVATOR->Spawn ();
-
- if (PerlACE::waitforfile_timed ($activator_ior_file, $PerlACE::wait_interval_for_process_creation) == -1)
- {
- print STDERR "ERROR: cannot find $activator_ior_file\n";
- $ACTIVATOR->Kill ();
- $LOCATOR->Kill ();
- return 1;
- }
-
- # Redirect STDERR to a log file so that the ERROR
- # message does not get printed to the terminal
- open(SAVEERR, ">&STDERR");
- open(STDERR, ">$log_file");
-
- # Add the illegal persistent POA name to the IMR
- $TAO_IMR->Arguments("-ORBInitRef ImplRepoService=file://$imr_ior_file add \"\"");
- $result = $TAO_IMR->SpawnWaitKill (30);
-
- # Close the log file and restore STDERR
- close(STDERR);
- open(STDERR, ">&SAVEERR");
-
- # If the add of an empty string failed, then
- # the test of the tao_imr succeeded.
- if ($result != 0) {
- $result = 0;
- }
- else {
- $result = -1;
- }
+my $locator_port = $locator->RandomPort();
+
+$LC = $locator->CreateProcess ("../../ImplRepo_Service/ImplRepo_Service",
+ "-ORBdebuglevel $debug_level -o $locator_imr_iorfile ".
+ "-ORBEndpoint iiop://:$locator_port");
+
+$AC = $activator->CreateProcess ("../../ImplRepo_Service/ImR_Activator",
+ "-ORBdebuglevel $debug_level -o $activator_iorfile ".
+ "-ORBInitRef ImplRepoService=file://$activator_imr_iorfile");
+
+$TI = $tao_imr->CreateProcess ("$ENV{ACE_ROOT}/bin",
+ "-ORBInitRef ImplRepoService=file://$tao_imr_imr_iorfile add \"\"");
+
+sub test_body {
+
+ $process_status = $LC->Spawn ();
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: locator returned $process_status\n";
+ return 1;
+ }
+
+ if ($locator->WaitForFileTimed ($imr_ior,
+ $locator->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$locator_imr_iorfile>\n";
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ if ($locator->GetFile ($imr_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$locator_imr_iorfile>\n";
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ if ($activator->PutFile ($imr_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$activator_imr_iorfile>\n";
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ if ($tao_imr->PutFile ($imr_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$tao_imr_imr_iorfile>\n";
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ $process_status = $AC->Spawn ();
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: activator returned $process_status\n";
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ if ($activator->WaitForFileTimed ($activator_ior,
+ $activator->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$activator_iorfile>\n";
+ $AC->Kill (); $AC->TimedWait (1);
+ $LC->Kill (); $LC->TimedWait (1);
+ return 1;
+ }
+
+ # Add the illegal persistent POA name to the IMR
+ $result = $TI->SpawnWaitKill ($tao_imr->ProcessStartWaitInterval() + 15);
+
+ # If the add of an empty string failed, then
+ # the test of the tao_imr succeeded.
+ if ($result != 0) {
+ $result = 0;
+ }
+ else {
+ $result = -1;
+ }
# Tidy up
- $ACTIVATOR->TerminateWaitKill (5);
- $LOCATOR->TerminateWaitKill (5);
+ $AC->TerminateWaitKill ($activator->ProcessStopWaitInterval());
+ $LC->TerminateWaitKill ($locator->ProcessStopWaitInterval());
return $result;
}
# Run regression for bug #1437
-$test_result = test_body();
+$status = test_body();
-if ($test_result != 0)
-{
+if ($status != 0) {
print STDERR "ERROR: Regression test for Bug #1437 failed\n";
}
-else
-{
+else {
print "Regression test for Bug #1437 passed.\n";
}
-unlink $log_file;
-unlink $imr_ior_file;
-unlink $activator_ior_file;
-exit $test_result;
+$locator->DeleteFile ($imr_ior);
+$activator->DeleteFile ($activator_ior);
+$activator->DeleteFile ($imr_ior);
+$tao_imr->DeleteFile ($imr_ior);
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp
index 290084753a7..06d3a46dc22 100644
--- a/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp
+++ b/TAO/orbsvcs/tests/Bug_2248_Regression/client.cpp
@@ -57,7 +57,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
second_iogr_file = get_opts.opt_arg ();
break;
case 't':
- delay = atoi(get_opts.opt_arg ());
+ delay = ACE_OS::atoi(get_opts.opt_arg ());
break;
case '?':
default:
diff --git a/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl b/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl
index 99454685e65..fe9d79a0e18 100755
--- a/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl
+++ b/TAO/orbsvcs/tests/Event/Mcast/Complex/run_test.pl
@@ -1,17 +1,18 @@
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::TestTarget;
+use POSIX;
+
# This is a Perl script that runs Simple EC Mcast example. It starts
# consumer, supplier and two (federated) Event Channel servers.
# See README for more details.
-use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use POSIX;
###############################################################
# Configuration parameters
@@ -19,15 +20,45 @@ use POSIX;
# Amount of delay (in seconds) between starting a server and a client
# to allow proper server initialization.
+$status = 0;
+
$sleeptime = 10;
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+
+$test->AddLibPath ("../Common");
+
# Variables for command-line arguments to client and server
# executables.
-$consumer_iorfile = PerlACE::LocalFile ("consumer-ec.ior");
-$supplier_iorfile = PerlACE::LocalFile ("supplier-ec.ior");
-$consumer_conffile = PerlACE::LocalFile ("consumer-ec.conf");
-$supplier_conffile = PerlACE::LocalFile ("supplier-ec.conf");
+my $supplier_ior = "supplier-ec.ior";
+my $consumer_ior = "consumer-ec.ior";
+my $supplier_conf = "supplier-ec.conf";
+my $consumer_conf = "consumer-ec.conf";
+
+my $test_supplier_ior = $test->LocalFile ($supplier_ior);
+my $test_consumer_ior = $test->LocalFile ($consumer_ior);
+$test->DeleteFile ($supplier_ior);
+$test->DeleteFile ($consumer_ior);
+
+my $test_supplier_conf = $test->LocalFile ($supplier_conf);
+my $test_consumer_conf = $test->LocalFile ($consumer_conf);
+
+my @outputs = ();
+for ($i = 0; $i < 4; $i++) {
+ $outputs[$i] = "run_test_".$i.".log";
+ $output_files[$i] = $test->LocalFile ($outputs[$i]);
+ $test->DeleteFile ($outputs[$i]);
+}
+#Processes creation
+$EC_SP = $test->CreateProcess ("gateway-ec", "-ORBsvcconf $test_supplier_conf ".
+ "-i $test_supplier_ior -ORBLogFile $output_files[0]");
+$EC_CM = $test->CreateProcess ("gateway-ec", "-ORBsvcconf $test_consumer_conf ".
+ "-i $test_consumer_ior -ORBLogFile $output_files[1]");
+$CM = $test->CreateProcess ("consumer", "-ORBInitRef Event_Service=file://$test_consumer_ior ".
+ "-ORBLogFile $output_files[2]");
+$SP = $test->CreateProcess ("supplier", "-ORBInitRef Event_Service=file://$test_supplier_ior ".
+ "-ORBLogFile $output_files[3]");
#################################################################
# Subs
@@ -35,77 +66,98 @@ $supplier_conffile = PerlACE::LocalFile ("supplier-ec.conf");
sub run_test
{
+ # Start Event Channel server.
# Supplier EC.
- if (run_ec (0, $supplier_conffile, $supplier_iorfile) != 0) {
- kill_processes (); return -1;
+ my $process_status = $EC_SP->Spawn ();
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: ec_supplier returned $process_status\n";
+ return -1;
}
-
+
+ if ($test->WaitForFileTimed ($supplier_ior,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_supplier_ior>\n";
+ $EC_SP->Kill (); $EC_SP->TimedWait (1);
+ return -1;
+ }
+
# Consumer EC.
- if (run_ec (1, $consumer_conffile, $consumer_iorfile) != 0) {
- kill_processes (); return -1;
+ $process_status = $EC_CM->Spawn ();
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: ec_consumer returned $process_status\n";
+ return -1;
+ }
+
+ if ($test->WaitForFileTimed ($consumer_ior,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_consumer_ior>\n";
+ $EC_SP->Kill (); $EC_SP->TimedWait (1);
+ $EC_CM->Kill (); $EC_CM->TimedWait (1);
+ return -1;
}
- # Consumer.
- $ps[2] =
- new PerlACE::Process ("consumer",
- "-ORBInitRef Event_Service=file://$consumer_iorfile");
- if ($ps[2]->Spawn () == -1) {
- kill_processes (); return -1;
+ # Consumer.
+ $process_status = $CM->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: consumer returned $process_status\n";
+ $status = 1;
+ kill_processes ();
+ return -1;
}
# Give consumer a chance to connect to its EC before firing off the supplier.
sleep ($sleeptime);
# Supplier.
- $ps[3] =
- new PerlACE::Process ("supplier",
- "-ORBInitRef Event_Service=file://$supplier_iorfile");
- if ($ps[3]->Spawn () == -1) {
- kill_processes (); return -1;
+ $process_status = $SP->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: supplier returned $process_status\n";
+ $status = 1;
+ kill_processes ();
+ return $status;
}
# Shutdown.
return kill_processes ();
}
-# Start Event Channel server.
-sub run_ec
-{
- my $ec_id = $_[0];
- my $conf_file = $_[1];
- my $ior_file = $_[2];
+# Wait for and kill, if necessary, all started processes.
+sub kill_processes {
+ my $result = 0;
- unlink $ior_file;
+ my $process_status = $EC_SP->WaitKill ($test->ProcessStopWaitInterval() + 45);
- $ps[$ec_id] = new PerlACE::Process ("gateway-ec",
- "-ORBsvcconf $conf_file -i $ior_file");
- if ($ps[$ec_id]->Spawn () == -1) {
- return 1;
+ if ($process_status != 0) {
+ print STDERR "ERROR: ec_supplier returned $process_status\n";
+ $result = 1;
}
- if (PerlACE::waitforfile_timed ($ior_file, $PerlACE::wait_interval_for_process_creation) == -1)
- {
- print STDERR "ERROR: cannot find IOR file <$ior_file>\n";
- $ps[$ec_id]->Kill ();
- return 1;
+ $process_status = $EC_CM->WaitKill ($test->ProcessStopWaitInterval() + 45);
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: ec_consumer returned $process_status\n";
+ $result = 1;
}
- return 0;
-}
+ $process_status = $SP->WaitKill ($test->ProcessStopWaitInterval() + 45);
-# Wait for and kill, if necessary, all started processes.
-sub kill_processes
-{
- my $result = 0;
+ if ($process_status != 0) {
+ print STDERR "ERROR: supplier returned $process_status\n";
+ $result = 1;
+ }
- foreach $p (@ps)
- {
- if ($p->WaitKill (60) != 0) {
- $result = -1;
- }
+ $process_status = $CM->WaitKill ($test->ProcessStopWaitInterval() + 45);
+
+ if ($process_status != 0) {
+ print STDERR "ERROR: consumer returned $process_status\n";
+ $result = 1;
}
- if ($result == -1) {
+ if ($result != 0) {
print STDERR "ERROR detected\n";
return -1;
}
@@ -113,70 +165,41 @@ sub kill_processes
return 0;
}
-sub restore_output
-{
- # Restore output facilities.
- close (STDERR);
- close (STDOUT);
- open (STDOUT, ">&OLDOUT");
- open (STDERR, ">&OLDERR");
-}
-
-sub redirect_output
-{
- my $rundate = POSIX::strftime("%Y_%m_%d_%H_%M", localtime);
- $output_file = PerlACE::LocalFile ("run_test_$rundate");
-
- open (OLDOUT, ">&STDOUT");
- open (STDOUT, ">$output_file") or die "can't redirect stdout: $!";
- open (OLDERR, ">&STDERR");
- open (STDERR, ">&STDOUT") or die "can't redirect stderror: $!";
-}
-
-sub analyze_results
-{
- if (! open (TEST_OUTPUT, "<$output_file"))
- {
- print STDERR "ERROR: Could not open $output_file\n";
- return -1;
- }
-
+sub analyze_results {
my $status = 0;
my $a_events = 0;
my $b_events = 0;
my $c_events = 0;
- while (<TEST_OUTPUT>)
- {
- if (m/Received event A/)
- {
- $a_events += 1;
- }
- elsif (m/Received event B/)
- {
- $b_events += 1;
- }
- elsif (m/Received event C/)
- {
- $c_events += 1;
- }
- elsif (m/Received 100 events/
- || m/SUCCESS/)
- {
- #skip this line - we do our own counting.
+
+ foreach $output_file (@output_files) {
+ if (! open (TEST_OUTPUT, "<$output_file")) {
+ print STDERR "ERROR: Could not open $output_file\n";
+ return -1;
}
- else
- {
- print STDERR $_;
- $status = -1;
+
+ while (<TEST_OUTPUT>) {
+ if (m/Received event A/) {
+ $a_events += 1;
+ }
+ elsif (m/Received event B/) {
+ $b_events += 1;
+ }
+ elsif (m/Received event C/) {
+ $c_events += 1;
+ }
+ elsif (m/Received 100 events/ || m/SUCCESS/) {
+ #skip this line - we do our own counting.
+ }
+ else {
+ print STDERR $_;
+ $status = -1;
+ }
}
+ close (TEST_OUTPUT);
}
- close (TEST_OUTPUT);
my $all_received = 1;
- if ($a_events != 100
- || $b_events != 100
- || $c_events != 100)
- {
+ if ($a_events != 100 || $b_events != 100 || $c_events != 100) {
$all_received = 0;
print STDERR "ERROR: consumer received\n"
."\t$a_events A events, expected 100\n"
@@ -199,17 +222,19 @@ sub analyze_results
$status = 0;
-redirect_output ();
-
-if (run_test () == -1) {
+if (run_test () != 0) {
$status = 1;
}
-restore_output ();
-
if (analyze_results () == -1) {
$status = 1;
}
-exit $status;
+$test->DeleteFile ($supplier_ior);
+$test->DeleteFile ($consumer_ior);
+$test->DeleteFile ($outputs[0]);
+$test->DeleteFile ($outputs[1]);
+$test->DeleteFile ($outputs[2]);
+$test->DeleteFile ($outputs[3]);
+exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_demo.pl b/TAO/orbsvcs/tests/FT_App/run_test_demo.pl
index b2ff8cc0aca..56226d77fe4 100755
--- a/TAO/orbsvcs/tests/FT_App/run_test_demo.pl
+++ b/TAO/orbsvcs/tests/FT_App/run_test_demo.pl
@@ -79,44 +79,69 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# 10) Start Cient3 with IOGR3.
# 10.1) Repeat 8.1 & 8.2 using IOGR3.
# 11) System manages to shut itself down.
-
use lib "$ENV{ACE_ROOT}/bin";
-#use lib '$ENV{ACE_ROOT}/bin';
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
########################
#command line options
#set defaults:
+
+my($status) = 0;
my($verbose) = 0; # 1: report perl actions before executing them
my($debug_builds) = ($^O eq 'MSWin32' ? 0 : 1);; # 0: use exes from Release directories
my($simulated) = 1; # 1: use "client simulated" fault tolerance
+# List of the proccess which must be killed before exit with error
+@kill_list = ();
+
+sub add_to_kills{
+ $goal = shift;
+ @kill_list = (@kill_list, $goal);
+}
+sub exit_and_kill{
+ $status = shift;
+ foreach $goal (@kill_list){
+ $goal->Kill (); $goal->TimedWait (1);
+ }
+ exit $status;
+}
+
foreach $i (@ARGV) {
- if ($i eq "--debug_build")
- {
- $debug_builds = 1;
- }
- elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
- {
- $simulated = 0;
- }
- elsif ($i eq "-v")
- {
- $verbose += 1;
- }
+ if ($i eq "--debug_build"){
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate"){ # reverse this once we have FT ORB support
+ $simulated = 0;
+ }
+ elsif ($i eq "-v"){
+ $verbose += 1;
+ }
}
my($build_directory) = "/Release";
if ( $debug_builds ) {
- $build_directory = "";
+ $build_directory = "";
}
if ( $verbose > 1) {
- print "verbose: $verbose\n";
- print "debug_builds: $debug_builds -> $build_directory\n";
- print "simulated: $simulated\n";
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
}
+my $rp_manager = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $rp_manager_controller = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $fault_detector1 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $fault_detector2 = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $fault_notifier = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+my $ft_replica1 = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
+my $ft_replica2 = PerlACE::TestTarget::create_target (7) || die "Create target 7 failed\n";
+my $ft_replica3 = PerlACE::TestTarget::create_target (8) || die "Create target 8 failed\n";
+my $ft_creator = PerlACE::TestTarget::create_target (9) || die "Create target 9 failed\n";
+my $client1 = PerlACE::TestTarget::create_target (10) || die "Create target 10 failed\n";
+my $client2 = PerlACE::TestTarget::create_target (11) || die "Create target 11 failed\n";
+my $client3 = PerlACE::TestTarget::create_target (12) || die "Create target 12 failed\n";
+
my($role1) = "hobbit";
my($role2) = "elf";
@@ -124,117 +149,248 @@ my($location1) = "shire";
my($location2) = "bree";
my($location3) = "rivendell";
-my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
-my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
-
#define temp files
-my($rm_ior) = PerlACE::LocalFile ("rm.ior");
-my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
-my($detector1_ior) = PerlACE::LocalFile ("detector1.ior");
-my($detector2_ior) = PerlACE::LocalFile ("detector2.ior");
-my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
-my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
-my($factory3_ior) = PerlACE::LocalFile ("factory3.ior");
-my($replica1_ior) = PerlACE::LocalFile ("${role1}_${location1}_0.ior");
-my($replica2_ior) = PerlACE::LocalFile ("${role1}_${location2}_0.ior");
-my($replica3_ior) = PerlACE::LocalFile ("${role2}_${location2}_1.ior");
-my($replica4_ior) = PerlACE::LocalFile ("${role2}_${location3}_0.ior");
-my($replica5_ior) = PerlACE::LocalFile ("${role1}_${location1}_1.ior");
-my($replica6_ior) = PerlACE::LocalFile ("${role1}_${location2}_2.ior");
-
-my($replica1_iogr) = PerlACE::LocalFile ("${role1}_0.iogr");
-my($replica2_iogr) = PerlACE::LocalFile ("${role2}_1.iogr");
-my($replica3_iogr) = PerlACE::LocalFile ("${role1}_2.iogr");
-
-my($client_data) = PerlACE::LocalFile ("persistent.dat");
-
-#discard junk from previous tests
-unlink $rm_ior;
-unlink $notifier_ior;
-unlink $detector1_ior;
-unlink $detector2_ior;
-unlink $factory1_ior;
-unlink $factory2_ior;
-unlink $factory3_ior;
-unlink $replica1_ior;
-unlink $replica2_ior;
-unlink $replica3_ior;
-unlink $replica4_ior;
-unlink $replica5_ior;
-unlink $replica6_ior;
-unlink $replica1_iogr;
-unlink $replica2_iogr;
-
-unlink $client_data;
-
-my($status) = 0;
-
-my($RM) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager$build_directory/FT_ReplicationManager", "-o $rm_ior $rm_endpoint");
-my($RMC) = new PerlACE::Process (".$build_directory/replmgr_controller", "$rm_initref -x");
-my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "$rm_initref -o $notifier_ior -q");
-my($DET1) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector1_ior -l $location1 -q");
-my($DET2) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector2_ior -l $location2 -q");
-my($FAC1) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory1_ior -l $location1 -i $role1 -q");
-my($FAC2) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory2_ior -l $location2 -i $role1 -i $role2 -q");
-my($FAC3) = new PerlACE::Process (".$build_directory/ft_replica", "$rm_initref -o $factory3_ior -l $location3 -i $role2 -q");
+my($rm_ior) = "rm.ior";
+my($factory1_ior) = "factory1.ior";
+my($factory2_ior) = "factory2.ior";
+my($factory3_ior) = "factory3.ior";
+my($detector1_ior) = "detector1.ior";
+my($detector2_ior) = "detector2.ior";
+my($notifier_ior) = "notifier.ior";
+
+my($replica1_ior) = "${role1}_${location1}_0.ior";
+my($replica2_ior) = "${role1}_${location2}_0.ior";
+my($replica3_ior) = "${role2}_${location2}_1.ior";
+my($replica4_ior) = "${role2}_${location3}_0.ior";
+my($replica5_ior) = "${role1}_${location1}_1.ior";
+my($replica6_ior) = "${role1}_${location2}_2.ior";
+
+my($replica1_iogr) = "${role1}_0.iogr";
+my($replica2_iogr) = "${role2}_1.iogr";
+my($replica3_iogr) = "${role1}_2.iogr";
+
+my($client_data) = "persistent.dat";
+
+# Files for rp_manager
+my $rp_manager_ior = $rp_manager->LocalFile ($rm_ior);
+$rp_manager->DeleteFile ($rm_ior);
+
+# Files for fault_detector1
+my $fault_detector1_ior = $fault_detector1->LocalFile ($detector1_ior);
+$fault_detector1->DeleteFile ($detector1_ior);
+
+# Files for fault_detector2
+my $fault_detector2_ior = $fault_detector2->LocalFile ($detector2_ior);
+$fault_detector2->DeleteFile ($detector2_ior);
+
+# Files for fault_notifier
+my $fault_notifier_ior = $fault_notifier->LocalFile ($notifier_ior);
+$fault_notifier->DeleteFile ($notifier_ior);
+
+# Files for ft_replica1
+my $ft_replica1_factory1_ior = $ft_replica1->LocalFile ($factory1_ior);
+my $ft_replica1_client_data = $ft_replica1->LocalFile ($client_data);
+
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+my $ft_replica2_factory2_ior = $ft_replica2->LocalFile ($factory2_ior);
+my $ft_replica2_client_data = $ft_replica2->LocalFile ($client_data);
+
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for ft_replica3
+my $ft_replica3_factory3_ior = $ft_replica3->LocalFile ($factory3_ior);
+my $ft_replica3_client_data = $ft_replica3->LocalFile ($client_data);
+
+$ft_replica3->DeleteFile ($factory3_ior);
+$ft_replica3->DeleteFile ($client_data);
+
+# Files for ft_creator
+my $creator_replica1_ior = $ft_creator->LocalFile ($replica1_ior);
+my $creator_replica2_ior = $ft_creator->LocalFile ($replica2_ior);
+my $creator_replica3_ior = $ft_creator->LocalFile ($replica3_ior);
+my $creator_replica4_ior = $ft_creator->LocalFile ($replica4_ior);
+my $creator_replica5_ior = $ft_creator->LocalFile ($replica5_ior);
+my $creator_replica6_ior = $ft_creator->LocalFile ($replica6_ior);
+
+my $creator_replica1_iogr = $ft_creator->LocalFile ($replica1_iogr);
+my $creator_replica2_iogr = $ft_creator->LocalFile ($replica2_iogr);
+my $creator_replica3_iogr = $ft_creator->LocalFile ($replica3_iogr);
+
+$ft_creator->DeleteFile ($replica1_ior);
+$ft_creator->DeleteFile ($replica2_ior);
+$ft_creator->DeleteFile ($replica3_ior);
+$ft_creator->DeleteFile ($replica4_ior);
+$ft_creator->DeleteFile ($replica5_ior);
+$ft_creator->DeleteFile ($replica6_ior);
+
+$ft_creator->DeleteFile ($replica1_iogr);
+$ft_creator->DeleteFile ($replica2_iogr);
+$ft_creator->DeleteFile ($replica3_iogr);
+
+# Files for client1
+my $client1_replica1_ior = $client1->LocalFile ($replica1_ior);
+my $client1_replica2_ior = $client1->LocalFile ($replica2_ior);
+my $client1_replica1_iogr = $client1->LocalFile ($replica1_iogr);
+
+$client1->DeleteFile ($replica1_ior);
+$client1->DeleteFile ($replica2_ior);
+$client1->DeleteFile ($replica1_iogr);
+
+# Files for client2
+my $client2_replica3_ior = $client2->LocalFile ($replica3_ior);
+my $client2_replica4_ior = $client2->LocalFile ($replica4_ior);
+my $client2_replica2_iogr = $client2->LocalFile ($replica2_iogr);
+
+$client2->DeleteFile ($replica3_ior);
+$client2->DeleteFile ($replica4_ior);
+$client2->DeleteFile ($replica2_iogr);
+
+# Files for client3
+my $client3_replica5_ior = $client3->LocalFile ($replica5_ior);
+my $client3_replica6_ior = $client3->LocalFile ($replica6_ior);
+my $client3_replica3_iogr = $client3->LocalFile ($replica3_iogr);
+
+$client3->DeleteFile ($replica5_ior);
+$client3->DeleteFile ($replica6_ior);
+$client3->DeleteFile ($replica3_iogr);
+
+$hostname = $rp_manager->HostName ();
+$port = $rp_manager->RandomPort ();
+
+$RM = $rp_manager->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/FT_ReplicationManager" .
+ "$build_directory/FT_ReplicationManager",
+ "-o $rp_manager_ior " .
+ "-ORBEndpoint iiop://$hostname:$port");
+
+$RMC = $rp_manager_controller->CreateProcess (".$build_directory/replmgr_controller" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-x");
+
+$NOT = $fault_notifier->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier" .
+ "$build_directory/Fault_Notifier" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $fault_notifier_ior -q");
+
+$DET1 = $fault_detector1->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector" .
+ "$build_directory/Fault_Detector" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $fault_detector1_ior " .
+ "-l $location1 -q");
+
+$DET2 = $fault_detector2->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector" .
+ "$build_directory/Fault_Detector" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $fault_detector1_ior " .
+ "-l $location2 -q");
+
+$REP1 = $ft_replica1->CreateProcess (".$build_directory/ft_replica" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $ft_replica1_factory1_ior ".
+ "-l $location1 -i $role1 -q -p $ft_replica1_client_data");
+
+$REP2 = $ft_replica2->CreateProcess (".$build_directory/ft_replica" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $ft_replica2_factory2_ior ".
+ "-l $location2 -i $role1 -i $role2 -q -p $ft_replica2_client_data");
+
+$REP3 = $ft_replica3->CreateProcess (".$build_directory/ft_replica" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $ft_replica3_factory3_ior ".
+ "-l $location3 -i $role2 -q -p $ft_replica3_client_data");
my($OGC);
my($CL1);
my($CL2);
my($CL3);
if ($simulated) {
- print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
- $OGC= new PerlACE::Process (".$build_directory/ft_create", "$rm_initref -r $role1 -r $role2 -r $role1 -i -n");
- $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
- $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_ior -f file://$replica4_ior -c testscript");
- $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica5_ior -f file://$replica6_ior -c testscript");
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $OGC = $ft_creator->CreateProcess (".$build_directory/ft_create" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-n -r $role1 -r $role2 -r $role1 -u $role3 -i");
+
+ $CL1 = $client1->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client1_replica1_ior " .
+ "-f file://$client1_replica2_ior " .
+ "-c testscript");
+
+ $CL2 = $client2->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client2_replica3_ior " .
+ "-f file://$client2_replica4_ior " .
+ "-c testscript");
+
+ $CL3 = $client3->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client3_replica5_ior " .
+ "-f file://$client3_replica6_ior " .
+ "-c testscript");
+
+
+
}else{
- print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
- $OGC = new PerlACE::Process (".$build_directory/ft_create", "$rm_initref -r $role1 -r $role2 -r $role1 -g -n");
- $CL1 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
- $CL2 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica2_iogr -c testscript");
- $CL3 = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica3_iogr -c testscript");
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $OGC = $ft_creator->CreateProcess (".$build_directory/ft_create" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-n -r $role1 -r $role2 -r $role1 -u $role3 -g");
+
+ $CL1 = $client1->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client1_replica1_iogr " .
+ "-c testscript");
+
+ $CL2 = $client2->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client2_replica2_iogr " .
+ "-c testscript");
+
+ $CL3 = $client3->CreateProcess (".$build_directory/ft_client" ,
+ "-f file://$client3_replica3_iogr " .
+ "-c testscript");
}
+
#######################
-# Start ReplicationManager
+# ReplicationManager
-print "\nTEST: Starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
+print "\nTEST: starting ReplicationManager " . $RM->CommandLine . "\n" if ($verbose);
$RM->Spawn ();
+add_to_kills ($RM);
+
print "TEST: waiting for registry's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($rm_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$rm_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- exit 1;
+
+if ($rp_manager->WaitForFileTimed ($rm_ior,
+ $rp_manager->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$rp_manager_ior>\n";
+ exit_and_kill (1);
}
#######################
# Start FaultNotifier
-print "\nTEST: Starting FaultNotifier " . $NOT->CommandLine . "\n" if ($verbose);
+print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
$NOT->Spawn ();
-print "TEST: waiting for FaultNotifier's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($notifier_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- exit 1;
-}
+add_to_kills ($NOT);
+print "TEST: waiting for notifier's IOR\n" if ($verbose);
+if ($fault_notifier->WaitForFileTimed ($notifier_ior,
+ $fault_notifier->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_notifier_ior>\n";
+ exit_and_kill (1);
+}
##############################
# Start FaultDetectorFactory 1
print "\nTEST: Starting FaultDetectorFactory at $location1 " . $DET1->CommandLine . "\n" if ($verbose);
$DET1->Spawn ();
+add_to_kills ($DET1);
+
print "TEST: waiting for FaultDetector's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($detector1_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$detector1_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- exit 1;
+if ($fault_detector1->WaitForFileTimed ($detector1_ior,
+ $fault_detector1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_detector1_ior>\n";
+ exit_and_kill (1);
}
##############################
@@ -242,192 +398,252 @@ if (PerlACE::waitforfile_timed ($detector1_ior, $PerlACE::wait_interval_for_proc
print "\nTEST: Starting FaultDetectorFactory at $location2 " . $DET2->CommandLine . "\n" if ($verbose);
$DET2->Spawn ();
+add_to_kills ($DET2);
+
print "TEST: waiting for FaultDetector's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($detector2_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$detector2_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- $DET2->Kill (); $DET2->TimedWait (1);
- exit 1;
+if ($fault_detector2->WaitForFileTimed ($detector2_ior,
+ $fault_detector2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_detector1_ior>\n";
+ exit_and_kill (1);
}
-
#################
# Start Factories
-print "\nTEST: Starting replica factory at $location1 " . $FAC1->CommandLine . "\n" if ($verbose);
-$FAC1->Spawn ();
+print "\nTEST: starting factory 1 " . $REP1->CommandLine . "\n" if ($verbose);
+$REP1->Spawn ();
+
+add_to_kills ($REP1);
print "TEST: waiting for factory 1's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($factory1_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$factory1_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- $DET2->Kill (); $DET2->TimedWait (1);
- $FAC1->Kill (); $FAC1->TimedWait (1);
- exit 1;
+if ($ft_replica1->WaitForFileTimed ($factory1_ior,
+ $ft_replica1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ft_replica1_factory1_ior>\n";
+ exit_and_kill (1);
}
-print "\nTEST: Starting replica factory at $location2 " . $FAC2->CommandLine . "\n" if ($verbose);
-$FAC2->Spawn ();
+print "\nTEST: starting factory 2 " . $REP2->CommandLine . "\n" if ($verbose);
+$REP2->Spawn ();
+
+add_to_kills ($REP2);
print "TEST: waiting for factory 2's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($factory2_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$factory2_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- $DET2->Kill (); $DET2->TimedWait (1);
- $FAC1->Kill (); $FAC1->TimedWait (1);
- $FAC2->Kill (); $FAC2->TimedWait (1);
- exit 1;
+if ($ft_replica2->WaitForFileTimed ($factory2_ior,
+ $ft_replica2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ft_replica2_factory2_ior>\n";
+ exit_and_kill (1);
}
-print "\nTEST: Starting replica factory at $location3 " . $FAC3->CommandLine . "\n" if ($verbose);
-$FAC3->Spawn ();
+print "\nTEST: starting factory 3 " . $REP3->CommandLine . "\n" if ($verbose);
+$REP3->Spawn ();
+
+add_to_kills ($REP3);
print "TEST: waiting for factory 3's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($factory3_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$factory3_ior>\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- $DET2->Kill (); $DET2->TimedWait (1);
- $FAC1->Kill (); $FAC1->TimedWait (1);
- $FAC2->Kill (); $FAC2->TimedWait (1);
- $FAC3->Kill (); $FAC3->TimedWait (1);
- exit 1;
+if ($ft_replica3->WaitForFileTimed ($factory3_ior,
+ $ft_replica3->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ft_replica3_factory3_ior>\n";
+ exit_and_kill (1);
}
-
######################
# Create object groups
-
print "\nTEST: Starting object group creator " . $OGC->CommandLine . "\n" if ($verbose);
$OGC->Spawn ();
print "\nTEST: wait for object group creator.\n" if ($verbose);
-$config = $OGC->WaitKill (30);
-if ($config != 0) {
- print STDERR "TEST ERROR: Object Group Creator returned $config\n";
- $RM->Kill (); $RM->TimedWait (1);
- $NOT->Kill (); $NOT->TimedWait (1);
- $DET1->Kill (); $DET1->TimedWait (1);
- $DET2->Kill (); $DET2->TimedWait (1);
- $FAC1->Kill (); $FAC1->TimedWait (1);
- $FAC2->Kill (); $FAC2->TimedWait (1);
- $FAC3->Kill (); $FAC3->TimedWait (1);
- exit 1;
+
+$status_creator = $OGC->WaitKill ($ft_creator->ProcessStartWaitInterval());
+
+if ($status_creator != 0) {
+ print STDERR "TEST ERROR: Object Group Creator returned $status_creator\n";
+ exit_and_kill (1);
+}
+# Get/Put files:
+# replica1_ior: client1
+if ($ft_creator->GetFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica1_ior\n";
+ exit_and_kill (1);
+}
+if ($client1->PutFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client1_replica1_ior>\n";
+ exit_and_kill (1);
+}
+# replica2_ior: client1
+if ($ft_creator->GetFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica2_ior\n";
+ exit_and_kill (1);
+}
+if ($client1->PutFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client1_replica2_ior>\n";
+ exit_and_kill (1);
+}
+# replica3_ior: client2
+if ($ft_creator->GetFile ($replica3_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica3_ior\n";
+ exit_and_kill (1);
+}
+if ($client2->PutFile ($replica3_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client2_replica3_ior>\n";
+ exit_and_kill (1);
+}
+# replica4_ior: client2
+if ($ft_creator->GetFile ($replica4_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica4_ior\n";
+ exit_and_kill (1);
+}
+if ($client2->PutFile ($replica4_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client2_replica4_ior>\n";
+ exit_and_kill (1);
+}
+# replica5_ior: client3
+if ($ft_creator->GetFile ($replica5_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica5_ior\n";
+ exit_and_kill (1);
+}
+if ($client3->PutFile ($replica5_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client3_replica5_ior>\n";
+ exit_and_kill (1);
+}
+# replica6_ior: client3
+if ($ft_creator->GetFile ($replica6_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$creator_replica6_ior\n";
+ exit_and_kill (1);
+}
+if ($client3->PutFile ($replica6_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client3_replica6_ior>\n";
+ exit_and_kill (1);
}
#############
# Run clients
print "\nTEST: Starting client using first group of hobbits " . $CL1->CommandLine . "\n" if ($verbose);
-$client = $CL1->SpawnWaitKill (60);
-
-if ($client != 0) {
- print STDERR "TEST ERROR: client returned $client\n";
- $status = 1;
+$status_client = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 45);
+if ($status_client != 0) {
+ print STDERR "TEST ERROR: client returned $status_client\n";
+ exit_and_kill(1);
}
print "\nTEST: Starting client using group of elves " . $CL2->CommandLine . "\n" if ($verbose);
-$client2 = $CL2->SpawnWaitKill (60);
-
-if ($client2 != 0) {
- print STDERR "TEST ERROR: client returned $client2\n";
- $status = 1;
+$status_client = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
+if ($status_client != 0) {
+ print STDERR "TEST ERROR: client returned $status_client\n";
+ exit_and_kill(1);
}
print "\nTEST: Starting client using second group of hobbits " . $CL3->CommandLine . "\n" if ($verbose);
-$client3 = $CL3->SpawnWaitKill (60);
-
-if ($client3 != 0) {
- print STDERR "TEST ERROR: client returned $client3\n";
- $status = 1;
+$status_client = $CL3->SpawnWaitKill ($client3->ProcessStartWaitInterval() + 45);
+if ($status_client != 0) {
+ print STDERR "TEST ERROR: client returned $status_client\n";
+ exit_and_kill(1);
}
######################
# Clean house and exit
print "\nTEST: wait for factory 1.\n" if ($verbose);
-$factory1 = $FAC1->WaitKill (30);
-if ($factory1 != 0) {
- print STDERR "TEST ERROR: replica returned $factory 1\n";
+$status_replica = $REP1->WaitKill ($ft_replica1->ProcessStopWaitInterval() + 15);
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
-
print "\nTEST: wait for factory 2.\n" if ($verbose);
-$factory2 = $FAC2->WaitKill (30);
-if ($factory2 != 0) {
- print STDERR "TEST ERROR: factory 2 returned $factory2\n";
+$status_replica = $REP2->WaitKill ($ft_replica2->ProcessStopWaitInterval() + 15);
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
print "\nTEST: wait for factory 3.\n" if ($verbose);
-$factory3 = $FAC3->WaitKill (30);
-if ($factory3 != 0) {
- print STDERR "TEST ERROR: factory 3 returned $factory3\n";
+$status_replica = $REP3->WaitKill ($ft_replica3->ProcessStopWaitInterval() + 15);
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
-
print "\nTEST: wait for FaultDetectorFactory 1.\n" if ($verbose);
-$detector1 = $DET1->WaitKill (30);
-if ($detector1 != 0) {
- print STDERR "TEST ERROR: FaultDetectorFactory returned $detector1\n";
+$status_detector = $DET1->WaitKill ($fault_detector1->ProcessStopWaitInterval() + 15);
+if ($status_detector != 0) {
+ print STDERR "TEST ERROR: FaultDetectorFactory returned $status_detector\n";
$status = 1;
}
-
print "\nTEST: wait for FaultDetectorFactory 2.\n" if ($verbose);
-$detector2 = $DET2->WaitKill (30);
-if ($detector2 != 0) {
- print STDERR "TEST ERROR: FaultDetectorFactory returned $detector2\n";
+$status_detector = $DET2->WaitKill ($fault_detector2->ProcessStopWaitInterval() + 15);
+if ($status_detector != 0) {
+ print STDERR "TEST ERROR: FaultDetectorFactory returned $status_detector\n";
$status = 1;
}
print "\nTEST: shutting down the replication manager.\n" if ($verbose);
-$controller = $RMC->SpawnWaitKill (300);
-if ($controller != 0) {
- print STDERR "TEST ERROR: replication manager controller returned $controller\n";
+$status_controller = $RMC->SpawnWaitKill ($rp_manager_controller->ProcessStartWaitInterval() + 285);
+if ($status_controller != 0) {
+ print STDERR "TEST ERROR: replication manager controller returned $status_controller\n";
$status = 1;
}
-
print "\nTEST: wait for ReplicationManager.\n" if ($verbose);
-#$RM->Kill ();
-$repmgr = $RM->WaitKill (30);
-if ($repmgr != 0) {
- print STDERR "TEST ERROR: ReplicationManager returned $repmgr\n";
+$status_repmgr = $RM->WaitKill ($rp_manager->ProcessStopWaitInterval() + 15);
+if ($status_repmgr != 0) {
+ print STDERR "TEST ERROR: ReplicationManager returned $status_repmgr\n";
$status = 1;
}
print "\nTEST: wait for FaultNotifier.\n" if ($verbose);
-$notifier = $NOT->WaitKill (30);
-if ($notifier != 0) {
- print STDERR "TEST ERROR: FaultNotifier returned $notifier\n";
+$status_not = $NOT->WaitKill ($fault_notifier->ProcessStopWaitInterval());
+if ($status_not != 0) {
+ print STDERR "TEST ERROR: notifier returned $status_not\n";
$status = 1;
}
-if ($status == 0 && 0) {
- print "\nTEST: releasing scratch files.\n" if ($verbose);
- unlink $rm_ior;
- unlink $detector1_ior;
- unlink $detector2_ior;
- unlink $notifier_ior;
- unlink $factory1_ior;
- unlink $factory2_ior;
- unlink $factory3_ior;
- unlink $replica1_ior;
- unlink $replica2_ior;
- unlink $replica3_ior;
- unlink $replica4_ior;
- unlink $replica5_ior;
- unlink $replica6_ior;
- unlink $replica1_iogr;
- unlink $replica2_iogr;
+print "\nTEST: releasing scratch files.\n" if ($verbose);
- unlink $client_data;
-}
+# Files for rp_manager
+$rp_manager->DeleteFile ($rm_ior);
+
+# Files for fault_detector1
+$fault_detector1->DeleteFile ($detector1_ior);
+
+# Files for fault_detector2
+$fault_detector2->DeleteFile ($detector2_ior);
+
+# Files for fault_notifier
+$fault_notifier->DeleteFile ($notifier_ior);
+
+# Files for ft_replica1
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for ft_replica3
+$ft_replica3->DeleteFile ($factory3_ior);
+$ft_replica3->DeleteFile ($client_data);
+
+# Files for ft_creator
+$ft_creator->DeleteFile ($replica1_ior);
+$ft_creator->DeleteFile ($replica2_ior);
+$ft_creator->DeleteFile ($replica3_ior);
+$ft_creator->DeleteFile ($replica4_ior);
+$ft_creator->DeleteFile ($replica5_ior);
+$ft_creator->DeleteFile ($replica6_ior);
+
+$ft_creator->DeleteFile ($replica1_iogr);
+$ft_creator->DeleteFile ($replica2_iogr);
+$ft_creator->DeleteFile ($replica3_iogr);
+
+# Files for client1
+$client1->DeleteFile ($replica1_ior);
+$client1->DeleteFile ($replica2_ior);
+$client1->DeleteFile ($replica1_iogr);
+
+# Files for client2
+$client2->DeleteFile ($replica3_ior);
+$client2->DeleteFile ($replica4_ior);
+$client2->DeleteFile ($replica2_iogr);
+# Files for client3
+$client3->DeleteFile ($replica5_ior);
+$client3->DeleteFile ($replica6_ior);
+$client3->DeleteFile ($replica3_iogr);
exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_detector.pl b/TAO/orbsvcs/tests/FT_App/run_test_detector.pl
index ed5adb7964a..694895a5c81 100755
--- a/TAO/orbsvcs/tests/FT_App/run_test_detector.pl
+++ b/TAO/orbsvcs/tests/FT_App/run_test_detector.pl
@@ -62,160 +62,282 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# Delete temp files.
#
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
########################
#command line options
#set defaults:
+my($status) = 0;
my($verbose) = 0; # 1: report perl actions before executing them; 2 display settings from command line
my($debug_builds) = 0; # 0: use exes from Release directories
my($simulated) = 1; # 1: use "client simulated" fault tolerance
foreach $i (@ARGV) {
- if ($i eq "--debug_build")
- {
- $debug_builds = 1;
- }
- elsif ($i eq "-v")
- {
- $verbose += 1;
- }
+ if ($i eq "--debug_build"){
+ $debug_builds = 1;
+ }
+ elsif ($i eq "-v"){
+ $verbose += 1;
+ }
}
my($build_directory) = "/Release";
if ( $debug_builds ) {
- $build_directory = "";
+ $build_directory = "";
}
if ( $verbose > 1) {
- print "verbose: $verbose\n";
- print "debug_builds: $debug_builds -> $build_directory\n";
- print "simulated: $simulated\n";
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
+}
+
+# List of the proccess which must be killed before exit with error
+@kill_list = ();
+
+sub add_to_kills{
+ $goal = shift;
+ @kill_list = (@kill_list, $goal);
+}
+sub exit_and_kill{
+ $status = shift;
+ foreach $goal (@kill_list){
+ $goal->Kill (); $goal->TimedWait (1);
+ }
+ exit $status;
}
+my $ft_replica1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $ft_replica2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $fault_detector = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $fault_notifier = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $client = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+
+
+$hostname = $fault_detector->HostName ();
+$port = $fault_detector->RandomPort ();
#define temp files
-my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
-my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
-my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
-my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
-my($detector_ior) = PerlACE::LocalFile ("detector.ior");
-my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
-my($client_data) = PerlACE::LocalFile ("persistent.dat");
-
-#discard junk from previous tests
-unlink $factory1_ior;
-unlink $factory2_ior;
-unlink $replica1_ior;
-unlink $replica2_ior;
-unlink $detector_ior;
-unlink $notifier_ior;
-unlink #client_data
+my($factory1_ior) = "factory1.ior";
+my($factory2_ior) = "factory2.ior";
+my($replica1_ior) = "replica1.ior";
+my($replica2_ior) = "replica2.ior";
+my($detector_ior) = "detector.ior";
+my($notifier_ior) = "notifier.ior";
+my($client_data) = "persistent.dat";
-my($status) = 0;
+# Files for ft_replica1
+my $ft_replica1_factory1_ior = $ft_replica1->LocalFile ($factory1_ior);
+my $ft_replica1_replica1_ior = $ft_replica1->LocalFile ($replica1_ior);
+my $ft_replica1_client_data = $ft_replica1->LocalFile ($client_data);
+
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($replica1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+my $ft_replica2_factory2_ior = $ft_replica2->LocalFile ($factory2_ior);
+my $ft_replica2_replica2_ior = $ft_replica2->LocalFile ($replica2_ior);
+my $ft_replica2_client_data = $ft_replica2->LocalFile ($client_data);
+
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($replica2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for fault_detector
+my $fault_detector_ior = $fault_detector->LocalFile ($detector_ior);
+$fault_detector->DeleteFile ($detector_ior);
+
+# Files for fault_notifier
+my $fault_notifier_ior = $fault_notifier->LocalFile ($notifier_ior);
+my $notifier_replica1_ior = $fault_notifier->LocalFile ($replica1_ior);
+my $notifier_replica2_ior = $fault_notifier->LocalFile ($replica2_ior);
+my $notifier_detector_ior = $fault_notifier->LocalFile ($detector_ior);
+
+$fault_notifier->DeleteFile ($notifier_ior);
+$fault_notifier->DeleteFile ($replica1_ior);
+$fault_notifier->DeleteFile ($replica2_ior);
+$fault_notifier->DeleteFile ($detector_ior);
+
+# Files for client
+my $client_replica1_ior = $client->LocalFile ($replica1_ior);
+my $client_replica2_ior = $client->LocalFile ($replica2_ior);
+
+$client->DeleteFile ($replica1_ior);
+$client->DeleteFile ($replica2_ior);
+
+### Create process
+$REP1 = $ft_replica1->CreateProcess (".$build_directory/ft_replica" ,
+ "-o $ft_replica1_factory1_ior ".
+ "-f none -t $ft_replica1_replica1_ior " .
+ "-l loc1 -i type1 -q -p $ft_replica1_client_data");
+
+$REP2 = $ft_replica2->CreateProcess (".$build_directory/ft_replica" ,
+ "-o $ft_replica2_factory2_ior ".
+ "-f none -t $ft_replica2_replica2_ior " .
+ "-l loc2 -i type1 -q -p $ft_replica2_client_data");
+
+$DET = $fault_detector->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector" .
+ "$build_directory/Fault_Detector" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $fault_detector_ior -q");
-my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
-my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+$NOT = $fault_notifier->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier" .
+ "$build_directory/Fault_Notifier" ,
+ "-ORBInitRef ReplicationManager=corbaloc::$hostname:$port/ReplicationManager " .
+ "-o $fault_notifier_ior -q " .
+ "-d file://$notifier_detector_ior " .
+ "-r file://$notifier_replica1_ior -r file://$notifier_replica2_ior");
+$CL = $client->CreateProcess (".$build_directory/ft_client",
+ "-f file://$client_replica1_ior " .
+ "-f file://$client_replica2_ior " .
+ "-c testscript");
-my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory1_ior -f none -t $replica1_ior -l loc1 -i type1 -q");
-my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-o $factory2_ior -f none -t $replica2_ior -l loc2 -i type1 -q");
-my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "$rm_initref -o $detector_ior -q");
-my($NOT) = new PerlACE::Process (".$build_directory/ft_notifier", "-o $notifier_ior -q -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior");
-my($CL) = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
print "TEST: starting replica1 ". $REP1->CommandLine . "\n" if ($verbose);
$REP1->Spawn ();
+add_to_kills ($REP1);
+
print "TEST: waiting for replica 1's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($replica1_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- exit 1;
+if ($ft_replica1->WaitForFileTimed ($replica1_ior,
+ $ft_replica1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ft_replica1_replica1_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $replica1_ior: notifier_replica1_ior $client_replica1_ior
+if ($ft_replica1->GetFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ft_replica1_replica1_ior>\n";
+ exit_and_kill (1);
+}
+if ($fault_notifier->PutFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$notifier_replica1_ior>\n";
+ exit_and_kill (1);
+}
+if ($client->PutFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client_replica1_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
$REP2->Spawn ();
+add_to_kills ($REP2);
+
print "TEST: waiting for replica 2's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($replica2_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- exit 1;
+if ($ft_replica2->WaitForFileTimed ($replica2_ior,
+ $ft_replica2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$ft_replica2_replica2_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $replica2_ior: notifier_replica2_ior $client_replica2_ior
+if ($ft_replica2->GetFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ft_replica2_replica2_ior>\n";
+ exit_and_kill (1);
+}
+if ($fault_notifier->PutFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$notifier_replica2_ior>\n";
+ exit_and_kill (1);
+}
+if ($client->PutFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client_replica2_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
$DET->Spawn ();
+add_to_kills ($DET);
+
print "TEST: waiting for detector's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($detector_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- $DET->Kill (); $DET2->TimedWait(1);
- exit 1;
+if ($fault_detector->WaitForFileTimed ($detector_ior,
+ $fault_detector->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_detector_ior>\n";
+ exit_and_kill (1);
+}
+
+# Get/Put $detector_ior: $notifier_detector_ior
+if ($fault_detector->GetFile ($detector_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$fault_detector_ior>\n";
+ exit_and_kill (1);
+}
+if ($fault_notifier->PutFile ($detector_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$notifier_detector_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
$NOT->Spawn ();
+add_to_kills ($NOT);
+
print "TEST: waiting for notifier's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($notifier_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- $DET->Kill (); $DET2->TimedWait(1);
- $NOT->Kill (); $NOT->TimedWait(1);
- exit 1;
+if ($fault_notifier->WaitForFileTimed ($notifier_ior,
+ $fault_notifier->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_notifier_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting client." . $CL->CommandLine . "\n" if ($verbose);
-$client = $CL->SpawnWaitKill (60);
-if ($client != 0) {
- print STDERR "TEST ERROR: client returned $client\n";
+$status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
+
+if ($status != 0) {
+ print STDERR "TEST ERROR: client returned $status\n";
$status = 1;
}
print "\nTEST: wait for replica 1.\n" if ($verbose);
-$replica1 = $REP1->WaitKill (60);
-if ($replica1 != 0) {
- print STDERR "TEST ERROR: replica returned $replica1\n";
+$status_replica = $REP1->WaitKill ($ft_replica1->ProcessStopWaitInterval() + 45);
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
-
print "\nTEST: wait for replica 2.\n" if ($verbose);
-$replica2 = $REP2->WaitKill (60);
-if ($replica2 != 0) {
- print STDERR "TEST ERROR: replica returned $replica2\n";
+$status_replica = $REP2->WaitKill ($ft_replica2->ProcessStopWaitInterval() + 45);
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
-$detector = $DET->WaitKill (60);
-if ($detector != 0) {
- print STDERR "TEST ERROR: detector returned $detector\n";
+$status_det = $DET->WaitKill ($fault_detector->ProcessStopWaitInterval() + 45);
+if ($status_det != 0) {
+ print STDERR "TEST ERROR: detector returned $status_det\n";
$status = 1;
}
print "\nTEST: wait for notifier to leave.\n" if ($verbose);
-$notifier = $NOT->WaitKill (60);
-if ($notifier != 0) {
- print STDERR "TEST ERROR: notifier returned $notifier\n";
+$status_not = $NOT->WaitKill ($fault_notifier->ProcessStopWaitInterval() + 45);
+if ($status_not != 0) {
+ print STDERR "TEST ERROR: notifier returned $status_not\n";
$status = 1;
}
print "\nTEST: releasing scratch files.\n" if ($verbose);
-unlink $factory1_ior;
-unlink $factory2_ior;
-unlink $replica1_ior;
-unlink $replica2_ior;
-unlink $detector_ior;
-unlink $notifier_ior;
-
-#client's work file
-unlink #client_data;
+# Files for ft_replica1
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($replica1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($replica2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for fault_detector
+$fault_detector->DeleteFile ($detector_ior);
+
+# Files for fault_notifier
+$fault_notifier->DeleteFile ($notifier_ior);
+$fault_notifier->DeleteFile ($replica1_ior);
+$fault_notifier->DeleteFile ($replica2_ior);
+$fault_notifier->DeleteFile ($detector_ior);
+
+# Files for client
+$client->DeleteFile ($replica1_ior);
+$client->DeleteFile ($replica2_ior);
exit $status;
diff --git a/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl b/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl
index d2687d0a63e..66329347408 100755
--- a/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl
+++ b/TAO/orbsvcs/tests/FT_App/run_test_fault_consumer.pl
@@ -76,195 +76,337 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# [1] Client mediated fault tolerance. These points will
# change when IOGR support is available.
use lib "$ENV{ACE_ROOT}/bin";
-#use lib '$ENV{ACE_ROOT}/bin';
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
########################
#command line options
#set defaults:
+my($status) = 0;
my($verbose) = 0; # 1: report perl actions before executing them
my($debug_builds) = 0; # 0: use exes from Release directories
my($simulated) = 1; # 1: use "client simulated" fault tolerance
-foreach $i (@ARGV) {
- if ($i eq "--debug_build")
- {
- $debug_builds = 1;
- }
- elsif ($i eq "--no_simulate") # reverse this once we have FT ORB support
- {
- $simulated = 0;
- }
- elsif ($i eq "-v")
- {
- $verbose += 1;
- }
+# List of the proccess which must be killed before exit with error
+@kill_list = ();
+
+sub add_to_kills{
+ $goal = shift;
+ @kill_list = (@kill_list, $goal);
+}
+sub exit_and_kill{
+ $status = shift;
+ foreach $goal (@kill_list){
+ $goal->Kill (); $goal->TimedWait (1);
+ }
+ exit $status;
}
+foreach $i (@ARGV) {
+ if ($i eq "--debug_build"){
+ $debug_builds = 1;
+ }
+ elsif ($i eq "--no_simulate"){ # reverse this once we have FT ORB support
+ $simulated = 0;
+ }
+ elsif ($i eq "-v"){
+ $verbose += 1;
+ }
+}
my($build_directory) = "/Release";
if ( $debug_builds ) {
- $build_directory = "";
+ $build_directory = "";
}
if ( $verbose > 1) {
- print "verbose: $verbose\n";
- print "debug_builds: $debug_builds -> $build_directory\n";
- print "simulated: $simulated\n";
+ print "verbose: $verbose\n";
+ print "debug_builds: $debug_builds -> $build_directory\n";
+ print "simulated: $simulated\n";
}
-#define temp files
-my($factory1_ior) = PerlACE::LocalFile ("factory1.ior");
-my($factory2_ior) = PerlACE::LocalFile ("factory2.ior");
-my($replica1_ior) = PerlACE::LocalFile ("replica1.ior");
-my($replica2_ior) = PerlACE::LocalFile ("replica2.ior");
-my($detector_ior) = PerlACE::LocalFile ("detector.ior");
-my($notifier_ior) = PerlACE::LocalFile ("notifier.ior");
-my($ready_file) = PerlACE::LocalFile ("ready.file");
-my($client_data) = PerlACE::LocalFile ("persistent.dat");
-
-#discard junk from previous tests
-unlink $factory1_ior;
-unlink $factory2_ior;
-unlink $replica1_ior;
-unlink $replica2_ior;
-unlink $detector_ior;
-unlink $notifier_ior;
-unlink $ready_file;
-unlink $client_data;
-
-my ($rm_endpoint) = "-ORBEndpoint iiop://localhost:2833";
-my ($rm_initref) = "-ORBInitRef ReplicationManager=corbaloc::localhost:2833/ReplicationManager";
+my $ft_replica1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $ft_replica2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $fault_detector = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $fault_notifier = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $client = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+my $consumer = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
-my($status) = 0;
+#define temp files
+my($factory1_ior) = "factory1.ior";
+my($factory2_ior) = "factory2.ior";
+my($replica1_ior) = "replica1.ior";
+my($replica2_ior) = "replica2.ior";
+my($replica1_iogr) = "replica1.iogr";
+my($detector_ior) = "detector.ior";
+my($notifier_ior) = "notifier.ior";
+my($client_data) = "persistent.dat";
+my($ready_file) = "ready.file";
+
+# Files for ft_replica1
+my $ft_replica1_factory1_ior = $ft_replica1->LocalFile ($factory1_ior);
+my $ft_replica1_replica1_ior = $ft_replica1->LocalFile ($replica1_ior);
+my $ft_replica1_client_data = $ft_replica1->LocalFile ($client_data);
+
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($replica1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+my $ft_replica2_factory2_ior = $ft_replica2->LocalFile ($factory2_ior);
+my $ft_replica2_replica2_ior = $ft_replica2->LocalFile ($replica2_ior);
+my $ft_replica2_client_data = $ft_replica2->LocalFile ($client_data);
+
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($replica2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for fault_detector
+my $fault_detector_ior = $fault_detector->LocalFile ($detector_ior);
+$fault_detector->DeleteFile ($detector_ior);
+
+# Files for fault_notifier
+my $fault_notifier_ior = $fault_notifier->LocalFile ($notifier_ior);
+$fault_notifier->DeleteFile ($notifier_ior);
+
+# Files for consumer
+my $consumer_notifier_ior = $consumer->LocalFile ($notifier_ior);
+my $consumer_replica1_ior = $consumer->LocalFile ($replica1_ior);
+my $consumer_replica2_ior = $consumer->LocalFile ($replica2_ior);
+my $consumer_detector_ior = $consumer->LocalFile ($detector_ior);
+my $consumer_ready_file = $consumer->LocalFile ($ready_file);
+
+$consumer->DeleteFile ($notifier_ior);
+$consumer->DeleteFile ($replica1_ior);
+$consumer->DeleteFile ($replica2_ior);
+$consumer->DeleteFile ($detector_ior);
+
+
+# Files for client
+my $client_replica1_ior = $client->LocalFile ($replica1_ior);
+my $client_replica2_ior = $client->LocalFile ($replica2_ior);
+my $client_replica1_iogr = $client->LocalFile ($replica2_ior);
+
+$client->DeleteFile ($replica1_ior);
+$client->DeleteFile ($replica2_ior);
+$client->DeleteFile ($replica1_iogr);
+
+### Create process
+$REP1 = $ft_replica1->CreateProcess (".$build_directory/ft_replica" ,
+ "-o $ft_replica1_factory1_ior ".
+ "-f none -t $ft_replica1_replica1_ior " .
+ "-l loc1 -i type1 -q -p $ft_replica1_client_data");
+
+$REP2 = $ft_replica2->CreateProcess (".$build_directory/ft_replica" ,
+ "-o $ft_replica2_factory2_ior ".
+ "-f none -t $ft_replica2_replica2_ior " .
+ "-l loc2 -i type1 -q -p $ft_replica2_client_data");
+
+$DET = $fault_detector->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector" .
+ "$build_directory/Fault_Detector" ,
+ "-r " .
+ "-o $fault_detector_ior -q");
+
+$NOT = $fault_notifier->CreateProcess ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier" .
+ "$build_directory/Fault_Notifier" ,
+ "-r " .
+ "-o $fault_notifier_ior -q");
+
+$CONS = $consumer->CreateProcess (".$build_directory/ft_fault_consumer",
+ "-o $consumer_ready_file " .
+ "-n file://consumer_notifier_ior " .
+ "-q -d file://$consumer_detector_ior " .
+ "-r file://$client_replica1_ior " .
+ "-r file://$client_replica2_ior");
+
+my($CL) = $client->CreateProcess (".$build_directory/ft_client",
+ "-f file://$client_replica1_ior " .
+ "-f file://$client_replica2_ior " .
+ "-c testscript");
+if ($simulated){
+ print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
+ $CL = $client->CreateProcess (".$build_directory/ft_client",
+ "-f file://$client_replica1_ior " .
+ "-f file://$client_replica2_ior " .
+ "-c testscript");
-my($REP1) = new PerlACE::Process (".$build_directory/ft_replica", "-f none -o $factory1_ior -t $replica1_ior -l loc1 -i type1 -q");
-my($REP2) = new PerlACE::Process (".$build_directory/ft_replica", "-f none -o $factory2_ior -t $replica2_ior -l loc2 -i type1 -q");
-my($DET) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Detector$build_directory/Fault_Detector", "-r -o $detector_ior -q");
-my($NOT) = new PerlACE::Process ("$ENV{'TAO_ROOT'}/orbsvcs/Fault_Notifier$build_directory/Fault_Notifier", "-r -o $notifier_ior -q");
-my($CONS) = new PerlACE::Process (".$build_directory/ft_fault_consumer", "-o $ready_file -n file://$notifier_ior -q -d file://$detector_ior -r file://$replica1_ior -r file://$replica2_ior");
-
-my($CL);
-if ($simulated) {
- print "\nTEST: Preparing Client Mediated Fault Tolerance test.\n" if ($verbose);
- $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_ior -f file://$replica2_ior -c testscript");
-}else{
- print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
- $CL = new PerlACE::Process (".$build_directory/ft_client", "-f file://$replica1_iogr -c testscript");
+}
+else{
+ print "\nTEST: Preparing IOGR based test.\n" if ($verbose);
+ $CL = $client->CreateProcess (".$build_directory/ft_client",
+ "-f file://$client_replica1_iogr " .
+ "-c testscript");
}
-print "TEST: starting replica1 " . $REP1->CommandLine . "\n" if ($verbose);
+print "TEST: starting replica1 ". $REP1->CommandLine . "\n" if ($verbose);
$REP1->Spawn ();
+add_to_kills ($REP1);
+
print "TEST: waiting for replica 1's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($replica1_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$replica1_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- exit 1;
+if ($ft_replica1->WaitForFileTimed ($replica1_ior,
+ $ft_replica1->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ft_replica1_replica1_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $replica1_ior: consumer_replica1_ior $client_replica1_ior
+if ($ft_replica1->GetFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ft_replica1_replica1_ior>\n";
+ exit_and_kill (1);
+}
+if ($consumer->PutFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$consumer_replica1_ior>\n";
+ exit_and_kill (1);
+}
+if ($client->PutFile ($replica1_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client_replica1_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting replica2 " . $REP2->CommandLine . "\n" if ($verbose);
$REP2->Spawn ();
+add_to_kills ($REP2);
+
print "TEST: waiting for replica 2's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($replica2_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$replica2_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- exit 1;
+if ($ft_replica2->WaitForFileTimed ($replica2_ior,
+ $ft_replica2->ProcessStartWaitInterval()) == -1) {
+ print STDERR "TEST ERROR: cannot find file <$ft_replica2_replica2_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $replica2_ior: consumer_replica2_ior $client_replica2_ior
+if ($ft_replica2->GetFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ft_replica2_replica2_ior>\n";
+ exit_and_kill (1);
+}
+if ($consumer->PutFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$consumer_replica2_ior>\n";
+ exit_and_kill (1);
+}
+if ($client->PutFile ($replica2_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$client_replica2_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting detector factory " . $DET->CommandLine . "\n" if ($verbose);
$DET->Spawn ();
+add_to_kills ($DET);
+
print "TEST: waiting for detector's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($detector_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$detector_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- $DET->Kill (); $DET->TimedWait(1);
- exit 1;
+if ($fault_detector->WaitForFileTimed ($detector_ior,
+ $fault_detector->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_detector_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $detector_ior: $consumer_detector_ior
+if ($fault_detector->GetFile ($detector_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$fault_detector_ior>\n";
+ exit_and_kill (1);
+}
+if ($consumer->PutFile ($detector_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$consumer_detector_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting notifier " . $NOT->CommandLine . "\n" if ($verbose);
$NOT->Spawn ();
+add_to_kills ($NOT);
+
print "TEST: waiting for notifier's IOR\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($notifier_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$notifier_ior>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- $DET->Kill (); $DET->TimedWait(1);
- $NOT->Kill (); $NOT->TimedWait(1);
- exit 1;
+if ($fault_notifier->WaitForFileTimed ($notifier_ior,
+ $fault_notifier->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_notifier_ior>\n";
+ exit_and_kill (1);
+}
+# Get/Put $notifier_ior: $consumer_notifier_ior
+if ($fault_notifier->GetFile ($notifier_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$fault_notifier_ior>\n";
+ exit_and_kill (1);
+}
+if ($consumer->PutFile ($notifier_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$consumer_notifier_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting fault consumer " . $CONS->CommandLine . "\n" if ($verbose);
$CONS->Spawn ();
print "TEST: waiting for READY.FILE from fault consumer\n" if ($verbose);
-if (PerlACE::waitforfile_timed ($ready_file, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "TEST ERROR: cannot find file <$ready_file>\n";
- $REP1->Kill (); $REP1->TimedWait (1);
- $REP2->Kill (); $REP2->TimedWait (1);
- $DET->Kill (); $DET->TimedWait(1);
- $NOT->Kill (); $NOT->TimedWait(1);
- $CONS->Kill (); $CONS->TimedWait(1);
- exit 1;
+if ($consumer->WaitForFileTimed ($consumer_ready_file,
+ $consumer->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$fault_notifier_ior>\n";
+ exit_and_kill (1);
}
print "\nTEST: starting client " . $CL->CommandLine . "\n" if ($verbose);
-$client = $CL->SpawnWaitKill (60);
+$status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
-if ($client != 0) {
- print STDERR "TEST ERROR: client returned $client\n";
+if ($status != 0) {
+ print STDERR "TEST ERROR: client returned $status\n";
$status = 1;
}
print "\nTEST: wait for replica 1.\n" if ($verbose);
-$replica1 = $REP1->WaitKill (5);
-if ($replica1 != 0) {
- print STDERR "TEST ERROR: replica returned $replica1\n";
+$status_replica = $REP1->WaitKill ($ft_replica1->ProcessStopWaitInterval());
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
-
print "\nTEST: wait for replica 2.\n" if ($verbose);
-$replica2 = $REP2->WaitKill (5);
-if ($replica2 != 0) {
- print STDERR "TEST ERROR: replica returned $replica2\n";
+$status_replica = $REP2->WaitKill ($ft_replica2->ProcessStopWaitInterval());
+if ($status_replica != 0) {
+ print STDERR "TEST ERROR: replica returned $status_replica\n";
$status = 1;
}
-
print "\nTEST: wait for detector factory to leave.\n" if ($verbose);
-$detector = $DET->WaitKill (20);
-if ($detector != 0) {
- print STDERR "TEST ERROR: detector returned $detector\n";
+$status_det = $DET->WaitKill ($fault_detector->ProcessStopWaitInterval());
+if ($status_det != 0) {
+ print STDERR "TEST ERROR: detector returned $status_det\n";
$status = 1;
}
print "\nTEST: wait for notifier to leave.\n" if ($verbose);
-$notifier = $NOT->WaitKill (20);
-if ($notifier != 0) {
- print STDERR "TEST ERROR: notifier returned $notifier\n";
+$status_not = $NOT->WaitKill ($fault_notifier->ProcessStopWaitInterval());
+if ($status_not != 0) {
+ print STDERR "TEST ERROR: notifier returned $status_not\n";
$status = 1;
}
print "\nTEST: wait for fault consumer to leave.\n" if ($verbose);
-$consumer = $CONS->WaitKill (20);
-if ($consumer != 0) {
- print STDERR "TEST ERROR: fault consumer returned $consumer\n";
+$status_cons = $CONS->WaitKill ($consumer->ProcessStopWaitInterval());
+if ($status_cons != 0) {
+ print STDERR "TEST ERROR: notifier returned $status_cons\n";
$status = 1;
}
-
print "\nTEST: releasing scratch files.\n" if ($verbose);
-unlink $replica1_ior;
-unlink $replica2_ior;
-unlink $detector_ior;
-unlink $notifier_ior;
-unlink $ready_file;
-
-#client's work file
-unlink $client_data;
+
+# Files for ft_replica1
+$ft_replica1->DeleteFile ($factory1_ior);
+$ft_replica1->DeleteFile ($replica1_ior);
+$ft_replica1->DeleteFile ($client_data);
+
+# Files for ft_replica2
+$ft_replica2->DeleteFile ($factory2_ior);
+$ft_replica2->DeleteFile ($replica2_ior);
+$ft_replica2->DeleteFile ($client_data);
+
+# Files for fault_detector
+$fault_detector->DeleteFile ($detector_ior);
+
+# Files for fault_notifier
+$fault_notifier->DeleteFile ($notifier_ior);
+
+# Files for consumer
+$consumer->DeleteFile ($notifier_ior);
+$consumer->DeleteFile ($replica1_ior);
+$consumer->DeleteFile ($replica2_ior);
+$consumer->DeleteFile ($detector_ior);
+
+# Files for client
+$client->DeleteFile ($replica1_ior);
+$client->DeleteFile ($replica2_ior);
+$client->DeleteFile ($replica1_iogr);
exit $status;
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp
index 3b0c332f536..9709b6e5e76 100644
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/main.cpp
@@ -28,14 +28,16 @@ void printContents (const CORBA::ContainedSeq& cont)
//printf ("-- %s:\n", desc->name.in ());
for (CORBA::ULong j1 = 0; j1 < desc->operations.length (); ++j1)
- ACE_OS::printf ("operation %s::%s\n",
- desc->name.in (),
- desc->operations[j1].name.in ());
+ ACE_DEBUG ((LM_DEBUG,
+ "operation %C::%C\n",
+ desc->name.in (),
+ desc->operations[j1].name.in ()));
for (CORBA::ULong j2 = 0; j2 < desc->attributes.length (); ++j2)
- ACE_OS::printf ("attribute %s::%s\n",
- desc->name.in (),
- desc->attributes[j2].name.in ());
+ ACE_DEBUG ((LM_DEBUG,
+ "attribute %C::%C\n",
+ desc->name.in (),
+ desc->attributes[j2].name.in ()));
}
else if (topdesc->kind == CORBA::dk_Module)
{
diff --git a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
index ce9cf02cfaa..42b85861cf6 100755
--- a/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
+++ b/TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl
@@ -1,13 +1,23 @@
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 strict;
+use PerlACE::TestTarget;
+
+$status = 0;
+
+# The location of the tao_idl utility - depends on O/S
+my $tao_ifr = "undefined";
+if ($^O eq "MSWin32"){
+ $tao_ifr = "$ENV{ACE_ROOT}/bin/tao_ifr";
+}
+else{
+ $tao_ifr = "../../../IFR_Service/tao_ifr";
+}
my %isa = ();
$isa{"InterfaceRoot::get_root"} = "operation";
@@ -41,88 +51,94 @@ $got{"SubInterface::root_attr3"} = 13;
$got{"SubInterface::sub_attr1"} = 13;
$got{"SubInterface::sub_attr2"} = 13;
-my $iorfile = "if_repo.ior";
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $iorbase = "if_repo.ior";
my $testoutputfilename = "IFR_Inheritance_test.output";
-unlink $testoutputfilename;
-
-my $status = 0;
+my $log1 = "server1.log";
+my $log2 = "server2.log";
+my $log3 = "client.log";
-unlink $iorfile;
+my $log1_test = $test->LocalFile ($log1);
+my $log2_test = $test->LocalFile ($log2);
+my $log3_test = $test->LocalFile ($log3);
-my $SV = new PerlACE::Process ("../../../IFR_Service/IFR_Service", " -o $iorfile" );
+$test->DeleteFile ($log1);
+$test->DeleteFile ($log2);
+$test->DeleteFile ($log3);
-my $CL = new PerlACE::Process ("IFR_Inheritance_Test",
- " -ORBInitRef InterfaceRepository=file://$iorfile");
+my $test_iorfile = $test->LocalFile ($iorbase);
+$test->DeleteFile($iorbase);
-# The location of the tao_idl utility - depends on O/S
-my $tao_ifr = "undefined";
-if ($^O eq "MSWin32")
-{
- $tao_ifr = "$ENV{ACE_ROOT}/bin/tao_ifr";
-}
-else
-{
- $tao_ifr = "../../../IFR_Service/tao_ifr";
-}
+$SV1 = $test->CreateProcess ("../../../IFR_Service/IFR_Service",
+ " -o $test_iorfile " .
+ "-ORBLogFile $log1_test");
-# Compile the IDL
-#
-my $TAO_IFR = new PerlACE::Process("$tao_ifr",
- "IFR_Inheritance_Test.idl"
- . " -ORBInitRef InterfaceRepository=file://$iorfile");
+$SV2 = $test->CreateProcess ("$tao_ifr",
+ " IFR_Inheritance_Test.idl " .
+ "-ORBInitRef InterfaceRepository=file://$test_iorfile " .
+ "-ORBLogFile $log2_test");
+
+$CL = $test->CreateProcess ("IFR_Inheritance_Test",
+ "-ORBInitRef InterfaceRepository=file://$test_iorfile " .
+ "-ORBLogFile $log3_test");
-$SV->Spawn ();
+$server_status = $SV1->Spawn ();
-if (PerlACE::waitforfile_timed ($iorfile, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$iorfile>\n";
- $SV->Kill ();
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
exit 1;
}
-if( $TAO_IFR->SpawnWaitKill(20) != 0 )
-{
- print STDERR "ERROR: can't compile IDL\n";
- $TAO_IFR->Kill ();
- $status = 1;
- exit $status;
+if ($test->WaitForFileTimed ($iorbase,
+ $test->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$test_iorfile>\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ exit 1;
}
-# Redirect STDERR to a log file so that
-# we can make sure that we got a warning
-open(SAVE, ">&STDOUT");
-open(STDOUT, ">$testoutputfilename");
+$server_status = $SV2->SpawnWaitKill ($test->ProcessStartWaitInterval());
-my $client = $CL->SpawnWaitKill (60);
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
+ $SV1->Kill (); $SV1->TimedWait (1);
+ $SV2->Kill (); $SV2->TimedWait (1);
+ exit 1;
+}
-# Close the log file and restore STDERR
-close(STDOUT);
-open(STDOUT, ">&SAVE");
+$client_status = $CL->SpawnWaitKill ($test->ProcessStartWaitInterval() + 45);
+if ($client_status != 0) {
+ print STDERR "ERROR: client returned $client_status\n";
+ $status = 1;
+}
my $type = "";
my $name = "";
-open(THELOG, "< $testoutputfilename") or die "could not open the saved log";
-while (<THELOG>) {
- if (/^attribute/ || "^operation") {
- chomp($_);
- ($type, $name) = split(/ /, $_);
- #print "found $type $name\n";
- if ($isa{$name} eq $type) {
- #print "got $name\n";
- $got{$name} = 1;
- }
- else {
- print STDERR "ERROR: $type $name was not expected\n";
- $status = 1;
- }
- }
- else {
- print STDOUT "ERROR: unexpected line: $_\n";
- }
+
+foreach $result_file ("$log3_test"){
+ open(THELOG, "< $result_file") or die "could not open the saved log";
+ while (<THELOG>) {
+ if (/^attribute/ || "^operation") {
+ chomp($_);
+ ($type, $name) = split(/ /, $_);
+ #print "found $type $name\n";
+ if ($isa{$name} eq $type) {
+ #print "got $name\n";
+ $got{$name} = 1;
+ }
+ else {
+ print STDERR "ERROR: $type $name was not expected\n";
+ $status = 1;
+ }
+ }
+ else {
+ print STDOUT "ERROR: unexpected line: $_\n";
+ }
+ }
+ close(THELOG);
}
-close(THELOG);
### did we get all of the expected attributes and operations?
my $key = "";
@@ -138,19 +154,16 @@ foreach $key (keys (%got)) {
}
}
-if ($client != 0) {
- print STDERR "ERROR: client returned $client\n";
- $status = 1;
-}
-
-my $server = $SV->TerminateWaitKill (5);
+$server_status = $SV1->TerminateWaitKill ($test->ProcessStopWaitInterval());
-if ($server != 0) {
- print STDERR "ERROR: server returned $server\n";
+if ($server_status != 0) {
+ print STDERR "ERROR: server returned $server_status\n";
$status = 1;
}
-unlink $iorfile;
-unlink $testoutputfilename;
+$test->DeleteFile ($log1);
+$test->DeleteFile ($log2);
+$test->DeleteFile ($log3);
+$test->DeleteFile($iorbase);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl
index 04eba6bd96f..a2e5d3d76d0 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/1_Path_Period_0_Lanes/run_test.pl
@@ -6,17 +6,29 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
+use PerlACE::TestTarget;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $nfs = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $sup = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $con = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+
PerlACE::check_privilege_group();
# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
exit 0;
}
@@ -24,146 +36,187 @@ if ($opt_h)
$experiment_timeout = 240;
$startup_timeout = 120;
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
+if ($opt_n) {
+ $nfs_nfsconffile = $nfs->LocalFile ($opt_n);
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+}else {
+ $nfs_nfsconffile = $nfs->LocalFile ("notify.conf");
}
-if ($opt_s)
-{
- $supplier_conf = PerlACE::LocalFile ($opt_s);
+if ($opt_s) {
+ $sup_supconffile = $sup->LocalFile ($opt_s);
-}else
-{
- $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}else {
+ $sup_supconffile = $sup->LocalFile ("supplier.conf");
}
-if ($opt_c)
-{
- $consumer_conf = PerlACE::LocalFile ($opt_c);
+if ($opt_c) {
+ $con_conconffile = $con->LocalFile ($opt_c);
-}else
-{
- $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}else {
+ $con_conconffile = $con->LocalFile ("consumer.conf");
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$supplier_ior = PerlACE::LocalFile ("supplier.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+$nsiorfile = "naming.ior";
+$nfsiorfile = "notify.ior";
+$supiorfile = "supplier.ior";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
+my $sup_supiorfile = $sup->LocalFile ($supiorfile);
+my $con_supiorfile = $con->LocalFile ($supiorfile);
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+
+#TODO: remove all *.dat files when the test will be fixed
+#@list=glob("*.dat");
+#for $file (@list)
+#{
+# DeleteFile($file) or die "Could not delete $file";
+#}
+
+$NS = $ns->CreateProcess ("../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+$NFS = $nfs->CreateProcess ("../../../../../Notify_Service/Notify_Service");
+$NFS_Args = "-ORBInitRef NameService=file://$nfs_nsiorfile -IORoutput $nfs_nfsiorfile -ORBSvcConf $nfs_nfsconffile";
+
+$SUP = $sup->CreateProcess ("../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level -ORBInitRef NameService=file://$sup_nsiorfile -IORoutput $sup_supiorfile -ORBSvcConf $sup_supconffile";
+
+$CON = $con->CreateProcess ("../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile -IORinput file://$con_supiorfile -ORBSvcConf $con_conconffile";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$status = 0;
-
-$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
-
-#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
-
-$Supplier = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
-
-#$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -ORBDebugLevel 1";
-
-$Consumer = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
-
-#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
-
-unlink $naming_ior;
-$Naming->Spawn ();
-
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
+$NFS->Arguments ($NFS_Args);
+$args = $NFS->Arguments ();
print STDERR "Running Notification with arguments: $args\n";
-$Notification->Spawn ();
-
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$NFS_status = $NFS->Spawn ();
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Notification Service returned $NFS_status\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $supplier_ior;
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->Spawn ();
-
-if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the supplier to start\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$SUP_status = $SUP->Spawn ();
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
-print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Consumer returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($sup->WaitForFileTimed ($supiorfile,$sup->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-unlink $consumer_ior;
+}
+if ($sup->GetFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-$Supplier->Wait ();
-unlink $supplier_ior;
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$CON_status = $CON->SpawnWaitKill ($con->ProcessStartWaitInterval()+$experiment_timeout);
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ $status = 1;
+}
-$Notification->Kill ();
-unlink $notify_ior;
-$Naming->Kill ();
-unlink $naming_ior;
+$SUP_status = $SUP->WaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
+$NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Closing Notification Service returned $NFS_status\n";
+ $status = 1;
+}
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- print STDERR "Saving results to $results_directory\n";
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- move ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl
index 64a08cb157f..93be84d3627 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/3_Path_Period_10ms_Lanes/run_test.pl
@@ -6,17 +6,29 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
+use PerlACE::TestTarget;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $nfs = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $sup = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $con = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+
PerlACE::check_privilege_group();
# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
exit 0;
}
@@ -24,144 +36,187 @@ if ($opt_h)
$experiment_timeout = 120;
$startup_timeout = 120;
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
+if ($opt_n) {
+ $nfs_nfsconffile = $nfs->LocalFile ($opt_n);
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+}else {
+ $nfs_nfsconffile = $nfs->LocalFile ("notify.conf");
}
-if ($opt_s)
-{
- $supplier_conf = PerlACE::LocalFile ($opt_s);
+if ($opt_s) {
+ $sup_supconffile = $sup->LocalFile ($opt_s);
-}else
-{
- $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}else {
+ $sup_supconffile = $sup->LocalFile ("supplier.conf");
}
-if ($opt_c)
-{
- $consumer_conf = PerlACE::LocalFile ($opt_c);
+if ($opt_c) {
+ $con_conconffile = $con->LocalFile ($opt_c);
-}else
-{
- $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}else {
+ $con_conconffile = $con->LocalFile ("consumer.conf");
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$supplier_ior = PerlACE::LocalFile ("supplier.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+$nsiorfile = "naming.ior";
+$nfsiorfile = "notify.ior";
+$supiorfile = "supplier.ior";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
+my $sup_supiorfile = $sup->LocalFile ($supiorfile);
+my $con_supiorfile = $con->LocalFile ($supiorfile);
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+
+#TODO: remove all *.dat files when the test will be fixed
+#@list=glob("*.dat");
+#for $file (@list)
+#{
+# DeleteFile($file) or die "Could not delete $file";
+#}
+
+$NS = $ns->CreateProcess ("../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+$NFS = $nfs->CreateProcess ("../../../../../Notify_Service/Notify_Service");
+$NFS_Args = "-ORBInitRef NameService=file://$nfs_nsiorfile -IORoutput $nfs_nfsiorfile -ORBSvcConf $nfs_nfsconffile";
+
+$SUP = $sup->CreateProcess ("../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level -ORBInitRef NameService=file://$sup_nsiorfile -IORoutput $sup_supiorfile -ORBSvcConf $sup_supconffile";
+
+$CON = $con->CreateProcess ("../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile -IORinput file://$con_supiorfile -ORBSvcConf $con_conconffile";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$status = 0;
-
-$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
-
-#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
-
-$Supplier = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
-
-$Consumer = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
-
-#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
-
-unlink $naming_ior;
-$Naming->Spawn ();
-
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
+$NFS->Arguments ($NFS_Args);
+$args = $NFS->Arguments ();
print STDERR "Running Notification with arguments: $args\n";
-$Notification->Spawn ();
-
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$NFS_status = $NFS->Spawn ();
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Notification Service returned $NFS_status\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $supplier_ior;
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->Spawn ();
-
-if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the supplier to start\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$SUP_status = $SUP->Spawn ();
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
-print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Consumer returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($sup->WaitForFileTimed ($supiorfile,$sup->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-unlink $consumer_ior;
+}
+if ($sup->GetFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-$Supplier->Wait ();
-unlink $supplier_ior;
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$CON_status = $CON->SpawnWaitKill ($con->ProcessStartWaitInterval()+$experiment_timeout);
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ $status = 1;
+}
-$Notification->Kill ();
-unlink $notify_ior;
-$Naming->Kill ();
-unlink $naming_ior;
+$SUP_status = $SUP->WaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
+$NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Closing Notification Service returned $NFS_status\n";
+ $status = 1;
+}
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- print STDERR "Saving results to $results_directory\n";
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- move ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl
index f872b264118..276d14817fd 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops/run_test.pl
@@ -6,112 +6,208 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
-
-$experiment_timeout = 60;
-$startup_timeout = 60;
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-$consumer_ior = PerlACE::LocalFile ("consumer.ior");
-$relay_ior = PerlACE::LocalFile ("relay.ior");
-
-$supplier_conf = PerlACE::LocalFile ("supplier.conf");
-$consumer_conf = PerlACE::LocalFile ("consumer.conf");
-$relay_conf = PerlACE::LocalFile ("relay.conf");
+use PerlACE::TestTarget;
+use Getopt::Std;
$status = 0;
+$debug_level = '0';
-$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$relay_ior -ORBSvcConf $supplier_conf -Skip_Priority_Levels_Check";
-
-$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf -Skip_Priority_Levels_Check";
-
-$Relay = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
-$Relay_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $relay_ior -IORinput file://$consumer_ior -ORBSvcConf $relay_conf -Skip_Priority_Levels_Check";
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $sup = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $con = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $rel = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
-unlink $naming_ior;
-$Naming->Spawn ();
+$experiment_timeout = 60;
+$startup_timeout = 60;
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+$nsiorfile = "naming.ior";
+$reliorfile = "relay.ior";
+$coniorfile = "consumer.ior";
+$supconffile = "supplier.conf";
+$conconffile = "consumer.conf";
+$relconffile = "relay.conf";
+
+$chighdat = "c_high.dat";
+$shighdat = "s_high.dat";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $rel_nsiorfile = $rel->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $rel_reliorfile = $rel->LocalFile ($reliorfile);
+my $sup_reliorfile = $sup->LocalFile ($reliorfile);
+my $con_coniorfile = $con->LocalFile ($coniorfile);
+my $rel_coniorfile = $rel->LocalFile ($coniorfile);
+my $sup_supconffile = $sup->LocalFile ($supconffile);
+my $con_conconffile = $con->LocalFile ($conconffile);
+my $rel_relconffile = $rel->LocalFile ($relconffile);
+my $con_chighdat = $con->LocalFile ($chighdat);
+my $sup_shighdat = $sup->LocalFile ($shighdat);
+$ns->DeleteFile ($nsiorfile);
+$rel->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$con->DeleteFile ($coniorfile);
+$rel->DeleteFile ($coniorfile);
+$rel->DeleteFile ($reliorfile);
+$sup->DeleteFile ($reliorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
+
+$NS = $ns->CreateProcess ("../../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+
+$SUP = $sup->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level ".
+ "-ORBInitRef NameService=file://$sup_nsiorfile ".
+ "-IORinput file://$sup_reliorfile ".
+ "-ORBSvcConf $sup_supconffile ".
+ "-Skip_Priority_Levels_Check";
+
+$CON = $con->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile ".
+ "-IORoutput $con_coniorfile ".
+ "-ORBSvcConf $con_conconffile ".
+ "-Skip_Priority_Levels_Check";
+
+$REL = $rel->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$REL_Args = "-ORBInitRef NameService=file://$rel_nsiorfile ".
+ "-IORoutput $rel_reliorfile ".
+ "-IORinput file://$rel_coniorfile ".
+ "-ORBSvcConf $rel_relconffile ".
+ "-Skip_Priority_Levels_Check";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($rel->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$rel_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->Spawn ();
-
-if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the consumer to start\n";
- $Naming->Kill ();
- exit 1;
+$CON_status = $CON->Spawn ();
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->WaitForFileTimed ($coniorfile,$con->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$con_coniorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->GetFile ($coniorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$con_coniorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($rel->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$rel_nsiorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $relay_ior;
-$Relay->Arguments ($Relay_Args);
-$args = $Relay->Arguments ();
+$REL->Arguments ($REL_Args);
+$args = $REL->Arguments ();
print STDERR "Running Relay with arguments: $args\n";
-$status = $Relay->Spawn ();
-
-if (PerlACE::waitforfile_timed ($relay_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the Relay to start\n";
- $Consumer->Kill ();
- $Naming->Kill ();
- exit 1;
+$REL_status = $REL->Spawn ();
+if ($REL_status != 0) {
+ print STDERR "ERROR: Relay returned $REL_status\n";
+ $REL->Kill (); $REL->TimedWait (1);
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
-print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Supplier returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($rel->WaitForFileTimed ($reliorfile,$rel->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$rel_reliorfile>\n";
+ $REL->Kill (); $REL->TimedWait (1);
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-$Supplier->Kill ();
-$Consumer->Kill ();
-$Relay->Kill ();
+}
-unlink $consumer_ior;
-unlink $relay_ior;
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$SUP_status = $SUP->SpawnWaitKill ($sup->ProcessStartWaitInterval()+$experiment_timeout);
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $status = 1;
+}
-$Naming->Kill ();
-unlink $naming_ior;
+$SUP_status = $SUP->TerminateWaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
-if ($#ARGV > -1)
- {
- $results_directory = $ARGV[0];
- print STDERR "Saving results to $results_directory\n";
+$CON_status = $CON->TerminateWaitKill ($con->ProcessStopWaitInterval());
+if ($CON_status != 0) {
+ print STDERR "ERROR: Closing Consumer returned $CON_status\n";
+ $status = 1;
+}
+$REL_status = $REL->TerminateWaitKill ($rel->ProcessStopWaitInterval());
+if ($REL_status != 0) {
+ print STDERR "ERROR: Closing Relay returned $REL_status\n";
+ $status = 1;
+}
- mkdir $results_directory, 0777;
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
+if ($#ARGV > -1) {
+ print STDERR "Results are not saved in $ARGV[0]\n";
+}
- @list=glob("*.conf");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$rel->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$con->DeleteFile ($coniorfile);
+$rel->DeleteFile ($coniorfile);
+$rel->DeleteFile ($reliorfile);
+$sup->DeleteFile ($reliorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl
index 3be1938c231..716e97cb155 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/3_Hops_RTCORBA/run_test.pl
@@ -6,112 +6,205 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
-
-$experiment_timeout = 60;
-$startup_timeout = 60;
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-$consumer_ior = PerlACE::LocalFile ("consumer.ior");
-$relay_ior = PerlACE::LocalFile ("relay.ior");
-
-$supplier_conf = PerlACE::LocalFile ("supplier.conf");
-$consumer_conf = PerlACE::LocalFile ("consumer.conf");
-$relay_conf = PerlACE::LocalFile ("relay.conf");
+use PerlACE::TestTarget;
+use Getopt::Std;
$status = 0;
+$debug_level = '0';
-$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$relay_ior -ORBSvcConf $supplier_conf";
-
-$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $consumer_ior -ORBSvcConf $consumer_conf";
-
-$Relay = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
-$Relay_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $relay_ior -IORinput file://$consumer_ior -ORBSvcConf $relay_conf";
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $sup = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $con = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $rel = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
-unlink $naming_ior;
-$Naming->Spawn ();
+$experiment_timeout = 60;
+$startup_timeout = 60;
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+$nsiorfile = "naming.ior";
+$reliorfile = "relay.ior";
+$coniorfile = "consumer.ior";
+$supconffile = "supplier.conf";
+$conconffile = "consumer.conf";
+$relconffile = "relay.conf";
+
+$chighdat = "c_high.dat";
+$shighdat = "s_high.dat";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $rel_nsiorfile = $rel->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $rel_reliorfile = $rel->LocalFile ($reliorfile);
+my $sup_reliorfile = $sup->LocalFile ($reliorfile);
+my $con_coniorfile = $con->LocalFile ($coniorfile);
+my $rel_coniorfile = $rel->LocalFile ($coniorfile);
+my $sup_supconffile = $sup->LocalFile ($supconffile);
+my $con_conconffile = $con->LocalFile ($conconffile);
+my $rel_relconffile = $rel->LocalFile ($relconffile);
+my $con_chighdat = $con->LocalFile ($chighdat);
+my $sup_shighdat = $sup->LocalFile ($shighdat);
+$ns->DeleteFile ($nsiorfile);
+$rel->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$con->DeleteFile ($coniorfile);
+$rel->DeleteFile ($coniorfile);
+$rel->DeleteFile ($reliorfile);
+$sup->DeleteFile ($reliorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
+
+$NS = $ns->CreateProcess ("../../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+
+$SUP = $sup->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level ".
+ "-ORBInitRef NameService=file://$sup_nsiorfile ".
+ "-IORinput file://$sup_reliorfile ".
+ "-ORBSvcConf $sup_supconffile";
+
+$CON = $con->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile ".
+ "-IORoutput $con_coniorfile ".
+ "-ORBSvcConf $con_conconffile";
+
+$REL = $rel->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$REL_Args = "-ORBInitRef NameService=file://$rel_nsiorfile ".
+ "-IORoutput $rel_reliorfile ".
+ "-IORinput file://$rel_coniorfile ".
+ "-ORBSvcConf $rel_relconffile";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($rel->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$rel_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->Spawn ();
-
-if (PerlACE::waitforfile_timed ($consumer_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the consumer to start\n";
- $Naming->Kill ();
- exit 1;
+$CON_status = $CON->Spawn ();
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->WaitForFileTimed ($coniorfile,$con->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$con_coniorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->GetFile ($coniorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$con_coniorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($rel->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$rel_nsiorfile>\n";
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $relay_ior;
-$Relay->Arguments ($Relay_Args);
-$args = $Relay->Arguments ();
+$REL->Arguments ($REL_Args);
+$args = $REL->Arguments ();
print STDERR "Running Relay with arguments: $args\n";
-$status = $Relay->Spawn ();
-
-if (PerlACE::waitforfile_timed ($relay_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the Relay to start\n";
- $Consumer->Kill ();
- $Naming->Kill ();
- exit 1;
+$REL_status = $REL->Spawn ();
+if ($REL_status != 0) {
+ print STDERR "ERROR: Relay returned $REL_status\n";
+ $REL->Kill (); $REL->TimedWait (1);
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
-print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Supplier returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($rel->WaitForFileTimed ($reliorfile,$rel->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$rel_reliorfile>\n";
+ $REL->Kill (); $REL->TimedWait (1);
+ $CON->Kill (); $CON->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-$Supplier->Kill ();
-$Consumer->Kill ();
-$Relay->Kill ();
+}
-unlink $consumer_ior;
-unlink $relay_ior;
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$SUP_status = $SUP->SpawnWaitKill ($sup->ProcessStartWaitInterval()+$experiment_timeout);
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $status = 1;
+}
-$Naming->Kill ();
-unlink $naming_ior;
+$SUP_status = $SUP->TerminateWaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
-if ($#ARGV > -1)
- {
- $results_directory = $ARGV[0];
- print STDERR "Saving results to $results_directory\n";
+$CON_status = $CON->TerminateWaitKill ($con->ProcessStopWaitInterval());
+if ($CON_status != 0) {
+ print STDERR "ERROR: Closing Consumer returned $CON_status\n";
+ $status = 1;
+}
+$REL_status = $REL->TerminateWaitKill ($rel->ProcessStopWaitInterval());
+if ($REL_status != 0) {
+ print STDERR "ERROR: Closing Relay returned $REL_status\n";
+ $status = 1;
+}
- mkdir $results_directory, 0777;
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
+if ($#ARGV > -1) {
+ print STDERR "Results are not saved in $ARGV[0]\n";
+}
- @list=glob("*.conf");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$rel->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$con->DeleteFile ($coniorfile);
+$rel->DeleteFile ($coniorfile);
+$rel->DeleteFile ($reliorfile);
+$sup->DeleteFile ($reliorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl
index 93218c3e115..cc008c94780 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify/run_test.pl
@@ -6,17 +6,29 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
+use PerlACE::TestTarget;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $nfs = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $sup = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $con = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+
PerlACE::check_privilege_group();
# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
-getopts ("n:s:c:o:h");
+getopts ("n:s:c:o:h:debug");
-if ($opt_h)
-{
+if ($opt_h) {
print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
exit 0;
}
@@ -24,146 +36,195 @@ if ($opt_h)
$experiment_timeout = 120;
$startup_timeout = 120;
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
+if ($opt_n) {
+ $nfs_nfsconffile = $nfs->LocalFile ($opt_n);
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+}else {
+ $nfs_nfsconffile = $nfs->LocalFile ("notify.conf");
}
-if ($opt_s)
-{
- $supplier_conf = PerlACE::LocalFile ($opt_s);
+if ($opt_s) {
+ $sup_supconffile = $sup->LocalFile ($opt_s);
-}else
-{
- $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}else {
+ $sup_supconffile = $sup->LocalFile ("supplier.conf");
}
-if ($opt_c)
-{
- $consumer_conf = PerlACE::LocalFile ($opt_c);
+if ($opt_c) {
+ $con_conconffile = $con->LocalFile ($opt_c);
-}else
-{
- $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}else {
+ $con_conconffile = $con->LocalFile ("consumer.conf");
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$supplier_ior = PerlACE::LocalFile ("supplier.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+$nsiorfile = "naming.ior";
+$nfsiorfile = "notify.ior";
+$supiorfile = "supplier.ior";
+
+$chighdat = "c_high.dat";
+$shighdat = "s_high.dat";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
+my $sup_supiorfile = $sup->LocalFile ($supiorfile);
+my $con_supiorfile = $con->LocalFile ($supiorfile);
+my $con_chighdat = $con->LocalFile ($chighdat);
+my $sup_shighdat = $sup->LocalFile ($shighdat);
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
+
+$NS = $ns->CreateProcess ("../../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+$NFS = $nfs->CreateProcess ("../../../../../../Notify_Service/Notify_Service");
+$NFS_Args = "-ORBInitRef NameService=file://$nfs_nsiorfile ".
+ "-IORoutput $nfs_nfsiorfile ".
+ "-ORBSvcConf $nfs_nfsconffile";
+
+$SUP = $sup->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level ".
+ "-ORBInitRef NameService=file://$sup_nsiorfile ".
+ "-IORoutput $sup_supiorfile ".
+ "-ORBSvcConf $sup_supconffile ".
+ "-Skip_Priority_Levels_Check";
+
+$CON = $con->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile ".
+ "-IORinput file://$con_supiorfile ".
+ "-ORBSvcConf $con_conconffile ".
+ "-Skip_Priority_Levels_Check";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$status = 0;
-
-$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../../../../Notify_Service/Notify_Service");
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
-
-$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf -Skip_Priority_Levels_Check";
-
-$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -Skip_Priority_Levels_Check";
-
-unlink $naming_ior;
-$Naming->Spawn ();
-
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
+$NFS->Arguments ($NFS_Args);
+$args = $NFS->Arguments ();
print STDERR "Running Notification with arguments: $args\n";
-$Notification->Spawn ();
-
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$NFS_status = $NFS->Spawn ();
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Notification Service returned $NFS_status\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $supplier_ior;
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
-print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->Spawn ();
-if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the supplier to start\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$SUP_status = $SUP->Spawn ();
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
-print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Consumer returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($sup->WaitForFileTimed ($supiorfile,$sup->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-unlink $consumer_ior;
-
-$Supplier->Kill ();
-unlink $supplier_ior;
-
-$Notification->Kill ();
-unlink $notify_ior;
+}
+if ($sup->GetFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-$Naming->Kill ();
-unlink $naming_ior;
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$CON_status = $CON->SpawnWaitKill ($con->ProcessStartWaitInterval()+$experiment_timeout);
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $status = 1;
+}
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
+$SUP_status = $SUP->TerminateWaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+$NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Closing Notification Service returned $NFS_status\n";
+ $status = 1;
+}
- print STDERR "Saving results to $results_directory\n";
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.conf");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl
index a5d631da445..70817769af3 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Notify_RTCORBA/run_test.pl
@@ -6,17 +6,29 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
-use File::Copy;
+use PerlACE::TestTarget;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $nfs = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $sup = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $con = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+
PerlACE::check_privilege_group();
# -n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h
-getopts ("n:s:c:o:h");
+getopts ("n:s:c:o:h:debug");
-if ($opt_h)
-{
+if ($opt_h) {
print STDERR "-n notify.conf -s supplier.conf -c consumer.conf -o output_dir -h\n";
exit 0;
}
@@ -24,149 +36,193 @@ if ($opt_h)
$experiment_timeout = 120;
$startup_timeout = 120;
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
+if ($opt_n) {
+ $nfs_nfsconffile = $nfs->LocalFile ($opt_n);
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+}else {
+ $nfs_nfsconffile = $nfs->LocalFile ("notify.conf");
}
-if ($opt_s)
-{
- $supplier_conf = PerlACE::LocalFile ($opt_s);
+if ($opt_s) {
+ $sup_supconffile = $sup->LocalFile ($opt_s);
-}else
-{
- $supplier_conf = PerlACE::LocalFile ("supplier.conf");
+}else {
+ $sup_supconffile = $sup->LocalFile ("supplier.conf");
}
-if ($opt_c)
-{
- $consumer_conf = PerlACE::LocalFile ($opt_c);
+if ($opt_c) {
+ $con_conconffile = $con->LocalFile ($opt_c);
-}else
-{
- $consumer_conf = PerlACE::LocalFile ("consumer.conf");
+}else {
+ $con_conconffile = $con->LocalFile ("consumer.conf");
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$supplier_ior = PerlACE::LocalFile ("supplier.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+$nsiorfile = "naming.ior";
+$nfsiorfile = "notify.ior";
+$supiorfile = "supplier.ior";
+
+$chighdat = "c_high.dat";
+$shighdat = "s_high.dat";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
+my $sup_nsiorfile = $sup->LocalFile ($nsiorfile);
+my $con_nsiorfile = $con->LocalFile ($nsiorfile);
+my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
+my $sup_supiorfile = $sup->LocalFile ($supiorfile);
+my $con_supiorfile = $con->LocalFile ($supiorfile);
+my $con_chighdat = $con->LocalFile ($chighdat);
+my $sup_shighdat = $sup->LocalFile ($shighdat);
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
+
+$NS = $ns->CreateProcess ("../../../../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
+$NFS = $nfs->CreateProcess ("../../../../../../Notify_Service/Notify_Service");
+$NFS_Args = "-ORBInitRef NameService=file://$nfs_nsiorfile ".
+ "-IORoutput $nfs_nfsiorfile ".
+ "-ORBSvcConf $nfs_nfsconffile";
+
+$SUP = $sup->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$SUP_Args = "-ORBDebugLevel $debug_level ".
+ "-ORBInitRef NameService=file://$sup_nsiorfile ".
+ "-IORoutput $sup_supiorfile ".
+ "-ORBSvcConf $sup_supconffile ";
+
+$CON = $con->CreateProcess ("../../../../Driver/Notify_Tests_Driver");
+$CON_Args = "-ORBInitRef NameService=file://$con_nsiorfile ".
+ "-IORinput file://$con_supiorfile ".
+ "-ORBSvcConf $con_conconffile ";
+
+$NS_status = $NS->Spawn ();
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-$status = 0;
-
-$Naming = new PerlACE::Process ("../../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../../../../Notify_Service/Notify_Service");
-
-#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
-
-$Supplier = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Supplier_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $supplier_ior -ORBSvcConf $supplier_conf";
-
-$Consumer = new PerlACE::Process ("../../../../Driver/Notify_Tests_Driver");
-
-$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf";
-#$Consumer_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$supplier_ior -ORBSvcConf $consumer_conf -ORBDebugLevel 1";
-
-unlink $naming_ior;
-$Naming->Spawn ();
-
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($sup->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$sup_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
+$NFS->Arguments ($NFS_Args);
+$args = $NFS->Arguments ();
print STDERR "Running Notification with arguments: $args\n";
-$Notification->Spawn ();
-
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$NFS_status = $NFS->Spawn ();
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Notification Service returned $NFS_status\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-unlink $supplier_ior;
-$Supplier->Arguments ($Supplier_Args);
-$args = $Supplier->Arguments ();
-print STDERR "Running Supplier with arguments: $args\n";
-$Supplier->Spawn ();
-if (PerlACE::waitforfile_timed ($supplier_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the supplier to start\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+$SUP->Arguments ($SUP_Args);
+$args = $SUP->Arguments ();
+print STDERR "Running Supplier with arguments: $args\n";
+$SUP_status = $SUP->Spawn ();
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Supplier returned $SUP_status\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
}
-
-unlink $consumer_ior;
-$Consumer->Arguments ($Consumer_Args);
-$args = $Consumer->Arguments ();
-print STDERR "Running Consumer with arguments: $args\n";
-$status = $Consumer->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Consumer returned $status\n";
- $Supplier->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($sup->WaitForFileTimed ($supiorfile,$sup->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
- }
-
-unlink $consumer_ior;
-
-$Supplier->Kill ();
-unlink $supplier_ior;
-
-$Notification->Kill ();
-unlink $notify_ior;
+}
+if ($sup->GetFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$sup_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($con->PutFile ($supiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$con_supiorfile>\n";
+ $SUP->Kill (); $SUP->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-$Naming->Kill ();
-unlink $naming_ior;
+$CON->Arguments ($CON_Args);
+$args = $CON->Arguments ();
+print STDERR "Running Consumer with arguments: $args\n";
+$CON_status = $CON->SpawnWaitKill ($con->ProcessStartWaitInterval()+$experiment_timeout);
+if ($CON_status != 0) {
+ print STDERR "ERROR: Consumer returned $CON_status\n";
+ $status = 1;
+}
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
+$SUP_status = $SUP->TerminateWaitKill ($sup->ProcessStopWaitInterval());
+if ($SUP_status != 0) {
+ print STDERR "ERROR: Closing Supplier returned $SUP_status\n";
+ $status = 1;
+}
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+$NFS_status = $NFS->TerminateWaitKill ($nfs->ProcessStopWaitInterval());
+if ($NFS_status != 0) {
+ print STDERR "ERROR: Closing Notification Service returned $NFS_status\n";
+ $status = 1;
+}
- print STDERR "Saving results to $results_directory\n";
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Closing Name Service returned $NS_status\n";
+ $status = 1;
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.conf");
- for $file (@list)
- {
- copy ("$file", "$results_directory/$file");
- }
- }
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$sup->DeleteFile ($nsiorfile);
+$con->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+$sup->DeleteFile ($supiorfile);
+$con->DeleteFile ($supiorfile);
+$con->DeleteFile ($chighdat);
+$sup->DeleteFile ($shighdat);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl
index 9e545edf0ad..ccb5adb94fa 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_high_path.pl
@@ -1,109 +1,94 @@
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;
use File::Copy;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
+ $opt_h = 0; #to disable fuxx.pl warning only
print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
exit 0;
}
-$experiment_timeout = 120;
-$startup_timeout = 120;
+my $notify_ior = "notify.ior";
+my $naming_ior = "naming.ior";
+my $high_path_ior = "high_path.ior";
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
+my $other_paths_conf = "other_paths.conf";
+my $high_path_conf = "high_path.conf";
+my $notify_conf = "notify.conf";
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+if ($opt_n) {
+ $notify_conf = $opt_n;
}
-if ($opt_s)
-{
- $high_path_conf = PerlACE::LocalFile ($opt_s);
-
-}else
-{
- $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+if ($opt_s) {
+ $high_path_conf = $opt_s;
}
-if ($opt_c)
-{
- $other_paths_conf = PerlACE::LocalFile ($opt_c);
-
-}else
-{
- $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
-}
-
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$high_path_ior = PerlACE::LocalFile ("high_path.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+if ($opt_c) {
+ $other_paths_conf = $opt_c;
}
-$status = 0;
+my $test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $test_notify_ior = $test->LocalFile ($notify_ior);
+my $test_naming_ior = $test->LocalFile ($naming_ior);
+my $test_highpath_ior = $test->LocalFile ($high_path_ior);
+$test->DeleteFile($notify_ior);
+$test->DeleteFile($naming_ior);
+$test->DeleteFile($high_path_ior);
-$High_path = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+my $test_highpath_conf = $test->LocalFile ($high_path_conf);
-$High_path_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $high_path_ior -ORBSvcConf $high_path_conf";
+#uncomment it when test will be fixed
+#@datfiles = glob("*.dat");
+#for $file (@datfiles) {
+# $test->DeleteFile($file);
+#}
+$T = $test->CreateProcess ("../../../Driver/Notify_Tests_Driver",
+ "-ORBInitRef NameService=file://$test_naming_ior ".
+ "-IORoutput $test_highpath_ior ".
+ "-ORBSvcConf $test_highpath_conf");
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- exit 1;
+if ($test->WaitForFileTimed ($notify_ior,
+ $test->ProcessStartWaitInterval() + 105) == -1) {
+ print STDERR "ERROR: waiting for the notify service to start\n";
+ exit 1;
}
-unlink $high_path_ior;
-$High_path->Arguments ($High_path_Args);
-$args = $High_path->Arguments ();
-print STDERR "Running High_path with arguments: $args\n";
-$status = $High_path->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Other_paths returned $status\n";
- $High_path->Kill ();
+$test_status = $T->SpawnWaitKill ($test->ProcessStartWaitInterval() + 105);
+if ($test_status != 0) {
+ print STDERR "ERROR: test returned $test_status\n";
exit 1;
- }
-
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
-
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+}
- print STDERR "Saving results to $results_directory\n";
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- move ("$file", "$results_directory/$file");
- }
- }
+$test->DeleteFile($notify_ior);
+$test->DeleteFile($naming_ior);
+$test->DeleteFile($high_path_ior);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl
index b954d95b3b5..c3429f9f78a 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_notify.pl
@@ -1,100 +1,115 @@
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;
use File::Copy;
use Getopt::Std;
PerlACE::check_privilege_group();
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
+ $opt_h = 0; #to disable fuxx.pl warning only
print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
exit 0;
}
-$experiment_timeout = 600;
-$startup_timeout = 120;
-
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
-
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+$nt_conf = "notify.conf";
+if ($opt_n) {
+ $nt_conf = $opt_n;
}
-if ($opt_s)
-{
- $high_path_conf = PerlACE::LocalFile ($opt_s);
-
-}else
-{
- $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+$high_path_conf = "high_path.conf";
+if ($opt_s) {
+ $high_path_conf = $opt_s;
}
-if ($opt_c)
-{
- $other_paths_conf = PerlACE::LocalFile ($opt_c);
-
-}else
-{
- $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+$other_paths_conf = "other_paths.conf";
+if ($opt_c) {
+ $other_paths_conf = $opt_c;
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
+my $nm_service = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $nt_service = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
-$naming_ior = PerlACE::LocalFile ("naming.ior");
+#uncomment it when test will be fixed
+#@list = glob("*.dat");
+#for $file (@list) {
+# $nm_service->DeleteFile ($file);
+# $nt_service->DeleteFile ($file);
+#}
-$high_path_ior = PerlACE::LocalFile ("high_path.ior");
+my $nm_ior = "naming.ior";
+my $nt_ior = "notify.ior";
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
-}
+my $nt_service_nt_conf = $nt_service->LocalFile($nt_conf);
+my $nm_service_nm_ior = $nm_service->LocalFile($nm_ior);
+my $nt_service_nm_ior = $nt_service->LocalFile($nm_ior);
+my $nt_service_nt_ior = $nt_service->LocalFile($nt_ior);
+$nm_service->DeleteFile($nm_ior);
+$nt_service->DeleteFile($nm_ior);
+$nt_service->DeleteFile($nt_ior);
-$status = 0;
+$NM_SV = $nm_service->CreateProcess ("../../../../../Naming_Service/Naming_Service",
+ "-ORBDebugLevel $debug_level -o $nm_service_nm_ior");
-$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
+$NT_SV = $nt_service->CreateProcess ("../../../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=file://$nt_service_nm_ior ".
+ "-IORoutput $nt_service_nt_ior ".
+ "-ORBSvcConf $nt_service_nt_conf ".
+ "-ORBDebugLevel $debug_level");
-$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
+$service_status = $NM_SV->Spawn ();
-#$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf -ORBDebugLevel 1";
+if ($service_status != 0) {
+ print STDERR "ERROR: naming service returned $service_status\n";
+ exit 1;
+}
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf";
+if ($nm_service->WaitForFileTimed ($nm_ior,
+ $nm_service->ProcessStartWaitInterval() + 105) == -1) {
+ print STDERR "ERROR: cannot find file <$nm_service_nm_ior>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-unlink $naming_ior;
-$Naming->Spawn ();
+if ($nm_service->GetFile ($nm_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$nm_service_nm_ior>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($nt_service->PutFile ($nm_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$nt_service_nm_ior>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
-print STDERR "Running Notification with arguments: $args\n";
-$status = $Notification->SpawnWaitKill ($experiment_timeout);
-
-if ($status != 0)
- {
- print STDERR "ERROR: Other_paths returned $status\n";
- $Notification->Kill ();
- $Naming->Kill ();
+$service_status = $NT_SV->SpawnWaitKill ($nt_service->ProcessStartWaitInterval() + 585);
+
+if ($service_status != 0) {
+ print STDERR "ERROR: notification service returned $service_status\n";
exit 1;
- }
+}
+
+$nm_service->DeleteFile($nm_ior);
+$nt_service->DeleteFile($nm_ior);
+$nt_service->DeleteFile($nt_ior);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl
index d2bfbcfb48d..5686184ffe1 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_other_paths.pl
@@ -1,111 +1,92 @@
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;
use File::Copy;
use Getopt::Std;
+$status = 0;
+$debug_level = '0';
+
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
+ $opt_h = 0; #to disable fuxx.pl warning only
print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h\n";
exit 0;
}
-$experiment_timeout = 120;
-$startup_timeout = 120;
-
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
-
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_conf = "notify.conf";
+if ($opt_n) {
+ $notify_conf = $opt_n;
}
-if ($opt_s)
-{
- $high_path_conf = PerlACE::LocalFile ($opt_s);
-
-}else
-{
- $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+$high_path_conf = "high_path.conf";
+if ($opt_s) {
+ $high_path_conf = $opt_s;
}
-if ($opt_c)
-{
- $other_paths_conf = PerlACE::LocalFile ($opt_c);
-
-}else
-{
- $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
-}
-
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$high_path_ior = PerlACE::LocalFile ("high_path.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+$other_paths_conf = "other_paths.conf";
+if ($opt_c) {
+ $other_paths_conf = $opt_c;
}
-$status = 0;
+my $naming_ior = "naming.ior";
+my $high_path_ior = "high_path.ior";
-$Other_paths = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+$test = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
-$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf";
+#uncomment it when test will be fixed
+#@list = glob("*.dat");
+#for $file (@list) {
+# $test->DeleteFile ($file);
+#}
-#$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf -ORBDebugLevel 1";
+my $test_op_conf = $test->LocalFile ($other_paths_conf);
+my $test_nm_ior = $test->LocalFile ($naming_ior);
+my $test_hp_ior = $test->LocalFile ($high_path_ior);
+$test->DeleteFile ($naming_ior);
+$test->DeleteFile ($high_path_ior);
-if (PerlACE::waitforfile_timed ($high_path_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the high_path to start\n";
+$T = $test->CreateProcess("../../../Driver/Notify_Tests_Driver",
+ "-ORBInitRef NameService=file://$test_nm_ior ".
+ "-IORinput file://$test_hp_ior ".
+ "-ORBSvcConf $test_op_conf -ORBdebuglevel $debug_level");
- exit 1;
+if ($test->WaitForFileTimed ($high_path_ior,
+ $test->ProcessStartWaitInterval() + 105) == -1) {
+ print STDERR "ERROR: cannot find file <$test_hp_ior> to start\n";
+ $T->Kill (); $T->TimedWait (1);
+ exit 1;
}
-unlink $other_paths_ior;
-$Other_paths->Arguments ($Other_paths_Args);
-$args = $Other_paths->Arguments ();
-print STDERR "Running Other_paths with arguments: $args\n";
-$status = $Other_paths->SpawnWaitKill ($experiment_timeout);
+$test->DeleteFile($other_paths_ior);
-if ($status != 0)
- {
- print STDERR "ERROR: Other_paths returned $status\n";
+$status = $T->SpawnWaitKill ($test->ProcessStartWaitInterval() + 105);
+if ($status != 0) {
+ print STDERR "ERROR: Other_paths returned $status\n";
exit 1;
- }
-
-unlink $other_paths_ior;
-
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
-
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+}
- print STDERR "Saving results to $results_directory\n";
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- move ("$file", "$results_directory/$file");
- }
- }
+$test->DeleteFile($other_paths_ior);
+$test->DeleteFile($naming_ior);
+$test->DeleteFile($high_path_ior);
exit $status;
diff --git a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl
index e4bff7eb2a9..b6bc4c2b26e 100755
--- a/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl
+++ b/TAO/orbsvcs/tests/Notify/performance-tests/scripts/Paths_vs_Throughput/run_test.pl
@@ -1,169 +1,205 @@
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;
use File::Copy;
use Getopt::Std;
PerlACE::check_privilege_group();
+$status = 0;
+
# -n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h
getopts ("n:s:c:o:h");
-if ($opt_h)
-{
+if ($opt_h) {
+ $opt_h = 0; #to disable warning
print STDERR "-n notify.conf -s high_path.conf -c other_paths.conf -o output_dir -h -d\n";
exit 0;
}
-$experiment_timeout = 300;
-$startup_timeout = 300;
$debug = "";
-if ($opt_d)
-{
- $debug = "-ORBDebugLevel 1"
+if ($opt_d) {
+ $opt_d = 0; #to disable warning
+ $debug = "-ORBDebugLevel 1"
}
-if ($opt_n)
-{
- $notify_conf = PerlACE::LocalFile ($opt_n);
-
-}else
-{
- $notify_conf = PerlACE::LocalFile ("notify.conf");
+$notify_conf = "notify.conf";
+if ($opt_n) {
+ $notify_conf = $opt_n;
}
-if ($opt_s)
-{
- $high_path_conf = PerlACE::LocalFile ($opt_s);
-
-}else
-{
- $high_path_conf = PerlACE::LocalFile ("high_path.conf");
+$high_path_conf = "high_path.conf";
+if ($opt_s) {
+ $high_path_conf = $opt_s;
}
-if ($opt_c)
-{
- $other_paths_conf = PerlACE::LocalFile ($opt_c);
-
-}else
-{
- $other_paths_conf = PerlACE::LocalFile ("other_paths.conf");
+$other_paths_conf = "other_paths.conf";
+if ($opt_c) {
+ $other_paths_conf = $opt_c;
}
-$notify_ior = PerlACE::LocalFile ("notify.ior");
-
-$naming_ior = PerlACE::LocalFile ("naming.ior");
-
-$high_path_ior = PerlACE::LocalFile ("high_path.ior");
-
-@list=glob("*.dat");
-for $file (@list)
-{
- unlink $file or die "Could not delete $file";
+my $notify_ior = "notify.ior";
+my $naming_ior = "naming.ior";
+my $high_path_ior = "high_path.ior";
+
+$nm_service = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+$nt_service = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+$high_path = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+$other_path = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+
+#uncomment it when test will be fixed
+#@list = glob("*.dat");
+#for $file (@list) {
+#->DeleteFile($file);
+#}
+
+#localisations of ior files
+$nm_service_nmiorfile = $nm_service->LocalFile($naming_ior);
+$nt_service_nmiorfile = $nt_service->LocalFile($naming_ior);
+$high_path_nmiorfile = $high_path->LocalFile($naming_ior);
+$other_path_nmiorfile = $other_path->LocalFile($naming_ior);
+$nt_service_ntiorfile = $nt_service->LocalFile($notify_ior);
+$high_path_hpiorfile = $high_path->LocalFile($high_path_ior);
+$other_path_hpiorfile = $other_path->LocalFile($high_path_ior);
+#delete all ior files
+$nm_service->DeleteFile($naming_ior);
+$nt_service->DeleteFile($naming_ior);
+$high_path->DeleteFile($naming_ior);
+$other_path->DeleteFile($naming_ior);
+$nt_service->DeleteFile($notify_ior);
+$high_path->DeleteFile($high_path_ior);
+$other_path->DeleteFile($high_path_ior);
+#localisations of conf files
+$nt_service_ntconffile = $nt_service->LocalFile($notify_conf);
+$high_path_hpconffile = $high_path->LocalFile($high_path_conf);
+$other_path_opconffile = $other_path->LocalFile($other_paths_conf);
+
+$NM_SV = $nm_service->CreateProcess ("../../../../../Naming_Service/Naming_Service",
+ "-o $nm_service_nmiorfile $debug");
+$NT_SV = $nt_service->CreateProcess ("../../../../../Notify_Service/Notify_Service",
+ "-ORBInitRef NameService=file://$nt_service_nmiorfile ".
+ "-IORoutput $nt_service_ntiorfile ".
+ "-ORBSvcConf $nt_service_ntconffile $debug");
+
+$HP = $high_path->CreateProcess ("../../../Driver/Notify_Tests_Driver",
+ "-ORBInitRef NameService=file://$high_path_nmiorfile ".
+ "-IORoutput $high_path_hpiorfile ".
+ "-ORBSvcConf $high_path_hpconffile $debug");
+
+$OP = $other_path->CreateProcess ("../../../Driver/Notify_Tests_Driver",
+ "-ORBInitRef NameService=file://$other_path_nmiorfile ".
+ "-IORinput file://$other_path_hpiorfile ".
+ "-ORBSvcConf $other_path_opconffile $debug");
+
+$process_status = $NM_SV->Spawn ();
+
+if ($process_status != 0) {
+ print STDERR "ERROR: naming service returned $process_status\n";
+ exit 1;
}
-$status = 0;
-
-$Naming = new PerlACE::Process ("../../../../../Naming_Service/Naming_Service",
- "-o $naming_ior");
-
-$Notification = new PerlACE::Process ("../../../../../Notify_Service/Notify_Service");
-
-$Notify_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $notify_ior -ORBSvcConf $notify_conf $debug";
-
-$High_path = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
-
-$High_path_Args = "-ORBInitRef NameService=file://$naming_ior -IORoutput $high_path_ior -ORBSvcConf $high_path_conf $debug";
+if ($nm_service->WaitForFileTimed ($naming_ior,
+ $nm_service->ProcessStartWaitInterval() + 285) == -1) {
+ print STDERR "ERROR: cannot find file <$nm_service_nmiorfile>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-$Other_paths = new PerlACE::Process ("../../../Driver/Notify_Tests_Driver");
+if ($nm_service->GetFile ($naming_ior) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$nm_service_nmiorfile>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-$Other_paths_Args = "-ORBInitRef NameService=file://$naming_ior -IORinput file://$high_path_ior -ORBSvcConf $other_paths_conf $debug";
+if ($nt_service->PutFile ($naming_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$nt_service_nmiorfile>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-unlink $naming_ior;
-$Naming->Spawn ();
+if ($high_path->PutFile ($naming_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$high_path_nmiorfile>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($naming_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+if ($other_path->PutFile ($naming_ior) == -1) {
+ print STDERR "ERROR: cannot set file <$other_path_nmiorfile>\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
}
-unlink $notify_ior;
-$Notification->Arguments ($Notify_Args);
-$args = $Notification->Arguments ();
-print STDERR "Running Notification with arguments: $args\n";
-$Notification->Spawn ();
+$process_status = $NT_SV->Spawn ();
-if (PerlACE::waitforfile_timed ($notify_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+if ($process_status != 0) {
+ print STDERR "ERROR: notify service returned $process_status\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
}
-unlink $high_path_ior;
-$High_path->Arguments ($High_path_Args);
-$args = $High_path->Arguments ();
-print STDERR "Running High_path with arguments: $args\n";
-$High_path->Spawn ();
-
-if (PerlACE::waitforfile_timed ($high_path_ior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the high_path to start\n";
- $High_path->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+if ($nt_service->WaitForFileTimed ($notify_ior,
+ $nt_service->ProcessStartWaitInterval() + 285) == -1) {
+ print STDERR "ERROR: cannot find file <$nt_service_ntiorfile> to start\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ $NT_SV->Kill (); $NT_SV->TimedWait (1);
+ exit 1;
}
-unlink $other_paths_ior;
-$Other_paths->Arguments ($Other_paths_Args);
-$args = $Other_paths->Arguments ();
-print STDERR "Running Other_paths with arguments: $args\n";
-$status = $Other_paths->SpawnWaitKill ($experiment_timeout);
+$process_status = $HP->Spawn ();
-if ($status != 0)
- {
- print STDERR "ERROR: Other_paths returned $status\n";
- $High_path->Kill ();
- $Notification->Kill ();
- $Naming->Kill ();
+if ($process_status != 0) {
+ print STDERR "ERROR: high path returned $process_status\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ $NT_SV->Kill (); $NT_SV->TimedWait (1);
exit 1;
- }
-
-unlink $other_paths_ior;
+}
-$High_path->Wait ();
-unlink $high_path_ior;
+if ($high_path->WaitForFileTimed ($high_path_ior,
+ $high_path->ProcessStartWaitInterval() + 285) == -1) {
+ print STDERR "ERROR: cannot find file <$high_path_hpiorfile> to start\n";
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ $NT_SV->Kill (); $NT_SV->TimedWait (1);
+ $HP->Kill (); $HP->TimedWait (1);
+ exit 1;
+}
-$Notification->Kill ();
-unlink $notify_ior;
+$process_status = $OP->SpawnWaitKill ($other_path->ProcessStartWaitInterval() + 285);
-$Naming->Kill ();
-unlink $naming_ior;
+if ($process_status != 0) {
+ print STDERR "ERROR: other path returned $process_status\n";
+ $status = 1;
+ $HP->Kill (); $HP->TimedWait (1);
+ $NT_SV->Kill (); $NT_SV->TimedWait (1);
+ $NM_SV->Kill (); $NM_SV->TimedWait (1);
+ exit 1;
+}
-if ($opt_o)
- {
- $results_directory = PerlACE::LocalFile ($opt_o);
+$process_status = $HP->WaitKill ($high_path->ProcessStopWaitInterval());
+if ($process_status != 0) {
+ print STDERR "ERROR: high path returned $process_status\n";
+ $status = 1;
+}
- if (! -e $results_directory)
- {
- mkdir $results_directory, 0777;
- }
+$NT_SV->Kill ();
+$NM_SV->Kill ();
- print STDERR "Saving results to $results_directory\n";
+if ($opt_o) {
+ print STDERR "Results are not saved in $opt_o\n";
+}
- @list=glob("*.dat");
- for $file (@list)
- {
- move ("$file", "$results_directory/$file");
- }
- }
+$nm_service->DeleteFile($naming_ior);
+$nt_service->DeleteFile($naming_ior);
+$high_path->DeleteFile($naming_ior);
+$other_path->DeleteFile($naming_ior);
+$nt_service->DeleteFile($notify_ior);
+$high_path->DeleteFile($high_path_ior);
+$other_path->DeleteFile($high_path_ior);
exit $status;