Permalink
Browse files

Adding Vagrant support for testing jmeter-ec2 locally

  • Loading branch information...
erichelgeson authored and Eric.Helgeson committed Sep 21, 2013
1 parent 99dc7c4 commit a42837b984298d8175332c5379b2546dd413ba93
Showing with 75 additions and 0 deletions.
  1. +21 −0 README.md
  2. +25 −0 Vagrantfile
  3. +29 −0 jmeter-ec2.properties.vagrant
View
@@ -113,6 +113,27 @@ IMPORTANT - There is a limit imposed by Amazon on how many instances can be run
Where 'someproject' is the name of the project directory (and jmx file) and '1' is the number of instances you wish to spread the test over. If you have provided a list of hosts using REMOTE_HOSTS then this value is ignored and all hosts in the list will be used.
## Running locally with Vagrant
[Vagrant](http://vagrantup.com) allows you to test your jmeter-ec2 scripts locally before pushing them to ec2.
### Pre-requisits
* [Vagrant](http://vagrantup.com)
### Usage:
Use `jmeter-ec2.properties.vagrant` as a template for local provisioning. This file is setup to use Vagrants ssh key, ports, etc.
```
# backup your properties files just in case
cp jmeter-ec2.properties jmeter-ec2.properties.bak
# use the vagrant properties file
cp jmeter-ec2.properties.vagrant jmeter-ec2.properties
# start vm and provision defaultjre
vagrant up
# run your project
project="myproject" setup="TRUE" ./jmeter-ec2.sh
```
### Note
* You may need to edit the `Vagrantfile` to meet any specific networking needs. See Vagrant's [networking documentation](http://docs.vagrantup.com/v2/getting-started/networking.html) for details
## Notes:
### Your PEM File
View
@@ -0,0 +1,25 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "quantal64"
config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box"
# Forward jmeter's command port for shutdown.
config.vm.network :forwarded_port, guest: 4445, host: 4445
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network :private_network, ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# jmeter-ec2.sh requires java installed when using REMTOE_HOSTS
config.vm.provision :shell do |shell|
shell.inline = "sudo apt-get update"
shell.inline = "sudo apt-get -y install default-jre"
end
end
@@ -0,0 +1,29 @@
# This is a java stye properties file for the jmeter-ec2 shell script
#
# It is treated like a normal shell script and must have executable permissions
#
# See README.txt for more details about each property
#
LOCAL_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # The root for this script - all files should be put here as per the README
REMOTE_HOME="/tmp" # This can be left as /tmp - it is a temporary working location
PEM_FILE="insecure_private_key" # The full name of the pem file you downloaded from your Amazon account. Usualy .pem from AWS but you could generate your own and name it what you want.
PEM_PATH="$HOME/.vagrant.d" # The path to your pem file
USER="vagrant" # Should match the AMI
REMOTE_PORT="2222" # The port number sshd is running on,
JMETER_VERSION="apache-jmeter-2.7" # The version of JMeter to be used. Must be the full name used in the dir structure. Does not work for versions prior to 2.5.1.
JAVA_VERSION_32='jre-6u32-linux-i586.bin' # Specify the JAVA binary you will be using in the case of 32Bit.
JAVA_VERSION_64='jre-6u32-linux-x64.bin' # Specify the JAVA binary you will be using in the case of 64Bit.
# REMOTE_HOSTS
REMOTE_HOSTS="127.0.0.1"
# DATABASE SETTINGS
# If specified, then the script will import the results to the mysql database given here
DB_HOST=""
DB_SSH_PORT="22"
DB_NAME=""
DB_USER=""
DB_PSWD=""
DB_PEM_FILE=""
DB_PEM_PATH=""
DB_PEM_USER=""

0 comments on commit a42837b

Please sign in to comment.