Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tests / Muxing / run_test.pl
blob3540944502bf0c4b2720a07613465f9424ab3b16
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 target 1 failed\n";
20 my $client1 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
21 my $client2 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
23 my $iorbase = "server.ior";
24 my $server_iorfile = $server->LocalFile ($iorbase);
25 my $client1_iorfile = $client1->LocalFile ($iorbase);
26 my $client2_iorfile = $client2->LocalFile ($iorbase);
27 $server->DeleteFile($iorbase);
28 $client1->DeleteFile($iorbase);
29 $client2->DeleteFile($iorbase);
31 $SV = $server->CreateProcess ("server",
32 "-ORBdebuglevel $debug_level " .
33 "-o $server_iorfile");
34 $CL1 = $client1->CreateProcess ("client", "-k file://$client1_iorfile");
35 $CL2 = $client2->CreateProcess ("client", "-k file://$client2_iorfile");
37 $server_status = $SV->Spawn ();
39 if ($server_status != 0) {
40 print STDERR "ERROR: server returned $server_status\n";
41 exit 1;
44 if ($server->WaitForFileTimed ($iorbase,
45 $server->ProcessStartWaitInterval()) == -1) {
46 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
47 $SV->Kill (); $SV->TimedWait (1);
48 exit 1;
51 if ($server->GetFile ($iorbase) == -1) {
52 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
53 $SV->Kill (); $SV->TimedWait (1);
54 exit 1;
56 if ($client1->PutFile ($iorbase) == -1) {
57 print STDERR "ERROR: cannot set file <$client1_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
59 exit 1;
61 if ($client2->PutFile ($iorbase) == -1) {
62 print STDERR "ERROR: cannot set file <$client2_iorfile>\n";
63 $SV->Kill (); $SV->TimedWait (1);
64 exit 1;
67 $client_status = $CL1->Spawn ();
69 if ($client_status != 0) {
70 print STDERR "ERROR: client returned $client_status\n";
71 $SV->Kill (); $SV->TimedWait (1);
72 exit 1;
75 $client_status = $CL2->Spawn ();
77 if ($client_status != 0) {
78 print STDERR "ERROR: client returned $client_status\n";
79 $SV->Kill (); $SV->TimedWait (1);
80 $CL1->Kill (); $CL1->TimedWait (1);
81 exit 1;
84 $client_status = $CL1->WaitKill ($client1->ProcessStopWaitInterval() + 45);
86 if ($client_status != 0) {
87 print STDERR "ERROR: client returned $client_status\n";
88 $status = 1;
91 $client_status = $CL2->WaitKill ($client2->ProcessStopWaitInterval() + 45);
93 if ($client_status != 0) {
94 print STDERR "ERROR: client returned $client_status\n";
95 $status = 1;
98 $CL1->Arguments ("-k file://$client1_iorfile -x");
100 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 60);
102 if ($client_status != 0) {
103 print STDERR "ERROR: client returned $client_status\n";
104 $SV->Kill (); $SV->TimedWait (1);
105 exit 1;
108 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
110 if ($server_status != 0) {
111 print STDERR "ERROR: server returned $server_status\n";
112 $status = 1;
115 $server->DeleteFile($iorbase);
116 $client1->DeleteFile($iorbase);
117 $client2->DeleteFile($iorbase);
119 exit $status;