Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / tests / Security / MT_SSLIOP / run_test.pl
blob719e7f4f64a14133a53533c8c3298f57b945a714
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 = '2';
14 $iterations = '100';
15 $number_threads_in_client = '2';
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");
57 $CL2 = $client2->CreateProcess ("client",
58 "-k file://$client2_iorfile " .
59 "-ORBSvcConf $client2_conf " .
60 "-n $number_threads_in_client -i $iterations -x");
62 $server_status = $SV->Spawn ();
64 if ($server_status != 0) {
65 print STDERR "ERROR: server returned $server_status\n";
66 exit 1;
69 if ($server->WaitForFileTimed ($iorfile,
70 $server->ProcessStartWaitInterval()) == -1) {
71 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
72 KillServers ();
73 exit 1;
76 if ($server->GetFile ($iorfile) == -1) {
77 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
78 $SV->Kill (); $SV->TimedWait (1);
79 exit 1;
82 if ($client1->PutFile ($iorfile) == -1) {
83 print STDERR "ERROR: cannot set file <$client1_iorfile>\n";
84 $SV->Kill (); $SV->TimedWait (1);
85 exit 1;
88 if ($client2->PutFile ($iorfile) == -1) {
89 print STDERR "ERROR: cannot set file <$client2_iorfile>\n";
90 $SV->Kill (); $SV->TimedWait (1);
91 exit 1;
94 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 45);
96 if ($client_status != 0) {
97 print STDERR "ERROR: client returned $client_status\n";
98 $status = 1;
102 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
104 if ($client_status != 0) {
105 print STDERR "ERROR: client returned $client_status\n";
106 $status = 1;
109 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
111 if ($server_status != 0) {
112 print STDERR "ERROR: server returned $server_status\n";
113 $status = 1;
116 $server->DeleteFile($iorfile);
117 $client1->DeleteFile($iorfile);
118 $client2->DeleteFile($iorfile);
120 exit $status;