Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / Miop / McastZIOP / run_test.pl
blob881085ce7e44a91b3da99141666f314206505346
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 $server = PerlACE::TestTarget::create_target (1) || die "Create server failed\n";
20 my $client = PerlACE::TestTarget::create_target (2) || die "Create client failed\n";
22 my $iorfile = "server.ior";
24 #Files which used by server
25 my $server_iorfile = $server->LocalFile ($iorfile);
26 $server->DeleteFile($iorfile);
28 #Files which used by server2
29 my $client_iorfile = $client->LocalFile ($iorfile);
30 $client->DeleteFile($iorfile);
32 $SV = $server->CreateProcess ("server",
33 "-ORBdebuglevel $debug_level " .
34 "-o $server_iorfile");
36 $CL = $client->CreateProcess ("client",
37 "-ORBAllowZIOPNoServerPolicies 1 " .
38 "-ORBdebuglevel $debug_level " .
39 "-k file://$iorfile");
41 $server_status = $SV->Spawn ();
43 if ($server_status != 0) {
44 print STDERR "ERROR: server returned $server_status\n";
45 exit 1;
48 sub KillServers{
49 $SV->Kill (); $SV->TimedWait (1);
52 if ($server->WaitForFileTimed ($iorfile,
53 $server->ProcessStartWaitInterval()) == -1) {
54 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
55 KillServers ();
56 exit 1;
59 if ($server->GetFile ($iorfile) == -1) {
60 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
61 KillServers ();
62 exit 1;
64 if ($client->PutFile ($iorfile) == -1) {
65 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
66 KillServers ();
67 exit 1;
70 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 60);
72 if ($client_status != 0) {
73 print STDERR "ERROR: client returned $client_status\n";
74 $status = 1;
77 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
79 if ($server_status != 0) {
80 print STDERR "ERROR: server returned $server_status\n";
81 $status = 1;
85 $server->DeleteFile($iorfile);
86 $client->DeleteFile($iorfile);
88 exit $status;