1. Exceeding Max Capacity and testing under bad conditions
2. Overview of how the delay tool works.
3. Basic setup & working example
4. java-TestProxy Tool
This is the opensource java test tool that I used to add delays to the socket connections in other CA Products (most notably Single-Sign-On) we've used it a few times to simulate issues such as failover or delays in backend processes.
The java-TestProxy.zip file is attached to this article. Download and unzip it.
In the directory are :
You need to edit the .bat files to ensure they point to java sdk location, then run the compile.
Note: There are .sh versions of the files for unix systems as well
compile.bat - will compile the src code and build the TestProxy.jar file
run.bat - will run the tool, and give you a cmd prompt.
When starting up initial commands are read from proxyinit.txt, so you can set some standard setup there.
4.2 Basic Setup
From the current proxyinit.txt
# add simple proxy
The above create two new "proxy" listens, on :8081 and :8082 both of which forward to localhost:80
(I use this setup often to add delay to one backed, while leaving the other backend unchanged - can be used to test failover or load balancing )
This starts the proxy servers listening, there is also a stopProxy <port> which will stop them listening.
Then to add a 400 ms delay to any traffic via port 8081 we issue the following command, either in the proxyinit.txt file or at the cmd line prompt.
addSendDelay 8081 400
4.3 Full list of Commands
Typing "help" at the prompt gives a full list of commands.
# Commands to setup proxy ports :
addProxy <localport>:<remotehost>:<remoteport> - Create new proxy service, and start it
removeProxy <localport> - remove proxy service, and close all client connections
startProxy <localport> - Start listenin on localport for new connections (need previously setup service)
stopProxy <localport> - Stop listening for new connection, but leave existing ones open
# Commands to add delays to proxy connections :
setSendDelay <localport> <ms> - Add a delay in client requests before send to backend
setRecvDelay <localport> <ms>- Add a delay in client requests before pass back to client
# Commands to close specific client connections:
close <localport> <num> - Close a specific client connection from 'status' report
closeAll <localport> - Close all client connections for localport (listener remains active for new clients however)
# Commands to list connections :
status <localport> -print status of one port
status -print status of all ports
# Misc commands for batch scripts and init file
. <filename> - take commands from file
source <filename> -takes commands from file
sleep <time-sec> -sleep for time (for use in script file)
# comment - comment line, can also be
<command> # comment - comments can occur on cmd lines.
4.4 Examples of using this tool in CA Single-Sign-On
Here are the main articles showing how used this tool in CA SSO
Cheers - Mark