puppet-openstack/spec/classes/openstack_swift_storage-node.rb
Sebastien Badia 96917bcbe0 Fix unit-test in order to prepare module for deprecation
* Update spec tests in order to match rspec 3.x syntax (and puppet-rspec 2.x)
* Remove gems over-specifications (puppetlabs_spec_helper already add
  runtime deps on rpsec, puppet-rspec and rake)
* Fix RedHat fact (cherry-pick of commit
  https://review.openstack.org/106555/)
* Pin fixtures to stable/icehouse (this module is EOL)
* Pin concat to 1.2.1

Partial-Bug: #1326034
Change-Id: If299e1f9591f21d9410f2a5744d29823f913c000
2015-04-16 16:57:09 +02:00

52 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'openstack::swift::storage-node' do
let :params do
{
:swift_zone => '1',
:storage_devices => '1',
}
end
let :facts do
{ :ipaddress_eth0 => '192.168.1.2' }
end
it 'should configure using the default values' do
is_expected.to contain_class('swift').with(
:swift_hash_suffix => 'swift_secret',
:package_ensure => 'present',
)
is_expected.to contain_define('swift::storage::loopback').with(
:base_dir => '/srv/loopback-device',
:mnt_base_dir => '/srv/node',
)
is_expected.to contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2',
)
end
describe 'when setting up dsik for storage_type' do
before do
params.merge!(
:storage_type => 'disk',
:storage_devices => 'sda',
)
end
it 'should configure using the configured values' do
is_expected.to contain_class('swift').with(
:swift_hash_suffix => 'swift_secret',
:package_ensure => 'present',
)
is_expected.to contain_define('swift::storage::disk').with(
:mnt_base_dir => '/srv/node',
:byte_size => '1024',
)
is_expected.to contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2',
)
end
end