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";
21 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
23 my $iorbase = "test.ior";
24 my $outside = "outside.conf";
25 my $inside = "inside.conf";
27 my $server_iorfile = $server->LocalFile ($iorbase);
28 my $client_iorfile = $client->LocalFile ($iorbase);
30 my $server_conf = $server->LocalFile ($outside);
31 my $client_conf = $client->LocalFile ($inside);
34 $server->DeleteFile($iorbase);
35 $client->DeleteFile($iorbase);
37 $hostname = $server->HostName();
39 $SV = $server->CreateProcess ("server",
40 "-ORBdebuglevel $debug_level " .
41 "-ORBEndPoint htiop://$hostname: " .
42 "-ORBSvcConf $server_conf " .
44 "-o $server_iorfile");
47 $CL = $client->CreateProcess ("client",
48 "-ORBSvcConf $client_conf " .
49 "-k file://$client_iorfile");
50 $server_status = $SV->Spawn ();
52 if ($server_status != 0) {
53 print STDERR
"ERROR: server returned $server_status\n";
57 if ($server->WaitForFileTimed ($iorbase,
58 $server->ProcessStartWaitInterval()) == -1) {
59 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
60 $SV->Kill (); $SV->TimedWait (1);
64 if ($server->GetFile ($iorbase) == -1) {
65 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
69 if ($client->PutFile ($iorbase) == -1) {
70 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
75 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 10);
77 if ($client_status != 0) {
78 print STDERR
"ERROR: client returned $client_status\n";
82 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 10);
84 if ($server_status != 0) {
85 print STDERR
"ERROR: server returned $server_status\n";
89 $server->DeleteFile($iorbase);
90 $client->DeleteFile($iorbase);