From b56e1daac71945f0ed80c62a959922c8d18ed7ed Mon Sep 17 00:00:00 2001 From: marina Date: Wed, 22 Nov 2000 00:06:28 +0000 Subject: ChangelogTag:Tue Nov 21 18:04:00 2000 Marina Spivak --- TAO/tests/RTCORBA/Banded_Connections/README | 271 +++++++++++++++++++--------- TAO/tests/RTCORBA/README | 7 +- 2 files changed, 189 insertions(+), 89 deletions(-) diff --git a/TAO/tests/RTCORBA/Banded_Connections/README b/TAO/tests/RTCORBA/Banded_Connections/README index fc367260a41..dfab6b9c90f 100644 --- a/TAO/tests/RTCORBA/Banded_Connections/README +++ b/TAO/tests/RTCORBA/Banded_Connections/README @@ -1,130 +1,225 @@ $Id$ -This is a unit test for RTCORBA::SERVER_DECLARED priority model. +This is a test for RTCORBA::PriorityBandedConnectionPolicy. + +Description +----------- +This test consists of seven mini-tests, each exercising +some aspect of PriorityBandedConnectionPolicy: + +(Server) + +1. Attempt to create a POA with + RTCORBA::PriorityBandedConnectionPolicy but without the + RTCORBA::PriorityModelPolicy. Should get POA::InvalidPolicy + exception. + +2. Attempt to create a POA with + RTCORBA::PriorityBandedConnectionPolicy where bands do not match + the resources of the POA, i.e., threadpool lanes/endpoints. + Should get POA::InvalidPolicy exception. + +3. Create a POA with RTCORBA::SERVER_DECLARED priority model and + RTCORBA::PriorityBandedConnectionPolicy. Attempt to register an + object with priority that doesn't match the resources/configuration + of that POA, i.e., its priority bands. Should get BAD_PARAM exception. + +(Client) + +4. Set RTCORBA::PriorityBandedConnectionPolicy on the object where + bands do not match server resources, i.e., threadpool + lanes/endpoints. Attempt an invocation on the object. Should get + INV_POLICY exception. + +5. Set RTCORBA::PriorityBandedConnectionPolicy on the object with + CLIENT_PROPAGATED priority model where bands match server + resources. Attempt several invocations on the object, changing the + priority of the invoking client thread before each. This should + succeed, Verify that correct band is being used for each invocation, and + that appropriate server threadpool lane is providing the service. + +6. Now attempt one more invocation on the same object (with + CLIENT_PROPAGATED and bands), but with the client thread priority + not matching any of the bands. Should get INV_POLICY exception. + +7. Attempt invocation on an object with SERVER_DECLARED priority model + and RTCORBA::PriorityBandedConnectionPolicy set using the client + thread with priority not matching any of the object's priority + bands. This should succeed. Verify the correct band and server + threadpool lane are being used for the invocation. Scenario: ---------- - -The server creates a POA with RTCORBA::SERVER_DECLARED priority model -policy. Two objects are created using this POA, one inherits the POA -priority and the second one overrides POA priority with its own. -Server threadpool resources are configured appropriately. (Once POA -threadpools are completely supported, this means associating a -two-lane threadpool with the POA, one lane corresponding to POA -priority, and another to object priority. However, currently, while -RTCORBA POA threadpools are not in place yet, this means emulating POA -threadpool with TAO's Reactor-per-priority scheme, i.e., ORB-level -pool with lane for each endpoint priority.) Finally, the server -attempts to create a third object, using invalid/not matching the -resources priority, i.e., priority not matching any of the pool -lanes. This attempt should fail, and the server expects to receive -the appropriate exception. - -The client obtains two object references and invokes a method on each -several times. On each invocation, the client passes object's server -declared priority as operation argument. This allows the servant to -check that appropriate resources are being used for servicing client -requests. In particular, servant checks that priority of the thread -used for servicing the request equals to the server declared priority -of the object, known from the operation argument. To run (on Unix): ------- -$./server [-p -o -c ] - -a -b - -ORBsvcconf server.conf - -ORBendpoint xxxx://targethost:0/priority= - -ORBendpoint xxxx://targethost:0/priority= +$./server [-n -o ] + [-w -b ] + -p + -ORBdebuglevel 1 -ORBSvcConf server.conf + -ORBendpoint iiop://targethost:0/priority= + -ORBendpoint iiop://targethost:0/priority= [more endpoints if desired] -$./client [-p -o ] +$./client [-n -o ] + -a -b -c + -ORBSvcConf client.conf Options: -------- Server: --p Default: test1.ior +-n Default: test1.ior Filename for output of the first object's IOR - (i.e., object that does not override POA - priority). + (the object with CLIENT_PROPAGATED priority + model.) -o Default: test2.ior Filename for output of the second object's IOR - (i.e., object that overrides POA priority). - --a Default: -1, must be overridden - SERVER_DECLARED priority of the poa. - --b Default: -1, must be overridden - SERVER_DECLARED priority of the second object. - --c Default: -1 - Invalid/not matching the configuration - priority value, used in an attempt to activate - a third object. The test checks that such - attempt fails and an appropriate exception is - thrown. + (the object with SERVER_DECLARED priority + model and PriorityBandedConnectionPolicy set.) + +-b Default: bands + Name of the file containing priority bands + used for the test (on server and client). + + The format of the file is a single line, with + no leading or trailing spaces, with a list of + all bands' lows and highs. Single space + is used to separate values. For example: + 65 69 74 76 80 80 + +-p Default: -1, must be overridden. + SERVER_DECLARED priority of the poa. Must + match one of the bands specified in the + . + +-w Default: -1 + Priority not matching any of the priority + bands. Used for test #3. + +-ORBdebuglevel 1 Default: none + This ORB option is useful for verifying that + correct band/threadpool lane are used during + invocations. The following are the required server ORB options for this test. -These options help set up server resources to emulate a two-lane POA -threadpool, one lane with , and one lane -with . Once POA threadpools are implemented, these +These options help set up server resources to emulate POA +threadpool with ORB pool. Once POA threadpools are implemented, these options will go away. -ORBSvcConf server.conf --ORBendpoint xxxx://targethost:0/priority= --ORBendpoint xxxx://targethost:0/priority= +-ORBendpoint xxxx://targethost:0/priority= +-ORBendpoint xxxx://targethost:0/priority= +... There must be enough endpoints to cover all bands specified in +the . For an example, see run_test.pl Client: --p Default: file://test1.ior - IOR for the first object (with POA's - priority). +-n Default: file://test1.ior + IOR for the first object (with + CLIENT_PROPAGATED priority model). -o Default: file://test2.ior - IOR for the second object. - + IOR for the second object (with + SERVER_DECLARED priority model and priority + bands). + +-a Default: -1, must be overridden. + Client thread priority that will be used for + one of the invocations. Must match one of the + bands specified in the . Used for + test #5. + +-b Default: -1, must be overridden. + Client thread priority that will be used for + one of the invocations. Must match one of the + bands specified in the . Used for + test #5. + +-c Default: -1, must be overridden. + Client thread priority that will be used for + one of the invocations. Must not match any + of the bands specified in the . + Used for test #6. Expected output: ---------------- -Below is the expected output from run_test.pl on a Windows -platform. See run_test.pl for command-line options used for client and -server. NOTE: expected output differs on unix. +Below is the output from run_test.pl on Unix. (On windows, different +priority values are used). See run_test.pl for more info. Note, due +to the use of -ORBdebuglevel option, test output may differ from what +is shown above as ORB debug messages are modified and added. -In general, the output must contain "BAD_PARAM exception is caught as -expected.", and server declared priorities must equal corresponding -servant thread priorities. +In general, tests 1, 2, 3, 4, and 6 must result in expected exceptions +being caught. In test 5 and 7, object and server thread priorities +must match one of the priority bands, and all of the priority values +must correspond to those specified with the command-line options. +********** RTCORBA Priority Banded Connections Unit Test +TAO (25332|1) Loaded default protocol +TAO (25332|1) Loaded default protocol +TAO (25332|1) Loaded default protocol -********** RTCORBA SERVER_DECLARED Priority Unit Test + Test 1 +InvalidPolicy exception is caught as expected. + Test 2 +InvalidPolicy exception is caught as expected. -Activated object one as + Test 3 +BAD_PARAM exception is caught as expected. +Activated object one as -Activated object two as -BAD_PARAM exception is caught as expected. -Server_Declared priority: 3 Servant thread priority: 3 -Server_Declared priority: 5 Servant thread priority: 5 -Server_Declared priority: 3 Servant thread priority: 3 -Server_Declared priority: 5 Servant thread priority: 5 -Server_Declared priority: 3 Servant thread priority: 3 -Server_Declared priority: 5 Servant thread priority: 5 -Server_Declared priority: 3 Servant thread priority: 3 -Server_Declared priority: 5 Servant thread priority: 5 -Server_Declared priority: 3 Servant thread priority: 3 -Server_Declared priority: 5 Servant thread priority: 5 +Activated object two as + + + Test 4 +INV_POLICY exception is caught as expected. + + Test 5 +TAO (25332|5) IIOP connection from client<127.0.0.1:57368> on 17 +RTCORBA::CLIENT_PROPAGATED processing (25332|5): original thread priority 75 temporarily changed to 76 + +Object bands: +1) 65 69 +2) 74 76 +3) 80 80 +Object priority: 76 Servant thread priority: 76 +Band 2 was used for this invocation +TAO (25332|6) IIOP connection from client<127.0.0.1:57369> on 18 + +Object bands: +1) 65 69 +2) 74 76 +3) 80 80 +Object priority: 80 Servant thread priority: 80 +Band 3 was used for this invocation + + Test 6 +INV_POLICY exception is caught as expected. + + Test 7 +TAO (25332|4) IIOP connection from client<127.0.0.1:57370> on 19 + +Object bands: +1) 65 69 +2) 74 76 +3) 80 80 +Object priority: 67 Servant thread priority: 66 +Band 1 was used for this invocation + Server ORB event loop finished + + diff --git a/TAO/tests/RTCORBA/README b/TAO/tests/RTCORBA/README index f656e2ae28d..e82186edd3d 100644 --- a/TAO/tests/RTCORBA/README +++ b/TAO/tests/RTCORBA/README @@ -44,4 +44,9 @@ includes the following: . Private_Connection - Tests RTCORBA::PrivateConnectionPolicy support. \ No newline at end of file + Tests RTCORBA::PrivateConnectionPolicy support. + + . Banded_Connections + + Tests RTCORBA::PriorityBandedConnectionPolicy. + -- cgit v1.2.1