Update spec tests

This commit updates the spec tests so that they should work.

- the ssh module that they depend on had introduced a dependency on
  the operatingsystem fact
- tests had not been updated to reflect using xinetd and not the service
to run the rsync daemon
- update travis-ci to include the xinetd module
This commit is contained in:
Dan Bode 2012-03-13 16:30:19 -07:00
parent cb233bd6a1
commit f07363b6af
10 changed files with 42 additions and 11 deletions

1
.gitignore vendored

@ -3,3 +3,4 @@ spec/fixtures/modules/memcached
spec/fixtures/modules/rsync
spec/fixtures/modules/ssh
spec/fixtures/modules/stdlib
spec/fixtures/modules/xinetd

@ -5,6 +5,7 @@ rvm:
before_script:
- 'git clone git://github.com/saz/puppet-ssh spec/fixtures/modules/ssh'
- 'git clone git://github.com/puppetlabs/puppetlabs-rsync spec/fixtures/modules/rsync'
- 'git clone git://github.com/ghoneycutt/puppet-xinetd spec/fixtures/modules/xinetd'
- 'git clone git://github.com/saz/puppet-memcached spec/fixtures/modules/memcached'
- 'git clone git://github.com/puppetlabs/puppetlabs-stdlib spec/fixtures/modules/stdlib'
- 'git clone git://github.com/puppetlabs/puppet-apt spec/fixtures/modules/apt'

@ -6,6 +6,10 @@ describe 'swift' do
{:swift_hash_suffix => 'string'}
end
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"include ssh::server::install"
end

@ -1,6 +1,10 @@
require 'spec_helper'
describe 'swift::storage::account' do
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'ssh::server::install': }
class { 'swift': swift_hash_suffix => 'foo' }

@ -3,6 +3,10 @@ require 'spec_helper'
describe 'swift::storage::all' do
# TODO I am not testing the upstart code b/c it should be temporary
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'swift': swift_hash_suffix => 'changeme' }
include ssh::server::install
@ -52,12 +56,11 @@ describe 'swift::storage::all' do
['object', 'container', 'account'].each do |type|
it { should contain_package("swift-#{type}").with_ensure('present') }
it { should contain_service("swift-#{type}").with(
{:provider => 'upstart',
:ensure => 'running',
{:provider => 'upstart',
:ensure => 'running',
:enable => true,
:hasstatus => true,
:subscribe => 'Service[rsync]'}
)}
:hasstatus => true
})}
it { should contain_file("/etc/swift/#{type}-server/").with(
{:ensure => 'directory',
:owner => 'swift',
@ -85,7 +88,7 @@ describe 'swift::storage::all' do
)}
it { should contain_class('rsync::server').with(
{:use_xinetd => false,
{:use_xinetd => true,
:address => param_hash[:storage_local_net_ip]
}
)}

@ -1,6 +1,10 @@
require 'spec_helper'
describe 'swift::storage::container' do
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'ssh::server::install': }
class { 'swift': swift_hash_suffix => 'foo' }

@ -1,6 +1,10 @@
require 'spec_helper'
describe 'swift::storage::object' do
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'ssh::server::install': }
class { 'swift': swift_hash_suffix => 'foo' }

@ -3,6 +3,10 @@ require 'spec_helper'
describe 'swift::storage' do
# TODO I am not testing the upstart code b/c it should be temporary
let :facts do
{:operatingsystem => 'Ubuntu'}
end
describe 'when required classes are specified' do
let :pre_condition do
"class { 'swift': swift_hash_suffix => 'changeme' }
@ -22,7 +26,7 @@ describe 'swift::storage' do
end
it { should contain_class('rsync::server').with(
{:use_xinetd => false,
{:use_xinetd => true,
:address => params[:storage_local_net_ip]
}
)}

@ -5,6 +5,10 @@ describe 'swift::storage::generic' do
'account'
end
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'ssh::server::install': }
class { 'swift': swift_hash_suffix => 'foo' }
@ -46,8 +50,7 @@ describe 'swift::storage::generic' do
:ensure => 'running',
:enable => true,
:hasstatus => true,
:provider => param_hash[:service_provider],
:subscribe => 'Service[rsync]'
:provider => param_hash[:service_provider]
)}
it { should contain_file("/etc/swift/#{t}-server/").with(
:ensure => 'directory',

@ -1,6 +1,10 @@
require 'spec_helper'
describe 'swift::storage::server' do
let :facts do
{:operatingsystem => 'Ubuntu'}
end
let :pre_condition do
"class { 'ssh::server::install': }
class { 'swift': swift_hash_suffix => 'foo' }
@ -53,8 +57,7 @@ describe 'swift::storage::server' do
it { should contain_service("swift-#{t}").with(
:ensure => 'running',
:enable => true,
:hasstatus => true,
:subscribe => 'Service[rsync]'
:hasstatus => true
)}
it { should contain_file("/etc/swift/#{t}-server/").with(
:ensure => 'directory',