1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
15 $number_threads_in_client = '10';
23 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
24 my $client1 = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
25 my $client2 = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
27 my $iorfile = "test.ior";
29 #Files which used by server
30 my $server_iorfile = $server->LocalFile ($iorfile);
31 $server->DeleteFile($iorfile);
33 #Files which used by client1
34 my $client1_iorfile = $client1->LocalFile ($iorfile);
35 $client1->DeleteFile($iorfile);
37 #Files which used by client2
38 my $client2_iorfile = $client2->LocalFile ($iorfile);
39 $client2->DeleteFile($iorfile);
41 #Configuration files for server and client
42 $server_conf = $server->LocalFile ("server" . $PerlACE::svcconf_ext
);
43 $client1_conf = $client1->LocalFile ("client" . $PerlACE::svcconf_ext
);
44 $client2_conf = $client2->LocalFile ("client" . $PerlACE::svcconf_ext
);
47 $SV = $server->CreateProcess ("server",
48 "-ORBdebuglevel $debug_level " .
49 "-ORBSvcConf $server_conf " .
50 "-o $server_iorfile " .
53 $CL1 = $client1->CreateProcess ("client",
54 "-k file://$client1_iorfile " .
55 "-ORBSvcConf $client1_conf " .
56 "-n $number_threads_in_client -i $iterations");
58 $CL2 = $client2->CreateProcess ("client",
59 "-k file://$client2_iorfile " .
60 "-ORBSvcConf $client2_conf " .
61 "-n $number_threads_in_client -i $iterations -x");
63 $server_status = $SV->Spawn ();
65 if ($server_status != 0) {
66 print STDERR
"ERROR: server returned $server_status\n";
70 if ($server->WaitForFileTimed ($iorfile,
71 $server->ProcessStartWaitInterval()) == -1) {
72 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
77 if ($server->GetFile ($iorfile) == -1) {
78 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
79 $SV->Kill (); $SV->TimedWait (1);
83 if ($client1->PutFile ($iorfile) == -1) {
84 print STDERR
"ERROR: cannot set file <$client1_iorfile>\n";
85 $SV->Kill (); $SV->TimedWait (1);
89 if ($client2->PutFile ($iorfile) == -1) {
90 print STDERR
"ERROR: cannot set file <$client2_iorfile>\n";
91 $SV->Kill (); $SV->TimedWait (1);
95 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 450);
97 if ($client_status != 0) {
98 print STDERR
"ERROR: client returned $client_status\n";
103 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 450);
105 if ($client_status != 0) {
106 print STDERR
"ERROR: client returned $client_status\n";
110 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
112 if ($server_status != 0) {
113 print STDERR
"ERROR: server returned $server_status\n";
117 $server->DeleteFile($iorfile);
118 $client1->DeleteFile($iorfile);
119 $client2->DeleteFile($iorfile);