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
;
12 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
13 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
15 my $iorbase = "server.ior";
16 my $logout0 = "log.out";
17 my $logout1 = "log.out.1";
18 my $logout2 = "log.out.2";
19 my $logout3 = "log.out.3";
20 my $svcconf = "logger" . $PerlACE::svcconf_ext
;
21 my $server_iorfile = $server->LocalFile ($iorbase);
22 my $server_logout0 = $server->LocalFile ($logout0);
23 my $server_logout1 = $server->LocalFile ($logout1);
24 my $server_logout2 = $server->LocalFile ($logout2);
25 my $server_logout3 = $server->LocalFile ($logout3);
26 my $server_svcconf = $server->LocalFile ($svcconf);
27 my $client_iorfile = $client->LocalFile ($iorbase);
28 $server->DeleteFile($iorbase);
29 $server->DeleteFile($logout0);
30 $server->DeleteFile($logout1);
31 $server->DeleteFile($logout2);
32 $server->DeleteFile($logout3);
33 $client->DeleteFile($iorbase);
35 $tofile = "-ORBLogFile $logout0";
43 if ($server->PutFile ($svcconf) == -1) {
44 print STDERR
"ERROR: cannot set file <$server_svcconf>\n";
48 $SV = $server->CreateProcess ("server", "-ORBdebuglevel 10 $tofile ".
49 "-ORBSvcConf $server_svcconf -o $server_iorfile ".
50 "-ORBHandleLoggingStrategyEvents Logger");
51 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
53 $server_status = $SV->Spawn ();
55 if ($server_status != 0) {
56 print STDERR
"ERROR: server returned $server_status\n";
60 if ($server->WaitForFileTimed ($iorbase,
61 $server->ProcessStartWaitInterval()) == -1) {
62 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
67 if ($server->GetFile ($iorbase) == -1) {
68 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
69 $SV->Kill (); $SV->TimedWait (1);
72 if ($client->PutFile ($iorbase) == -1) {
73 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
74 $SV->Kill (); $SV->TimedWait (1);
78 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
80 if ($client_status != 0) {
81 print STDERR
"ERROR: client returned $client_status\n";
85 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR
"ERROR: server returned $server_status\n";
92 if ($server->GetFile ($logout0) == -1) {
93 print STDERR
"ERROR: cannot retrieve file <$server_logout0>\n";
96 if ($server->GetFile ($logout1) == -1) {
97 print STDERR
"ERROR: cannot retrieve file <$server_logout1>\n";
100 if ($server->GetFile ($logout2) == -1) {
101 print STDERR
"ERROR: cannot retrieve file <$server_logout2>\n";
104 if ($server->GetFile ($logout3) == -1) {
105 print STDERR
"ERROR: cannot retrieve file <$server_logout3>\n";
110 print STDERR
"ERROR: log files are not rotated (missing $logout0)\n";
114 print STDERR
"ERROR: log files are not rotated (missing $logout1)\n";
118 print STDERR
"ERROR: log files are not rotated (missing $logout2)\n";
122 print STDERR
"ERROR: log files are not rotated (missing $logout3)\n";
126 $server->DeleteFile($iorbase);
127 $server->DeleteFile($logout0);
128 $server->DeleteFile($logout1);
129 $server->DeleteFile($logout2);
130 $server->DeleteFile($logout3);
131 $client->DeleteFile($iorbase);