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 failed\n";
20 my $server2 = PerlACE
::TestTarget
::create_target
(2) || die "Create failed\n";
22 my $TARGETHOSTNAME = $server2->HostName ();
23 my $port = $server2->RandomPort ();
25 my $iorbase = "server.ior";
26 my $server_iorfile = $server->LocalFile ($iorbase);
27 my $server2_iorfile = $server2->LocalFile ($iorbase);
28 $server->DeleteFile($iorbase);
29 $server2->DeleteFile($iorbase);
31 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
32 $SV2 = $server2->CreateProcess ("server2",
33 "-k file://$server2_iorfile ".
34 "-ORBListenEndpoints iiop://$TARGETHOSTNAME:$port ".
35 "-a corbaloc:iiop:$TARGETHOSTNAME:$port/SIMPLE_TEST_KEY");
37 print "Starting Server\n";
38 $server_status = $SV->Spawn ();
40 if ($server_status != 0) {
41 print STDERR
"ERROR: server returned $server_status\n";
45 if ($server->WaitForFileTimed ($iorbase,
46 $server->ProcessStartWaitInterval()) == -1) {
47 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
48 $SV->Kill (); $SV->TimedWait (1);
52 if ($server->GetFile ($iorbase) == -1) {
53 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
54 $SV->Kill (); $SV->TimedWait (1);
57 if ($server2->PutFile ($iorbase) == -1) {
58 print STDERR
"ERROR: cannot set file <$server2_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
63 print "Starting Other Server\n";
64 $server2_status = $SV2->Spawn ();
66 if ($server2_status != 0) {
67 print STDERR
"ERROR: server2 returned $server2_status\n";
68 $SV->Kill (); $SV->TimedWait (1);
72 $server2_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
74 if ($server2_status != 0) {
75 print STDERR
"ERROR: server2 returned $server2_status\n";
79 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
81 if ($server_status != 0) {
82 print STDERR
"ERROR: server returned $server_status\n";
86 $server->DeleteFile($iorbase);
87 $server2->DeleteFile($iorbase);