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
This commit is contained in:
Sebastien Badia
2014-06-21 15:25:08 +02:00
committed by François Charlier
parent d81d2d8628
commit 96917bcbe0
20 changed files with 352 additions and 331 deletions

View File

@@ -1,27 +1,47 @@
fixtures: fixtures:
repositories: repositories:
'cinder': 'git://github.com/stackforge/puppet-cinder' 'cinder':
"keystone": "git://github.com/stackforge/puppet-keystone.git" repo: 'git://github.com/stackforge/puppet-cinder'
"nova": "git://github.com/stackforge/puppet-nova.git" ref: 'origin/stable/icehouse'
"glance": "git://github.com/stackforge/puppet-glance.git" 'keystone':
'horizon': 'git://github.com/stackforge/puppet-horizon' repo: 'git://github.com/stackforge/puppet-keystone.git'
'swift' : 'git://github.com/stackforge/puppet-swift' ref: 'origin/stable/icehouse'
'neutron': 'git://github.com/stackforge/puppet-neutron' 'nova':
'ceilometer' : 'git://github.com/stackforge/puppet-ceilometer' repo: 'git://github.com/stackforge/puppet-nova.git'
'heat' : 'git://github.com/stackforge/puppet-heat' ref: 'origin/stable/icehouse'
"apt": "git://github.com/puppetlabs/puppetlabs-apt.git" 'glance':
"apache": "git://github.com/puppetlabs/puppetlabs-apache.git" repo: 'git://github.com/stackforge/puppet-glance.git'
"concat": "git://github.com/puppetlabs/puppetlabs-concat.git" ref: 'origin/stable/icehouse'
"firewall": "git://github.com/puppetlabs/puppetlabs-firewall.git" 'horizon':
"mysql": repo: 'git://github.com/stackforge/puppet-horizon'
repo: "git://github.com/puppetlabs/puppetlabs-mysql.git" ref: 'origin/stable/icehouse'
ref: "origin/0.x" 'swift' :
"rabbitmq": repo: 'git://github.com/stackforge/puppet-swift'
repo: "git://github.com/puppetlabs/puppetlabs-rabbitmq" ref: 'origin/stable/icehouse'
ref: "origin/2.x" 'neutron':
repo: 'git://github.com/stackforge/puppet-neutron'
ref: 'origin/stable/icehouse'
'ceilometer' :
repo: 'git://github.com/stackforge/puppet-ceilometer'
ref: 'origin/stable/icehouse'
'heat' :
repo: 'git://github.com/stackforge/puppet-heat'
ref: 'origin/stable/icehouse'
'apt': 'git://github.com/puppetlabs/puppetlabs-apt.git'
'apache': 'git://github.com/puppetlabs/puppetlabs-apache.git'
'concat':
repo: 'git://github.com/puppetlabs/puppetlabs-concat.git'
ref: '1.2.1'
'firewall': 'git://github.com/puppetlabs/puppetlabs-firewall.git'
'mysql':
repo: 'git://github.com/puppetlabs/puppetlabs-mysql.git'
ref: 'origin/0.x'
'rabbitmq':
repo: 'git://github.com/puppetlabs/puppetlabs-rabbitmq'
ref: 'origin/2.x'
'memcached': 'git://github.com/saz/puppet-memcached' 'memcached': 'git://github.com/saz/puppet-memcached'
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" 'stdlib': 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
"sysctl": "git://github.com/duritong/puppet-sysctl.git" 'sysctl': 'git://github.com/duritong/puppet-sysctl.git'
'inifile': 'git://github.com/puppetlabs/puppetlabs-inifile' 'inifile': 'git://github.com/puppetlabs/puppetlabs-inifile'
'vswitch': 'git://github.com/stackforge/puppet-vswitch' 'vswitch': 'git://github.com/stackforge/puppet-vswitch'
'tempest': 'git://github.com/stackforge/puppet-tempest' 'tempest': 'git://github.com/stackforge/puppet-tempest'

View File

@@ -3,7 +3,8 @@ source 'https://rubygems.org'
group :development, :test do group :development, :test do
gem 'puppetlabs_spec_helper', :require => false gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2' gem 'puppet-lint', '~> 0.3.2'
gem 'rake', '10.1.1' gem 'json'
gem 'webmock'
end end
if puppetversion = ENV['PUPPET_GEM_VERSION'] if puppetversion = ENV['PUPPET_GEM_VERSION']

View File

@@ -39,7 +39,7 @@ describe 'openstack::all' do
end end
it 'raises an error if no neutron_user_password is set' do it 'raises an error if no neutron_user_password is set' do
expect { subject }.to raise_error(Puppet::Error, /neutron_user_password must be specified when neutron is configured/) expect { catalogue }.to raise_error(Puppet::Error, /neutron_user_password must be specified when neutron is configured/)
end end
context 'with neutron_user_password set' do context 'with neutron_user_password set' do
@@ -47,7 +47,7 @@ describe 'openstack::all' do
params.merge!(:neutron_user_password => 'neutron_user_password') params.merge!(:neutron_user_password => 'neutron_user_password')
end end
it 'raises an error if no neutron_db_password is set' do it 'raises an error if no neutron_db_password is set' do
expect { subject }.to raise_error(Puppet::Error, /neutron_db_password must be set when configuring neutron/) expect { catalogue }.to raise_error(Puppet::Error, /neutron_db_password must be set when configuring neutron/)
end end
end end
@@ -59,7 +59,7 @@ describe 'openstack::all' do
) )
end end
it 'raises an error if no bridge_interface is set' do it 'raises an error if no bridge_interface is set' do
expect { subject }.to raise_error(Puppet::Error, /bridge_interface must be set when configuring neutron/) expect { catalogue }.to raise_error(Puppet::Error, /bridge_interface must be set when configuring neutron/)
end end
end end
@@ -84,7 +84,7 @@ describe 'openstack::all' do
) )
end end
it 'raises an error if no shared metadata key is set' do it 'raises an error if no shared metadata key is set' do
expect { subject }.to raise_error(Puppet::Error, /metadata_shared_secret parameter must be set when using metadata agent/) expect { catalogue }.to raise_error(Puppet::Error, /metadata_shared_secret parameter must be set when using metadata agent/)
end end
end end
@@ -100,7 +100,7 @@ describe 'openstack::all' do
) )
end end
it 'contains an openstack::neutron class' do it 'contains an openstack::neutron class' do
should contain_class('openstack::neutron').with( is_expected.to contain_class('openstack::neutron').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
:rabbit_user => 'openstack', :rabbit_user => 'openstack',
@@ -143,7 +143,7 @@ describe 'openstack::all' do
) )
end end
it 'contains a nova::compute class with force_config_drive set' do it 'contains a nova::compute class with force_config_drive set' do
should contain_class('nova::compute').with( is_expected.to contain_class('nova::compute').with(
:enabled => true, :enabled => true,
:force_config_drive => true :force_config_drive => true
) )
@@ -166,7 +166,7 @@ describe 'openstack::all' do
) )
end end
it 'contains an openstack::neutron class' do it 'contains an openstack::neutron class' do
should contain_class('openstack::neutron').with( is_expected.to contain_class('openstack::neutron').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
:rabbit_user => 'openstack', :rabbit_user => 'openstack',
@@ -212,7 +212,7 @@ describe 'openstack::all' do
end end
it 'raises an error if no cinder_db_password is set' do it 'raises an error if no cinder_db_password is set' do
expect { subject }.to raise_error(Puppet::Error, /Must set cinder db password when setting up a cinder controller/) expect { catalogue }.to raise_error(Puppet::Error, /Must set cinder db password when setting up a cinder controller/)
end end
context 'with cinder_db_password set' do context 'with cinder_db_password set' do
@@ -220,7 +220,7 @@ describe 'openstack::all' do
params.merge!(:cinder_db_password => 'cinder_db_password') params.merge!(:cinder_db_password => 'cinder_db_password')
end end
it 'raises an error if no cinder_user_password is set' do it 'raises an error if no cinder_user_password is set' do
expect { subject }.to raise_error(Puppet::Error, /Must set cinder user password when setting up a cinder controller/) expect { catalogue }.to raise_error(Puppet::Error, /Must set cinder user password when setting up a cinder controller/)
end end
end end
@@ -232,7 +232,7 @@ describe 'openstack::all' do
) )
end end
it 'raises an error if no cinder_user_password is set' do it 'raises an error if no cinder_user_password is set' do
should contain_class('openstack::cinder::all').with( is_expected.to contain_class('openstack::cinder::all').with(
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
:keystone_auth_host => '127.0.0.1', :keystone_auth_host => '127.0.0.1',
:keystone_password => 'cinder_user_password', :keystone_password => 'cinder_user_password',
@@ -249,7 +249,7 @@ describe 'openstack::all' do
:debug => false, :debug => false,
:verbose => false :verbose => false
) )
should contain_nova_config('DEFAULT/volume_api_class').with(:value => 'nova.volume.cinder.API') is_expected.to contain_nova_config('DEFAULT/volume_api_class').with(:value => 'nova.volume.cinder.API')
end end
end end
end end
@@ -271,7 +271,7 @@ describe 'openstack::all' do
end end
it 'should have cinder::volume::rbd' do it 'should have cinder::volume::rbd' do
should contain_class('cinder::volume::rbd').with( is_expected.to contain_class('cinder::volume::rbd').with(
:rbd_pool => 'volumes', :rbd_pool => 'volumes',
:rbd_user => 'volumes', :rbd_user => 'volumes',
:rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406' :rbd_secret_uuid => 'e80afa94-a64c-486c-9e34-d55e85f26406'
@@ -294,7 +294,7 @@ describe 'openstack::all' do
end end
it 'should have openstack::db::mysql configured' do it 'should have openstack::db::mysql configured' do
should contain_class('openstack::db::mysql').with( is_expected.to contain_class('openstack::db::mysql').with(
:charset => 'latin1', :charset => 'latin1',
:mysql_root_password => 'sql_pass', :mysql_root_password => 'sql_pass',
:mysql_bind_address => '0.0.0.0', :mysql_bind_address => '0.0.0.0',
@@ -322,7 +322,7 @@ describe 'openstack::all' do
end end
it 'should have openstack::keystone configured' do it 'should have openstack::keystone configured' do
should contain_class('openstack::keystone').with( is_expected.to contain_class('openstack::keystone').with(
:debug => false, :debug => false,
:verbose => false, :verbose => false,
:db_type => 'mysql', :db_type => 'mysql',
@@ -350,7 +350,7 @@ describe 'openstack::all' do
end end
it 'should have openstack::glance configured' do it 'should have openstack::glance configured' do
should contain_class('openstack::glance').with( is_expected.to contain_class('openstack::glance').with(
:debug => false, :debug => false,
:verbose => false, :verbose => false,
:db_type => 'mysql', :db_type => 'mysql',
@@ -366,7 +366,7 @@ describe 'openstack::all' do
end end
it 'should have nova::compute configured' do it 'should have nova::compute configured' do
should contain_class('nova::compute').with( is_expected.to contain_class('nova::compute').with(
:enabled => true, :enabled => true,
:vnc_enabled => true, :vnc_enabled => true,
:vncserver_proxyclient_address => '10.0.0.1', :vncserver_proxyclient_address => '10.0.0.1',
@@ -375,7 +375,7 @@ describe 'openstack::all' do
end end
it 'should have nova::compute::libvirt configured' do it 'should have nova::compute::libvirt configured' do
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '10.0.0.1', :vncserver_listen => '10.0.0.1',
:migration_support => false :migration_support => false
@@ -383,7 +383,7 @@ describe 'openstack::all' do
end end
it 'should have openstack::nova::controller configured' do it 'should have openstack::nova::controller configured' do
should contain_class('openstack::nova::controller').with( is_expected.to contain_class('openstack::nova::controller').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:network_manager => 'nova.network.manager.FlatDHCPManager', :network_manager => 'nova.network.manager.FlatDHCPManager',
:network_config => {}, :network_config => {},
@@ -421,11 +421,11 @@ describe 'openstack::all' do
end end
it 'should configure horizon' do it 'should configure horizon' do
should contain_class('openstack::horizon').with( is_expected.to contain_class('openstack::horizon').with(
:secret_key => 'secret_key', :secret_key => 'secret_key',
:cache_server_ip => '127.0.0.1', :cache_server_ip => '127.0.0.1',
:cache_server_port => 11211, :cache_server_port => 11211,
:horizon_app_links => '' :horizon_app_links => nil
) )
end end
end end
@@ -445,7 +445,7 @@ describe 'openstack::all' do
) )
end end
it 'raises an error if no fixed_range is given' do it 'raises an error if no fixed_range is given' do
expect { subject }.to raise_error(Puppet::Error, /Must specify the fixed range when using nova-network/) expect { catalogue }.to raise_error(Puppet::Error, /Must specify the fixed range when using nova-network/)
end end
end end
@@ -454,7 +454,7 @@ describe 'openstack::all' do
params.merge!(:private_interface => false) params.merge!(:private_interface => false)
end end
it 'raises an error if no private_interface is given' do it 'raises an error if no private_interface is given' do
expect { subject }.to raise_error(Puppet::Error, /private interface must be set when nova networking is used/) expect { catalogue }.to raise_error(Puppet::Error, /private interface must be set when nova networking is used/)
end end
end end
@@ -466,7 +466,7 @@ describe 'openstack::all' do
end end
it 'sets send_arp_for_ha' do it 'sets send_arp_for_ha' do
should contain_nova_config('DEFAULT/send_arp_for_ha').with(:value => true) is_expected.to contain_nova_config('DEFAULT/send_arp_for_ha').with(:value => true)
end end
@@ -480,13 +480,13 @@ describe 'openstack::all' do
end end
it 'unsets multi_host and send_arp_for_ha' do it 'unsets multi_host and send_arp_for_ha' do
should contain_nova_config('DEFAULT/multi_host').with(:value => false) is_expected.to contain_nova_config('DEFAULT/multi_host').with(:value => false)
should contain_nova_config('DEFAULT/send_arp_for_ha').with(:value => false) is_expected.to contain_nova_config('DEFAULT/send_arp_for_ha').with(:value => false)
end end
end end
it 'configures nova::network' do it 'configures nova::network' do
should contain_class('nova::network').with( is_expected.to contain_class('nova::network').with(
:private_interface => 'eth1', :private_interface => 'eth1',
:public_interface => 'eth0', :public_interface => 'eth0',
:fixed_range => '10.0.0.0/24', :fixed_range => '10.0.0.0/24',
@@ -516,7 +516,7 @@ describe 'openstack::all' do
end end
it 'should have glance::backend::rbd with default user/pool' do it 'should have glance::backend::rbd with default user/pool' do
should contain_class('glance::backend::rbd').with( is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_user => 'images', :rbd_store_user => 'images',
:rbd_store_pool => 'images' :rbd_store_pool => 'images'
) )

View File

@@ -9,7 +9,7 @@ describe 'openstack::auth_file' do
end end
it 'should create a openrc file' do it 'should create a openrc file' do
verify_contents(subject, '/root/openrc', [ verify_contents(catalogue, '/root/openrc', [
'export OS_NO_CACHE=\'true\'', 'export OS_NO_CACHE=\'true\'',
'export OS_TENANT_NAME=\'openstack\'', 'export OS_TENANT_NAME=\'openstack\'',
'export OS_USERNAME=\'admin\'', 'export OS_USERNAME=\'admin\'',
@@ -43,7 +43,7 @@ describe 'openstack::auth_file' do
end end
it 'should create a openrc file' do it 'should create a openrc file' do
verify_contents(subject, '/root/openrc', [ verify_contents(catalogue, '/root/openrc', [
'export OS_SERVICE_TOKEN=\'keystone\'', 'export OS_SERVICE_TOKEN=\'keystone\'',
'export OS_SERVICE_ENDPOINT=\'http://127.0.0.2:35357/v2.0/\'', 'export OS_SERVICE_ENDPOINT=\'http://127.0.0.2:35357/v2.0/\'',
'export OS_NO_CACHE=\'true\'', 'export OS_NO_CACHE=\'true\'',
@@ -72,7 +72,7 @@ describe 'openstack::auth_file' do
end end
it 'should create a openrc file' do it 'should create a openrc file' do
verify_contents(subject, '/root/openrc', [ verify_contents(catalogue, '/root/openrc', [
'export OS_SERVICE_TOKEN=\'key\\\'stone\'', 'export OS_SERVICE_TOKEN=\'key\\\'stone\'',
'export OS_PASSWORD=\'singlequote\\\'\'', 'export OS_PASSWORD=\'singlequote\\\'\'',
]) ])

View File

@@ -14,8 +14,8 @@ describe 'openstack::cinder::all' do
{ :osfamily => 'Debian' } { :osfamily => 'Debian' }
end end
it 'should configure using the default values' do it 'is_expected.to configure using the default values' do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8", :sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8",
:sql_idle_timeout => '3600', :sql_idle_timeout => '3600',
:rpc_backend => 'cinder.openstack.common.rpc.impl_kombu', :rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
@@ -32,7 +32,7 @@ describe 'openstack::cinder::all' do
:debug => false, :debug => false,
:verbose => false :verbose => false
) )
should contain_class('cinder::api').with( is_expected.to contain_class('cinder::api').with(
:keystone_password => params[:keystone_password], :keystone_password => params[:keystone_password],
:keystone_enabled => true, :keystone_enabled => true,
:keystone_user => 'cinder', :keystone_user => 'cinder',
@@ -44,23 +44,23 @@ describe 'openstack::cinder::all' do
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
:enabled => true :enabled => true
) )
should contain_class('cinder::scheduler').with( is_expected.to contain_class('cinder::scheduler').with(
:scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler', :scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler',
:package_ensure => 'present', :package_ensure => 'present',
:enabled => true :enabled => true
) )
should contain_class('cinder::volume').with( is_expected.to contain_class('cinder::volume').with(
:package_ensure => 'present', :package_ensure => 'present',
:enabled => true :enabled => true
) )
should contain_class('cinder::volume::iscsi').with( is_expected.to contain_class('cinder::volume::iscsi').with(
:iscsi_ip_address => '127.0.0.1', :iscsi_ip_address => '127.0.0.1',
:volume_group => 'cinder-volumes' :volume_group => 'cinder-volumes'
) )
should contain_class('cinder::glance').with( is_expected.to contain_class('cinder::glance').with(
:glance_api_servers => '127.0.0.1:9292' :glance_api_servers => '127.0.0.1:9292'
) )
should_not contain_class('cinder::setup_test_volume') is_expected.to_not contain_class('cinder::setup_test_volume')
end end
describe 'with manage_volumes set to false' do describe 'with manage_volumes set to false' do
@@ -69,7 +69,7 @@ describe 'openstack::cinder::all' do
:manage_volumes => false :manage_volumes => false
) )
end end
it { should_not contain_class('cinder::volume') } it { is_expected.to_not contain_class('cinder::volume') }
end end
describe 'with a volume driver other than iscsi' do describe 'with a volume driver other than iscsi' do
@@ -78,7 +78,7 @@ describe 'openstack::cinder::all' do
:volume_driver => 'netapp' :volume_driver => 'netapp'
) )
end end
it { should_not contain_class('cinder::volume::iscsi') } it { is_expected.to_not contain_class('cinder::volume::iscsi') }
end end
describe 'with a volume driver other than rbd' do describe 'with a volume driver other than rbd' do
@@ -87,7 +87,7 @@ describe 'openstack::cinder::all' do
:volume_driver => 'netapp' :volume_driver => 'netapp'
) )
end end
it { should_not contain_class('cinder::volume::rbd') } it { is_expected.to_not contain_class('cinder::volume::rbd') }
end end
describe 'with the rbd volume driver' do describe 'with the rbd volume driver' do
@@ -96,7 +96,7 @@ describe 'openstack::cinder::all' do
:volume_driver => 'rbd' :volume_driver => 'rbd'
) )
end end
it { should contain_class('cinder::volume::rbd') } it { is_expected.to contain_class('cinder::volume::rbd') }
end end
describe 'when setting up test volumes for iscsi' do describe 'when setting up test volumes for iscsi' do
@@ -105,14 +105,14 @@ describe 'openstack::cinder::all' do
:setup_test_volume => true :setup_test_volume => true
) )
end end
it { should contain_class('cinder::setup_test_volume').with( it { is_expected.to contain_class('cinder::setup_test_volume').with(
:volume_name => 'cinder-volumes' :volume_name => 'cinder-volumes'
)} )}
describe 'when volume_group is set' do describe 'when volume_group is set' do
before do before do
params.merge!(:volume_group => 'foo') params.merge!(:volume_group => 'foo')
end end
it { should contain_class('cinder::setup_test_volume').with( it { is_expected.to contain_class('cinder::setup_test_volume').with(
:volume_name => 'foo' :volume_name => 'foo'
)} )}
end end
@@ -125,7 +125,7 @@ describe 'openstack::cinder::all' do
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
end end
it { should contain_class('cinder').with( it { is_expected.to contain_class('cinder').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
)} )}
@@ -138,7 +138,7 @@ describe 'openstack::cinder::all' do
end end
it do it do
expect { subject }.to raise_error(Puppet::Error, /Unsupported db_type sqlite/) expect { catalogue }.to raise_error(Puppet::Error, /Unsupported db_type sqlite/)
end end
end end

View File

@@ -11,11 +11,11 @@ describe 'openstack::cinder::controller' do
end end
let :facts do let :facts do
{ :osfamily => 'Redhat' } { :osfamily => 'RedHat' }
end end
it 'should configure using the default values' do it 'should configure using the default values' do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8", :sql_connection => "mysql://cinder:#{params[:db_password]}@127.0.0.1/cinder?charset=utf8",
:sql_idle_timeout => '3600', :sql_idle_timeout => '3600',
:rpc_backend => 'cinder.openstack.common.rpc.impl_kombu', :rpc_backend => 'cinder.openstack.common.rpc.impl_kombu',
@@ -32,7 +32,7 @@ describe 'openstack::cinder::controller' do
:debug => false, :debug => false,
:verbose => false :verbose => false
) )
should contain_class('cinder::api').with( is_expected.to contain_class('cinder::api').with(
:keystone_password => params[:keystone_password], :keystone_password => params[:keystone_password],
:keystone_enabled => true, :keystone_enabled => true,
:keystone_user => 'cinder', :keystone_user => 'cinder',
@@ -44,12 +44,12 @@ describe 'openstack::cinder::controller' do
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
:enabled => true :enabled => true
) )
should contain_class('cinder::scheduler').with( is_expected.to contain_class('cinder::scheduler').with(
:scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler', :scheduler_driver => 'cinder.scheduler.simple.SimpleScheduler',
:package_ensure => 'present', :package_ensure => 'present',
:enabled => true :enabled => true
) )
should contain_class('cinder::glance').with( is_expected.to contain_class('cinder::glance').with(
:glance_api_servers => '127.0.0.1:9292' :glance_api_servers => '127.0.0.1:9292'
) )
end end
@@ -63,7 +63,7 @@ describe 'openstack::cinder::controller' do
end end
it do it do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
@@ -77,7 +77,7 @@ describe 'openstack::cinder::controller' do
end end
it do it do
expect { subject }.to raise_error(Puppet::Error, /Unsupported db_type sqlite/) expect { catalogue }.to raise_error(Puppet::Error, /Unsupported db_type sqlite/)
end end
end end

View File

@@ -10,11 +10,11 @@ describe 'openstack::cinder::storage' do
end end
let :facts do let :facts do
{ :osfamily => 'Redhat' } { :osfamily => 'RedHat' }
end end
it 'should configure cinder and cinder::volume using defaults and required parameters' do it 'should configure cinder and cinder::volume using defaults and required parameters' do
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:sql_connection => params[:sql_connection], :sql_connection => params[:sql_connection],
:rabbit_userid => 'guest', :rabbit_userid => 'guest',
:rabbit_password => params[:rabbit_password], :rabbit_password => params[:rabbit_password],
@@ -29,18 +29,18 @@ describe 'openstack::cinder::storage' do
:debug => false, :debug => false,
:verbose => false :verbose => false
) )
should contain_class('cinder::volume').with( is_expected.to contain_class('cinder::volume').with(
:package_ensure => 'present', :package_ensure => 'present',
:enabled => true :enabled => true
) )
should contain_class('cinder::volume::iscsi').with( is_expected.to contain_class('cinder::volume::iscsi').with(
:iscsi_ip_address => '127.0.0.1', :iscsi_ip_address => '127.0.0.1',
:volume_group => 'cinder-volumes' :volume_group => 'cinder-volumes'
) )
should contain_class('cinder::glance').with( is_expected.to contain_class('cinder::glance').with(
:glance_api_servers => '127.0.0.1:9292' :glance_api_servers => '127.0.0.1:9292'
) )
should_not contain_class('cinder::setup_test_volume') is_expected.to_not contain_class('cinder::setup_test_volume')
end end
describe 'with a volume driver other than iscsi' do describe 'with a volume driver other than iscsi' do
@@ -49,7 +49,7 @@ describe 'openstack::cinder::storage' do
:volume_driver => 'netapp' :volume_driver => 'netapp'
) )
end end
it { should_not contain_class('cinder::volume::iscsi') } it { is_expected.to_not contain_class('cinder::volume::iscsi') }
end end
describe 'when setting up test volumes for iscsi' do describe 'when setting up test volumes for iscsi' do
@@ -58,14 +58,14 @@ describe 'openstack::cinder::storage' do
:setup_test_volume => true :setup_test_volume => true
) )
end end
it { should contain_class('cinder::setup_test_volume').with( it { is_expected.to contain_class('cinder::setup_test_volume').with(
:volume_name => 'cinder-volumes' :volume_name => 'cinder-volumes'
)} )}
describe 'when volume_group is set' do describe 'when volume_group is set' do
before do before do
params.merge!(:volume_group => 'foo') params.merge!(:volume_group => 'foo')
end end
it { should contain_class('cinder::setup_test_volume').with( it { is_expected.to contain_class('cinder::setup_test_volume').with(
:volume_name => 'foo' :volume_name => 'foo'
)} )}
end end
@@ -81,7 +81,7 @@ describe 'openstack::cinder::storage' do
) )
end end
it { should contain_class('cinder::volume::rbd').with( it { is_expected.to contain_class('cinder::volume::rbd').with(
:rbd_user => 'rbd', :rbd_user => 'rbd',
:rbd_pool => 'rbd_pool', :rbd_pool => 'rbd_pool',
:rbd_secret_uuid => 'secret' :rbd_secret_uuid => 'secret'
@@ -98,7 +98,7 @@ describe 'openstack::cinder::storage' do
) )
end end
it { should contain_class('cinder').with( it { is_expected.to contain_class('cinder').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) } ) }

View File

@@ -7,41 +7,41 @@ describe 'openstack::client' do
end end
describe 'with default params' do describe 'with default params' do
it { should contain_class('ceilometer::client') } it { is_expected.to contain_class('ceilometer::client') }
it { should contain_class('cinder::client') } it { is_expected.to contain_class('cinder::client') }
it { should contain_class('glance::client') } it { is_expected.to contain_class('glance::client') }
it { should contain_class('keystone::client') } it { is_expected.to contain_class('keystone::client') }
it { should contain_class('nova::client') } it { is_expected.to contain_class('nova::client') }
it { should contain_class('neutron::client') } it { is_expected.to contain_class('neutron::client') }
end end
describe 'without ceilometer' do describe 'without ceilometer' do
let (:params) { {:ceilometer => false }} let (:params) { {:ceilometer => false }}
it { should_not contain_class('ceilometer::client') } it { is_expected.to_not contain_class('ceilometer::client') }
end end
describe 'without cinder' do describe 'without cinder' do
let (:params) { {:cinder => false }} let (:params) { {:cinder => false }}
it { should_not contain_class('cinder::client') } it { is_expected.to_not contain_class('cinder::client') }
end end
describe 'without glance' do describe 'without glance' do
let (:params) { {:glance => false }} let (:params) { {:glance => false }}
it { should_not contain_class('glance::client') } it { is_expected.to_not contain_class('glance::client') }
end end
describe 'without keystone' do describe 'without keystone' do
let (:params) { {:keystone => false }} let (:params) { {:keystone => false }}
it { should_not contain_class('keystone::client') } it { is_expected.to_not contain_class('keystone::client') }
end end
describe 'without nova' do describe 'without nova' do
let (:params) { {:nova => false }} let (:params) { {:nova => false }}
it { should_not contain_class('nova::client') } it { is_expected.to_not contain_class('nova::client') }
end end
describe 'without neutron' do describe 'without neutron' do
let (:params) { {:neutron => false }} let (:params) { {:neutron => false }}
it { should_not contain_class('neutron::client') } it { is_expected.to_not contain_class('neutron::client') }
end end
end end

View File

@@ -30,7 +30,7 @@ describe 'openstack::compute' do
describe "when using default class parameters" do describe "when using default class parameters" do
it { it {
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_connection => 'mysql://nova:pass@127.0.0.1/nova', :sql_connection => 'mysql://nova:pass@127.0.0.1/nova',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
:rabbit_hosts => false, :rabbit_hosts => false,
@@ -43,22 +43,22 @@ describe 'openstack::compute' do
:log_facility => 'LOG_USER', :log_facility => 'LOG_USER',
:verbose => false :verbose => false
) )
should_not contain_resources('nova_config').with_purge(true) is_expected.to_not contain_resources('nova_config').with_purge(true)
should contain_class('nova::compute').with( is_expected.to contain_class('nova::compute').with(
:enabled => true, :enabled => true,
:vnc_enabled => true, :vnc_enabled => true,
:vncserver_proxyclient_address => '127.0.0.2', :vncserver_proxyclient_address => '127.0.0.2',
:vncproxy_host => false, :vncproxy_host => false,
:force_config_drive => false :force_config_drive => false
) )
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'kvm', :libvirt_type => 'kvm',
:vncserver_listen => '127.0.0.2' :vncserver_listen => '127.0.0.2'
) )
should contain_nova_config('DEFAULT/multi_host').with( :value => false ) is_expected.to contain_nova_config('DEFAULT/multi_host').with( :value => false )
should contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => false ) is_expected.to contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => false )
should_not contain_class('nova::api') is_expected.to_not contain_class('nova::api')
should contain_class('nova::network').with({ is_expected.to contain_class('nova::network').with({
:enabled => false, :enabled => false,
:install_service => false, :install_service => false,
:private_interface => 'eth0', :private_interface => 'eth0',
@@ -71,7 +71,7 @@ describe 'openstack::compute' do
:enabled => false, :enabled => false,
:install_service => false :install_service => false
}) })
should contain_class('openstack::cinder::storage').with( is_expected.to contain_class('openstack::cinder::storage').with(
:sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder', :sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder',
:rabbit_password => 'rabbit_pw', :rabbit_password => 'rabbit_pw',
:rabbit_userid => 'openstack', :rabbit_userid => 'openstack',
@@ -113,7 +113,7 @@ describe 'openstack::compute' do
) )
end end
it do it do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_connection => 'mysql://nova_user:pass@127.0.0.1/novadb', :sql_connection => 'mysql://nova_user:pass@127.0.0.1/novadb',
:rabbit_host => 'my_host', :rabbit_host => 'my_host',
:rabbit_hosts => ['rabbit:5673', 'rabbit2:5674'], :rabbit_hosts => ['rabbit:5673', 'rabbit2:5674'],
@@ -124,21 +124,21 @@ describe 'openstack::compute' do
:glance_api_servers => ['controller:9292'], :glance_api_servers => ['controller:9292'],
:verbose => true :verbose => true
) )
should contain_class('nova::compute').with( is_expected.to contain_class('nova::compute').with(
:enabled => true, :enabled => true,
:vnc_enabled => false, :vnc_enabled => false,
:vncserver_proxyclient_address => '127.0.0.1', :vncserver_proxyclient_address => '127.0.0.1',
:vncproxy_host => '127.0.0.2', :vncproxy_host => '127.0.0.2',
:force_config_drive => true :force_config_drive => true
) )
should contain_class('nova::compute::libvirt').with( is_expected.to contain_class('nova::compute::libvirt').with(
:libvirt_type => 'qemu', :libvirt_type => 'qemu',
:vncserver_listen => '127.0.0.1' :vncserver_listen => '127.0.0.1'
) )
should contain_nova_config('DEFAULT/multi_host').with( :value => false ) is_expected.to contain_nova_config('DEFAULT/multi_host').with( :value => false )
should contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => false ) is_expected.to contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => false )
should_not contain_class('nova::api') is_expected.to_not contain_class('nova::api')
should contain_class('nova::network').with({ is_expected.to contain_class('nova::network').with({
:enabled => false, :enabled => false,
:install_service => false, :install_service => false,
:private_interface => 'eth1', :private_interface => 'eth1',
@@ -156,7 +156,7 @@ describe 'openstack::compute' do
:manage_volumes => false :manage_volumes => false
) )
end end
it { should_not contain_class('openstack::cinder::storage') } it { is_expected.to_not contain_class('openstack::cinder::storage') }
end end
@@ -169,7 +169,7 @@ describe 'openstack::compute' do
) )
end end
it do it do
should contain_class('openstack::cinder::storage').with( is_expected.to contain_class('openstack::cinder::storage').with(
:sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder', :sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder',
:rabbit_password => 'rabbit_pw', :rabbit_password => 'rabbit_pw',
:rabbit_userid => 'openstack', :rabbit_userid => 'openstack',
@@ -201,18 +201,18 @@ describe 'openstack::compute' do
end end
it 'should configure nova for multi-host' do it 'should configure nova for multi-host' do
#should contain_class('keystone::python') #is_expected.to contain_class('keystone::python')
should contain_nova_config('DEFAULT/multi_host').with(:value => true) is_expected.to contain_nova_config('DEFAULT/multi_host').with(:value => true)
should contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => true) is_expected.to contain_nova_config('DEFAULT/send_arp_for_ha').with( :value => true)
should contain_class('nova::network').with({ is_expected.to contain_class('nova::network').with({
'enabled' => true, 'enabled' => true,
'install_service' => true 'install_service' => true
}) })
should_not contain_class('openstack::neutron') is_expected.to_not contain_class('openstack::neutron')
end end
describe 'with defaults' do describe 'with defaults' do
it { should contain_class('nova::api').with( it { is_expected.to contain_class('nova::api').with(
:enabled => true, :enabled => true,
:admin_tenant_name => 'services', :admin_tenant_name => 'services',
:admin_user => 'nova', :admin_user => 'nova',
@@ -236,7 +236,7 @@ describe 'openstack::compute' do
) )
end end
it { should contain_class('nova::network').with({ it { is_expected.to contain_class('nova::network').with({
:private_interface => 'eth1', :private_interface => 'eth1',
:public_interface => 'eth2', :public_interface => 'eth2',
:fixed_range => '12.0.0.0/24', :fixed_range => '12.0.0.0/24',
@@ -256,7 +256,7 @@ describe 'openstack::compute' do
end end
it { it {
expect { should raise_error(Puppet::Error) } expect { is_expected.to raise_error(Puppet::Error) }
} }
end end
@@ -270,9 +270,9 @@ describe 'openstack::compute' do
end end
it { it {
should contain_nova_config('DEFAULT/multi_host').with({ 'value' => true}) is_expected.to contain_nova_config('DEFAULT/multi_host').with({ 'value' => true})
should contain_class('nova::api') is_expected.to contain_class('nova::api')
should contain_class('nova::network').with({ is_expected.to contain_class('nova::network').with({
'enabled' => true, 'enabled' => true,
'install_service' => true 'install_service' => true
}) })
@@ -294,7 +294,7 @@ describe 'openstack::compute' do
end end
it 'should configure neutron' do it 'should configure neutron' do
should contain_class('openstack::neutron').with( is_expected.to contain_class('openstack::neutron').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:ovs_local_ip => params[:internal_address], :ovs_local_ip => params[:internal_address],
:rabbit_host => params[:rabbit_host], :rabbit_host => params[:rabbit_host],
@@ -316,11 +316,11 @@ describe 'openstack::compute' do
:verbose => false :verbose => false
) )
should contain_class('nova::compute::neutron').with( is_expected.to contain_class('nova::compute::neutron').with(
:libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver' :libvirt_vif_driver => 'nova.virt.libvirt.vif.LibvirtGenericVIFDriver'
) )
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'neutron_user_password', :neutron_admin_password => 'neutron_user_password',
:neutron_auth_strategy => 'keystone', :neutron_auth_strategy => 'keystone',
:neutron_url => "http://127.0.0.2:9696", :neutron_url => "http://127.0.0.2:9696",
@@ -330,10 +330,10 @@ describe 'openstack::compute' do
:security_group_api => 'neutron' :security_group_api => 'neutron'
) )
should_not contain_class('neutron::server') is_expected.to_not contain_class('neutron::server')
should_not contain_class('neutron::plugins::ovs') is_expected.to_not contain_class('neutron::plugins::ovs')
should_not contain_class('neutron::agents::dhcp') is_expected.to_not contain_class('neutron::agents::dhcp')
should_not contain_class('neutron::agents::l3') is_expected.to_not contain_class('neutron::agents::l3')
end end
end end
@@ -348,17 +348,17 @@ describe 'openstack::compute' do
end end
it do it do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('openstack::neutron').with( is_expected.to contain_class('openstack::neutron').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('openstack::cinder::storage').with( is_expected.to contain_class('openstack::cinder::storage').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )

View File

@@ -63,7 +63,7 @@ describe 'openstack::controller' do
end end
it do it do
expect { subject }.to raise_error(Puppet::Error) expect { catalogue }.to raise_error(Puppet::Error)
end end
end end
@@ -84,38 +84,38 @@ describe 'openstack::controller' do
end end
it 'should configure mysql server' do it 'should configure mysql server' do
param_value(subject, 'class', 'mysql::server', 'enabled').should be_true expect(param_value(catalogue, 'class', 'mysql::server', 'enabled')).to eq(true)
config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') config_hash = param_value(catalogue, 'class', 'mysql::server', 'config_hash')
config_hash['bind_address'].should == '0.0.0.0' expect(config_hash['bind_address']).to eq('0.0.0.0')
config_hash['root_password'].should == 'sql_pass' expect(config_hash['root_password']).to eq('sql_pass')
end end
it 'should contain openstack db config' do it 'should contain openstack db config' do
should contain_class('keystone::db::mysql').with( is_expected.to contain_class('keystone::db::mysql').with(
:user => 'keystone', :user => 'keystone',
:password => 'keystone_pass', :password => 'keystone_pass',
:dbname => 'keystone', :dbname => 'keystone',
:allowed_hosts => '%' :allowed_hosts => '%'
) )
should contain_class('glance::db::mysql').with( is_expected.to contain_class('glance::db::mysql').with(
:user => 'glance', :user => 'glance',
:password => 'glance_pass', :password => 'glance_pass',
:dbname => 'glance', :dbname => 'glance',
:allowed_hosts => '%' :allowed_hosts => '%'
) )
should contain_class('nova::db::mysql').with( is_expected.to contain_class('nova::db::mysql').with(
:user => 'nova', :user => 'nova',
:password => 'nova_pass', :password => 'nova_pass',
:dbname => 'nova', :dbname => 'nova',
:allowed_hosts => '%' :allowed_hosts => '%'
) )
should contain_class('cinder::db::mysql').with( is_expected.to contain_class('cinder::db::mysql').with(
:user => 'cinder', :user => 'cinder',
:password => 'cinder_pass', :password => 'cinder_pass',
:dbname => 'cinder', :dbname => 'cinder',
:allowed_hosts => '%' :allowed_hosts => '%'
) )
should contain_class('neutron::db::mysql').with( is_expected.to contain_class('neutron::db::mysql').with(
:user => 'neutron', :user => 'neutron',
:password => 'q_db_pass', :password => 'q_db_pass',
:dbname => 'neutron', :dbname => 'neutron',
@@ -124,7 +124,7 @@ describe 'openstack::controller' do
end end
it { should contain_class('mysql::server::account_security')} it { is_expected.to contain_class('mysql::server::account_security')}
end end
@@ -137,8 +137,8 @@ describe 'openstack::controller' do
) )
end end
it do it do
should_not contain_class('neutron::db::mysql') is_expected.to_not contain_class('neutron::db::mysql')
should_not contain_class('cinder::db::mysql') is_expected.to_not contain_class('cinder::db::mysql')
end end
end end
@@ -152,14 +152,14 @@ describe 'openstack::controller' do
end end
it 'should configure mysql server' do it 'should configure mysql server' do
param_value(subject, 'class', 'mysql::server', 'enabled').should be_false expect(param_value(catalogue, 'class', 'mysql::server', 'enabled')).to eq(false)
config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') config_hash = param_value(catalogue, 'class', 'mysql::server', 'config_hash')
config_hash['bind_address'].should == '0.0.0.0' expect(config_hash['bind_address']).to eq('0.0.0.0')
config_hash['root_password'].should == 'sql_pass' expect(config_hash['root_password']).to eq('sql_pass')
end end
['keystone', 'nova', 'glance', 'cinder', 'neutron'].each do |x| ['keystone', 'nova', 'glance', 'cinder', 'neutron'].each do |x|
it { should_not contain_class("#{x}::db::mysql") } it { is_expected.to_not contain_class("#{x}::db::mysql") }
end end
end end
@@ -170,14 +170,14 @@ describe 'openstack::controller' do
) )
end end
it { should_not contain_class('mysql::server::account_security')} it { is_expected.to_not contain_class('mysql::server::account_security')}
end end
context 'with default SSL params, disabled' do context 'with default SSL params, disabled' do
it 'SSL in mysql should be disabled' do it 'SSL in mysql is_expected.to be disabled' do
config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') config_hash = param_value(catalogue, 'class', 'mysql::server', 'config_hash')
config_hash['ssl'].should == false expect(config_hash['ssl']).to eq(false)
end end
end end
@@ -193,11 +193,11 @@ describe 'openstack::controller' do
end end
it 'should configure mysql server' do it 'should configure mysql server' do
config_hash = param_value(subject, 'class', 'mysql::server', 'config_hash') config_hash = param_value(catalogue, 'class', 'mysql::server', 'config_hash')
config_hash['ssl'].should == true expect(config_hash['ssl']).to eq(true)
config_hash['ssl_ca'].should == '/etc/mysql/ca.pem' expect(config_hash['ssl_ca']).to eq('/etc/mysql/ca.pem')
config_hash['ssl_cert'].should == '/etc/mysql/server.pem' expect(config_hash['ssl_cert']).to eq('/etc/mysql/server.pem')
config_hash['ssl_key'].should == '/etc/mysql/server.key' expect(config_hash['ssl_key']).to eq('/etc/mysql/server.key')
end end
end end
@@ -214,7 +214,7 @@ describe 'openstack::controller' do
it 'should configure default keystone configuration' do it 'should configure default keystone configuration' do
should contain_class('openstack::keystone').with( is_expected.to contain_class('openstack::keystone').with(
:swift => false, :swift => false,
:swift_user_password => false, :swift_user_password => false,
:swift_public_address => false, :swift_public_address => false,
@@ -224,7 +224,7 @@ describe 'openstack::controller' do
:log_facility => 'LOG_USER' :log_facility => 'LOG_USER'
) )
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:catalog_type => 'sql', :catalog_type => 'sql',
@@ -235,12 +235,12 @@ describe 'openstack::controller' do
:sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone" :sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone"
) )
should contain_class('keystone::roles::admin').with( is_expected.to contain_class('keystone::roles::admin').with(
:email => 'some_user@some_fake_email_address.foo', :email => 'some_user@some_fake_email_address.foo',
:password => 'ChangeMe', :password => 'ChangeMe',
:admin_tenant => 'admin' :admin_tenant => 'admin'
) )
should contain_class('keystone::endpoint').with( is_expected.to contain_class('keystone::endpoint').with(
:public_address => '10.0.0.1', :public_address => '10.0.0.1',
:public_protocol => 'http', :public_protocol => 'http',
:internal_address => '127.0.0.1', :internal_address => '127.0.0.1',
@@ -253,7 +253,7 @@ describe 'openstack::controller' do
'glance' => 'glance_pass' 'glance' => 'glance_pass'
}.each do |type, pw| }.each do |type, pw|
should contain_class("#{type}::keystone::auth").with( is_expected.to contain_class("#{type}::keystone::auth").with(
:password => pw, :password => pw,
:public_address => '10.0.0.1', :public_address => '10.0.0.1',
:public_protocol => 'http', :public_protocol => 'http',
@@ -274,7 +274,7 @@ describe 'openstack::controller' do
) )
end end
it 'should configure swift auth in keystone' do it 'should configure swift auth in keystone' do
should contain_class('openstack::keystone').with( is_expected.to contain_class('openstack::keystone').with(
:swift => true, :swift => true,
:swift_user_password => 'foo', :swift_user_password => 'foo',
:swift_public_address => '10.0.0.2', :swift_public_address => '10.0.0.2',
@@ -291,11 +291,11 @@ describe 'openstack::controller' do
end end
it 'should not configure endpoints' do it 'should not configure endpoints' do
should contain_class('keystone').with(:enabled => false) is_expected.to contain_class('keystone').with(:enabled => false)
should_not contain_class('keystone::roles::admin') is_expected.to_not contain_class('keystone::roles::admin')
should_not contain_class('keystone::endpoint') is_expected.to_not contain_class('keystone::endpoint')
should_not contain_class('glance::keystone::auth') is_expected.to_not contain_class('glance::keystone::auth')
should_not contain_class('nova::keystone::auth') is_expected.to_not contain_class('nova::keystone::auth')
end end
end end
@@ -306,10 +306,10 @@ describe 'openstack::controller' do
end end
it 'should propagate it to the endpoints' do it 'should propagate it to the endpoints' do
should contain_class('keystone::endpoint').with(:public_protocol => 'https') is_expected.to contain_class('keystone::endpoint').with(:public_protocol => 'https')
should contain_class('glance::keystone::auth').with(:public_protocol => 'https') is_expected.to contain_class('glance::keystone::auth').with(:public_protocol => 'https')
should contain_class('nova::keystone::auth').with(:public_protocol => 'https') is_expected.to contain_class('nova::keystone::auth').with(:public_protocol => 'https')
should contain_class('cinder::keystone::auth').with(:public_protocol => 'https') is_expected.to contain_class('cinder::keystone::auth').with(:public_protocol => 'https')
end end
end end
@@ -323,14 +323,14 @@ describe 'openstack::controller' do
end end
it 'should set addresses in subclasses' do it 'should set addresses in subclasses' do
should contain_class('keystone::endpoint').with( is_expected.to contain_class('keystone::endpoint').with(
:public_address => '1.1.1.1', :public_address => '1.1.1.1',
:internal_address => '2.2.2.2', :internal_address => '2.2.2.2',
:admin_address => '3.3.3.3' :admin_address => '3.3.3.3'
) )
['nova', 'cinder', 'glance'].each do |type| ['nova', 'cinder', 'glance'].each do |type|
should contain_class("#{type}::keystone::auth").with( is_expected.to contain_class("#{type}::keystone::auth").with(
:public_address => '1.1.1.1', :public_address => '1.1.1.1',
:internal_address => '2.2.2.2', :internal_address => '2.2.2.2',
:admin_address => '3.3.3.3' :admin_address => '3.3.3.3'
@@ -351,7 +351,7 @@ describe 'openstack::controller' do
end end
it 'should configure keystone with SSL mysql connection' do it 'should configure keystone with SSL mysql connection' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone?ssl_ca=/etc/mysql/ca.pem" :sql_connection => "mysql://keystone:keystone_pass@127.0.0.1/keystone?ssl_ca=/etc/mysql/ca.pem"
) )
end end
@@ -359,7 +359,7 @@ describe 'openstack::controller' do
end end
it do it do
should contain_class('memcached').with( is_expected.to contain_class('memcached').with(
:listen_ip => '127.0.0.1' :listen_ip => '127.0.0.1'
) )
end end
@@ -371,7 +371,7 @@ describe 'openstack::controller' do
context 'when enabled' do context 'when enabled' do
it 'should contain enabled glance with defaults' do it 'should contain enabled glance with defaults' do
should contain_class('openstack::glance').with( is_expected.to contain_class('openstack::glance').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:registry_host => '0.0.0.0', :registry_host => '0.0.0.0',
@@ -380,7 +380,7 @@ describe 'openstack::controller' do
:log_facility => 'LOG_USER' :log_facility => 'LOG_USER'
) )
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:auth_type => 'keystone', :auth_type => 'keystone',
@@ -394,7 +394,7 @@ describe 'openstack::controller' do
:enabled => true :enabled => true
) )
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:auth_type => 'keystone', :auth_type => 'keystone',
@@ -407,7 +407,7 @@ describe 'openstack::controller' do
:enabled => true :enabled => true
) )
should contain_class('glance::backend::file') is_expected.to contain_class('glance::backend::file')
end end
end end
context 'when not enabled' do context 'when not enabled' do
@@ -417,11 +417,11 @@ describe 'openstack::controller' do
end end
it 'should disable glance services' do it 'should disable glance services' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:enabled => false :enabled => false
) )
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:enabled => false :enabled => false
) )
end end
@@ -449,7 +449,7 @@ describe 'openstack::controller' do
end end
it 'should override params for glance' do it 'should override params for glance' do
should contain_class('openstack::glance').with( is_expected.to contain_class('openstack::glance').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:registry_host => '127.0.0.2', :registry_host => '127.0.0.2',
@@ -458,7 +458,7 @@ describe 'openstack::controller' do
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:registry_host => '127.0.0.2', :registry_host => '127.0.0.2',
@@ -472,7 +472,7 @@ describe 'openstack::controller' do
:sql_idle_timeout => '30' :sql_idle_timeout => '30'
) )
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:auth_type => 'keystone', :auth_type => 'keystone',
@@ -494,7 +494,7 @@ describe 'openstack::controller' do
:glance_rbd_store_pool => 'mypool' :glance_rbd_store_pool => 'mypool'
) )
should contain_class('glance::backend::rbd').with( is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_user => 'myuser', :rbd_store_user => 'myuser',
:rbd_store_pool => 'mypool' :rbd_store_pool => 'mypool'
) )
@@ -513,7 +513,7 @@ describe 'openstack::controller' do
end end
it 'should configure glance with SSL mysql connection' do it 'should configure glance with SSL mysql connection' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:sql_connection => "mysql://glance:glance_pass@127.0.0.1/glance?ssl_ca=/etc/mysql/ca.pem" :sql_connection => "mysql://glance:glance_pass@127.0.0.1/glance?ssl_ca=/etc/mysql/ca.pem"
) )
end end
@@ -537,7 +537,7 @@ describe 'openstack::controller' do
context 'with default params' do context 'with default params' do
it 'should contain enabled nova services' do it 'should contain enabled nova services' do
should contain_class('openstack::nova::controller').with( is_expected.to contain_class('openstack::nova::controller').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:sql_idle_timeout => '3600', :sql_idle_timeout => '3600',
:network_manager => 'nova.network.manager.FlatDHCPManager', :network_manager => 'nova.network.manager.FlatDHCPManager',
@@ -570,7 +570,7 @@ describe 'openstack::controller' do
:rabbit_hosts => false, :rabbit_hosts => false,
:rabbit_cluster_nodes => false, :rabbit_cluster_nodes => false,
:rabbit_virtual_host => '/', :rabbit_virtual_host => '/',
:glance_api_servers => '', :glance_api_servers => nil,
:vnc_enabled => true, :vnc_enabled => true,
:vncproxy_host => '10.0.0.1', :vncproxy_host => '10.0.0.1',
:use_syslog => false, :use_syslog => false,
@@ -580,15 +580,15 @@ describe 'openstack::controller' do
:enabled => true :enabled => true
) )
should_not contain_resources('nova_config').with_purge(true) is_expected.to_not contain_resources('nova_config').with_purge(true)
should contain_class('nova::rabbitmq').with( is_expected.to contain_class('nova::rabbitmq').with(
:userid => 'openstack', :userid => 'openstack',
:password => 'rabbit_pw', :password => 'rabbit_pw',
:cluster_disk_nodes => false, :cluster_disk_nodes => false,
:virtual_host => '/', :virtual_host => '/',
:enabled => true :enabled => true
) )
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_connection => 'mysql://nova:nova_pass@127.0.0.1/nova', :sql_connection => 'mysql://nova:nova_pass@127.0.0.1/nova',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
:rabbit_hosts => false, :rabbit_hosts => false,
@@ -601,7 +601,7 @@ describe 'openstack::controller' do
:verbose => false, :verbose => false,
:memcached_servers => false :memcached_servers => false
) )
should contain_class('nova::api').with( is_expected.to contain_class('nova::api').with(
:enabled => true, :enabled => true,
:admin_tenant_name => 'services', :admin_tenant_name => 'services',
:admin_user => 'nova', :admin_user => 'nova',
@@ -610,36 +610,36 @@ describe 'openstack::controller' do
:auth_host => '127.0.0.1', :auth_host => '127.0.0.1',
:api_bind_address => '0.0.0.0' :api_bind_address => '0.0.0.0'
) )
should contain_class('nova::cert').with(:enabled => true) is_expected.to contain_class('nova::cert').with(:enabled => true)
should contain_class('nova::consoleauth').with(:enabled => true) is_expected.to contain_class('nova::consoleauth').with(:enabled => true)
should contain_class('nova::scheduler').with(:enabled => true) is_expected.to contain_class('nova::scheduler').with(:enabled => true)
should contain_class('nova::objectstore').with(:enabled => true) is_expected.to contain_class('nova::objectstore').with(:enabled => true)
should contain_class('nova::conductor').with(:enabled => true) is_expected.to contain_class('nova::conductor').with(:enabled => true)
should contain_class('nova::vncproxy').with( is_expected.to contain_class('nova::vncproxy').with(
:enabled => true, :enabled => true,
:host => '10.0.0.1' :host => '10.0.0.1'
) )
end end
it { should_not contain_nova_config('DEFAULT/auto_assign_floating_ip') } it { is_expected.to_not contain_nova_config('DEFAULT/auto_assign_floating_ip') }
end end
context 'when auto assign floating ip is assigned' do context 'when auto assign floating ip is assigned' do
let :params do let :params do
default_params.merge(:auto_assign_floating_ip => true) default_params.merge(:auto_assign_floating_ip => true)
end end
it { should contain_nova_config('DEFAULT/auto_assign_floating_ip').with(:value => true)} it { is_expected.to contain_nova_config('DEFAULT/auto_assign_floating_ip').with(:value => true)}
end end
context 'when not enabled' do context 'when not enabled' do
let :params do let :params do
default_params.merge(:enabled => false) default_params.merge(:enabled => false)
end end
it 'should disable everything' do it 'should disable everything' do
should contain_class('nova::rabbitmq').with(:enabled => false) is_expected.to contain_class('nova::rabbitmq').with(:enabled => false)
should contain_class('nova::api').with(:enabled => false) is_expected.to contain_class('nova::api').with(:enabled => false)
should contain_class('nova::cert').with(:enabled => false) is_expected.to contain_class('nova::cert').with(:enabled => false)
should contain_class('nova::consoleauth').with(:enabled => false) is_expected.to contain_class('nova::consoleauth').with(:enabled => false)
should contain_class('nova::scheduler').with(:enabled => false) is_expected.to contain_class('nova::scheduler').with(:enabled => false)
should contain_class('nova::objectstore').with(:enabled => false) is_expected.to contain_class('nova::objectstore').with(:enabled => false)
should contain_class('nova::vncproxy').with(:enabled => false) is_expected.to contain_class('nova::vncproxy').with(:enabled => false)
end end
end end
context 'when params are overridden' do context 'when params are overridden' do
@@ -651,13 +651,13 @@ describe 'openstack::controller' do
) )
end end
it 'should override params for nova' do it 'should override params for nova' do
should contain_class('openstack::nova::controller').with( is_expected.to contain_class('openstack::nova::controller').with(
:sql_idle_timeout => '30', :sql_idle_timeout => '30',
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_idle_timeout => '30' :sql_idle_timeout => '30'
) )
end end
@@ -667,7 +667,7 @@ describe 'openstack::controller' do
context 'config for horizon' do context 'config for horizon' do
it 'should contain enabled horizon' do it 'should contain enabled horizon' do
should contain_class('horizon').with( is_expected.to contain_class('horizon').with(
:secret_key => 'secret_key', :secret_key => 'secret_key',
:cache_server_ip => '127.0.0.1', :cache_server_ip => '127.0.0.1',
:cache_server_port => '11211', :cache_server_port => '11211',
@@ -680,7 +680,7 @@ describe 'openstack::controller' do
let :params do let :params do
default_params.merge(:horizon => false) default_params.merge(:horizon => false)
end end
it { should_not contain_class('horizon') } it { is_expected.to_not contain_class('horizon') }
end end
end end
@@ -692,11 +692,11 @@ describe 'openstack::controller' do
default_params.merge(:cinder => false) default_params.merge(:cinder => false)
end end
it 'should not contain cinder classes' do it 'should not contain cinder classes' do
should_not contain_class('openstack::cinder::all') is_expected.to_not contain_class('openstack::cinder::all')
should_not contain_class('cinder') is_expected.to_not contain_class('cinder')
should_not contain_class('cinder::api') is_expected.to_not contain_class('cinder::api')
should_not contain_class('cinder::scheduler') is_expected.to_not contain_class('cinder::scheduler')
should_not contain_class('cinder::volume') is_expected.to_not contain_class('cinder::volume')
end end
end end
@@ -705,7 +705,7 @@ describe 'openstack::controller' do
default_params default_params
end end
it 'should configure cinder using defaults' do it 'should configure cinder using defaults' do
should contain_class('openstack::cinder::all').with( is_expected.to contain_class('openstack::cinder::all').with(
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
:sql_idle_timeout => '3600', :sql_idle_timeout => '3600',
:keystone_password => 'cinder_pass', :keystone_password => 'cinder_pass',
@@ -729,14 +729,14 @@ describe 'openstack::controller' do
:verbose => false :verbose => false
) )
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:debug => false, :debug => false,
:verbose => false, :verbose => false,
:sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder?charset=utf8', :sql_connection => 'mysql://cinder:cinder_pass@127.0.0.1/cinder?charset=utf8',
:rabbit_password => 'rabbit_pw' :rabbit_password => 'rabbit_pw'
) )
should contain_class('cinder::api').with_keystone_password('cinder_pass') is_expected.to contain_class('cinder::api').with_keystone_password('cinder_pass')
should contain_class('cinder::scheduler') is_expected.to contain_class('cinder::scheduler')
end end
end end
@@ -760,7 +760,7 @@ describe 'openstack::controller' do
) )
end end
it 'should configure cinder using custom parameters' do it 'should configure cinder using custom parameters' do
should contain_class('openstack::cinder::all').with( is_expected.to contain_class('openstack::cinder::all').with(
:sql_idle_timeout => '30', :sql_idle_timeout => '30',
:keystone_password => 'foo', :keystone_password => 'foo',
:rabbit_userid => 'rabbituser', :rabbit_userid => 'rabbituser',
@@ -779,7 +779,7 @@ describe 'openstack::controller' do
) )
should contain_class('cinder').with( is_expected.to contain_class('cinder').with(
:debug => true, :debug => true,
:verbose => true, :verbose => true,
:sql_connection => 'mysql://baz:bar@127.0.0.2/blah?charset=utf8', :sql_connection => 'mysql://baz:bar@127.0.0.2/blah?charset=utf8',
@@ -787,8 +787,8 @@ describe 'openstack::controller' do
:rabbit_password => 'rabbit_pw2', :rabbit_password => 'rabbit_pw2',
:rabbit_userid => 'rabbituser' :rabbit_userid => 'rabbituser'
) )
should contain_class('cinder::api').with_keystone_password('foo') is_expected.to contain_class('cinder::api').with_keystone_password('foo')
should contain_class('cinder::scheduler') is_expected.to contain_class('cinder::scheduler')
end end
end end
@@ -830,17 +830,17 @@ describe 'openstack::controller' do
end end
it 'should not fail when required ovs parameters are not set' do it 'should not fail when required ovs parameters are not set' do
should contain_class('openstack::controller') is_expected.to contain_class('openstack::controller')
end end
end end
it { should_not contain_class('nova::network') } it { is_expected.to_not contain_class('nova::network') }
it { should contain_class('nova::network::neutron').with(:security_group_api => 'neutron') } it { is_expected.to contain_class('nova::network::neutron').with(:security_group_api => 'neutron') }
it 'should configure neutron' do it 'should configure neutron' do
should contain_class('openstack::neutron').with( is_expected.to contain_class('openstack::neutron').with(
:db_host => '127.0.0.1', :db_host => '127.0.0.1',
:sql_idle_timeout => '30', :sql_idle_timeout => '30',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
@@ -885,7 +885,7 @@ describe 'openstack::controller' do
let :params do let :params do
default_params.merge(:neutron => false, :multi_host => false) default_params.merge(:neutron => false, :multi_host => false)
end end
it {should contain_class('nova::network').with( it {is_expected.to contain_class('nova::network').with(
:private_interface => 'eth0', :private_interface => 'eth0',
:public_interface => 'eth1', :public_interface => 'eth1',
:fixed_range => '10.0.0.0/24', :fixed_range => '10.0.0.0/24',
@@ -903,8 +903,8 @@ describe 'openstack::controller' do
let :params do let :params do
default_params.merge(:neutron => false, :multi_host => true) default_params.merge(:neutron => false, :multi_host => true)
end end
it { should contain_nova_config('DEFAULT/multi_host').with(:value => true)} it { is_expected.to contain_nova_config('DEFAULT/multi_host').with(:value => true)}
it {should contain_class('nova::network').with( it {is_expected.to contain_class('nova::network').with(
:create_networks => true, :create_networks => true,
:enabled => true, :enabled => true,
:install_service => true :install_service => true

View File

@@ -19,7 +19,7 @@ describe 'openstack::glance' do
describe 'with only required parameters' do describe 'with only required parameters' do
it 'should configure with applicable defaults' do it 'should configure with applicable defaults' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:registry_host => '0.0.0.0', :registry_host => '0.0.0.0',
@@ -36,7 +36,7 @@ describe 'openstack::glance' do
:log_facility => 'LOG_USER', :log_facility => 'LOG_USER',
:enabled => true :enabled => true
) )
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
@@ -52,7 +52,7 @@ describe 'openstack::glance' do
:log_facility => 'LOG_USER', :log_facility => 'LOG_USER',
:enabled => true :enabled => true
) )
should contain_class('glance::backend::file') is_expected.to contain_class('glance::backend::file')
end end
end end
@@ -61,7 +61,7 @@ describe 'openstack::glance' do
params.merge!(:db_type => 'sqlite' ) params.merge!(:db_type => 'sqlite' )
end end
it 'should fail' do it 'should fail' do
expect { subject }.to raise_error(Puppet::Error, /db_type sqlite is not supported/) expect { catalogue }.to raise_error(Puppet::Error, /db_type sqlite is not supported/)
end end
end end
@@ -70,7 +70,7 @@ describe 'openstack::glance' do
params.merge!(:backend => 'ceph') params.merge!(:backend => 'ceph')
end end
it 'should fail' do it 'should fail' do
expect { subject }.to raise_error(Puppet::Error, /Unsupported backend ceph/) expect { catalogue }.to raise_error(Puppet::Error, /Unsupported backend ceph/)
end end
end end
@@ -85,9 +85,9 @@ describe 'openstack::glance' do
end end
it 'should configure swift as the backend' do it 'should configure swift as the backend' do
should_not contain_class('glance::backend::file') is_expected.to_not contain_class('glance::backend::file')
should contain_class('glance::backend::swift').with( is_expected.to contain_class('glance::backend::swift').with(
:swift_store_user => 'dan', :swift_store_user => 'dan',
:swift_store_key => '123', :swift_store_key => '123',
:swift_store_auth_address => 'http://127.0.0.1:5000/v2.0/', :swift_store_auth_address => 'http://127.0.0.1:5000/v2.0/',
@@ -101,7 +101,7 @@ describe 'openstack::glance' do
end end
it 'should fail' do it 'should fail' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error, /swift_store_key must be set when configuring swift/) end.to raise_error(Puppet::Error, /swift_store_key must be set when configuring swift/)
end end
end end
@@ -111,7 +111,7 @@ describe 'openstack::glance' do
end end
it 'should fail' do it 'should fail' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error, /swift_store_user must be set when configuring swift/) end.to raise_error(Puppet::Error, /swift_store_user must be set when configuring swift/)
end end
end end
@@ -128,11 +128,11 @@ describe 'openstack::glance' do
end end
it 'should configure rbd as the backend' do it 'should configure rbd as the backend' do
should_not contain_class('glance::backend::file') is_expected.to_not contain_class('glance::backend::file')
should_not contain_class('glance::backend::swift') is_expected.to_not contain_class('glance::backend::swift')
should contain_class('glance::backend::rbd').with( is_expected.to contain_class('glance::backend::rbd').with(
:rbd_store_user => 'don', :rbd_store_user => 'don',
:rbd_store_pool => 'images' :rbd_store_pool => 'images'
) )
@@ -148,7 +148,7 @@ describe 'openstack::glance' do
end end
it 'should configure mysql properly' do it 'should configure mysql properly' do
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance?ssl_ca=/etc/mysql/ca.pem' :sql_connection => 'mysql://glance:glance_db_pass@127.0.0.1/glance?ssl_ca=/etc/mysql/ca.pem'
) )
end end
@@ -163,12 +163,12 @@ describe 'openstack::glance' do
end end
it 'should set parameters in included classes' do it 'should set parameters in included classes' do
should contain_class('glance::api').with( is_expected.to contain_class('glance::api').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
should contain_class('glance::registry').with( is_expected.to contain_class('glance::registry').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )

View File

@@ -12,7 +12,7 @@ describe 'openstack::horizon' do
let :facts do let :facts do
{ {
:osfamily => 'Redhat', :osfamily => 'RedHat',
:memorysize => '1GB', :memorysize => '1GB',
:processorcount => '1', :processorcount => '1',
:concat_basedir => '/tmp', :concat_basedir => '/tmp',
@@ -21,12 +21,12 @@ describe 'openstack::horizon' do
end end
it 'should configure horizon and memcache using default parameters and secret key' do it 'should configure horizon and memcache using default parameters and secret key' do
should contain_class('memcached').with( is_expected.to contain_class('memcached').with(
:listen_ip => '127.0.0.1', :listen_ip => '127.0.0.1',
:tcp_port => '11211', :tcp_port => '11211',
:udp_port => '11211' :udp_port => '11211'
) )
should contain_class('horizon').with( is_expected.to contain_class('horizon').with(
:cache_server_ip => '127.0.0.1', :cache_server_ip => '127.0.0.1',
:cache_server_port => '11211', :cache_server_port => '11211',
:secret_key => 'super_secret', :secret_key => 'super_secret',
@@ -46,8 +46,8 @@ describe 'openstack::horizon' do
) )
end end
it 'should configure horizon without memcached using default parameters and secret key' do it 'should configure horizon without memcached using default parameters and secret key' do
should_not contain_class('memcached') is_expected.to_not contain_class('memcached')
should contain_class('horizon').with( is_expected.to contain_class('horizon').with(
:cache_server_ip => '127.0.0.1', :cache_server_ip => '127.0.0.1',
:cache_server_port => '11211', :cache_server_port => '11211',
:secret_key => 'super_secret', :secret_key => 'super_secret',
@@ -69,7 +69,7 @@ describe 'openstack::horizon' do
) )
end end
it 'should override params for memcached' do it 'should override params for memcached' do
should contain_class('memcached').with( is_expected.to contain_class('memcached').with(
:listen_ip => '10.10.10.10' :listen_ip => '10.10.10.10'
) )
end end

View File

@@ -30,7 +30,7 @@ describe 'openstack::keystone' do
describe 'with only required params (and defaults for everything else)' do describe 'with only required params (and defaults for everything else)' do
it 'should configure keystone and all default endpoints' do it 'should configure keystone and all default endpoints' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:verbose => false, :verbose => false,
:debug => false, :debug => false,
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
@@ -45,7 +45,7 @@ describe 'openstack::keystone' do
:log_facility => 'LOG_USER' :log_facility => 'LOG_USER'
) )
[ 'glance', 'cinder', 'neutron' ].each do |type| [ 'glance', 'cinder', 'neutron' ].each do |type|
should contain_class("#{type}::keystone::auth").with( is_expected.to contain_class("#{type}::keystone::auth").with(
:password => params["#{type}_user_password".intern], :password => params["#{type}_user_password".intern],
:public_address => params[:public_address], :public_address => params[:public_address],
:admin_address => params[:public_address], :admin_address => params[:public_address],
@@ -53,7 +53,7 @@ describe 'openstack::keystone' do
:region => 'RegionOne' :region => 'RegionOne'
) )
end end
should contain_class('nova::keystone::auth').with( is_expected.to contain_class('nova::keystone::auth').with(
:password => params[:nova_user_password], :password => params[:nova_user_password],
:public_address => params[:public_address], :public_address => params[:public_address],
:admin_address => params[:public_address], :admin_address => params[:public_address],
@@ -69,12 +69,12 @@ describe 'openstack::keystone' do
required_params.merge(:nova => false) required_params.merge(:nova => false)
end end
it { should_not contain_class('nova::keystone::auth') } it { is_expected.to_not contain_class('nova::keystone::auth') }
end end
describe 'without swift' do describe 'without swift' do
it { should_not contain_class('swift::keystone::auth') } it { is_expected.to_not contain_class('swift::keystone::auth') }
end end
describe 'swift' do describe 'swift' do
@@ -84,7 +84,7 @@ describe 'openstack::keystone' do
end end
it 'should fail when the password is not set' do it 'should fail when the password is not set' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error) end.to raise_error(Puppet::Error)
end end
end end
@@ -93,7 +93,7 @@ describe 'openstack::keystone' do
required_params.merge(:swift => true, :swift_user_password => 'dude') required_params.merge(:swift => true, :swift_user_password => 'dude')
end end
it do it do
should contain_class('swift::keystone::auth').with( is_expected.to contain_class('swift::keystone::auth').with(
:password => 'dude', :password => 'dude',
:region => 'RegionOne' :region => 'RegionOne'
) )
@@ -102,7 +102,7 @@ describe 'openstack::keystone' do
end end
describe 'without heat' do describe 'without heat' do
it { should_not contain_class('heat::keystone::auth') } it { is_expected.to_not contain_class('heat::keystone::auth') }
end end
describe 'heat' do describe 'heat' do
@@ -112,7 +112,7 @@ describe 'openstack::keystone' do
end end
it 'should fail when the password is not set' do it 'should fail when the password is not set' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error) end.to raise_error(Puppet::Error)
end end
end end
@@ -121,7 +121,7 @@ describe 'openstack::keystone' do
required_params.merge(:heat => true, :heat_user_password => 'dude') required_params.merge(:heat => true, :heat_user_password => 'dude')
end end
it do it do
should contain_class('heat::keystone::auth').with( is_expected.to contain_class('heat::keystone::auth').with(
:password => 'dude', :password => 'dude',
:public_address => '127.0.0.1', :public_address => '127.0.0.1',
:region => 'RegionOne' :region => 'RegionOne'
@@ -131,7 +131,7 @@ describe 'openstack::keystone' do
end end
describe 'without heat_cfn' do describe 'without heat_cfn' do
it { should_not contain_class('heat::keystone::auth_cfn') } it { is_expected.to_not contain_class('heat::keystone::auth_cfn') }
end end
describe 'heat_cfn' do describe 'heat_cfn' do
@@ -141,7 +141,7 @@ describe 'openstack::keystone' do
end end
it 'should fail when the password is not set' do it 'should fail when the password is not set' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error) end.to raise_error(Puppet::Error)
end end
end end
@@ -150,7 +150,7 @@ describe 'openstack::keystone' do
required_params.merge(:heat_cfn => true, :heat_cfn_user_password => 'dude') required_params.merge(:heat_cfn => true, :heat_cfn_user_password => 'dude')
end end
it do it do
should contain_class('heat::keystone::auth_cfn').with( is_expected.to contain_class('heat::keystone::auth_cfn').with(
:password => 'dude', :password => 'dude',
:public_address => '127.0.0.1', :public_address => '127.0.0.1',
:region => 'RegionOne' :region => 'RegionOne'
@@ -168,7 +168,7 @@ describe 'openstack::keystone' do
end end
it 'should configure mysql properly' do it 'should configure mysql properly' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:sql_connection => 'mysql://keystone:pass@127.0.0.1/keystone?ssl_ca=/etc/mysql/ca.pem' :sql_connection => 'mysql://keystone:pass@127.0.0.1/keystone?ssl_ca=/etc/mysql/ca.pem'
) )
end end
@@ -183,7 +183,7 @@ describe 'openstack::keystone' do
end end
it 'should set parameters in included classes' do it 'should set parameters in included classes' do
should contain_class('keystone').with( is_expected.to contain_class('keystone').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )

View File

@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'openstack::neutron' do describe 'openstack::neutron' do
let :facts do let :facts do
{:osfamily => 'Redhat'} {:osfamily => 'RedHat'}
end end
let :params do let :params do
@@ -20,13 +20,13 @@ describe 'openstack::neutron' do
end end
it 'should fail b/c database password is required' do it 'should fail b/c database password is required' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error, /db password must be set/) end.to raise_error(Puppet::Error, /db password must be set/)
end end
end end
context 'install neutron with default and database password' do context 'install neutron with default and database password' do
it 'should perform default configuration' do it 'should perform default configuration' do
should contain_class('neutron').with( is_expected.to contain_class('neutron').with(
:enabled => true, :enabled => true,
:bind_host => '0.0.0.0', :bind_host => '0.0.0.0',
:rabbit_host => '127.0.0.1', :rabbit_host => '127.0.0.1',
@@ -40,11 +40,11 @@ describe 'openstack::neutron' do
:verbose => false, :verbose => false,
:debug => false :debug => false
) )
should contain_class('neutron::server').with( is_expected.to contain_class('neutron::server').with(
:auth_host => '127.0.0.1', :auth_host => '127.0.0.1',
:auth_password => 'q_user_pass' :auth_password => 'q_user_pass'
) )
should contain_class('neutron::plugins::ovs').with( is_expected.to contain_class('neutron::plugins::ovs').with(
:sql_connection => "mysql://neutron:bar@127.0.0.1/neutron?charset=utf8", :sql_connection => "mysql://neutron:bar@127.0.0.1/neutron?charset=utf8",
:tenant_network_type => 'gre' :tenant_network_type => 'gre'
) )
@@ -56,8 +56,8 @@ describe 'openstack::neutron' do
params.merge!(:enable_server => false) params.merge!(:enable_server => false)
end end
it 'should not configure server' do it 'should not configure server' do
should_not contain_class('neutron::server') is_expected.to_not contain_class('neutron::server')
should_not contain_class('neutron::plugins::ovs') is_expected.to_not contain_class('neutron::plugins::ovs')
end end
end end
@@ -70,7 +70,7 @@ describe 'openstack::neutron' do
:ovs_local_ip => '10.0.0.2' :ovs_local_ip => '10.0.0.2'
) )
end end
it { should contain_class('neutron::agents::ovs').with( it { is_expected.to contain_class('neutron::agents::ovs').with(
:bridge_uplinks => ['br-ex:eth0'], :bridge_uplinks => ['br-ex:eth0'],
:bridge_mappings => ['default:br-ex'], :bridge_mappings => ['default:br-ex'],
:enable_tunneling => true, :enable_tunneling => true,
@@ -83,7 +83,7 @@ describe 'openstack::neutron' do
before do before do
params.merge!(:enable_dhcp_agent => true) params.merge!(:enable_dhcp_agent => true)
end end
it { should contain_class('neutron::agents::dhcp').with( it { is_expected.to contain_class('neutron::agents::dhcp').with(
:use_namespaces => true, :use_namespaces => true,
:debug => false :debug => false
) } ) }
@@ -93,7 +93,7 @@ describe 'openstack::neutron' do
before do before do
params.merge!(:enable_l3_agent => true) params.merge!(:enable_l3_agent => true)
end end
it { should contain_class('neutron::agents::l3').with( it { is_expected.to contain_class('neutron::agents::l3').with(
:use_namespaces => true, :use_namespaces => true,
:debug => false :debug => false
) } ) }
@@ -107,7 +107,7 @@ describe 'openstack::neutron' do
end end
it 'should fail' do it 'should fail' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error, /metadata_shared_secret parameter must be set/) end.to raise_error(Puppet::Error, /metadata_shared_secret parameter must be set/)
end end
context 'with a shared secret' do context 'with a shared secret' do
@@ -116,7 +116,7 @@ describe 'openstack::neutron' do
:shared_secret => 'foo' :shared_secret => 'foo'
) )
end end
it { should contain_class('neutron::agents::metadata').with( it { is_expected.to contain_class('neutron::agents::metadata').with(
:auth_password => 'q_user_pass', :auth_password => 'q_user_pass',
:shared_secret => 'foo', :shared_secret => 'foo',
:auth_url => 'http://localhost:35357/v2.0', :auth_url => 'http://localhost:35357/v2.0',
@@ -133,7 +133,7 @@ describe 'openstack::neutron' do
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )
end end
it { should contain_class('neutron').with( it { is_expected.to contain_class('neutron').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) } ) }
@@ -145,7 +145,7 @@ describe 'openstack::neutron' do
end end
it 'should fail' do it 'should fail' do
expect do expect do
subject catalogue
end.to raise_error(Puppet::Error, /Unsupported db type: foo./) end.to raise_error(Puppet::Error, /Unsupported db type: foo./)
end end
end end

View File

@@ -25,20 +25,20 @@ describe 'openstack::nova::controller' do
default_params default_params
end end
it { should contain_class('openstack::nova::controller') } it { is_expected.to contain_class('openstack::nova::controller') }
context 'when configuring neutron' do context 'when configuring neutron' do
it 'should configure nova with neutron' do it 'should configure nova with neutron' do
should contain_class('nova::rabbitmq').with( is_expected.to contain_class('nova::rabbitmq').with(
:userid => 'openstack', :userid => 'openstack',
:password => 'rabbit_pass', :password => 'rabbit_pass',
:enabled => true, :enabled => true,
:cluster_disk_nodes => false, :cluster_disk_nodes => false,
:virtual_host => '/' :virtual_host => '/'
) )
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova', :sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova',
:rabbit_userid => 'openstack', :rabbit_userid => 'openstack',
:rabbit_password => 'rabbit_pass', :rabbit_password => 'rabbit_pass',
@@ -54,7 +54,7 @@ describe 'openstack::nova::controller' do
:log_facility => 'LOG_USER' :log_facility => 'LOG_USER'
) )
should contain_class('nova::api').with( is_expected.to contain_class('nova::api').with(
:enabled => true, :enabled => true,
:admin_tenant_name => 'services', :admin_tenant_name => 'services',
:admin_user => 'nova', :admin_user => 'nova',
@@ -65,7 +65,7 @@ describe 'openstack::nova::controller' do
:neutron_metadata_proxy_shared_secret => 'secret' :neutron_metadata_proxy_shared_secret => 'secret'
) )
should contain_class('nova::network::neutron').with( is_expected.to contain_class('nova::network::neutron').with(
:neutron_admin_password => 'neutron_user_pass', :neutron_admin_password => 'neutron_user_pass',
:neutron_auth_strategy => 'keystone', :neutron_auth_strategy => 'keystone',
:neutron_url => "http://127.0.0.1:9696", :neutron_url => "http://127.0.0.1:9696",
@@ -76,10 +76,10 @@ describe 'openstack::nova::controller' do
) )
['nova::scheduler', 'nova::objectstore', 'nova::cert', 'nova::consoleauth', 'nova::conductor'].each do |x| ['nova::scheduler', 'nova::objectstore', 'nova::cert', 'nova::consoleauth', 'nova::conductor'].each do |x|
should contain_class(x).with_enabled(true) is_expected.to contain_class(x).with_enabled(true)
end end
should contain_class('nova::vncproxy').with( is_expected.to contain_class('nova::vncproxy').with(
:host => '127.0.0.1', :host => '127.0.0.1',
:enabled => true :enabled => true
) )
@@ -93,7 +93,7 @@ describe 'openstack::nova::controller' do
) )
end end
it 'should configure nova with memcached' do it 'should configure nova with memcached' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:memcached_servers => ['memcached01:11211', 'memcached02:11211'] :memcached_servers => ['memcached01:11211', 'memcached02:11211']
) )
end end
@@ -107,7 +107,7 @@ describe 'openstack::nova::controller' do
) )
end end
it 'should configure SSL' do it 'should configure SSL' do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova?ssl_ca=/etc/mysql/ca.pem' :sql_connection => 'mysql://nova:nova_db_pass@127.0.0.1/nova?ssl_ca=/etc/mysql/ca.pem'
) )
end end
@@ -121,7 +121,7 @@ describe 'openstack::nova::controller' do
) )
end end
it do it do
should contain_class('nova').with( is_expected.to contain_class('nova').with(
:use_syslog => true, :use_syslog => true,
:log_facility => 'LOG_LOCAL0' :log_facility => 'LOG_LOCAL0'
) )

View File

@@ -17,7 +17,7 @@ describe 'openstack::provision' do
} }
end end
it { should contain_glance_image(params[:image_name_alt]).with( it { is_expected.to contain_glance_image(params[:image_name_alt]).with(
:ensure => 'present', :ensure => 'present',
:is_public => 'yes', :is_public => 'yes',
:container_format => 'bare', :container_format => 'bare',
@@ -26,7 +26,7 @@ describe 'openstack::provision' do
) )
} }
it { should contain_glance_image(params[:image_name]).with( it { is_expected.to contain_glance_image(params[:image_name]).with(
:ensure => 'present', :ensure => 'present',
:is_public => 'yes', :is_public => 'yes',
:container_format => 'bare', :container_format => 'bare',
@@ -44,7 +44,7 @@ describe 'openstack::provision' do
} }
end end
it { should contain_glance_image(params[:image_name]).with( it { is_expected.to contain_glance_image(params[:image_name]).with(
:ensure => 'present', :ensure => 'present',
:is_public => 'yes', :is_public => 'yes',
:container_format => 'bare', :container_format => 'bare',
@@ -64,19 +64,19 @@ describe 'openstack::provision' do
} }
end end
it { should contain_class('tempest').with( it { is_expected.to contain_class('tempest').with(
:resize_available => true, :resize_available => true,
:change_password_available => true, :change_password_available => true,
:tempest_repo_revision => 'stable/grizzly' :tempest_repo_revision => 'stable/grizzly'
) } ) }
it 'should configure neutron networks' do it 'should configure neutron networks' do
should contain_neutron_network('public').with( is_expected.to contain_neutron_network('public').with(
'ensure' => 'present', 'ensure' => 'present',
'router_external' => true, 'router_external' => true,
'tenant_name' => 'admin' 'tenant_name' => 'admin'
) )
should contain_neutron_network('private').with( is_expected.to contain_neutron_network('private').with(
'ensure' => 'present', 'ensure' => 'present',
'tenant_name' => 'demo' 'tenant_name' => 'demo'
) )
@@ -93,7 +93,7 @@ describe 'openstack::provision' do
} }
end end
it { should contain_class('tempest').with( it { is_expected.to contain_class('tempest').with(
:tempest_repo_revision => 'stable/grizzly' :tempest_repo_revision => 'stable/grizzly'
) } ) }
end end

View File

@@ -15,13 +15,13 @@ describe 'openstack::repo' do
end end
it do it do
should contain_yumrepo('rdo-release').with( is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-havana/epel-6/' :baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-havana/epel-6/'
) )
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Havana') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Havana')
should contain_yumrepo('epel') is_expected.to contain_yumrepo('epel')
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6')
end end
end end
@@ -38,13 +38,13 @@ describe 'openstack::repo' do
end end
it do it do
should contain_yumrepo('rdo-release').with( is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/epel-6/' :baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/epel-6/'
) )
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Grizzly') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Grizzly')
should contain_yumrepo('epel') is_expected.to contain_yumrepo('epel')
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6')
end end
end end
@@ -62,10 +62,10 @@ describe 'openstack::repo' do
end end
it do it do
should contain_yumrepo('rdo-release').with( is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-havana/fedora-18/' :baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-havana/fedora-18/'
) )
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Havana') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Havana')
end end
end end
@@ -84,10 +84,10 @@ describe 'openstack::repo' do
end end
it do it do
should contain_yumrepo('rdo-release').with( is_expected.to contain_yumrepo('rdo-release').with(
:baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/fedora-18/' :baseurl => 'http://repos.fedorapeople.org/repos/openstack/openstack-grizzly/fedora-18/'
) )
should contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Grizzly') is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-Grizzly')
end end
end end
@@ -108,7 +108,7 @@ describe 'openstack::repo' do
end end
it do it do
should contain_apt__source('ubuntu-cloud-archive').with_release('precise-updates/havana') is_expected.to contain_apt__source('ubuntu-cloud-archive').with_release('precise-updates/havana')
end end
end end
@@ -129,7 +129,7 @@ describe 'openstack::repo' do
end end
it do it do
should contain_apt__source('ubuntu-cloud-archive').with_release('precise-updates/grizzly') is_expected.to contain_apt__source('ubuntu-cloud-archive').with_release('precise-updates/grizzly')
end end
end end
end end

View File

@@ -15,7 +15,7 @@ describe 'openstack::repo::uca' do
} }
end end
it do it do
should contain_apt__source('ubuntu-cloud-archive').with( is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:release => 'precise-updates/grizzly' :release => 'precise-updates/grizzly'
) )
end end
@@ -38,7 +38,7 @@ describe 'openstack::repo::uca' do
end end
it do it do
should contain_apt__source('ubuntu-cloud-archive').with( is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:release => 'precise-proposed/folsom' :release => 'precise-proposed/folsom'
) )
end end

View File

@@ -14,15 +14,15 @@ describe 'openstack::swift::storage-node' do
end end
it 'should configure using the default values' do it 'should configure using the default values' do
should contain_class('swift').with( is_expected.to contain_class('swift').with(
:swift_hash_suffix => 'swift_secret', :swift_hash_suffix => 'swift_secret',
:package_ensure => 'present', :package_ensure => 'present',
) )
should contain_define('swift::storage::loopback').with( is_expected.to contain_define('swift::storage::loopback').with(
:base_dir => '/srv/loopback-device', :base_dir => '/srv/loopback-device',
:mnt_base_dir => '/srv/node', :mnt_base_dir => '/srv/node',
) )
should contain_class('swift::storage::all').with( is_expected.to contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2', :storage_local_net_ip => '192.168.1.2',
) )
end end
@@ -35,15 +35,15 @@ describe 'openstack::swift::storage-node' do
) )
end end
it 'should configure using the configured values' do it 'should configure using the configured values' do
should contain_class('swift').with( is_expected.to contain_class('swift').with(
:swift_hash_suffix => 'swift_secret', :swift_hash_suffix => 'swift_secret',
:package_ensure => 'present', :package_ensure => 'present',
) )
should contain_define('swift::storage::disk').with( is_expected.to contain_define('swift::storage::disk').with(
:mnt_base_dir => '/srv/node', :mnt_base_dir => '/srv/node',
:byte_size => '1024', :byte_size => '1024',
) )
should contain_class('swift::storage::all').with( is_expected.to contain_class('swift::storage::all').with(
:storage_local_net_ip => '192.168.1.2', :storage_local_net_ip => '192.168.1.2',
) )
end end

View File

@@ -2,8 +2,8 @@ require 'spec_helper'
describe 'openstack::test_file' do describe 'openstack::test_file' do
it do it do
should contain_file('/tmp/test_nova.sh').with_mode('0751') is_expected.to contain_file('/tmp/test_nova.sh').with_mode('0751')
should_not contain_file('/tmp/test_nova.sh').with_content(/add-floating-ip/) is_expected.to_not contain_file('/tmp/test_nova.sh').with_content(/add-floating-ip/)
should contain_file('/tmp/test_nova.sh').with_content(/floatingip-create/) is_expected.to contain_file('/tmp/test_nova.sh').with_content(/floatingip-create/)
end end
end end