Lbspec
Lbspec is an RSpec plugin for easy Loadbalancer testing.
Installation
Add this line to your application's Gemfile:
gem 'lbspec'
And then execute:
$ bundle
Or install it yourself as:
$ gem install lbspec
Requires
- Users need to be able to login with ssh to the target nodes.
- Users need to be able to
sudoon the target nodes. - netcat and ngrep are needed to be installed.
Limitations
- Lbspec uses only ssh configuration in ~/.ssh/config
Usage
Lbspec is best described by example. First, require lbspec in your spec_helper.rb:
# spec/spec_helper.rb
require 'rspec'
require 'lbspec'
Then, create a spec like this:
require_relative 'spec_helper'
describe 'vhost_a' do
it { should transfer('node_a') }
end
describe 'vhost_b' do
it { should transfer(['node_b','node_c']) }
end
describe 'vhost_c:80' do
it { should transfer(['node_b','node_c']).port(80) }
end
Contributing
- Fork it ( http://github.com/otahi/lbspec/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request


