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
;
21 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
23 for ($i = 0; $i < $num_clients; $i++) {
24 $clients[$i] = PerlACE
::TestTarget
::create_target
($i+1) || die "Create target $i+1 failed\n";
27 my $iorbase = "server.ior";
29 my $server_iorfile = $server->LocalFile ($iorbase);
30 $server->DeleteFile($iorbase);
31 $SV = $server->CreateProcess ("server_main", "-ORBdebuglevel $debug_level ".
32 "-o $server_iorfile ".
33 "-n $num_clients -t $num_orb_threads");
36 my @clients_iorfile = ();
37 for ($i = 0; $i < $num_clients; $i++) {
38 $clients_iorfile[$i] = $clients[$i]->LocalFile ($iorbase);
39 $clients[$i]->DeleteFile($iorbase);
40 $CLS[$i] = $clients[$i]->CreateProcess ("client_main", "-i file://$clients_iorfile[$i]");
43 $server_status = $SV->Spawn ();
45 if ($server_status != 0) {
46 print STDERR
"ERROR: server returned $server_status\n";
50 if ($server->WaitForFileTimed ($iorbase,
51 $server->ProcessStartWaitInterval()) == -1) {
52 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
57 if ($server->GetFile ($iorbase) == -1) {
58 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
63 for ($i = 0; $i < $num_clients; $i++) {
64 if ($clients[$i]->PutFile ($iorbase) == -1) {
65 print STDERR
"ERROR: client $i cannot set file <$clients_iorfile[$i]>\n";
66 $SV->Kill (); $SV->TimedWait (1);
71 for ($i = 0; $i < $num_clients; $i++) {
72 my $client_status = $CLS[$i]->Spawn();
73 if ($client_status != 0) {
74 print STDERR
"ERROR: client $i Spawn returned $client_status\n";
79 for ($i = 0; $i < $num_clients; $i++) {
80 my $client_status = $CLS[$i]->WaitKill ($clients[$i]->ProcessStartWaitInterval() + 45);
82 if ($client_status != 0) {
83 print STDERR
"ERROR: client returned $client_status\n";
88 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
90 if ($server_status != 0) {
91 print STDERR
"ERROR: server returned $server_status\n";
95 $server->DeleteFile($iorbase);
96 for ($i = 0; $i < $num_clients; $i++) {
97 $clients[$i]->DeleteFile($iorbase);