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";
21 my $client_shutdown = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
24 $orb_port = $server->RandomPort();
26 my $iorbase = "server.ior";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 my $client_shutdown_iorfile = $client_shutdown->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $client_shutdown->DeleteFile($iorbase);
32 $hostname = $server->HostName();
34 $SV = $server->CreateProcess ("server",
35 "-ORBdebuglevel $debug_level " .
36 "-ORBEndpoint iiop://$hostname:$orb_port " .
37 "-o $server_iorfile");
39 $CL = $client->CreateProcess ("client",
43 $SH_CL = $client_shutdown->CreateProcess ("shutdown_client", "-k file://$client_shutdown_iorfile");
45 $server_status = $SV->Spawn ();
47 if ($server_status != 0) {
48 print STDERR
"ERROR: server returned $server_status\n";
52 if ($server->WaitForFileTimed ($iorbase,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
55 $SV->Kill (); $SV->TimedWait (1);
59 if ($server->GetFile ($iorbase) == -1) {
60 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
64 if ($client_shutdown->PutFile ($iorbase) == -1) {
65 print STDERR
"ERROR: cannot set file <$client_shutdown_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
72 if ($client_status != 0) {
73 print STDERR
"ERROR: client returned $client_status\n";
77 print "Calling shutdown client\n";
79 $client_status = $SH_CL->SpawnWaitKill ($client_shutdown->ProcessStartWaitInterval() + 285);
81 if ($client_status != 0) {
82 print STDERR
"ERROR: client shutdown returned $client_status\n";
86 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 100);
88 if ($server_status != 0) {
89 print STDERR
"ERROR: server returned $server_status\n";
93 $server->DeleteFile($iorbase);
94 $client_shutdown->DeleteFile($iorbase);