Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / run_test_ipv6.pl
blob1f699934ef00626bf260fb0db4d6013dabb482c1
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $ns = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $nfs = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
21 my $test = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
23 $test->AddLibPath ('../lib');
25 PerlACE::check_privilege_group();
27 $experiment_timeout = 60;
28 $startup_timeout = 60;
30 $nsiorfile = "naming.ior";
31 $nfsiorfile = "notify.ior";
32 my $svcconffile = "adminproperties.conf";
34 my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
35 my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
36 my $test_nsiorfile = $test->LocalFile ($nsiorfile);
37 my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
38 my $test_svcconffile = $test->LocalFile ($svcconffile);
39 $ns->DeleteFile ($nsiorfile);
40 $nfs->DeleteFile ($nsiorfile);
41 $test->DeleteFile ($nsiorfile);
42 $nfs->DeleteFile ($nfsiorfile);
44 @tests = ( {
45 name => "AdminProperties",
46 args => "-ORBSvcConf $test_svcconffile -ORBConnectIPV6Only 1",
47 }, {
48 name => "ConnectDisconnect",
49 args => "-ORBConnectIPV6Only 1",
50 extra => 300,
51 }, {
52 name => "Events",
53 args => "-ORBConnectIPV6Only 1",
54 }, {
55 name => "IdAssignment",
56 args => "-ORBConnectIPV6Only 1",
57 }, {
58 name => "LifeCycle",
59 args => "-ORBConnectIPV6Only 1",
60 }, {
61 name => "Simple",
62 args => "-ORBConnectIPV6Only 1",
63 }, {
64 name => "MultiTypes",
65 args => "-ORBConnectIPV6Only 1",
66 }, {
67 name => "Filter",
68 args => "-ORBConnectIPV6Only 1",
69 }, {
70 name => "Updates",
71 args => "-ORBConnectIPV6Only 1",
72 }, {
73 name => "Sequence",
74 args => "-ORBConnectIPV6Only 1",
75 }, );
77 @default_test_configs = (
78 "notify.rt.conf",
79 "notify.reactive.conf",
80 "notify.mt.conf"
83 if ($#ARGV == -1) {
84 @test_configs = @default_test_configs;
86 else {
87 @test_configs = @ARGV;
90 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
91 "-o $ns_nsiorfile");
93 $NS_status = $NS->Spawn ();
94 if ($NS_status != 0) {
95 print STDERR "ERROR: Name Service returned $NS_status\n";
96 exit 1;
98 if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
99 print STDERR "ERROR: cannot find file <$ns_nsiorfile>\n";
100 $NS->Kill (); $NS->TimedWait (1);
101 exit 1;
103 if ($ns->GetFile ($nsiorfile) == -1) {
104 print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
105 $NS->Kill (); $NS->TimedWait (1);
106 exit 1;
108 if ($nfs->PutFile ($nsiorfile) == -1) {
109 print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
110 $NS->Kill (); $NS->TimedWait (1);
111 exit 1;
113 if ($test->PutFile ($nsiorfile) == -1) {
114 print STDERR "ERROR: cannot set file <$test_nsiorfile>\n";
115 $NS->Kill (); $NS->TimedWait (1);
116 exit 1;
119 for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1") {
121 for $config (@test_configs) {
122 if ($dispatch_opt =~ /UseSeparateDispatchingORB 1/i
123 && ($config =~ /\.(reactive|rt)\./)) {
124 print STDERR "\nSkipping $config; not supported with $dispatch_opt\n\n";
125 next;
128 print STDERR "\nTesting Notification Service with config file = $config ....\n\n";
130 my $nfs_config = $nfs->LocalFile ($config);
132 $NFS = $nfs->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Notify_Service/tao_cosnotification",
133 ' '.$dispatch_opt.' '.
134 "-ORBInitRef NameService=file://$nfs_nsiorfile " .
135 "-IORoutput $nfs_nfsiorfile " .
136 "-ORBSvcConf $nfs_config ".
137 "-ORBListenEndpoints iiop://1.2@[::1]");
138 $nfs->DeleteFile ($nfsiorfile);
139 $NFS_status = $NFS->Spawn ();
140 if ($NFS_status != 0) {
141 print STDERR "ERROR: Notify Service returned $NFS_status\n";
142 $NS->Kill (); $NS->TimedWait (1);
143 $NFS->Kill (); $NFS->TimedWait (1);
144 exit 1;
146 if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
147 print STDERR "ERROR: cannot find file <$nfs_nfsiorfile>\n";
148 $NS->Kill (); $NS->TimedWait (1);
149 $NFS->Kill (); $NFS->TimedWait (1);
150 exit 1;
153 for $name (@tests) {
154 $status = 0;
155 ## The MaxQueueLength and MaxEventsPerConsumer are not supported in the Reactive
156 ## configuration, so we skip this test for now.
157 ## The Notification should actually throw an exception for the property not supported.
158 if ($name->{name} eq "AdminProperties"
159 && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf")) {
160 next;
163 print STDERR "\nTesting $name->{name}....\n\n";
164 $TEST = $test->CreateProcess ("./$name->{name}",
165 "-ORBInitRef NameService=file://$test_nsiorfile " .
166 "$name->{args} ");
167 $TEST_status = $TEST->Spawn ();
168 if ($TEST_status != 0) {
169 print STDERR "ERROR: Test returned $TEST_status\n";
170 $TEST->Kill (); $TEST->TimedWait (1);
171 $NFS->Kill (); $NFS->TimedWait (1);
172 $NS->Kill (); $NS->TimedWait (1);
173 exit 1;
176 $TEST_status = $TEST->WaitKill ($test->ProcessStartWaitInterval()+$experiment_timeout +
177 (defined $name->{extra} ?
178 $name->{extra} : 0));
179 if ($TEST_status != 0) {
180 print STDERR "ERROR: $name->{name} returned $TEST_status\n";
181 $TEST->Kill (); $TEST->TimedWait (1);
185 $NFS_status = $NFS->Kill ($nfs->ProcessStopWaitInterval());
186 if ($NFS_status != 0) {
187 print STDERR "ERROR: Notify Service returned $NFS_status\n";
188 $NFS->Kill (); $NFS->TimedWait (1);
189 $NS->Kill (); $NS->TimedWait (1);
190 exit 1;
196 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
197 if ($NS_status != 0) {
198 print STDERR "ERROR: Name Service returned $NS_status\n";
199 $status = 1;
202 $ns->DeleteFile ($nsiorfile);
203 $nfs->DeleteFile ($nsiorfile);
204 $test->DeleteFile ($nsiorfile);
205 $nfs->DeleteFile ($nfsiorfile);
207 exit $status;