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 $TARGETHOSTNAME = $server->HostName ();
23 my $port = $server->RandomPort ();
25 my $iorbase = "server.ior";
26 my $server_iorfile = $server->LocalFile ($iorbase);
27 my $client_iorfile = $client->LocalFile ($iorbase);
28 $server->DeleteFile($iorbase);
29 $client->DeleteFile($iorbase);
31 $SV = $server->CreateProcess ("INS_test_server",
32 "-ORBdebuglevel $debug_level ".
33 "-ORBEndpoint iiop://1.0\@$TARGETHOSTNAME:$port ".
34 "-ORBDottedDecimalAddresses 1 ".
35 "-i object_name -o $server_iorfile");
36 $CL = $client->CreateProcess ("INS_test_client",
38 "-ORBInitRef random_service=corbaloc::1.1\@".
39 "$TARGETHOSTNAME:$port/object_name");
41 $server_status = $SV->Spawn ();
43 if ($server_status != 0) {
44 print STDERR
"ERROR: server returned $server_status\n";
48 if ($server->WaitForFileTimed ($iorbase,
49 $server->ProcessStartWaitInterval()) == -1) {
50 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
51 $SV->Kill (); $SV->TimedWait (1);
55 print STDERR
"\n\n==== InitRef test\n";
57 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
59 if ($client_status != 0) {
60 print STDERR
"ERROR: client returned $client_status\n";
61 $SV->Kill (); $SV->TimedWait (1);
65 print STDERR
"\n\n==== InvalidName test\n";
67 $CL->Arguments ("not_a_service -ORBInitRef random_service=corbaloc:iiop:1.0\@".
68 "$TARGETHOSTNAME:$port/object_name");
69 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
71 if ($client_status != 0) {
72 print STDERR
"ERROR: client returned $client_status\n";
73 $SV->Kill (); $SV->TimedWait (1);
77 print STDERR
"\n\n==== DefaultInitRef test\n";
79 $CL->Arguments ("object_name -ORBDefaultInitRef corbaloc:iiop:1.0\@".
80 "$TARGETHOSTNAME:$port/");
81 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
83 if ($client_status != 0) {
84 print STDERR
"ERROR: client returned $client_status\n";
85 $SV->Kill (); $SV->TimedWait (1);
89 print STDERR
"\n\n==== Multi endpoint test\n";
93 $CL->Arguments ("random_service -ORBInitRef random_service=corbaloc:iiop:1.0\@".
94 "$TARGETHOSTNAME:$port1,iiop:1.0\@$TARGETHOSTNAME:$port2,".
95 "iiop:1.0\@$TARGETHOSTNAME:$port/object_name");
96 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
98 if ($client_status != 0) {
99 print STDERR
"ERROR: client returned $client_status\n";
100 $SV->Kill (); $SV->TimedWait (1);
104 print STDERR
"\n\n==== Multi endpoint default ref test\n";
106 $CL->Arguments ("object_name -ORBDefaultInitRef corbaloc:iiop:1.0\@".
107 "$TARGETHOSTNAME:$port1,iiop:1.0\@$TARGETHOSTNAME:$port2,".
108 "iiop:1.0\@$TARGETHOSTNAME:$port/");
109 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
111 if ($client_status != 0) {
112 print STDERR
"ERROR: client returned $client_status\n";
113 $SV->Kill (); $SV->TimedWait (1);
117 print STDERR
"\n\n==== Default ref with final '/'\n";
119 $CL->Arguments ("object_name -ORBDefaultInitRef corbaloc:iiop:1.0\@".
120 "$TARGETHOSTNAME:$port/");
121 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
123 if ($client_status != 0) {
124 print STDERR
"ERROR: client returned $client_status\n";
125 $SV->Kill (); $SV->TimedWait (1);
129 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
131 if ($server_status != 0) {
132 print STDERR
"ERROR: server returned $server_status\n";
136 $server->DeleteFile($iorbase);
137 $client->DeleteFile($iorbase);