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 $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 my $iorbase = "server.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
29 $server_arg = "-ORBdebuglevel $debug_level -o $server_iorfile -ORBUseSharedProfile 0 ";
30 $client_arg = "-k file://$client_iorfile ";
34 description
=> "Testing server with '-ORBConnectIPV6Only 1'.\n",
35 server
=> "$server_arg -ORBConnectIPV6Only 1",
36 client
=> "$client_arg",
41 description
=> "Testing client with '-ORBPreferIPV6Interfaces 1'.\n",
42 server
=> "$server_arg ",
43 client
=> "$client_arg -ORBPreferIPV6Interfaces 1",
48 description
=> "Testing IPV4 server with client with '-ORBConnectIPV6Only 1'.\n",
49 server
=> "$server_arg -ORBListenEndpoints iiop://127.0.0.1",
50 client
=> "$client_arg -x -ORBConnectIPV6Only 1",
55 description
=> "Testing IPV4 server with client with '-ORBPreferIPV6Interfaces 1'.\n",
56 server
=> "$server_arg -ORBListenEndpoints iiop://127.0.0.1",
57 client
=> "$client_arg -ORBPreferIPV6Interfaces 1",
62 description
=> "Testing IPV4 server with client and URL-style IOR",
63 server
=> "$server_arg -ORBListenEndpoints iiop://0.0.0.0 -ORBObjRefStyle url",
64 client
=> "$client_arg",
69 description
=> "Testing IPV4 server with client and IPV6-forced URL",
70 server
=> "$server_arg -ORBListenEndpoints iiop://0.0.0.0 -ORBObjRefStyle url",
74 url_address
=> "corbaloc:iiop:1.2\@[::1]:",
76 description
=> "Testing IPV6 server with client and IPV4-forced URL",
77 server
=> "$server_arg -ORBListenEndpoints iiop://[::1] -ORBObjRefStyle url",
81 url_address
=> "corbaloc:iiop:1.2\@127.0.0.1:",
83 description
=> "Testing IPV6Only server with client and IPV4-forced URL",
84 server
=> "$server_arg -ORBConnectIPV6Only 1 -ORBObjRefStyle url",
88 url_address
=> "corbaloc:iiop:1.2\@127.0.0.1:",
90 description
=> "Testing server with client and IPV4-forced URL",
91 server
=> "$server_arg -ORBObjRefStyle url",
95 url_address
=> "corbaloc:iiop:1.2\@127.0.0.1:",
102 my $server_args = $_[0]->{server
};
103 my $client_args = $_[0]->{client
};
104 my $error = $_[0]->{error
};
107 print STDERR
"\n******************************************************\n";
108 print $_[0]->{description
};
110 print "\nRunning server with the following args:\n$server_args\n\n";
112 $SV = $server->CreateProcess ("server", $server_args);
113 $server_status = $SV->Spawn ();
115 if ($server_status != 0) {
116 print STDERR
"ERROR: server returned $server_status\n";
120 if ($server->WaitForFileTimed ($iorbase,
121 $server->ProcessStartWaitInterval()) == -1) {
122 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
123 $SV->Kill (); $SV->TimedWait (1);
127 if ($server->GetFile ($iorbase) == -1) {
128 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
129 $SV->Kill (); $SV->TimedWait (1);
133 if ($client->PutFile ($iorbase) == -1) {
134 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
135 $SV->Kill (); $SV->TimedWait (1);
141 open $fh, $client_iorfile;
145 print "Changing corbaloc url from:\n$url\nto\n";
147 my $url_addr = $_[0]->{url_address
};
148 if ($url =~ /corbaloc:iiop:1.[01234]\@[\[].*[\]]\:.*/) {
149 $url =~ s/(corbaloc:iiop:1.[01234]\@[\[].*[\]]\:)(.*)/$url_addr$2/;
152 $url =~ s/(corbaloc:iiop:1.[01234]\@[^:]*\:)(.*)/$url_addr$2/;
156 $client_args .= " -k \"$url\"";
159 print "\nRunning client with the following args:\n$client_args\n\n";
161 $CL = $client->CreateProcess ("client", $client_args);
163 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
164 if ($client_status != 0) {
165 print STDERR
"ERROR: client returned $client_status\n";
170 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
172 if ($server_status != 0) {
173 print STDERR
"ERROR: server returned $server_status\n";
178 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
180 if ($server_status != 0) {
181 print STDERR
"ERROR: server returned $server_status\n";
189 for $test (@configurations) {
190 if (run_test_
($test) != 0) {
194 $server->DeleteFile($iorbase);
195 $client->DeleteFile($iorbase);