diff options
author | Nick Williams <nicholas.williams@zaxiom.com> | 2020-07-30 09:57:44 -0500 |
---|---|---|
committer | Nick Williams <nicholas.williams@zaxiom.com> | 2020-08-28 08:05:34 -0500 |
commit | c5dae3839b9e056e6c91edc7684777a4b91c2baa (patch) | |
tree | 093e187ab071bf3338c6c2f679f21eb146a9c572 | |
parent | 82f8587c74e84654cff32984c42810df9344f625 (diff) | |
download | ATCD-c5dae3839b9e056e6c91edc7684777a4b91c2baa.tar.gz |
Updated for pull request comments
15 files changed, 161 insertions, 94 deletions
diff --git a/TAO/bin/tao_orb_tests.lst b/TAO/bin/tao_orb_tests.lst index 303c079e515..e7b9a3792c5 100644 --- a/TAO/bin/tao_orb_tests.lst +++ b/TAO/bin/tao_orb_tests.lst @@ -355,6 +355,8 @@ TAO/tests/Codec/run_test.pl TAO/tests/Bug_1693_Test/run_test.pl TAO/tests/IDL_Test/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !ANDROID TAO/tests/ORB_init/run_test.pl: +TAO/tests/ORB_portspan/run_test.pl -iiop: +TAO/tests/ORB_portspan/run_test.pl -diop: !NO_DIOP TAO/tests/ORB_destroy/run_test.pl: TAO/tests/ORB_shutdown/run_test.pl: TAO/tests/Server_Port_Zero/run_test.pl: diff --git a/TAO/docs/ORBEndpoint.html b/TAO/docs/ORBEndpoint.html index eecd1c81cc5..f2857bcd608 100644 --- a/TAO/docs/ORBEndpoint.html +++ b/TAO/docs/ORBEndpoint.html @@ -578,13 +578,46 @@ <P> Since DIOP endpoints in TAO have the same form as <A HREF="#IIOP">IIOP</A> endpoints, a detailed description is - therefore omitted. DIOP has no support for endpoint-specific - options. + therefore omitted. <P> We recommend explicitly setting port numbers for endpoints since TAO does not support automatic selection of free endpoints for UDP sockets. Instead, the ORB will try to use the same default port number in every case. + <P> + + <h3>DIOP Endpoint-Specific Options</h3> + <P> + TAO supports the following endpoint-specific options that apply only + to DIOP endpoints: + + <TABLE BORDER="2" CELLSPACING="2" CELLPADDING= "0"> + <TR> + <TH>Option</TH> + <TH>Availability</TH> + <TH>Description</TH> + </TR> + <TR> + <TD> + <CODE>portspan</CODE> + </TD> + <TD> + <CODE>TAO 2.5.11</CODE> + </TD> + <TD> + The <CODE>portspan</CODE> option works identically to the + <A HREF="#IIOP">IIOP</A> <CODE>portspan</CODE> option documented above. + <P> + The format for <CODE>ORBListenEndpoints</CODE> with the + <CODE>portspan</CODE> option is: + <BLOCKQUOTE> + <CODE>-ORBListenEndpoints diop://[</CODE><I>hostname</I><CODE>]:</CODE><I +>initialPort</I><CODE>/portspan=</CODE><I>span</I> + </BLOCKQUOTE> + </TD> + </TR> + </TABLE> + </P> <h3>DIOP Endpoint Examples</h3> <P> @@ -592,6 +625,7 @@ <UL> <LI><CODE>-ORBListenEndpoints diop://1.0@foo1:2345</CODE> <LI><CODE>-ORBListenEndpoints diop://1.1@:1234</CODE> + <LI><CODE>-ORBListenEndpoints diop://1.1@foo:2020/portspan=30</CODE> </UL> <hr> diff --git a/TAO/tao/Strategies/DIOP_Acceptor.cpp b/TAO/tao/Strategies/DIOP_Acceptor.cpp index 50827f1deb2..6bc6a5d1269 100644 --- a/TAO/tao/Strategies/DIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/DIOP_Acceptor.cpp @@ -1077,7 +1077,7 @@ TAO_DIOP_Acceptor::parse_options (const char *str) // @@ What's the lower bound on the range? zero, or one? if (range < 1 || range > ACE_MAX_DEFAULT_PORT) TAOLIB_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) Invalid IIOP endpoint ") + ACE_TEXT ("TAO (%P|%t) Invalid DIOP endpoint ") ACE_TEXT ("portspan: <%C>\n") ACE_TEXT ("Valid range 1 -- %d\n"), value.c_str (), ACE_MAX_DEFAULT_PORT), diff --git a/TAO/tests/ORB_init/Portspan/ORB_Init_Portspan.mpc b/TAO/tests/ORB_init/Portspan/ORB_Init_Portspan.mpc deleted file mode 100644 index 814a5e5ea44..00000000000 --- a/TAO/tests/ORB_init/Portspan/ORB_Init_Portspan.mpc +++ /dev/null @@ -1,4 +0,0 @@ -// -*- MPC -*- -project(*Server): taoserver { -} - diff --git a/TAO/tests/ORB_init/Portspan/README b/TAO/tests/ORB_init/Portspan/README deleted file mode 100644 index 8a01481a2d4..00000000000 --- a/TAO/tests/ORB_init/Portspan/README +++ /dev/null @@ -1,16 +0,0 @@ - - -portspan Test -------------- - -The portspan test verifies that the portspan option to the ORB_init() call -behaves correctly. This option allows you to restrict the port that a -server-side ORB will use to listen for IIOP requests, from a given range -of port numbers, starting at a given initial port. - -The test works by starting a simple ORB on an endpoint with a portspan of 2. -server -ORBEndpoint iiop://:5555/portspan=2 -The test script does this three times and reports an error if the first two -don't succeed, or if the third call doesn't fail. - - diff --git a/TAO/tests/ORB_init/Portspan/run_test.pl b/TAO/tests/ORB_init/Portspan/run_test.pl deleted file mode 100755 index 0544c5cba09..00000000000 --- a/TAO/tests/ORB_init/Portspan/run_test.pl +++ /dev/null @@ -1,71 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# -*- perl -*- - -use lib "$ENV{ACE_ROOT}/bin"; -use PerlACE::TestTarget; - -$status = 0; - -my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; - -foreach my $protocol ("iiop", "diop") { - $port = $server->RandomPort (); - $endpoint = "$protocol://:$port/portspan=2"; - print STDOUT "Creating three $protocol servers with endpoint $endpoint...\n"; - - $SV1 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint"); - $SV2 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint"); - $SV3 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint"); - - print STDOUT "Starting server 1\n"; - $server_status = $SV1->Spawn (); - if ($server_status != 0) { - print STDERR "ERROR: server failed to start: $server_status\n"; - exit 1; - } - $server_status = $SV1->Wait (1); - if ($server_status != -1) { - print STDERR "ERROR: server exited prematurely: $server_status\n"; - exit 1; - } - print STDOUT "Started server 1\n"; - - print STDOUT "Starting server 2\n"; - $server_status = $SV2->Spawn (); - if ($server_status != 0) { - print STDERR "ERROR: server failed to start: $server_status\n"; - $SV1->Kill (); - exit 1; - } - $server_status = $SV2->Wait (1); - if ($server_status != -1) { - print STDERR "ERROR: server exited prematurely: $server_status\n"; - exit 1; - } - print STDOUT "Started server 2\n"; - - print STDOUT "Starting server 3\n"; - $server_status = $SV3->Spawn (); - if ($server_status == 0) { - $server_status = $SV3->Wait (1); - if ($server_status == -1) { - print STDERR "ERROR: Last server didn't fail, still running!\n"; - $SV1->Kill (); - $SV2->Kill (); - $SV3->Kill (); - exit 1; - } - } - print STDOUT "Success: server 3 failed to start, stopping...\n"; - - $SV1->Kill(); - $SV2->Kill(); - $SV3->Kill(); - - print STDOUT "Portspan $protocol test completed successfully.\n\n"; -} - -exit $status; diff --git a/TAO/tests/ORB_init/Portspan/.gitignore b/TAO/tests/ORB_portspan/.gitignore index 2e326e8073b..2e326e8073b 100644 --- a/TAO/tests/ORB_init/Portspan/.gitignore +++ b/TAO/tests/ORB_portspan/.gitignore diff --git a/TAO/tests/ORB_portspan/ORB_portspan.mpc b/TAO/tests/ORB_portspan/ORB_portspan.mpc new file mode 100644 index 00000000000..e508035c1b8 --- /dev/null +++ b/TAO/tests/ORB_portspan/ORB_portspan.mpc @@ -0,0 +1,4 @@ +// -*- MPC -*- +project(*Server): taoserver, strategies { +} + diff --git a/TAO/tests/ORB_portspan/README b/TAO/tests/ORB_portspan/README new file mode 100644 index 00000000000..bff4bde3645 --- /dev/null +++ b/TAO/tests/ORB_portspan/README @@ -0,0 +1,21 @@ + + +portspan Test +------------- + +The portspan test verifies that the portspan option to the ORB_init() call +behaves correctly. This option allows you to restrict the port that a +server-side ORB will use to listen for requests, from a given range of port +numbers, starting at a given initial port. + +The test works by starting a simple ORB on an endpoint with a portspan of 2. +server -ORBEndpoint iiop://:5555/portspan=2. The test script does this +three times and reports an error if the first two don't succeed or if the +third call doesn't fail. + +The test accepts the following mutually-exclusive protocol arguments to +determine which protocol gets tested for portspan support. You must supply +exactly one of these arguments: + +• -iiop +• -diop diff --git a/TAO/tests/ORB_portspan/run_test.pl b/TAO/tests/ORB_portspan/run_test.pl new file mode 100755 index 00000000000..5e1ced9d851 --- /dev/null +++ b/TAO/tests/ORB_portspan/run_test.pl @@ -0,0 +1,97 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +my $usage = "Usage: ORB_portspan/run_test.pl [-iiop|-diop]"; + +my $protocol = undef; +foreach $i (@ARGV) { + if ($i eq "-iiop") { + $protocol = "iiop"; + } + elsif ($i eq "-diop") { + $protocol = "diop"; + } + else { + print STDERR "ERROR: Unknown option: $i\n$usage\n"; + exit 1; + } +} + +if (!$protocol) { + print STDERR "ERROR: $usage\n"; + exit 1; +} + +$status = 0; + +my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; + +$port = $server->RandomPort (); +$endpoint = "$protocol://:$port/portspan=2"; + +$svcconf = ""; +if (-e "svc-$protocol.conf") { + $svcconf = "-ORBSvcConf svc-$protocol.conf"; + print STDOUT "Using $svcconf\n"; +} + +print STDOUT "Creating three $protocol servers with endpoint $endpoint...\n"; + +$SV1 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf"); +$SV2 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf"); +$SV3 = $server->CreateProcess ("server", "-ORBEndpoint $endpoint $svcconf"); + +print STDOUT "Starting server 1\n"; +$server_status = $SV1->Spawn (); +if ($server_status != 0) { + print STDERR "ERROR: server failed to start: $server_status\n"; + exit 1; +} +$server_status = $SV1->Wait (1); +if ($server_status != -1) { + print STDERR "ERROR: server exited prematurely: $server_status\n"; + exit 1; +} +print STDOUT "Started server 1\n"; + +print STDOUT "Starting server 2\n"; +$server_status = $SV2->Spawn (); +if ($server_status != 0) { + print STDERR "ERROR: server failed to start: $server_status\n"; + $SV1->Kill (); + exit 1; +} +$server_status = $SV2->Wait (1); +if ($server_status != -1) { + print STDERR "ERROR: server exited prematurely: $server_status\n"; + exit 1; +} +print STDOUT "Started server 2\n"; + +print STDOUT "Starting server 3\n"; +$server_status = $SV3->Spawn (); +if ($server_status == 0) { + $server_status = $SV3->Wait (1); + if ($server_status == -1) { + print STDERR "ERROR: Last server didn't fail, still running!\n"; + $SV1->Kill (); + $SV2->Kill (); + $SV3->Kill (); + exit 1; + } +} +print STDOUT "Success: server 3 failed to start, stopping...\n"; + +$SV1->Kill(); +$SV2->Kill(); +$SV3->Kill(); + +print STDOUT "Portspan $protocol test completed successfully.\n\n"; + +exit $status; diff --git a/TAO/tests/ORB_init/Portspan/server.cpp b/TAO/tests/ORB_portspan/server.cpp index e5e58917cdd..e5e58917cdd 100644 --- a/TAO/tests/ORB_init/Portspan/server.cpp +++ b/TAO/tests/ORB_portspan/server.cpp diff --git a/TAO/tests/ORB_init/Portspan/simple.idl b/TAO/tests/ORB_portspan/simple.idl index dca7ddc8856..dca7ddc8856 100644 --- a/TAO/tests/ORB_init/Portspan/simple.idl +++ b/TAO/tests/ORB_portspan/simple.idl diff --git a/TAO/tests/ORB_init/Portspan/simpleI.cpp b/TAO/tests/ORB_portspan/simpleI.cpp index ce6324fb1e6..ce6324fb1e6 100644 --- a/TAO/tests/ORB_init/Portspan/simpleI.cpp +++ b/TAO/tests/ORB_portspan/simpleI.cpp diff --git a/TAO/tests/ORB_init/Portspan/simpleI.h b/TAO/tests/ORB_portspan/simpleI.h index f1585e382e5..f1585e382e5 100644 --- a/TAO/tests/ORB_init/Portspan/simpleI.h +++ b/TAO/tests/ORB_portspan/simpleI.h diff --git a/TAO/tests/ORB_init/Portspan/svc.conf b/TAO/tests/ORB_portspan/svc-diop.conf index a91d2a12663..a91d2a12663 100644 --- a/TAO/tests/ORB_init/Portspan/svc.conf +++ b/TAO/tests/ORB_portspan/svc-diop.conf |