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

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

102 lines
2.7 KiB
Ruby

require 'spec_helper'
describe 'openstack::provision' do
let :facts do
{
:osfamily => 'Debian'
}
end
describe 'creates a glance image and an alt' do
let :params do
{
:image_name => 'cirros',
:image_source => 'http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img',
:image_name_alt => 'cirros2',
}
end
it { is_expected.to contain_glance_image(params[:image_name_alt]).with(
:ensure => 'present',
:is_public => 'yes',
:container_format => 'bare',
:disk_format => 'qcow2',
:source => params[:image_source]
)
}
it { is_expected.to contain_glance_image(params[:image_name]).with(
:ensure => 'present',
:is_public => 'yes',
:container_format => 'bare',
:disk_format => 'qcow2',
:source => params[:image_source]
)
}
end
describe 'creates a glance image' do
let :params do
{
:image_name => 'cirros',
:image_source => 'http://download.cirros-cloud.net/0.3.2/cirros-0.3.2-x86_64-disk.img',
}
end
it { is_expected.to contain_glance_image(params[:image_name]).with(
:ensure => 'present',
:is_public => 'yes',
:container_format => 'bare',
:disk_format => 'qcow2',
:source => params[:image_source]
)
}
end
describe 'should be possible to override resize_available' do
let :params do
{
:configure_tempest => true,
:resize_available => true,
:change_password_available => true,
:tempest_repo_revision => 'stable/grizzly'
}
end
it { is_expected.to contain_class('tempest').with(
:resize_available => true,
:change_password_available => true,
:tempest_repo_revision => 'stable/grizzly'
) }
it 'should configure neutron networks' do
is_expected.to contain_neutron_network('public').with(
'ensure' => 'present',
'router_external' => true,
'tenant_name' => 'admin'
)
is_expected.to contain_neutron_network('private').with(
'ensure' => 'present',
'tenant_name' => 'demo'
)
end
end
describe 'should be possible to provision with neutron disabled' do
let :params do
{
:configure_tempest => true,
:neutron_available => false,
:tempest_repo_revision => 'stable/grizzly'
}
end
it { is_expected.to contain_class('tempest').with(
:tempest_repo_revision => 'stable/grizzly'
) }
end
end