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
;
20 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
22 for ($i = 0; $i < $num_clients; $i++) {
23 $clients[$i] = PerlACE
::TestTarget
::create_target
($i+1) || die "Create target $i+1 failed\n";
26 my $iorbase = "server.ior";
28 my $server_iorfile = $server->LocalFile ($iorbase);
29 $server->DeleteFile($iorbase);
30 $SV = $server->CreateProcess ("server_main", "-ORBdebuglevel $debug_level ".
31 "-o $server_iorfile -n $num_clients");
34 my @clients_iorfile = ();
35 for ($i = 0; $i < $num_clients; $i++) {
36 $clients_iorfile[$i] = $clients[$i]->LocalFile ($iorbase);
37 $clients[$i]->DeleteFile($iorbase);
38 $CLS[$i] = $clients[$i]->CreateProcess ("client_main", "-i file://$clients_iorfile[$i]");
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 if ($server->GetFile ($iorbase) == -1) {
56 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
57 $SV->Kill (); $SV->TimedWait (1);
61 for ($i = 0; $i < $num_clients; $i++) {
62 if ($clients[$i]->PutFile ($iorbase) == -1) {
63 print STDERR
"ERROR: client $i cannot set file <$clients_iorfile[$i]>\n";
64 $SV->Kill (); $SV->TimedWait (1);
69 for ($i = 0; $i < $num_clients; $i++) {
70 my $client_status = $CLS[$i]->Spawn();
71 if ($client_status != 0) {
72 print STDERR
"ERROR: client $i Spawn returned $client_status\n";
77 for ($i = 0; $i < $num_clients; $i++) {
78 my $client_status = $CLS[$i]->WaitKill ($clients[$i]->ProcessStartWaitInterval() + 45);
80 if ($client_status != 0) {
81 print STDERR
"ERROR: client returned $client_status\n";
86 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
88 if ($server_status != 0) {
89 print STDERR
"ERROR: server returned $server_status\n";
93 $server->DeleteFile($iorbase);
94 for ($i = 0; $i < $num_clients; $i++) {
95 $clients[$i]->DeleteFile($iorbase);