JMeter Testing
From Ogce
Contents |
What this tutorial will help you do
This JMeter Testing tutorial will help you verify that your OGCE Portal 2.2+ is installed and working correctly. Apache JMeter is a software program that allows one to test portlets, webpages, and other online content via assertion tests and load (stress) tests. The following guide will help you to run some assertion tests using JMeter that will show you specifically which portlets and parts of the OGCE package are working under your configuration and which are not.
Nightly Integration Test Results
To see the nightly results of these JMeter tests against TeraGrid services, see
http://ogce.svn.sourceforge.net/viewvc/*checkout*/ogce/BuildAndTest/OGCEJMeterResults.xml.
These are checked into SVN nightly, so to see historical results of these tests, go to
http://ogce.svn.sourceforge.net/viewvc/ogce/BuildAndTest/.
Requirements
In order to run JMeter based assertion tests, the following are required:
- OGCE Portal 2.2+ - Apache Tomcat 5.5.12+ (bundled with portal) - Maven 2.0.7+ (bundled with portal) - Java SDK 1.5+
Installation and Setup
Download and install Apache JMeter:
Go to the Apache JMeter download website: http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
Select either the binary or source (if you wish). If you select the binary: http://apache.mirror99.com/jakarta/jmeter/binaries/jakarta-jmeter-2.3.tgz Download it, and un-tar the package into your home directory:
> tar xzf jakarta-jmeter-2.3.tgz
Download and save JMeter testing file for OGCE
The following file represents contains the set of assertion tests you will run against OGCE. Save it into your JMeter bin directory (right-click, and select Save As):
| Date | Download Link |
|---|---|
| November 30, 2007 | OGCE_Test_Plan.jmx |
Change defaults in the test file to match your system
There are two possible scenerios at this point, either you have already run the OGCE portal through your web-browser (and thus created a new account), or you have not yet created a new account on OGCE.
Either way, you will still need to edit the test file you downloaded in the last step to your specific configuration. The first step is to open up JMeter: go to your JMeter bin directory and run JMeter:
> jakarta-jmeter-2.3RC4/bin/jmeter
Once the JMeter GUI loads, go to File->Open and select the OGCE_Test_Plan.jmx file. You can now start editing the test file for your configuration.
- You should see the following screen:
If you have not yet created an account on your OGCE portal:
- Skip down to the section about modifiying your MyProxy authentication values
- NOTE: The test file has default entries for setting up new OGCE username, password, email, and institution names. If you wish to run this same JMeter test file again, make sure you follow the steps below.
If you have already created an account on the OGCE portal:
- You will need to modify the first two HTTP-REQUEST modules in your JMeter test file to reflect your OGCE username and password. The first step is to delete the HTTP-REQUEST module called "Set up new portal account". You don't need this module since you already have an account, so just right click on the name, and in the sub-menu, click 'remove'.
- You need to edit the next HTTP-REQUEST module titled "Log into portal". Click on this module's name, and in the right hand window, edit the "username" and "password" fields to reflect your own OGCE username and password values. The following picture is a snapshot of what your screen should look like before making your edits:
Edit MyProxy authentication values
With the above steps completed, your test file will be able to log into the OGCE portal, but you still need to help it grab your MyProxy credentials to use all the portlets OGCE has to offer effectively.
- On the left hand menu in JMeter, look for the HTTP-REQUEST module titled "proxymanager-portlet (EDIT customize)". Click on this, and in the right hand window, modify the username field to reflect your own MyProxy username. The following is a snapshot of what your screen should look like before modification:
- On the left hand menu in JMeter, look for the HTTP-REQUEST module titled "proxymanager-portlet (get new cred)". Click on this, and in the right hand window, modify the username and password fields to reflect your own MyProxy username and password values. The following is a snapshot of what your screen should look like before modification:
Running the JMeter test file
In order to run the JMeter test file, you have to have your Tomcat server up and running on port 8080. If your server is not running on this port, you will have to modify the port number on each of the HTTP-REQUEST modules. You can do this by clicking on each HTTP-REQUEST module, and in the corresponding right hand window, modify each module's port number field to your desired port number value.
The following are steps to get your tests running
- 1) Go to the top toolbar menu, and click Run->Start
- 2) Scroll down the left hand menu, and click "View Results Tree" at the bottom of the menu list. The Results Tree provides a snapshot of each HTTP-REQUEST sent from the test file, and whether each request succeeded or not. As the JMeter test proceeds, the right hand window will fill with the results of the tests.
- The following is a snapshot of what the Results Tree window looks like - as you can see, portlets: condor-g and gpir-portlet failed the tests.
Analyzing the test results
After the tests fully complete, you will see (in the results tree right hand window) a list of test modules and their results. All the green colored modules succeeded but the red colored failed.
- To see why specific HTTP-REQUEST modules failed, on the left hand navigation menu at the bottom, click "Assertion Results". The right hand window will show specifically why certain tests failed. The following is a snapshot of what the assertion results window may look like:
- To see the HTML version of test results (what the server sent back), click on "View Results Tree" in the left-hand navigation. In the right hand menu, click any HTTP-REQUEST module's name, and then in the right hand window, click the "Response data" tab. Finally, at the bottom of this window, click the "Render HTML" radio button to view HTML responses from the server. The following is a snapshot of what the rendered html may look like for the failed gpir-portlet:
