Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Miop / McastHello / run_test.pl
blobec700de402457983f7ad682843d799b417e17517
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;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $server1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $server2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
21 my $client = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
23 my $ior1file = "server1.ior";
24 my $ior2file = "server2.ior.unused";
26 #Files which used by server1
27 my $server1_ior1file = $server1->LocalFile ($ior1file);
28 $server1->DeleteFile($ior1file);
30 #Files which used by server2
31 my $server2_ior2file = $server2->LocalFile ($ior2file);
32 $server2->DeleteFile($ior2file);
34 #Files which used by server2
35 my $client_ior1file = $client->LocalFile ($ior1file);
36 $client->DeleteFile($ior1file);
38 $SV1 = $server1->CreateProcess ("server",
39 "-ORBdebuglevel $debug_level " .
40 "-o $server1_ior1file");
42 $SV2 = $server2->CreateProcess ("server",
43 "-ORBdebuglevel $debug_level " .
44 "-o $server2_ior2file");
46 $CL = $client->CreateProcess ("client",
47 "-k file://$ior1file");
49 $server_status = $SV1->Spawn ();
51 if ($server_status != 0) {
52 print STDERR "ERROR: server returned $server_status\n";
53 exit 1;
56 $server_status = $SV2->Spawn ();
58 if ($server_status != 0) {
59 print STDERR "ERROR: server returned $server_status\n";
60 exit 1;
63 sub KillServers{
64 $SV1->Kill (); $SV1->TimedWait (1);
65 $SV2->Kill (); $SV2->TimedWait (1);
68 if ($server1->WaitForFileTimed ($ior1file,
69 $server1->ProcessStartWaitInterval()) == -1) {
70 print STDERR "ERROR: cannot find file <$server1_ior1file>\n";
71 KillServers ();
72 exit 1;
75 if ($server2->WaitForFileTimed ($ior2file,
76 $server2->ProcessStartWaitInterval()) == -1) {
77 print STDERR "ERROR: cannot find file <$server2_ior2file>\n";
78 KillServers ();
79 exit 1;
82 if ($server1->GetFile ($ior1file) == -1) {
83 print STDERR "ERROR: cannot retrieve file <$server1_ior1file>\n";
84 KillServers ();
85 exit 1;
87 if ($client->PutFile ($ior1file) == -1) {
88 print STDERR "ERROR: cannot set file <$client_ior1file>\n";
89 KillServers ();
90 exit 1;
93 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
95 if ($client_status != 0) {
96 print STDERR "ERROR: client returned $client_status\n";
97 $status = 1;
100 $server_status = $SV1->WaitKill ($server1->ProcessStopWaitInterval());
102 if ($server_status != 0) {
103 print STDERR "ERROR: server returned $server_status\n";
104 $status = 1;
107 $server_status = $SV2->WaitKill ($server2->ProcessStopWaitInterval());
109 if ($server_status != 0) {
110 print STDERR "ERROR: server returned $server_status\n";
111 $status = 1;
114 $server1->DeleteFile($ior1file);
115 $server2->DeleteFile($ior2file);
116 $client->DeleteFile($ior1file);
118 exit $status;