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";
20 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
22 my $iorbase = "server.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 $conf_file = "svc$PerlACE::svcconf_ext";
29 $client_conf = $client->LocalFile ($conf_file);
31 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
33 # copy the configruation file.
34 if ($client->PutFile ($conf_file) == -1) {
35 print STDERR
"ERROR: cannot set file <$client_conf>\n";
36 $SV->Kill (); $SV->TimedWait (1);
40 $CL = $client->CreateProcess ("client", "-ORBSvcConf $client_conf -ORBdebuglevel $debug_level -f file://$client_iorfile");
42 $server_status = $SV->Spawn ();
44 if ($server_status != 0) {
45 print STDERR
"ERROR: server returned $server_status\n";
49 if ($server->WaitForFileTimed ($iorbase,
50 $server->ProcessStartWaitInterval()) == -1) {
51 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
56 if ($server->GetFile ($iorbase) == -1) {
57 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
61 if ($client->PutFile ($iorbase) == -1) {
62 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
67 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
69 if ($client_status != 0) {
70 print STDERR
"ERROR: client returned $client_status\n";
74 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
76 if ($server_status != 0) {
77 print STDERR
"ERROR: server returned $server_status\n";
81 $server->GetStderrLog();
82 $client->GetStderrLog();
84 $server->DeleteFile($server_iorfile);
85 $client->DeleteFile($client_iorfile);