1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 # This is a Perl script that tests AMH exceptions
9 use lib
"$ENV{ACE_ROOT}/bin";
10 use PerlACE
::TestTarget
;
12 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $iorbase = "test.ior";
16 my $server_iorfile = $server->LocalFile ($iorbase);
17 my $client_iorfile = $client->LocalFile ($iorbase);
18 $server->DeleteFile($iorbase);
19 $client->DeleteFile($iorbase);
21 $AMH = $server->CreateProcess ("server", "");
22 $CL = $client->CreateProcess ("client", "");
28 print STDERR
"ERROR: AMH server returned $sv\n";
32 if ($server->WaitForFileTimed ($iorbase,
33 $server->ProcessStartWaitInterval()) == -1) {
34 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
35 $AMH->Kill (); $AMH->TimedWait (1);
38 if ($server->GetFile ($iorbase) == -1) {
39 print STDERR
"ERROR: cannot get file <$server_iorfile>\n";
40 $AMH->Kill (); $AMH->TimedWait (1);
43 if ($client->PutFile ($iorbase) == -1) {
44 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
45 $AMH->Kill (); $AMH->TimedWait (1);
50 $client_status = $CL->Spawn ();
51 if ($client_status != 0) {
52 print STDERR
"ERROR: Client returned $client_status\n";
58 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval() + 15);
59 if ($client_status != 0) {
60 print STDERR
"ERROR: Client returned $client_status\n";
64 $amhserver= $AMH->WaitKill ($server->ProcessStopWaitInterval());
65 if ($amhserver != 0) {
66 print STDERR
"ERROR: AMH Server returned $amhserver\n";
70 $server->DeleteFile($iorbase);
71 $client->DeleteFile($iorbase);