1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
10 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
11 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
13 $iorbase1 = "test1.ior";
14 $iorbase2 = "test2.ior";
16 $client_iorfile1 = $client->LocalFile ($iorbase1);
17 $client_iorfile2 = $client->LocalFile ($iorbase2);
18 $server_iorfile1 = $server->LocalFile ($iorbase1);
19 $server_iorfile2 = $server->LocalFile ($iorbase2);
21 $client->DeleteFile ($iorbase1);
22 $client->DeleteFile ($iorbase2);
23 $server->DeleteFile ($iorbase1);
24 $server->DeleteFile ($iorbase2);
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";
35 if ($server->PutFile ($svc_conf.'.xml') == -1) {
36 print STDERR
"ERROR: cannot set file <".$server->LocalFile ($svc_conf.'.xml').">\n";
39 if ($client->PutFile ($svc_conf) == -1) {
40 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf).">\n";
43 if ($client->PutFile ($svc_conf.'.xml') == -1) {
44 print STDERR
"ERROR: cannot set file <".$client->LocalFile ($svc_conf.'.xml').">\n";
48 print STDERR
"\n********** RTCORBA Priority Banded Connections Unit Test\n";
50 # Different priority values for the bands on each OS.
52 if ($^O
eq "MSWin32") {
59 # since we only do remote testing on *nix platforms
60 if ($server->PutFile ('bands.unix') == -1) {
61 print STDERR
"ERROR: cannot set file <".$server->LocalFile ('bands.unix').">\n";
66 $SV = $server->CreateProcess ("server", $server_args . " -n $server_iorfile1 -o $server_iorfile2"),
68 $CL = $client->CreateProcess ("client", "-n file://$client_iorfile1 -o file://$client_iorfile2");
70 $server_status = $SV->Spawn();
72 if ($server_status != 0) {
73 print STDERR
"ERROR: server returned $server_status\n";
77 if ($server->WaitForFileTimed ($iorbase2,
78 $server->ProcessStartWaitInterval()) == -1) {
79 $server_status = $SV->TimedWait (1);
80 if ($server_status == 2) {
81 # Mark as no longer running to avoid errors on exit.
86 print STDERR
"ERROR: cannot find file <$client_iorfile2>\n";
92 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
94 if ($client_status != 0) {
95 print STDERR
"ERROR: client returned $client_status\n";
99 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval () + 15);
101 if ($server_status != 0) {
102 print STDERR
"ERROR: server returned $server_status\n";
106 $client->DeleteFile ($iorbase1);
107 $client->DeleteFile ($iorbase2);
108 $server->DeleteFile ($iorbase1);
109 $server->DeleteFile ($iorbase2);
111 # Clean up SHMIOP files
112 PerlACE
::check_n_cleanup_files
("server_shmiop_*");