summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/Basic
diff options
context:
space:
mode:
authordbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-07 10:41:54 +0000
committerdbudko <dbudko@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-12-07 10:41:54 +0000
commitcc9d9f2fc4745f9ea5f8e1b01c9a026d674f933e (patch)
tree196c5de6a487aa8db71d37c42d5f20bdae42907e /TAO/orbsvcs/tests/Notify/Basic
parentc6229addf4bc897b263be0d4d8de565af15edbd4 (diff)
downloadATCD-cc9d9f2fc4745f9ea5f8e1b01c9a026d674f933e.tar.gz
Mon Dec 7 10:40:49 UTC 2009 Denis Budko <denis.budko@remedy.nl>
* orbsvcs/tests/Notify/Basic/run_test_ipv6.pl: * bin/tao_other_tests.lst: Test is converted to use new test framework and added to fuzz build.
Diffstat (limited to 'TAO/orbsvcs/tests/Notify/Basic')
-rwxr-xr-xTAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl228
1 files changed, 138 insertions, 90 deletions
diff --git a/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
index 113c5a716d7..e79866d9f82 100755
--- a/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
+++ b/TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl
@@ -6,7 +6,20 @@ 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';
+
+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 $test = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
PerlACE::add_lib_path ('../lib');
@@ -14,147 +27,182 @@ PerlACE::check_privilege_group();
$experiment_timeout = 60;
$startup_timeout = 60;
-$notifyior = PerlACE::LocalFile ("notify.ior");
-$namingior = PerlACE::LocalFile ("naming.ior");
-$status = 0;
-@tests =
- (
- {
+$nsiorfile = "naming.ior";
+$nfsiorfile = "notify.ior";
+my $svcconffile = "adminproperties.conf";
+
+my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
+my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
+my $test_nsiorfile = $test->LocalFile ($nsiorfile);
+my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
+my $test_svcconffile = $test->LocalFile ($svcconffile);
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$test->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
+
+@tests = ( {
name => "AdminProperties",
- args => "-ORBSvcConf adminproperties.conf -ORBConnectIPV6Only 1",
- },
- {
+ args => "-ORBSvcConf $test_svcconffile -ORBConnectIPV6Only 1",
+ }, {
name => "ConnectDisconnect",
args => "-ORBConnectIPV6Only 1",
extra => 300,
- },
- {
+ }, {
name => "Events",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "IdAssignment",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "LifeCycle",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "Simple",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "MultiTypes",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "Filter",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "Updates",
args => "-ORBConnectIPV6Only 1",
- },
- {
+ }, {
name => "Sequence",
args => "-ORBConnectIPV6Only 1",
- },
- );
+ }, );
-@default_test_configs =
- (
+@default_test_configs = (
"notify.rt.conf",
"notify.reactive.conf",
- "notify.mt.conf",
- );
+ "notify.mt.conf"
+);
-if ($#ARGV == -1)
- {
+if ($#ARGV == -1) {
@test_configs = @default_test_configs;
- }
-else
- {
+}
+else {
@test_configs = @ARGV;
- }
-
-$Naming = new PerlACE::Process ("../../../Naming_Service/Naming_Service",
- "-o $namingior");
-unlink $namingior;
+}
-$Naming->Spawn ();
+$NS = $ns->CreateProcess ("../../../Naming_Service/Naming_Service",
+ "-o $ns_nsiorfile");
-if (PerlACE::waitforfile_timed ($namingior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the naming service to start\n";
- $Naming->Kill ();
- exit 1;
+$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()+$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 ($test->PutFile ($nsiorfile) == -1) {
+ print STDERR "ERROR: cannot set file <$test_nsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+}
+
+for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1") {
-for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1")
-{
-for $config (@test_configs)
- {
+for $config (@test_configs) {
if ($dispatch_opt =~ /UseSeparateDispatchingORB 1/i
- && ($config =~ /\.(reactive|rt)\./))
- {
+ && ($config =~ /\.(reactive|rt)\./)) {
print STDERR "\nSkipping $config; not supported with $dispatch_opt\n\n";
next;
}
print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
-
- $Notification = new PerlACE::Process ("../../../Notify_Service/Notify_Service",
- ' '.$dispatch_opt.' '.
- "-ORBInitRef NameService=file://$namingior " .
- "-IORoutput $notifyior " .
- "-ORBSvcConf $config " .
- "-ORBListenEndpoints iiop://1.2@[::1]");
- unlink $notifyior;
- $Notification->Spawn ();
-
- if (PerlACE::waitforfile_timed ($notifyior, $startup_timeout) == -1) {
- print STDERR "ERROR: waiting for the notify service to start\n";
- $Notification->Kill ();
- $Naming->Kill ();
- exit 1;
+
+ my $nfs_config = $nfs->LocalFile ($config);
+
+ $NFS = $nfs->CreateProcess ("../../../Notify_Service/Notify_Service",
+ ' '.$dispatch_opt.' '.
+ "-ORBInitRef NameService=file://$nfs_nsiorfile " .
+ "-IORoutput $nfs_nfsiorfile " .
+ "-ORBSvcConf $nfs_config ".
+ "-ORBListenEndpoints iiop://1.2@[::1]");
+ $nfs->DeleteFile ($nfsiorfile);
+ $NFS_status = $NFS->Spawn ();
+ if ($NFS_status != 0) {
+ print STDERR "ERROR: Notify Service returned $NFS_status\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ exit 1;
+ }
+ if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
+ print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
+ $NS->Kill (); $NS->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ exit 1;
}
- for $name (@tests)
- {
+ for $name (@tests) {
+ $status = 0;
## The MaxQueueLength and MaxEventsPerConsumer are not supported in the Reactive
## configuration, so we skip this test for now.
## The Notification should actually throw an exception for the property not supported.
if ($name->{name} eq "AdminProperties"
- && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf"))
- {
+ && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf")) {
next;
}
print STDERR "\nTesting $name->{name}....\n\n";
- $test = new PerlACE::Process ("./$name->{name}",
- "-ORBInitRef NameService=file://$namingior " .
+ $TEST = $test->CreateProcess ("./$name->{name}",
+ "-ORBInitRef NameService=file://$test_nsiorfile " .
"$name->{args} ");
- $test->Spawn ();
-
- $status = $test->WaitKill ($experiment_timeout +
- (defined $name->{extra} ?
- $name->{extra} : 0));
+ $TEST_status = $TEST->Spawn ();
+ if ($TEST_status != 0) {
+ print STDERR "ERROR: Test returned $TEST_status\n";
+ $TEST->Kill (); $TEST->TimedWait (1);
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+ }
+
+ $TEST_status = $TEST->WaitKill ($test->ProcessStartWaitInterval()+$experiment_timeout +
+ (defined $name->{extra} ?
+ $name->{extra} : 0));
+ if ($TEST_status != 0) {
+ print STDERR "ERROR: $name->{name} returned $TEST_status\n";
+ $TEST->Kill (); $TEST->TimedWait (1);
+ }
+ }
- if ($status != 0)
- {
- print STDERR "ERROR: $name->{name} returned $status\n";
- break;
- }
- }
+ $NFS_status = $NFS->Kill ($nfs->ProcessStopWaitInterval());
+ if ($NFS_status != 0) {
+ print STDERR "ERROR: Notify Service returned $NFS_status\n";
+ $NFS->Kill (); $NFS->TimedWait (1);
+ $NS->Kill (); $NS->TimedWait (1);
+ exit 1;
+ }
- $Notification->Kill ();
- }
+}
}
-$Naming->Kill ();
+$NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
+if ($NS_status != 0) {
+ print STDERR "ERROR: Name Service returned $NS_status\n";
+ $status = 1;
+}
-unlink $namingior;
-unlink $notifyior;
+$ns->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nsiorfile);
+$test->DeleteFile ($nsiorfile);
+$nfs->DeleteFile ($nfsiorfile);
exit $status;