Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / performance-tests / POA / Implicit_Activation / run_test.pl
blob8707427449b0065f9191bf516fc92d08d9a24a0c
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 $iterations = '10000';
15 foreach $i (@ARGV) {
16 if ($i eq '-debug') {
17 $debug_level = '10';
21 print STDERR "================ Collocated Activation Test\n";
23 my $server1 = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
24 my $server2 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
25 my $client = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
28 my $iorbase = "test.ior";
29 my $server_iorfile = $server2->LocalFile ($iorbase);
30 my $client_iorfile = $client->LocalFile ($iorbase);
31 $server2->DeleteFile($iorbase);
32 $client->DeleteFile($iorbase);
34 $CO = $server1->CreateProcess ("collocated", "-i $iterations");
35 $SV = $server2->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
36 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile " .
37 "-i $iterations");
39 $server_status = $CO->SpawnWaitKill ($server1->ProcessStartWaitInterval() + 100);
41 if ($client_status != 0) {
42 print STDERR "ERROR: server returned $server_status\n";
43 $status = 1;
46 print STDERR "================ Activation Latency Test\n";
48 $server_status = $SV->Spawn ();
50 if ($server_status != 0) {
51 print STDERR "ERROR: server returned $server_status\n";
52 exit 1;
55 if ($server2->WaitForFileTimed ($iorbase,
56 $server2->ProcessStartWaitInterval()) == -1) {
57 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
58 $SV->Kill (); $SV->TimedWait (1);
59 exit 1;
62 if ($server2->GetFile ($iorbase) == -1) {
63 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
64 $SV->Kill (); $SV->TimedWait (1);
65 exit 1;
67 if ($client->PutFile ($iorbase) == -1) {
68 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
69 $SV->Kill (); $SV->TimedWait (1);
70 exit 1;
73 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 100);
75 if ($client_status != 0) {
76 print STDERR "ERROR: client returned $client_status\n";
77 $status = 1;
80 $server_status = $SV->WaitKill ($server2->ProcessStopWaitInterval());
82 if ($server_status != 0) {
83 print STDERR "ERROR: server returned $server_status\n";
84 $status = 1;
87 $server2->DeleteFile($iorbase);
88 $client->DeleteFile($iorbase);
90 exit $status;