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";
21 $clients[0] = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 $clients[1] = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
24 my $iorbase = "server.ior";
25 my $server_iorfile = $server->LocalFile ($iorbase);
26 my @clients_iorfile = ();
27 $clients_iorfile[0] = $clients[0]->LocalFile ($iorbase);
28 $clients_iorfile[1] = $clients[1]->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $clients[0]->DeleteFile($iorbase);
31 $clients[1]->DeleteFile($iorbase);
33 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
35 $CLS[0] = $clients[0]->CreateProcess ("client", "-k file://$clients_iorfile[0]");
36 $CLS[1] = $clients[1]->CreateProcess ("client", "-k file://$clients_iorfile[1] -x");
37 $server_status = $SV->Spawn ();
39 if ($server_status != 0) {
40 print STDERR
"ERROR: server returned $server_status\n";
44 if ($server->WaitForFileTimed ($iorbase,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
51 if ($server->GetFile ($iorbase) == -1) {
52 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
57 if ($clients[0]->PutFile ($iorbase) == -1) {
58 print STDERR
"ERROR: cannot set file <$clients_iorfile[0]>\n";
59 $SV->Kill (); $SV->TimedWait (1);
63 if ($clients[1]->PutFile ($iorbase) == -1) {
64 print STDERR
"ERROR: cannot set file <$clients_iorfile[1]>\n";
65 $SV->Kill (); $SV->TimedWait (1);
69 for ($i = 0; $i != 30; $i++) {
70 $client_status = $CLS[0]->SpawnWaitKill ($clients[0]->ProcessStartWaitInterval() + 285);
72 if ($client_status != 0) {
73 print STDERR
"ERROR: client 0 returned $client_status\n";
78 $client_status = $CLS[1]->SpawnWaitKill ($clients[1]->ProcessStartWaitInterval() + 285);
80 if ($client_status != 0) {
81 print STDERR
"ERROR: client 1 returned $client_status\n";
85 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR
"ERROR: server returned $server_status\n";
92 $server->DeleteFile($iorbase);
93 $clients[0]->DeleteFile($iorbase);
94 $clients[1]->DeleteFile($iorbase);