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 $client_iorbase = "client.ior";
25 my $server_iorfile = $server->LocalFile ($iorbase);
26 my $client_iorfile = $client->LocalFile ($iorbase);
27 $server->DeleteFile($iorbase);
28 $client->DeleteFile($iorbase);
30 my $client_iorbase_file = $client->LocalFile ($client_iorbase);
31 $client->DeleteFile($client_iorbase);
33 my $server_conf_file = "server.conf";
34 my $server_conf = $server->LocalFile ($server_conf_file);
37 # copy the configuation file
38 if ($server->PutFile ($server_conf_file) == -1) {
39 print STDERR
"ERROR: cannot set file <$server_conf>\n";
40 $SV->Kill (); $SV->TimedWait (1);
44 $SV = $server->CreateProcess ("server",
45 "-ORBdebuglevel $debug_level " .
46 "-ORBSvcConf $server_conf " .
47 "-o $server_iorfile");
49 $port = $client->RandomPort ();
51 $CL = $client->CreateProcess ("client",
52 "-ORBEndpoint iiop://:$port " .
53 "-k file://$client_iorfile " .
54 "-o $client_iorbase_file");
56 $server_status = $SV->Spawn ();
58 if ($server_status != 0) {
59 print STDERR
"ERROR: server returned $server_status\n";
63 if ($server->WaitForFileTimed ($iorbase,
64 $server->ProcessStartWaitInterval()) == -1) {
65 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
66 $SV->Kill (); $SV->TimedWait (1);
70 if ($server->GetFile ($iorbase) == -1) {
71 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
72 $SV->Kill (); $SV->TimedWait (1);
75 if ($client->PutFile ($iorbase) == -1) {
76 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
77 $SV->Kill (); $SV->TimedWait (1);
81 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
83 if ($client_status != 0) {
84 print STDERR
"ERROR: First client spawn returned $client_status. Indicates a problem other than a regression.\n";
88 if ($client_status == 0){
89 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
91 if ($client_status != 0) {
92 print STDERR
"ERROR: REGRESSION - Second client spawn returned $client\n";
98 $server_status = $SV->TerminateWaitKill ($server->ProcessStopWaitInterval());
100 if ($server_status != 0) {
101 print STDERR
"ERROR: server returned $server_status\n";
105 $server->DeleteFile($iorbase);
106 $client->DeleteFile($iorbase);
107 $client->DeleteFile($client_iorbase);