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 my $iorbase = "test.ior";
14 my $server_iorfile = $server->LocalFile ($iorbase);
15 my $client_iorfile = $client->LocalFile ($iorbase);
16 $server->DeleteFile($iorbase);
17 $client->DeleteFile($iorbase);
21 $server_reverse_conf_base = "server_reverse$PerlACE::svcconf_ext";
22 $server_reverse_conf = $server->LocalFile ($server_reverse_conf_base);
24 $server_iiop_uiop_conf_base = "server_iiop_uiop$PerlACE::svcconf_ext";
25 $server_iiop_uiop_conf = $server->LocalFile ($server_iiop_uiop_conf_base);
27 # Copy configuration files to the target.
28 if ($server->PutFile ($server_reverse_conf_base) == -1) {
29 print STDERR
"ERROR: cannot set file <$server_reverse_conf>\n";
32 if ($server->PutFile ($server_iiop_uiop_conf_base) == -1) {
33 print STDERR
"ERROR: cannot set file <$server_iiop_uiop_conf>\n";
37 # Configurations for all tests to be run.
39 ("-ORBSndSock 54321 -ORBendpoint iiop://",
41 "-ORBsvcconf $server_reverse_conf "
42 ."-ORBEndpoint shmiop:// -ORBEndpoint uiop:// -ORBendpoint iiop://",
44 "-ORBRcvSock 12345 -ORBsvcconf $server_iiop_uiop_conf "
45 ."-ORBEndpoint iiop:// -ORBEndpoint uiop:// "
48 @comments = ("* ORB Default Server Protocol Policy Test\n "
49 ."(TAO's default behavior without config files): \n",
51 "* ORB Default Server Protocol Policy Test\n "
52 ."(All TAO protocols are loaded, but in reverse order): \n",
54 "* Overriding ORB Default Server Protocol Policy in the POA\n"
55 ." (POA Server Protocol set to UIOP only): \n");
59 # UIOP only available on Unix. Substitute with alternative tests on Windows.
60 if ($^O
eq "MSWin32" || $^O
eq "VMS") {
61 $server_iiop_shmiop_conf_base = "server_iiop_shmiop$PerlACE::svcconf_ext";
62 $server_iiop_shmiop_conf = $server->LocalFile ($server_iiop_shmiop_conf_base);
64 $server_reverse_nt_conf_base = "server_reverse_nt$PerlACE::svcconf_ext";
65 $server_reverse_nt_conf = $server->LocalFile ($server_reverse_nt_conf_base);
67 # Copy the configuration files
68 if ($server->PutFile ($server_iiop_shmiop_conf_base) == -1) {
69 print STDERR
"ERROR: cannot set file <$server_iiop_shmiop_conf>\n";
72 if ($server->PutFile ($server_reverse_nt_conf_base) == -1) {
73 print STDERR
"ERROR: cannot set file <$server_reverse_nt_conf>\n";
78 ("-ORBSndSock 54321 -ORBendpoint iiop://",
80 "-ORBsvcconf $server_reverse_nt_conf "
81 ."-ORBEndpoint shmiop:// -ORBendpoint iiop://",
83 "-ORBRcvSock 12345 -ORBsvcconf $server_iiop_shmiop_conf "
84 ."-ORBEndpoint iiop:// -ORBEndpoint shmiop:// "
88 "* Overriding ORB Default Server Protocol Policy in the POA\n"
89 ." (POA Server Protocol set to SMHIOP only): \n";
93 print STDERR
"********** RTCORBA Server Protocol Policy Unit Test\n";
97 $SV = $server->CreateProcess ("server");
99 $CL = $client->CreateProcess ("client");
101 foreach $o (@server_opts) {
102 print STDERR
"\n\n----------------------------------\n";
103 print STDERR
" ".$comments[$test_number];
105 my $args = "$o -o $server_iorfile";
107 $server->DeleteFile ($iorbase);
109 $SV->Arguments ($args);
113 if ($server->WaitForFileTimed ($iorbase,
114 $server->ProcessStartWaitInterval()) == -1) {
115 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
116 $SV->Kill (); $SV->TimedWait (1);
120 $CL->Arguments ("-k file://$client_iorfile -ORBdebuglevel 1");
122 $client_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval ());
124 if ($client_status != 0) {
125 print STDERR
"ERROR: client returned $client_status\n";
129 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval ());
131 if ($server_status != 0) {
132 print STDERR
"ERROR: server returned $server_status\n";
139 $server->DeleteFile($iorbase);
140 $client->DeleteFile($iorbase);
142 # Clean up SHMIOP files
143 PerlACE
::check_n_cleanup_files
("server_shmiop_*");