Commit acb23925 authored by R. Tyler Croy's avatar R. Tyler Croy

Work in progress, haven't figured out how to get the jenkins module synced up properly

parent 487324cd
--color --order random --format progress --fail-fast
--color --order random --fail-fast
......@@ -15,4 +15,15 @@ group :development do
gem 'ci_reporter'
gem 'debugger', :platform => :mri
gem 'debugger-pry', :platform => :mri
gem 'serverspec'
gem 'vagrant', :github => 'mitchellh/vagrant',
:ref => 'v1.5.3',
:platform => :mri
end
# Vagrant plugins
group :plugins do
gem 'vagrant-aws', :github => 'mitchellh/vagrant-aws'
gem 'vagrant-serverspec', :github => 'jvoorhis/vagrant-serverspec'
end
GIT
remote: git://github.com/jvoorhis/vagrant-serverspec.git
revision: 253ec6e787e8fc6698f1fccc7426aad7cd1da6eb
specs:
vagrant-serverspec (0.0.1)
serverspec (~> 0.12.0)
GIT
remote: git://github.com/mitchellh/vagrant-aws.git
revision: d125a2f8ca5422f55f555ab921aaac968d1e6e72
specs:
vagrant-aws (0.5.0.dev)
fog (~> 1.18)
GIT
remote: git://github.com/mitchellh/vagrant.git
revision: 8c05b08fddb9358351d8652cd089aba4ec71cbbb
ref: v1.5.3
specs:
vagrant (1.5.3)
bundler (~> 1.5.2)
childprocess (~> 0.5.0)
erubis (~> 2.7.0)
i18n (~> 0.6.0)
listen (~> 2.7.1)
log4r (~> 1.1.9, < 1.1.11)
net-scp (~> 1.1.0)
net-ssh (>= 2.6.6, < 2.8.0)
rb-kqueue (~> 0.2.0)
wdm (~> 0.1.0)
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.2.7)
builder (3.2.2)
celluloid (0.15.2)
timers (~> 1.1.0)
celluloid-io (0.15.0)
celluloid (>= 0.15.0)
nio4r (>= 0.5.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
ci_reporter (1.9.1)
builder (>= 2.1.2)
coderay (1.1.0)
columnize (0.3.6)
debugger (1.6.5)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.3.1)
debugger-linecache (1.2.0)
debugger-pry (0.1.1)
debugger (~> 1)
pry (>= 0.9.9)
debugger-ruby_core_source (1.3.1)
diff-lcs (1.2.5)
erubis (2.7.0)
excon (0.33.0)
facter (2.0.1)
CFPropertyList (~> 2.2.6)
ffi (1.9.3)
fog (1.22.0)
fog-brightbox
fog-core (~> 1.21, >= 1.21.1)
fog-json
nokogiri (~> 1.5, >= 1.5.11)
fog-brightbox (0.0.2)
fog-core
fog-json
fog-core (1.22.0)
builder
excon (~> 0.33)
formatador (~> 0.2)
mime-types
net-scp (~> 1.1)
net-ssh (>= 2.1.3)
fog-json (1.0.0)
multi_json (~> 1.0)
formatador (0.2.4)
hiera (1.3.2)
json_pure
highline (1.6.21)
i18n (0.6.9)
json_pure (1.8.1)
listen (2.7.2)
celluloid (>= 0.15.2)
celluloid-io (>= 0.15.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
log4r (1.1.10)
metaclass (0.0.4)
method_source (0.8.2)
mime-types (2.2)
mini_portile (0.5.3)
mocha (1.0.0)
metaclass (~> 0.0.1)
multi_json (1.9.2)
net-scp (1.1.2)
net-ssh (>= 2.6.5)
net-ssh (2.7.0)
nio4r (1.0.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
parallel (0.9.2)
parallel_tests (0.16.6)
parallel
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
puppet (3.5.1)
facter (> 1.6, < 3)
hiera (~> 1.0)
json_pure
rgen (~> 0.6.5)
puppet-lint (0.3.2)
puppet-syntax (1.1.0)
puppet (>= 2.7.0)
rake
puppetlabs_spec_helper (0.4.1)
mocha (>= 0.10.5)
rake
rspec (>= 2.9.0)
rspec-puppet (>= 0.1.1)
rake (10.1.1)
rb-fsevent (0.9.4)
rb-inotify (0.9.4)
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
rcov (0.9.11)
rgen (0.6.6)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-puppet (1.0.1)
rspec
serverspec (0.12.0)
highline
net-ssh
rspec (>= 2.13.0)
specinfra (>= 0.0.2)
slop (3.4.7)
specinfra (1.6.0)
timers (1.1.0)
wdm (0.1.0)
PLATFORMS
ruby
DEPENDENCIES
ci_reporter
debugger
debugger-pry
parallel_tests
puppet (~> 3.5.1)
puppet-lint
puppet-syntax
puppetlabs_spec_helper
rake
rcov
rspec-puppet
serverspec
vagrant!
vagrant-aws!
vagrant-serverspec!
require 'yaml'
ENV['VAGRANT_DEFAULT_PROVIDER'] = 'aws'
Vagrant.configure("2") do |config|
access_key_id = File.read('.vagrant_key_id').chomp
secret_access_key = File.read('.vagrant_secret_access_key').chomp
keypair = File.read('.vagrant_keypair_name').chomp
config.vm.box = 'dummy'
Dir['spec/serverspec/*'].each do |dname|
# Convert spec/serverspec/ubuntu-precise into 'ubuntu-precise'
name = File.basename(dname)
spec_config = YAML.load_file(File.join(dname + '/config.yml'))
config.vm.define(name) do |node|
config.vm.provision 'puppet' do |pp|
pp.module_path = ['.', 'spec/fixtures/modules']
pp.manifests_path = "spec/serverspec/#{name}/manifests"
end
node.vm.provision :serverspec do |spec|
spec.pattern = "spec/serverspec/#{name}/*_spec.rb"
end
node.vm.provider :aws do |aws, override|
aws.access_key_id = access_key_id
aws.secret_access_key = secret_access_key
aws.keypair_name = keypair
hostname = "vagrant-jenkins-#{name}"
# Ensuring that our machines hostname is "correct" so Puppet will apply
# the right resources to it
aws.user_data = "#!/bin/sh
echo '#{hostname}' > /etc/hostname;
hostname '#{hostname}';"
aws.tags = {:Name => hostname}
# Ubuntu LTS 12.04 in us-west-2 with Puppet installed from the Puppet
# Labs apt repository
aws.ami = spec_config['ami']
aws.region = spec_config['region']
override.ssh.username = spec_config['username']
override.ssh.private_key_path = File.expand_path('~/.ssh/id_rsa')
end
end
end
end
# vim: ft=ruby
ami: "ami-665e3756"
region: "us-west-2"
username: "ubuntu"
node default {
include jenkins
notice("Hello world from ${::hostname}}")
}
require 'spec_helper'
describe 'Ubuntu 12.04 (Precise)', :type => :serverspec do
describe 'non-Jenkins properties' do
describe port(22) do
it { should be_listening }
end
describe port(80) do
it { should_not be_listening }
end
end
describe 'Jenkins-specific configuration' do
describe port(8080) do
it { should be_listening }
end
describe service('jenkins') do
it { should be_running }
it { should be_enabled }
end
end
end
......@@ -7,6 +7,17 @@ $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
require 'spec/helpers/rspechelpers'
###########################################################################
# Required for :type => :serverspec
require 'serverspec'
require 'pathname'
require 'net/ssh'
# Need to upll these into the global scope before we evaluate all our RSpec
# files :(
include SpecInfra::Helper::Ssh
include SpecInfra::Helper::DetectOS
###########################################################################
RSpec.configure do |c|
# Override puppetlabs_spec_helper's stupid setting of mock_with to :mocha,
# which is a totally piece of garbage mocking library
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment