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
;
11 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
12 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
16 $iorbase = "server.ior";
17 $server_ior_file = $server->LocalFile ($iorbase);
19 # The server configuration file
20 $server_conf_file = "server.conf";
21 $server_conf = $server->LocalFile ($server_conf_file);
23 $server->DeleteFile ($iorbase);
25 # The client and server processes
26 $perl_executable = $^X
;
27 $perl_executable =~ s/\.exe//ig;
29 $perl_executable =~ s/000000\///g
;
34 # copy the configuation file
35 if ($server->PutFile ($server_conf_file) == -1) {
36 print STDERR
"ERROR: cannot set file <$server_conf>\n";
37 $SV->Kill (); $SV->TimedWait (1);
41 $SV = $server->CreateProcess ("server",
42 "-o $server_ior_file " .
43 "-ORBEndpoint iiop://:$port " .
44 "-ORBSvcConf $server_conf");
46 $CL1 = $client->CreateProcess ("client", "-k file://$server_ior_file");
47 $CL2 = $client->CreateProcess ("$perl_executable", "hang_client.pl ".
48 $server->{'HOSTNAME'});
50 $CL2->IgnoreHostRoot(1);
51 $CL2->IgnoreExeSubDir(1);
55 $status_server = $SV->Spawn();
57 if ($status_server != 0) {
58 print STDERR
"ERROR: server returned $status_server\n";
62 # We can wait on the IOR file
63 if ($server->WaitForFileTimed ($iorbase,
64 $server->ProcessStartWaitInterval()) == -1) {
65 print STDERR
"ERROR: cannot find file <$server_ior_file>\n";
66 $SV->Kill (); $SV->TimedWait (1);
72 $CL2->Wait ($server->ProcessStartWaitInterval());
74 $client_status = $CL1->SpawnWaitKill ($server->ProcessStartWaitInterval());
76 if ($client_status != 0) {
77 print STDERR
"ERROR: Bug #2183 Regression failed. Client returned $client_status\n";
81 $server->DeleteFile ($iorbase);
85 print "Test succeeded !!!\n";
88 $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
89 $CL2->TerminateWaitKill ($server->ProcessStopWaitInterval());
91 $server->DeleteFile ($iorbase);