Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Bug_3837_Regression / run_test.pl
blob8c4c7def1c274e4d3a686201b8658a73e7921926
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
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";
37 foreach $i (@ARGV) {
38 if ($i eq '-debug') {
39 $tofile = '';
43 if ($server->PutFile ($svcconf) == -1) {
44 print STDERR "ERROR: cannot set file <$server_svcconf>\n";
45 exit 1;
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";
57 exit 1;
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);
64 exit 1;
67 if ($server->GetFile ($iorbase) == -1) {
68 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
69 $SV->Kill (); $SV->TimedWait (1);
70 exit 1;
72 if ($client->PutFile ($iorbase) == -1) {
73 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
74 $SV->Kill (); $SV->TimedWait (1);
75 exit 1;
78 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
80 if ($client_status != 0) {
81 print STDERR "ERROR: client returned $client_status\n";
82 $status = 1;
85 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR "ERROR: server returned $server_status\n";
89 $status = 1;
92 if ($server->GetFile ($logout0) == -1) {
93 print STDERR "ERROR: cannot retrieve file <$server_logout0>\n";
94 $status = 1;
96 if ($server->GetFile ($logout1) == -1) {
97 print STDERR "ERROR: cannot retrieve file <$server_logout1>\n";
98 $status = 1;
100 if ($server->GetFile ($logout2) == -1) {
101 print STDERR "ERROR: cannot retrieve file <$server_logout2>\n";
102 $status = 1;
104 if ($server->GetFile ($logout3) == -1) {
105 print STDERR "ERROR: cannot retrieve file <$server_logout3>\n";
106 $status = 1;
109 if (!-e $logout0) {
110 print STDERR "ERROR: log files are not rotated (missing $logout0)\n";
111 $status = 1;
113 if (!-e $logout1) {
114 print STDERR "ERROR: log files are not rotated (missing $logout1)\n";
115 $status = 1;
117 if (!-e $logout2) {
118 print STDERR "ERROR: log files are not rotated (missing $logout2)\n";
119 $status = 1;
121 if (!-e $logout3) {
122 print STDERR "ERROR: log files are not rotated (missing $logout3)\n";
123 $status = 1;
126 $server->DeleteFile($iorbase);
127 $server->DeleteFile($logout0);
128 $server->DeleteFile($logout1);
129 $server->DeleteFile($logout2);
130 $server->DeleteFile($logout3);
131 $client->DeleteFile($iorbase);
133 exit $status;