Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contains instructions to load test Apache Fortress using maven jmeter plugin.
mvn install -Dload.file=./ldap/setup/JmeterTestPolicy.xml
A. Add User: src/test/jmeter/ftAddUser.jmx
B. Del User: src/test/jmeter/ftDelUser.jmx
C. Check User: src/test/jmeter/ftCheckUser.jmx
These settings affect the length, duration, and the number of threads:
For example:
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Fortress CreateSession" enabled="true"> ... <elementProp name="ThreadGroup.main_controller" ...> <boolProp name="LoopController.continue_forever">false</boolProp> <stringProp name="LoopController.loops">1000</stringProp> </elementProp> <stringProp name="ThreadGroup.num_threads">10</stringProp> <stringProp name="ThreadGroup.ramp_time">10</stringProp> ... </ThreadGroup>
This test will start ten threads in ten seconds. Each thread executes the createSession function 1000 times before terminating.
From FORTRESS_HOME folder, enter the following command from a system prompt:
A. Add Users:
Will add user entry. Optionally will perform an update and/or role assignment.
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true -Dsleep=30 -Dupdate=true -Dou=loadtestu -Drole=jmeterrole
This test adds users. It uses runtime arguments to define behavior:
hostname=foo <-- optional field useful for distributing the load across servers in a multi-master env, it will override what's in fortress.properties
qualifier=A1 <-- this is used to construct userid: hostname + qualifier + counter
verify=true <-- will read after operation to verify success
update=true <-- will edit user's description if set to true
sleep=30 <-- sleep this many millisecones after each op
ou=loadtestu <-- this is a required attribute on user entry and must exist in user ou tree prior to test
role=jmeterrole <-- this is an optional attribute on user entry
All but hostname may also be set as properties in add config or del config files.
B. Delete Users:
mvn verify -Ploadtest -Dtype=ftDelUser -Dqualifier=A1 -Dverify=true -Dsleep=30
C. Check Users:
Will perform a createSession. Optionally reads the entry and/or permission checks.
mvn verify -Ploadtest -Dtype=ftCheckUser -Dqualifier=A1 -Dverify=true -Dsize=20 -Dperm=jmeterobject.oper
This test performs createSession on users. It uses runtime arguments to define behavior:
A. Qualifier property.
The add test generates userids based on: hostname + qualifier + counter. The counter is global across all threads, so if you enable 20 threads * 100 loops, with a qualifier = ‘A1’, 2,000 users will be added:
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1
hostname-A1-1 hostname-A1-2 hostname-A1-3 ... hostname-A1-1000
If you run the test a second time (before a delete run) there will be duplicates because it tries to add users with same userids again. This is the idea of the ‘qualifier’. Change its value to ensure the uids remain unique across test runs.
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A2
Or, you can run a delete before the next add:
mvn verify -Ploadtest -Dtype=ftDelUser -Dqualifier=A1
Just make sure the thread and loop counts in ftDelUser.jmx are the same as ftAddUser.jmx
B. Verify
If set to true, after every operation, a read of the entry will be performed.
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dverify=true
C. Update
If set to true, after every add, an update will be performed on user's description field.
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Dupdate=true
D. Role
If ‘role’ set as property, it will be assigned after the user has been added. The role itself must already exist before being used in assignment to user.
mvn verify -Ploadtest -Dtype=ftAddUser -Dqualifier=A1 -Drole=jmeterrole
E. Perm
This applies only to the CheckUser test. If set, it will be used as permission in checkAccess call 10 times. For example:
mvn verify -Ploadtest -Dtype=ftCheckUser -Dperm=jmeterobject.oper
Will call checkAccess:
obj: jmeterobject op oper1 obj: jmeterobject op oper2 obj: jmeterobject op oper3 ... obj: jmeterobject op oper10
These assignments must already exist before running this test.
A. View the results
B. View the logs