Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Faults / run_test_pp.pl
blobbc4a1a34dc4196671c8dc3366fd77c7c488637b2
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 = "server.ior";
23 my $server_iorfile = $server->LocalFile ($iorbase);
24 my $client_iorfile = $client->LocalFile ($iorbase);
25 $server->DeleteFile($iorbase);
26 $client->DeleteFile($iorbase);
28 my $svcconf = "server$PerlACE::svcconf_ext";
29 my $server_svcfile = $server->LocalFile ($svcconf);
30 if ($server->PutFile ($svcconf) == -1) {
31 print STDERR "ERROR: cannot set file <$server_svcfile>\n";
32 exit 1;
37 $SV = $server->CreateProcess ("ping",
38 "-ORBdebuglevel $debug_level -o $server_iorfile");
39 $CL = $client->CreateProcess ("pong",
40 "-k file://$client_iorfile -p 100 -i 60 -t 30");
42 ###############################################################################
43 print STDERR "################ Default ORB Config###############\n";
44 print STDERR "===== Ping-pong test, server crashes but client continues\n";
46 $server_status = $SV->Spawn ();
48 if ($server_status != 0) {
49 print STDERR "ERROR: server returned $server_status\n";
50 exit 1;
53 if ($server->WaitForFileTimed ($iorbase,
54 $server->ProcessStartWaitInterval()) == -1) {
55 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
56 $SV->Kill (); $SV->TimedWait (1);
57 exit 1;
60 if ($server->GetFile ($iorbase) == -1) {
61 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
62 $SV->Kill (); $SV->TimedWait (1);
63 exit 1;
65 if ($client->PutFile ($iorbase) == -1) {
66 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
68 exit 1;
71 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 85);
73 if ($client_status != 0) {
74 print STDERR "ERROR: client returned $client_status\n";
75 $status = 1;
78 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
80 if ($server_status != 0) {
81 print STDERR "ERROR: server returned $server_status\n";
82 $status = 1;
85 $server->DeleteFile($iorbase);
86 $client->DeleteFile($iorbase);
88 ########################################################################
89 ########################################################################
90 ########################################################################
91 print STDERR "################ Thread-Per-Connection Config###############\n";
92 print STDERR "===== Ping-pong test, server crashes but client continues\n";
94 $SV->Arguments ("-ORBdebuglevel $debug_level -ORBSvcConf $server_svcfile ".
95 "-o $server_iorfile");
96 $server_status = $SV->Spawn ();
98 if ($server_status != 0) {
99 print STDERR "ERROR: server returned $server_status\n";
100 exit 1;
103 if ($server->WaitForFileTimed ($iorbase,
104 $server->ProcessStartWaitInterval()) == -1) {
105 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
106 $SV->Kill (); $SV->TimedWait (1);
107 exit 1;
110 if ($server->GetFile ($iorbase) == -1) {
111 print STDERR "ERROR: cannot retrieve file <$server_iorfile>\n";
112 $SV->Kill (); $SV->TimedWait (1);
113 exit 1;
115 if ($client->PutFile ($iorbase) == -1) {
116 print STDERR "ERROR: cannot set file <$client_iorfile>\n";
117 $SV->Kill (); $SV->TimedWait (1);
118 exit 1;
121 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 85);
123 if ($client_status != 0) {
124 print STDERR "ERROR: client returned $client_status\n";
125 $status = 1;
128 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
130 if ($server_status != 0) {
131 print STDERR "ERROR: server returned $server_status\n";
132 $status = 1;
135 $server->DeleteFile($iorbase);
136 $client->DeleteFile($iorbase);
138 exit $status;