Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Bug_2615_Regression / run_test.pl
blob9bf1162b0b516314f92c94bdc592073576f3ca7a
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 $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
22 my $iorbase = "ior.ior";
23 my $iogrbase = "iogr.ior";
24 my $server_iorfile = $server->LocalFile ($iorbase);
25 my $client_iorfile = $client->LocalFile ($iorbase);
26 $server->DeleteFile($iorbase);
27 $client->DeleteFile($iorbase);
29 my $server_iogrfile = $server->LocalFile ($iogrbase);
30 my $client_iogrfile = $client->LocalFile ($iogrbase);
32 $server->DeleteFile($iogrbase);
33 $client->DeleteFile($iogrbase);
35 $SV = $server->CreateProcess ("server",
36 "-ORBdebuglevel $debug_level " .
37 "-o $server_iorfile " .
38 "-p $server_iogrfile");
40 $CL = $client->CreateProcess ("client",
41 "-k file://$client_iorfile " .
42 "-l file://$client_iogrfile ");
44 $server_status = $SV->Spawn ();
46 if ($server_status != 0) {
47 print STDERR "ERROR: server returned $server_status\n";
48 exit 1;
51 if ($server->WaitForFileTimed ($iorbase,
52 $server->ProcessStartWaitInterval()) == -1) {
53 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
54 $SV->Kill (); $SV->TimedWait (1);
55 exit 1;
58 if ($server->WaitForFileTimed ($iogrbase,
59 $server->ProcessStartWaitInterval()) == -1) {
60 print STDERR "ERROR: cannot find file <$server_iogrfile>\n";
61 $SV->Kill (); $SV->TimedWait (1);
62 exit 1;
65 if ($server->GetFile ($iorbase) == -1) {
66 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
68 exit 1;
70 if ($client->PutFile ($iorbase) == -1) {
71 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
72 $SV->Kill (); $SV->TimedWait (1);
73 exit 1;
75 if ($server->GetFile ($iogrbase) == -1) {
76 print STDERR "ERROR: cannot retrieve file <$server_iogrfile>\n";
77 $SV->Kill (); $SV->TimedWait (1);
78 exit 1;
81 if ($client->PutFile ($iogrbase) == -1) {
82 print STDERR "ERROR: cannot set file <$client_iogrfile>\n";
83 $SV->Kill (); $SV->TimedWait (1);
84 exit 1;
87 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 285);
89 if ($client_status != 0) {
90 print STDERR "ERROR: client returned $client_status\n";
91 $status = 1;
94 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
96 if ($server_status != 0) {
97 print STDERR "ERROR: server returned $server_status\n";
98 $status = 1;
101 $server->DeleteFile($iorbase);
102 $client->DeleteFile($iorbase);
103 $server->DeleteFile($iogrbase);
104 $client->DeleteFile($iogrbase);
106 exit $status;