Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / orbsvcs / tests / Notify / Basic / run_test_ipv6.pl
blobd8abc1dad28856fdb2841c2e2c2399e6d4f0a81b
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 $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);
42 @tests = ( {
43 name => "AdminProperties",
44 args => "-ORBSvcConf $test_svcconffile -ORBConnectIPV6Only 1",
45 }, {
46 name => "ConnectDisconnect",
47 args => "-ORBConnectIPV6Only 1",
48 extra => 300,
49 }, {
50 name => "Events",
51 args => "-ORBConnectIPV6Only 1",
52 }, {
53 name => "IdAssignment",
54 args => "-ORBConnectIPV6Only 1",
55 }, {
56 name => "LifeCycle",
57 args => "-ORBConnectIPV6Only 1",
58 }, {
59 name => "Simple",
60 args => "-ORBConnectIPV6Only 1",
61 }, {
62 name => "MultiTypes",
63 args => "-ORBConnectIPV6Only 1",
64 }, {
65 name => "Filter",
66 args => "-ORBConnectIPV6Only 1",
67 }, {
68 name => "Updates",
69 args => "-ORBConnectIPV6Only 1",
70 }, {
71 name => "Sequence",
72 args => "-ORBConnectIPV6Only 1",
73 }, );
75 @default_test_configs = (
76 "notify.rt.conf",
77 "notify.reactive.conf",
78 "notify.mt.conf"
81 if ($#ARGV == -1) {
82 @test_configs = @default_test_configs;
84 else {
85 @test_configs = @ARGV;
88 $NS = $ns->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
89 "-o $ns_nsiorfile");
91 $NS_status = $NS->Spawn ();
92 if ($NS_status != 0) {
93 print STDERR "ERROR: Name Service returned $NS_status\n";
94 exit 1;
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);
99 exit 1;
101 if ($ns->GetFile ($nsiorfile) == -1) {
102 print STDERR "ERROR: cannot retrieve file <$ns_nsiorfile>\n";
103 $NS->Kill (); $NS->TimedWait (1);
104 exit 1;
106 if ($nfs->PutFile ($nsiorfile) == -1) {
107 print STDERR "ERROR: cannot set file <$nfs_nsiorfile>\n";
108 $NS->Kill (); $NS->TimedWait (1);
109 exit 1;
111 if ($test->PutFile ($nsiorfile) == -1) {
112 print STDERR "ERROR: cannot set file <$test_nsiorfile>\n";
113 $NS->Kill (); $NS->TimedWait (1);
114 exit 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";
123 next;
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);
142 exit 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);
148 exit 1;
151 for $name (@tests) {
152 $status = 0;
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")) {
158 next;
161 print STDERR "\nTesting $name->{name}....\n\n";
162 $TEST = $test->CreateProcess ("./$name->{name}",
163 "-ORBInitRef NameService=file://$test_nsiorfile " .
164 "$name->{args} ");
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);
171 exit 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);
188 exit 1;
194 $NS_status = $NS->TerminateWaitKill ($ns->ProcessStopWaitInterval());
195 if ($NS_status != 0) {
196 print STDERR "ERROR: Name Service returned $NS_status\n";
197 $status = 1;
200 $ns->DeleteFile ($nsiorfile);
201 $nfs->DeleteFile ($nsiorfile);
202 $test->DeleteFile ($nsiorfile);
203 $nfs->DeleteFile ($nfsiorfile);
205 exit $status;