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
;
11 if ($^O
eq 'lynxos') {
12 print "This test will not run properly on LynxOS.\n",
13 "When one process uses up all of the file descriptors, no other\n",
14 "processes run by the same user can start.\n";
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 $server->AddRuntimeLibrary ('TAO_Codeset');
25 my $iorbase = "server.ior";
26 my $server_iorfile = $server->LocalFile ($iorbase);
27 my $client_iorfile = $client->LocalFile ($iorbase);
28 $server->DeleteFile($iorbase);
29 $client->DeleteFile($iorbase);
31 my $logbase = 'server.log';
32 my $server_logfile = $server->LocalFile ($logbase);
33 $server->DeleteFile($logbase);
35 my $SV = $server->CreateProcess ("server", "-ORBAcceptErrorDelay 5 -ORBDebugLevel 1 -ORBLogFile $server_logfile -o $server_iorfile");
36 my $CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
38 my $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 my $client_status = $CL->SpawnWaitKill(10 + $client->ProcessStartWaitInterval ());
54 if ($client_status != 0) {
55 print STDERR
"ERROR: client returned $client_status\n";
59 $server_status = $SV->WaitKill($server->ProcessStopWaitInterval ());
61 if ($server_status != 0) {
62 print STDERR
"ERROR: server returned $server_status\n";
66 if ($server->GetFile ($logbase) == -1) {
67 print STDERR
"ERROR: cannot retrieve file <$server_logfile>\n";
72 if (open(FH
, $server_logfile)) {
73 my $error_achieved = 0;
75 print STDERR
"processing <$server_logfile>\n";
78 if (/TAO_Acceptor::handle_accept_error.+Too many files open/) {
81 elsif (/TAO_Acceptor::handle_expiration.+registering\s+the\s+acceptor/) {
87 if (!$error_achieved) {
88 print STDERR
"ERROR: The error situation was not achieved\n";
92 print STDERR
"ERROR: The acceptor was not reregistered\n";
97 print STDERR
"ERROR: Unable to read $server_logfile\n";
102 $server->DeleteFile($iorbase);
103 $client->DeleteFile($iorbase);
104 $server->DeleteFile($logbase);