summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/RtEC
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-01 09:50:38 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-01 09:50:38 +0000
commit3ea77dfd63b78dc248e5b59c9617f6a6861a6b8a (patch)
tree680b2345c6f6895025861383a0447875a48cd2e5 /TAO/orbsvcs/examples/RtEC
parent649ca8a04517c721c008b891e327cca28cf90470 (diff)
downloadATCD-3ea77dfd63b78dc248e5b59c9617f6a6861a6b8a.tar.gz
Tue Dec 1 09:48:38 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/tests/Log/Basic_Log_Test/run_test.pl: * orbsvcs/tests/Bug_2800_Regression/client.cpp: * orbsvcs/tests/Bug_2800_Regression/run_test_federated.pl: * orbsvcs/tests/Bug_2800_Regression/nsmain.cpp: * orbsvcs/tests/Bug_2800_Regression/run_test.pl: * orbsvcs/tests/Bug_2777_Regression/run_test.pl: * orbsvcs/tests/Bug_3673_Regression/client.cpp: * orbsvcs/tests/Bug_3673_Regression/nsmain.cpp: * orbsvcs/tests/Bug_3673_Regression/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops_RTCORBA/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated_RTCORBA/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/2_Hops/run_test.pl: * orbsvcs/tests/Notify/performance-tests/scripts/Max_Throughput/Colocated/run_test.pl: * orbsvcs/tests/EC_Multiple/run_test.pl: * orbsvcs/tests/Interoperable_Naming/run_test.pl: * orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/run_test.pl: * orbsvcs/examples/ORT/run_test.pl: * orbsvcs/examples/Notify/Subscribe/run_test.pl: * orbsvcs/examples/Notify/ThreadPool/run_test.pl: * orbsvcs/examples/Notify/Lanes/run_test.pl: * orbsvcs/examples/Notify/Filter/run_test.pl: * orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl: * orbsvcs/examples/RtEC/IIOPGateway/run_test.pl: * orbsvcs/examples/RtEC/Simple/run_test.pl: * performance-tests/POA/Create_Reference/run_test.pl: * tests/Faults/run_test_pp.pl: * tests/Faults/run_test.pl: * tests/Muxing/run_test.pl: * tests/Bug_1020_Regression/run_test.pl: * tests/Bug_1551_Regression/run_test.pl: * tests/Bug_2678_Regression/run_test.pl: * tests/MT_Server/run_test.pl: * tests/LongUpcalls/run_test.pl: * tests/Bug_2084_Regression/run_test.pl: * tests/Bug_1482_Regression/run_test.pl: * tests/Bug_3547_Regression/run_test.pl: * tests/Bug_2174_Regression/run_test.pl: * tests/POA/TIE/server.cpp: * tests/POA/TIE/run_test.pl: * tests/MT_BiDir/run_test.pl: * tests/Monitor/Marshal_Buffer/run_test.pl: * tests/Bug_1869_Regression/client.cpp: * tests/Bug_1869_Regression/run_test.pl: * tests/Nested_Upcall_Crash/run_test.pl: * tests/ORB_Local_Config/run_tests_all.pl: * tests/Bug_1269_Regression/run_test.pl: * tests/Forwarding/run_test.pl: * bin/tao_orb_tests.lst: Test are converted to use new test framework and added to fuzz build.
Diffstat (limited to 'TAO/orbsvcs/examples/RtEC')
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl260
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl228
-rwxr-xr-xTAO/orbsvcs/examples/RtEC/Simple/run_test.pl126
3 files changed, 437 insertions, 177 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl b/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl
index cc5e25194a4..a34cba2cb9e 100755
--- a/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/consumerec_crash.pl
@@ -6,145 +6,253 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
$status = 0;
+$debug_level = '0';
-$ns_ior = PerlACE::LocalFile ("ns.ior");
-$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
-$gatewayconffile = PerlACE::LocalFile ("gateway" . "$PerlACE::svcconf_ext");
-
-unlink $ns_ior;
-
-$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
- "-o $ns_ior");
-
-$T1 = new PerlACE::Process ("EC",
- "-ORBInitRef NameService=file://$ns_ior "
- . "-ORBsvcconf $conffile "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplierec.log "
- . "-e channel1 ");
-
-$T2 = new PerlACE::Process ("EC",
- "-ORBInitRef NameService=file://$ns_ior -ORBEndpoint iiop://localhost:6000 "
- . "-ORBsvcconf $conffile "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumerec.log "
- . "-e channel2 ");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
-$G = new PerlACE::Process ("Gateway",
- "-ORBInitRef NameService=file://$ns_ior "
- . "-ORBSvcconf $gatewayconffile "
- . "-c channel2 "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile gateway.log "
- . "-s channel1 ");
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $t1 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $t2 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $g = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $c = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+my $s = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
+
+$nsiorfile = "ns.ior";
+$conffile = "ec" . "$PerlACE::svcconf_ext";
+$gconffile = "gateway" . "$PerlACE::svcconf_ext";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $t1_nsiorfile = $t1->LocalFile ($nsiorfile);
+my $t2_nsiorfile = $t2->LocalFile ($nsiorfile);
+my $g_nsiorfile = $g->LocalFile ($nsiorfile);
+my $c_nsiorfile = $c->LocalFile ($nsiorfile);
+my $s_nsiorfile = $s->LocalFile ($nsiorfile);
+my $t1_conffile = $t1->LocalFile ($conffile);
+my $t2_conffile = $t2->LocalFile ($conffile);
+my $g_gconffile = $g->LocalFile ($gconffile);
+$ns->DeleteFile ($nsiorfile);
+$t1->DeleteFile ($nsiorfile);
+$t2->DeleteFile ($nsiorfile);
+$g->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
+
+$NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service",
+ " -o $ns_nsiorfile");
+
+$T1 = $t1->CreateProcess ("EC",
+ " -ORBInitRef NameService=file://$t1_nsiorfile ".
+ "-ORBsvcconf $t1_conffile ".
+ "-e channel1");
+
+$T2 = $t2->CreateProcess ("EC",
+ " -ORBInitRef NameService=file://$t2_nsiorfile ".
+ "-ORBsvcconf $t2_conffile ".
+ "-e channel2");
+
+$G = $g->CreateProcess ("Gateway",
+ " -ORBInitRef NameService=file://$g_nsiorfile ".
+ "-ORBSvcconf $g_gconffile ".
+ "-c channel2 ".
+ "-s channel1");
+
+$C = $c->CreateProcess ("Consumer",
+ " -ORBInitRef NameService=file://$c_nsiorfile ".
+ "-ORBDebugLevel $debug_level ".
+ "-e channel2");
+
+$S = $s->CreateProcess ("Supplier",
+ " -ORBInitRef NameService=file://$s_nsiorfile ".
+ "-e channel1");
-$C = new PerlACE::Process ("Consumer",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumer.log "
- . "-e channel2 ");
+print STDOUT "Starting name server\n";
+$NS_status = $NS->Spawn ();
-$S = new PerlACE::Process ("Supplier",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplier.log "
- . "-e channel1 ");
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ exit 1;
+}
-print STDOUT "Starting name server\n";
-$NS->Spawn ();
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($ns_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$ns_ior>\n";
- $NS->Kill ();
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($t1->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$t1_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($t2->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$t2_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($g->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$g_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($c->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$c_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($s->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$s_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
}
print STDOUT "Starting event channel 1\n";
-$T1->Spawn ();
+$T1_status = $T1->Spawn ();
+
+if ($T1_status != 0) {
+ print STDERR "ERROR: T1 returned $T1_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting event channel 2\n";
-$T2->Spawn ();
+$T2_status = $T2->Spawn ();
+
+if ($T2_status != 0) {
+ print STDERR "ERROR: T2 returned $T2_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting gateway\n";
-$G->Spawn ();
+$G_status = $G->Spawn ();
+
+if ($G_status != 0) {
+ print STDERR "ERROR: Gateway returned $G_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting consumer\n";
-$C->Spawn ();
+$C_status = $C->Spawn ();
+
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
+ exit 1;
+}
sleep 1;
print STDOUT "Starting supplier\n";
-#$supplier = $S->SpawnWaitKill (12000);
-$S->Spawn();
+$S_status = $S->Spawn ();
+
+if ($S_status != 0) {
+ print STDERR "ERROR: Supplier returned $S_status\n";
+ exit 1;
+}
sleep 1;
+
if ($supplier != 0) {
print STDERR "ERROR: supplier returned $supplier\n";
$status = 1;
}
-#$consumer = $C->WaitKill (10);
-#
-#if ($consumer != 0) {
-# print STDERR "ERROR: consumer returned $consumer\n";
-# $status = 1;
-#}
-
print STDOUT "Terminating event channel 2 and consumer in 10 seconds...\n";
-#$service = $T2->TerminateWaitKill (5);
-$service = $T2->WaitKill (10);
-$C->Kill();
-
-if ($service != 0) {
- print STDERR "ERROR: service returned $service\n";
+$T2_status = $T2->WaitKill ($t2->ProcessStopWaitInterval());
+if ($T2_status != 0) {
+ print STDERR "ERROR: service returned $T2_status\n";
$status = 1;
}
+$C->Kill();
sleep 10;
print STDOUT "Starting event channel 2 again...\n";
-$T2->Spawn ();
+$T2_status = $T2->Spawn ();
+
+if ($T2_status != 0) {
+ print STDERR "ERROR: T2 returned $T2_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting consumer again...\n";
-$C->Spawn ();
+$C_status = $C->Spawn ();
-#$supplier = $C->WaitKill (15);
-#
-#if ($supplier != 0) {
-# print STDERR "ERROR: supplier returned $supplier\n";
-# $status = 1;
-#}
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
+ exit 1;
+}
print STDOUT "1500 seconds before termination...\n";
sleep 1500;
print STDOUT "Terminating supplier...\n";
-$S->TerminateWaitKill (5);
+$S_status = $S->WaitKill ($s->ProcessStopWaitInterval());
+if ($S_status != 0) {
+ print STDERR "ERROR: Supplier returned $S_status\n";
+ $status = 1;
+}
print STDOUT "Terminating consumer...\n";
-$C->TerminateWaitKill (5);
+$C_status = $C->WaitKill ($c->ProcessStopWaitInterval());
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
+ $status = 1;
+}
print STDOUT "Terminating gateway...\n";
-$G->TerminateWaitKill (5);
+$G_status = $G->TerminateWaitKill ($g->ProcessStopWaitInterval());
+
+if ($G_status != 0) {
+ print STDERR "ERROR: Gateway returned $G_status\n";
+ $status = 1;
+}
print STDOUT "Terminating event channels...\n";
-$T1->TerminateWaitKill (5);
-$T2->TerminateWaitKill (5);
+$T1_status = $T1->TerminateWaitKill ($t1->ProcessStopWaitInterval());
+
+if ($T1_status != 0) {
+ print STDERR "ERROR: service returned $T1_status\n";
+ $status = 1;
+}
+
+$T2_status = $T2->TerminateWaitKill ($t2->ProcessStopWaitInterval());
+
+if ($T2_status != 0) {
+ print STDERR "ERROR: service returned $T2_status\n";
+ $status = 1;
+}
-$nserver = $NS->TerminateWaitKill (5);
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
-if ($nserver != 0) {
- print STDERR "ERROR: name server returned $nserver\n";
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
$status = 1;
}
-unlink $ns_ior;
+$ns->DeleteFile ($nsiorfile);
+$t1->DeleteFile ($nsiorfile);
+$t2->DeleteFile ($nsiorfile);
+$g->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
exit $status;
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl b/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl
index 8bef21e4f6c..4a6868692c2 100755
--- a/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl
+++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/run_test.pl
@@ -6,119 +6,215 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
$status = 0;
+$debug_level = '0';
-$ns_ior = PerlACE::LocalFile ("ns.ior");
-$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
-$gatewayconffile = PerlACE::LocalFile ("gateway" . "$PerlACE::svcconf_ext");
-
-unlink $ns_ior;
-
-$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
- "-o $ns_ior ");
-
-$T1 = new PerlACE::Process ("EC",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplierec.log "
- . "-ORBsvcconf $conffile "
- . "-e channel1 ");
-
-$T2 = new PerlACE::Process ("EC",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumerec.log "
- . "-ORBsvcconf $conffile "
- . "-e channel2 ");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
-$G = new PerlACE::Process ("Gateway",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile gateway.log "
- . "-ORBSvcconf $gatewayconffile "
- . "-c channel2 "
- . "-s channel1 ");
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $t1 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $t2 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $g = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
+my $c = PerlACE::TestTarget::create_target (5) || die "Create target 5 failed\n";
+my $s = PerlACE::TestTarget::create_target (6) || die "Create target 6 failed\n";
+
+$nsiorfile = "ns.ior";
+$conffile = "ec" . "$PerlACE::svcconf_ext";
+$gconffile = "gateway" . "$PerlACE::svcconf_ext";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $t1_nsiorfile = $t1->LocalFile ($nsiorfile);
+my $t2_nsiorfile = $t2->LocalFile ($nsiorfile);
+my $g_nsiorfile = $g->LocalFile ($nsiorfile);
+my $c_nsiorfile = $c->LocalFile ($nsiorfile);
+my $s_nsiorfile = $s->LocalFile ($nsiorfile);
+my $t1_conffile = $t1->LocalFile ($conffile);
+my $t2_conffile = $t2->LocalFile ($conffile);
+my $g_gconffile = $g->LocalFile ($gconffile);
+$ns->DeleteFile ($nsiorfile);
+$t1->DeleteFile ($nsiorfile);
+$t2->DeleteFile ($nsiorfile);
+$g->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
+
+$NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service",
+ " -o $ns_nsiorfile");
+
+$T1 = $t1->CreateProcess ("EC",
+ " -ORBInitRef NameService=file://$t1_nsiorfile ".
+ "-ORBsvcconf $t1_conffile ".
+ "-e channel1");
+
+$T2 = $t2->CreateProcess ("EC",
+ " -ORBInitRef NameService=file://$t2_nsiorfile ".
+ "-ORBsvcconf $t2_conffile ".
+ "-e channel2");
+
+$G = $g->CreateProcess ("Gateway",
+ " -ORBInitRef NameService=file://$g_nsiorfile ".
+ "-ORBSvcconf $g_gconffile ".
+ "-c channel2 ".
+ "-s channel1");
+
+$C = $c->CreateProcess ("Consumer",
+ " -ORBInitRef NameService=file://$c_nsiorfile ".
+ "-ORBDebugLevel $debug_level ".
+ "-e channel2");
+
+$S = $s->CreateProcess ("Supplier",
+ " -ORBInitRef NameService=file://$s_nsiorfile ".
+ "-e channel1");
-$C = new PerlACE::Process ("Consumer",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile consumer.log "
- . "-e channel2 ");
+print STDOUT "Starting name server\n";
+$NS_status = $NS->Spawn ();
-$S = new PerlACE::Process ("Supplier",
- "-ORBInitRef NameService=file://$ns_ior "
-# . "-ORBDebug -ORBDebugLevel 10 -ORBLogFile supplier.log "
- . "-e channel1 ");
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ exit 1;
+}
-print STDOUT "Starting name server\n";
-$NS->Spawn ();
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($ns_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$ns_ior>\n";
- $NS->Kill ();
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($t1->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$t1_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($t2->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$t2_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($g->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$g_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($c->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$c_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($s->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$s_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
}
print STDOUT "Starting event channel 1\n";
-$T1->Spawn ();
+$T1_status = $T1->Spawn ();
+
+if ($T1_status != 0) {
+ print STDERR "ERROR: T1 returned $T1_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting event channel 2\n";
-$T2->Spawn ();
+$T2_status = $T2->Spawn ();
+
+if ($T2_status != 0) {
+ print STDERR "ERROR: T2 returned $T2_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting gateway\n";
-$G->Spawn ();
+$G_status = $G->Spawn ();
+
+if ($G_status != 0) {
+ print STDERR "ERROR: Gateway returned $G_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting consumer\n";
-$C->Spawn ();
+$C_status = $C->Spawn ();
+
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
+ exit 1;
+}
sleep 1;
print STDOUT "Starting supplier\n";
-#$supplier = $S->SpawnWaitKill (12000);
-$S->Spawn();
+$S_status = $S->Spawn ();
+
+if ($S_status != 0) {
+ print STDERR "ERROR: Supplier returned $S_status\n";
+ exit 1;
+}
sleep 1;
-if ($supplier != 0) {
- print STDERR "ERROR: supplier returned $supplier\n";
+$C_status = $C->WaitKill ($c->ProcessStopWaitInterval());
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
$status = 1;
}
-$consumer = $C->WaitKill (10);
+$T2_status = $T2->TerminateWaitKill ($t2->ProcessStopWaitInterval());
-if ($consumer != 0) {
- print STDERR "ERROR: consumer returned $consumer\n";
+if ($T2_status != 0) {
+ print STDERR "ERROR: service returned $T2_status\n";
$status = 1;
}
-$service = $T2->TerminateWaitKill (5);
+print STDOUT "15 seconds before termination...\n";
+sleep 15;
-if ($service != 0) {
- print STDERR "ERROR: service returned $service\n";
+$S_status = $S->WaitKill ($s->ProcessStopWaitInterval());
+if ($S_status != 0) {
+ print STDERR "ERROR: Supplier returned $S_status\n";
$status = 1;
}
-#$supplier = $C->WaitKill (15);
-#
-#if ($supplier != 0) {
-# print STDERR "ERROR: supplier returned $supplier\n";
-# $status = 1;
-#}
+$T1_status = $T1->TerminateWaitKill ($t1->ProcessStopWaitInterval());
-print STDOUT "15 seconds before termination...\n";
-sleep 15;
+if ($T1_status != 0) {
+ print STDERR "ERROR: service returned $T1_status\n";
+ $status = 1;
+}
+
+$G_status = $G->TerminateWaitKill ($g->ProcessStopWaitInterval());
+
+if ($G_status != 0) {
+ print STDERR "ERROR: Gateway returned $G_status\n";
+ $status = 1;
+}
-$nserver = $NS->TerminateWaitKill (5);
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
-if ($nserver != 0) {
- print STDERR "ERROR: name server returned $nserver\n";
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
$status = 1;
}
-unlink $ns_ior;
+$ns->DeleteFile ($nsiorfile);
+$t1->DeleteFile ($nsiorfile);
+$t2->DeleteFile ($nsiorfile);
+$g->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
exit $status;
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl b/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl
index 76e90d89f72..c481f933413 100755
--- a/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl
+++ b/TAO/orbsvcs/examples/RtEC/Simple/run_test.pl
@@ -6,78 +6,134 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
# -*- perl -*-
use lib "$ENV{ACE_ROOT}/bin";
-use PerlACE::Run_Test;
+use PerlACE::TestTarget;
$status = 0;
+$debug_level = '0';
-$ns_ior = PerlACE::LocalFile ("ns.ior");
-$conffile = PerlACE::LocalFile ("ec" . "$PerlACE::svcconf_ext");
+foreach $i (@ARGV) {
+ if ($i eq '-debug') {
+ $debug_level = '10';
+ }
+}
+
+my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
+my $t = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
+my $c = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
+my $s = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n";
-unlink $ns_ior;
+$nsiorfile = "ns.ior";
+$conffile = "ec" . "$PerlACE::svcconf_ext";
-$NS = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
- "-o $ns_ior ");
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $t_nsiorfile = $t->LocalFile ($nsiorfile);
+my $c_nsiorfile = $c->LocalFile ($nsiorfile);
+my $s_nsiorfile = $s->LocalFile ($nsiorfile);
+my $t_conffile = $t->LocalFile ($conffile);
+$ns->DeleteFile ($nsiorfile);
+$t->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
-$T = new PerlACE::Process ("Service",
- "-ORBInitRef NameService=file://$ns_ior "
- . "-ORBsvcconf $conffile");
+$NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service",
+ " -o $ns_nsiorfile");
-$C = new PerlACE::Process ("Consumer",
- "-ORBInitRef NameService=file://$ns_ior ");
+$T = $t->CreateProcess ("Service",
+ " -ORBInitRef NameService=file://$t_nsiorfile ".
+ "-ORBsvcconf $t_conffile ");
-$S = new PerlACE::Process ("Supplier",
- "-ORBInitRef NameService=file://$ns_ior ");
+$C = $c->CreateProcess ("Consumer",
+ " -ORBInitRef NameService=file://$c_nsiorfile ");
+$S = $s->CreateProcess ("Supplier",
+ " -ORBInitRef NameService=file://$s_nsiorfile ");
print STDOUT "Starting name server\n";
-$NS->Spawn ();
+$NS_status = $NS->Spawn ();
+
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ exit 1;
+}
+
+if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()) == -1) {
+ print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
-if (PerlACE::waitforfile_timed ($ns_ior, $PerlACE::wait_interval_for_process_creation) == -1) {
- print STDERR "ERROR: cannot find file <$ns_ior>\n";
- $NS->Kill ();
+if ($ns->GetFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($t->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$t_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($c->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$c_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+if ($s->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$s_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
exit 1;
}
print STDOUT "Starting event server\n";
-$T->Spawn ();
+$T_status = $T->Spawn ();
+
+if ($T_status != 0) {
+ print STDERR "ERROR: Service returned $T_status\n";
+ exit 1;
+}
sleep 2;
print STDOUT "Starting consumer\n";
-$C->Spawn ();
+$C_status = $C->Spawn ();
+
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
+ exit 1;
+}
sleep 1;
print STDOUT "Starting supplier\n";
-$supplier = $S->SpawnWaitKill (120);
-
-if ($supplier != 0) {
- print STDERR "ERROR: supplier returned $supplier\n";
- $status = 1;
+$S_status = $S->SpawnWaitKill ($s->ProcessStopWaitInterval()+105);
+if ($S_status != 0) {
+ print STDERR "ERROR: Supplier returned $S_status\n";
+ exit 1;
}
-$consumer = $C->WaitKill (15);
-
-if ($consumer != 0) {
- print STDERR "ERROR: consumer returned $consumer\n";
+$C_status = $C->WaitKill ($c->ProcessStopWaitInterval());
+if ($C_status != 0) {
+ print STDERR "ERROR: Consumer returned $C_status\n";
$status = 1;
}
-$service = $T->TerminateWaitKill (5);
+$T_status = $T->TerminateWaitKill ($t->ProcessStopWaitInterval());
-if ($service != 0) {
- print STDERR "ERROR: service returned $service\n";
+if ($T_status != 0) {
+ print STDERR "ERROR: service returned $T_status\n";
$status = 1;
}
-$nserver = $NS->TerminateWaitKill (5);
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
-if ($nserver != 0) {
- print STDERR "ERROR: name server returned $nserver\n";
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
$status = 1;
}
-unlink $ns_ior;
+$ns->DeleteFile ($nsiorfile);
+$t->DeleteFile ($nsiorfile);
+$c->DeleteFile ($nsiorfile);
+$s->DeleteFile ($nsiorfile);
exit $status;