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 $experiment_timeout = 60;
26 $startup_timeout = 60;
28 $nsiorfile = "naming.ior";
29 $nfsiorfile = "notify.ior";
30 my $svcconffile = "adminproperties.conf";
32 my $ns_nsiorfile = $ns->LocalFile ($nsiorfile);
33 my $nfs_nsiorfile = $nfs->LocalFile ($nsiorfile);
34 my $test_nsiorfile = $test->LocalFile ($nsiorfile);
35 my $nfs_nfsiorfile = $nfs->LocalFile ($nfsiorfile);
36 my $test_svcconffile = $test->LocalFile ($svcconffile);
37 $ns->DeleteFile ($nsiorfile);
38 $nfs->DeleteFile ($nsiorfile);
39 $test->DeleteFile ($nsiorfile);
40 $nfs->DeleteFile ($nfsiorfile);
43 name
=> "AdminProperties",
44 args
=> "-ORBSvcConf $test_svcconffile -ORBConnectIPV6Only 1",
46 name
=> "ConnectDisconnect",
47 args
=> "-ORBConnectIPV6Only 1",
51 args
=> "-ORBConnectIPV6Only 1",
53 name
=> "IdAssignment",
54 args
=> "-ORBConnectIPV6Only 1",
57 args
=> "-ORBConnectIPV6Only 1",
60 args
=> "-ORBConnectIPV6Only 1",
63 args
=> "-ORBConnectIPV6Only 1",
66 args
=> "-ORBConnectIPV6Only 1",
69 args
=> "-ORBConnectIPV6Only 1",
72 args
=> "-ORBConnectIPV6Only 1",
75 @default_test_configs = (
77 "notify.reactive.conf",
82 @test_configs = @default_test_configs;
85 @test_configs = @ARGV;
88 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
91 $NS_status = $NS->Spawn ();
92 if ($NS_status != 0) {
93 print STDERR
"ERROR: Name Service returned $NS_status\n";
96 if ($ns->WaitForFileTimed ($nsiorfile,$ns->ProcessStartWaitInterval()+$startup_timeout) == -1) {
97 print STDERR
"ERROR: cannot find file <$ns_nsiorfile>\n";
98 $NS->Kill (); $NS->TimedWait (1);
101 if ($ns->GetFile ($nsiorfile) == -1) {
102 print STDERR
"ERROR: cannot retrieve file <$ns_nsiorfile>\n";
103 $NS->Kill (); $NS->TimedWait (1);
106 if ($nfs->PutFile ($nsiorfile) == -1) {
107 print STDERR
"ERROR: cannot set file <$nfs_nsiorfile>\n";
108 $NS->Kill (); $NS->TimedWait (1);
111 if ($test->PutFile ($nsiorfile) == -1) {
112 print STDERR
"ERROR: cannot set file <$test_nsiorfile>\n";
113 $NS->Kill (); $NS->TimedWait (1);
117 for $dispatch_opt ("", "-UseSeparateDispatchingOrb 1") {
119 for $config (@test_configs) {
120 if ($dispatch_opt =~ /UseSeparateDispatchingORB 1/i
121 && ($config =~ /\.(reactive|rt)\./)) {
122 print STDERR
"\nSkipping $config; not supported with $dispatch_opt\n\n";
126 print STDERR
"\nTesting Notification Service with config file = $config ....\n\n";
128 my $nfs_config = $nfs->LocalFile ($config);
130 $NFS = $nfs->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Notify_Service/tao_cosnotification",
131 ' '.$dispatch_opt.' '.
132 "-ORBInitRef NameService=file://$nfs_nsiorfile " .
133 "-IORoutput $nfs_nfsiorfile " .
134 "-ORBSvcConf $nfs_config ".
135 "-ORBListenEndpoints iiop://1.2@[::1]");
136 $nfs->DeleteFile ($nfsiorfile);
137 $NFS_status = $NFS->Spawn ();
138 if ($NFS_status != 0) {
139 print STDERR
"ERROR: Notify Service returned $NFS_status\n";
140 $NS->Kill (); $NS->TimedWait (1);
141 $NFS->Kill (); $NFS->TimedWait (1);
144 if ($nfs->WaitForFileTimed ($nfsiorfile,$nfs->ProcessStartWaitInterval()+$startup_timeout) == -1) {
145 print STDERR
"ERROR: cannot find file <$nfs_nfsiorfile>\n";
146 $NS->Kill (); $NS->TimedWait (1);
147 $NFS->Kill (); $NFS->TimedWait (1);
153 ## The MaxQueueLength and MaxEventsPerConsumer are not supported in the Reactive
154 ## configuration, so we skip this test for now.
155 ## The Notification should actually throw an exception for the property not supported.
156 if ($name->{name
} eq "AdminProperties"
157 && ($config eq "notify.reactive.conf" || $config eq "notify.rt.conf")) {
161 print STDERR
"\nTesting $name->{name}....\n\n";
162 $TEST = $test->CreateProcess ("./$name->{name}",
163 "-ORBInitRef NameService=file://$test_nsiorfile " .
165 $TEST_status = $TEST->Spawn ();
166 if ($TEST_status != 0) {
167 print STDERR
"ERROR: Test returned $TEST_status\n";
168 $TEST->Kill (); $TEST->TimedWait (1);
169 $NFS->Kill (); $NFS->TimedWait (1);
170 $NS->Kill (); $NS->TimedWait (1);
174 $TEST_status = $TEST->WaitKill ($test->ProcessStartWaitInterval()+$experiment_timeout +
175 (defined $name->{extra
} ?
176 $name->{extra
} : 0));
177 if ($TEST_status != 0) {
178 print STDERR
"ERROR: $name->{name} returned $TEST_status\n";
179 $TEST->Kill (); $TEST->TimedWait (1);
183 $NFS_status = $NFS->Kill ($nfs->ProcessStopWaitInterval());
184 if ($NFS_status != 0) {
185 print STDERR
"ERROR: Notify Service returned $NFS_status\n";
186 $NFS->Kill (); $NFS->TimedWait (1);
187 $NS->Kill (); $NS->TimedWait (1);
194 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
195 if ($NS_status != 0) {
196 print STDERR
"ERROR: Name Service returned $NS_status\n";
200 $ns->DeleteFile ($nsiorfile);
201 $nfs->DeleteFile ($nsiorfile);
202 $test->DeleteFile ($nsiorfile);
203 $nfs->DeleteFile ($nfsiorfile);