Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / MT_SSLIOP / run_test_heavy.pl
blob0019737ff8b32ea387d66d2bb8ea89ed47dcfb25
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 $threads = '100';
14 $iterations = '10000';
15 $number_threads_in_client = '20';
17 foreach $i (@ARGV) {
18 if ($i eq '-debug') {
19 $debug_level = '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 " .
51 "-n $threads");
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";
67 exit 1;
70 if ($server->WaitForFileTimed ($iorfile,
71 $server->ProcessStartWaitInterval()) == -1) {
72 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
73 KillServers ();
74 exit 1;
77 if ($server->GetFile ($iorfile) == -1) {
78 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
79 $SV->Kill (); $SV->TimedWait (1);
80 exit 1;
83 if ($client1->PutFile ($iorfile) == -1) {
84 print STDERR "ERROR: cannot set file <$client1_iorfile>\n";
85 $SV->Kill (); $SV->TimedWait (1);
86 exit 1;
89 if ($client2->PutFile ($iorfile) == -1) {
90 print STDERR "ERROR: cannot set file <$client2_iorfile>\n";
91 $SV->Kill (); $SV->TimedWait (1);
92 exit 1;
95 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 580);
97 if ($client_status != 0) {
98 print STDERR "ERROR: client returned $client_status\n";
99 $status = 1;
103 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 580);
105 if ($client_status != 0) {
106 print STDERR "ERROR: client returned $client_status\n";
107 $status = 1;
110 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
112 if ($server_status != 0) {
113 print STDERR "ERROR: server returned $server_status\n";
114 $status = 1;
117 $server->DeleteFile($iorfile);
118 $client1->DeleteFile($iorfile);
119 $client2->DeleteFile($iorfile);
121 exit $status;