1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
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);
45 name
=> "AdminProperties",
46 args
=> "-ORBSvcConf $test_svcconffile -ORBConnectIPV6Only 1",
48 name
=> "ConnectDisconnect",
49 args
=> "-ORBConnectIPV6Only 1",
53 args
=> "-ORBConnectIPV6Only 1",
55 name
=> "IdAssignment",
56 args
=> "-ORBConnectIPV6Only 1",
59 args
=> "-ORBConnectIPV6Only 1",
62 args
=> "-ORBConnectIPV6Only 1",
65 args
=> "-ORBConnectIPV6Only 1",
68 args
=> "-ORBConnectIPV6Only 1",
71 args
=> "-ORBConnectIPV6Only 1",
74 args
=> "-ORBConnectIPV6Only 1",
77 @default_test_configs = (
79 "notify.reactive.conf",
84 @test_configs = @default_test_configs;
87 @test_configs = @ARGV;
90 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
93 $NS_status = $NS->Spawn ();
94 if ($NS_status != 0) {
95 print STDERR
"ERROR: Name Service returned $NS_status\n";
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);
103 if ($ns->GetFile ($nsiorfile) == -1) {
104 print STDERR
"ERROR: cannot retrieve file <$ns_nsiorfile>\n";
105 $NS->Kill (); $NS->TimedWait (1);
108 if ($nfs->PutFile ($nsiorfile) == -1) {
109 print STDERR
"ERROR: cannot set file <$nfs_nsiorfile>\n";
110 $NS->Kill (); $NS->TimedWait (1);
113 if ($test->PutFile ($nsiorfile) == -1) {
114 print STDERR
"ERROR: cannot set file <$test_nsiorfile>\n";
115 $NS->Kill (); $NS->TimedWait (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";
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);
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);
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")) {
163 print STDERR
"\nTesting $name->{name}....\n\n";
164 $TEST = $test->CreateProcess ("./$name->{name}",
165 "-ORBInitRef NameService=file://$test_nsiorfile " .
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);
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);
196 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
197 if ($NS_status != 0) {
198 print STDERR
"ERROR: Name Service returned $NS_status\n";
202 $ns->DeleteFile ($nsiorfile);
203 $nfs->DeleteFile ($nsiorfile);
204 $test->DeleteFile ($nsiorfile);
205 $nfs->DeleteFile ($nfsiorfile);