Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / RTCORBA / Client_Propagated / run_test.pl
bloba6ed3a0bb09cef20b8aaf40885a94ba0a005b656
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 = "test.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 $svc_conf = 'svc.conf';
30 # copy the configuation files
31 if ($server->PutFile ($svc_conf) == -1) {
32 print STDERR "ERROR: cannot set file <".$server->LocalFile ($svc_conf).">\n";
33 exit 1;
35 if ($server->PutFile ($svc_conf.'.xml') == -1) {
36 print STDERR "ERROR: cannot set file <".$server->LocalFile ($svc_conf.'.xml').">\n";
37 exit 1;
39 if ($client->PutFile ($svc_conf) == -1) {
40 print STDERR "ERROR: cannot set file <".$client->LocalFile ($svc_conf).">\n";
41 exit 1;
43 if ($client->PutFile ($svc_conf.'.xml') == -1) {
44 print STDERR "ERROR: cannot set file <".$client->LocalFile ($svc_conf.'.xml').">\n";
45 exit 1;
48 print STDERR "\n RTCORBA CLIENT_PROPAGATED Priority Unit Test\n\n";
50 $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile");
51 $CL = $client->CreateProcess ("client", "-ORBdebuglevel $debug_level -k file://$client_iorfile");
53 $server_status = $SV->Spawn ();
55 if ($server_status != 0) {
56 print STDERR "ERROR: server returned $server_status\n";
57 exit 1;
60 if ($server->WaitForFileTimed ($iorbase,
61 $server->ProcessStartWaitInterval()) == -1) {
62 $server = $SV->TimedWait (1);
63 if ($server == 2) {
64 # Mark as no longer running to avoid errors on exit.
65 $SV->{RUNNING} = 0;
66 exit $status;
67 } else {
68 print STDERR "ERROR: cannot find file <$iorbase>\n";
69 $SV->Kill ();
70 exit 1;
74 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval() + 45);
76 if ($client_status != 0) {
77 print STDERR "ERROR: client returned $client_status\n";
78 $status = 1;
81 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval() + 45);
83 if ($server_status != 0) {
84 print STDERR "ERROR: server returned $server_status\n";
85 $status = 1;
88 $server->DeleteFile($iorbase);
89 $client->DeleteFile($iorbase);
91 exit $status;