Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / DSI_AMI_Gateway / run_exception_test.pl
blob561bfc0c2fde00747b56b4f31d4eae424897c5ce
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 $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
11 $gateway = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
12 $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
14 $iorbase = "server.ior";
15 $gwbase = "gateway.ior";
17 $server_iorfile = $server->LocalFile ($iorbase);
18 $gateway_iorfile = $server->LocalFile ($iorbase);
19 $gateway_gwfile = $server->LocalFile ($gwbase);
20 $client_gwfile = $client->LocalFile ($gwbase);
22 $server->DeleteFile ($iorbase);
23 $gateway->DeleteFile ($iorbase);
24 $gateway->DeleteFile ($gwbase);
25 $client->DeleteFile ($gwbase);
27 $status = 0;
29 $SV = $server->CreateProcess ("server", "-o $server_iorfile");
30 $GW = $gateway->CreateProcess ("gateway", "-k file://$gateway_iorfile -o $gateway_gwfile");
31 $CL = $gateway->CreateProcess ("client", "-k file://$client_gwfile -u");
33 $server_status = $SV->Spawn ();
35 if ($server_status != 0) {
36 print STDERR "ERROR: server returned $server_status\n";
37 exit 1;
40 if ($server->WaitForFileTimed ($iorbase,
41 $server->ProcessStartWaitInterval()) == -1) {
42 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
43 $SV->Kill (); $SV->TimedWait (1);
44 exit 1;
47 $GW->Spawn ();
49 if ($gateway->WaitForFileTimed ($gwbase,
50 $gateway->ProcessStartWaitInterval()) == -1) {
51 print STDERR "ERROR: cannot find file <$gateway_gwfile>\n";
52 $SV->Kill (); $SV->TimedWait (1);
53 $GW->Kill (); $GW->TimedWait (1);
54 exit 1;
57 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
59 if ($client_status != 0) {
60 print STDERR "ERROR: client returned $client_status\n";
61 $status = 1;
64 $CL = $client->CreateProcess ("client", "-k file://$client_gwfile -s");
66 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
68 if ($client_status != 0) {
69 print STDERR "ERROR: client returned $client_status\n";
70 $status = 1;
73 $server_status = $SV->Kill ();
75 if ($server_status != 0) {
76 print STDERR "ERROR: server returned $server_status\n";
77 $status = 1;
80 $gateway_status = $GW->Kill ();
82 if ($gateway_status != 0) {
83 print STDERR "ERROR: gateway returned $gateway_status\n";
84 $status = 1;
87 $server->DeleteFile ($iorbase);
88 $gateway->DeleteFile ($iorbase);
89 $gateway->DeleteFile ($gwbase);
90 $client->DeleteFile ($gwbase);
92 exit $status;