Browse Source

Move nova to use OSDefaults - Part1

Switch @default_facts to OSDefaults

On going Part2 (new commit):
- nova_keystone_auth_spec.rb
- nova_migration_libvirt_spec.rb
- nova_network_spec.rb
- nova_objectstore_spec.rb
- nova_rabbitmq_spec.rb
- nova_scheduler_spec.rb
- nova_serial_proxy_spec.rb
- nova_spicehtml5_proxy_spec.rb
- nova_vnc_proxy_spec.rb
- nova_wsgi_apache_spec.rb

Change-Id: Ie53c2ebfa72710e248d14f5588bc632eeafc2d68
changes/21/326221/5
Iury Gregory Melo Ferreira 6 years ago
parent
commit
8c697c6349
  1. 59
      spec/classes/nova_api_spec.rb
  2. 30
      spec/classes/nova_availability_zone_spec.rb
  3. 20
      spec/classes/nova_cache_spec.rb
  4. 59
      spec/classes/nova_cells_spec.rb
  5. 40
      spec/classes/nova_cert_spec.rb
  6. 64
      spec/classes/nova_compute_libvirt_spec.rb
  7. 36
      spec/classes/nova_compute_rbd_spec.rb
  8. 42
      spec/classes/nova_compute_spec.rb
  9. 40
      spec/classes/nova_conductor_spec.rb
  10. 40
      spec/classes/nova_consoleauth_spec.rb
  11. 3
      spec/classes/nova_cron_archive_deleted_rows_spec.rb
  12. 96
      spec/classes/nova_db_mysql_api_spec.rb
  13. 96
      spec/classes/nova_db_mysql_spec.rb
  14. 44
      spec/classes/nova_db_spec.rb
  15. 58
      spec/classes/nova_init_spec.rb
  16. 19
      spec/classes/nova_logging_spec.rb
  17. 19
      spec/hosts/test-001_spec.rb

59
spec/classes/nova_api_spec.rb

@ -10,10 +10,6 @@ describe 'nova::api' do
{ :admin_password => 'passw0rd' }
end
let :facts do
@default_facts.merge({ :processorcount => 5 })
end
shared_examples 'nova-api' do
context 'with default parameters' do
@ -329,44 +325,25 @@ describe 'nova::api' do
end
context 'on Debian platforms' do
before do
facts.merge!(
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '8.0',
:operatingsystemmajrelease => '8',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
)
end
let :platform_params do
{ :nova_api_package => 'nova-api',
:nova_api_service => 'nova-api' }
end
it_behaves_like 'nova-api'
end
context 'on RedHat platforms' do
before do
facts.merge!(
:osfamily => 'RedHat',
:operatingsystem => 'RedHat',
:operatingsystemrelease => '7.0',
:operatingsystemmajrelease => '7',
:concat_basedir => '/var/lib/puppet/concat',
:fqdn => 'some.host.tld',
)
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :processorcount => 5 }))
end
let :platform_params do
{ :nova_api_package => 'openstack-nova-api',
:nova_api_service => 'openstack-nova-api' }
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :nova_api_package => 'nova-api',
:nova_api_service => 'nova-api' }
when 'RedHat'
{ :nova_api_package => 'openstack-nova-api',
:nova_api_service => 'openstack-nova-api' }
end
end
it_behaves_like 'nova-api'
end
it_behaves_like 'nova-api'
end
end

30
spec/classes/nova_availability_zone_spec.rb

@ -29,29 +29,15 @@ describe 'nova::availability_zone' do
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => 'jessie',
})
end
it_configures 'nova::availability_zone'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on Redhat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.1',
})
it_configures 'nova::availability_zone'
end
it_configures 'nova::availability_zone'
end
end

20
spec/classes/nova_cache_spec.rb

@ -62,20 +62,16 @@ describe 'nova::cache' do
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'nova-cache'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_configures 'nova-cache'
end
it_configures 'nova-cache'
end
end

59
spec/classes/nova_cells_spec.rb

@ -138,38 +138,35 @@ describe 'nova::cells' do
it_configures 'nova-cells'
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
{
:cells_package_name => 'nova-cells',
:cells_service_name => 'nova-cells'
}
end
it_configures 'a parent cell'
it_configures 'a parent cell with manage_service as false'
it_configures 'a child cell'
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
case facts[:osfamily]
when 'Debian'
let (:platform_params) do
{
:cells_package_name => 'nova-cells',
:cells_service_name => 'nova-cells'
}
end
it_configures 'a parent cell with manage_service as false'
when 'RedHat'
let (:platform_params) do
{
:cells_package_name => 'openstack-nova-cells',
:cells_service_name => 'openstack-nova-cells'
}
end
end
it_configures 'a parent cell'
it_configures 'a child cell'
end
let :platform_params do
{
:cells_package_name => 'openstack-nova-cells',
:cells_service_name => 'openstack-nova-cells'
}
end
it_configures 'a parent cell'
it_configures 'a child cell'
end
end

40
spec/classes/nova_cert_spec.rb

@ -6,25 +6,29 @@ describe 'nova::cert' do
'include nova'
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
it_behaves_like 'generic nova service', {
:name => 'nova-cert',
:package_name => 'nova-cert',
:service_name => 'nova-cert' }
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
it_behaves_like 'generic nova service', {
:name => 'nova-cert',
:package_name => 'nova-cert',
:service_name => 'nova-cert' }
when 'RedHat'
it_behaves_like 'generic nova service', {
:name => 'nova-cert',
:package_name => 'openstack-nova-cert',
:service_name => 'openstack-nova-cert' }
end
end
end
it_behaves_like 'generic nova service', {
:name => 'nova-cert',
:package_name => 'openstack-nova-cert',
:service_name => 'openstack-nova-cert' }
end
end

64
spec/classes/nova_compute_libvirt_spec.rb

@ -335,42 +335,38 @@ describe 'nova::compute::libvirt' do
end
context 'on Debian platforms' do
let (:facts) do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:os_package_family => 'debian',
:operatingsystemmajrelease => '8'
})
end
it_behaves_like 'debian-nova-compute-libvirt'
end
context 'on Ubuntu platforms' do
let (:facts) do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:os_package_family => 'ubuntu',
:operatingsystemmajrelease => '16.04'
})
end
it_behaves_like 'debian-nova-compute-libvirt'
end
on_supported_os({
:supported_oos => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
case [:osfamily]
when 'Debian'
case [:operatingsystem]
when 'Debian'
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:os_package_family => 'debian',
:operatingsystemmajrelease => '8'}))
end
it_behaves_like 'debian-nova-compute-libvirt'
when 'Ubuntu'
let (:facts) do
facts.merge!(OSDefaults.get_facts({
:os_package_family => 'ubuntu',
:operatingsystemmajrelease => '16.04'}))
end
it_behaves_like 'debian-nova-compute-libvirt'
end
context 'on RedHat platforms' do
let (:facts) do
@default_facts.merge({
:osfamily => 'RedHat',
:os_package_type => 'rpm',
})
when 'RedHat'
let (:facts) do
facts.merge!(OSDefaults.get_facts({ :os_package_type => 'rpm' }))
end
it_behaves_like 'redhat-nova-compute-libvirt'
end
end
it_behaves_like 'redhat-nova-compute-libvirt'
end
end

36
spec/classes/nova_compute_rbd_spec.rb

@ -160,28 +160,24 @@ describe 'nova::compute::rbd' do
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
{ :ceph_client_package => 'ceph'}
end
it_configures 'nova compute rbd'
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :ceph_client_package => 'ceph-common' }
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :ceph_client_package => 'ceph' }
when 'RedHat'
{ :ceph_client_package => 'ceph-common' }
end
end
it_configures 'nova compute rbd'
end
it_configures 'nova compute rbd'
end
end

42
spec/classes/nova_compute_spec.rb

@ -221,30 +221,26 @@ describe 'nova::compute' do
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
{ :nova_compute_package => 'nova-compute',
:nova_compute_service => 'nova-compute' }
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :nova_compute_package => 'nova-compute',
:nova_compute_service => 'nova-compute' }
when 'RedHat'
{ :nova_compute_package => 'openstack-nova-compute',
:nova_compute_service => 'openstack-nova-compute' }
end
end
it_behaves_like 'nova-compute'
end
it_behaves_like 'nova-compute'
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do
{ :nova_compute_package => 'openstack-nova-compute',
:nova_compute_service => 'openstack-nova-compute' }
end
it_behaves_like 'nova-compute'
end
end

40
spec/classes/nova_conductor_spec.rb

@ -73,30 +73,26 @@ describe 'nova::conductor' do
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
let :platform_params do
{ :conductor_package_name => 'nova-conductor',
:conductor_service_name => 'nova-conductor' }
end
it_configures 'nova-conductor'
end
context 'on Redhat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
{ :conductor_package_name => 'openstack-nova-conductor',
:conductor_service_name => 'openstack-nova-conductor' }
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :conductor_package_name => 'nova-conductor',
:conductor_service_name => 'nova-conductor' }
when 'RedHat'
{ :conductor_package_name => 'openstack-nova-conductor',
:conductor_service_name => 'openstack-nova-conductor' }
end
end
it_configures 'nova-conductor'
end
it_configures 'nova-conductor'
end
end

40
spec/classes/nova_consoleauth_spec.rb

@ -6,25 +6,29 @@ describe 'nova::consoleauth' do
'include nova'
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
it_behaves_like 'generic nova service', {
:name => 'nova-consoleauth',
:package_name => 'nova-consoleauth',
:service_name => 'nova-consoleauth' }
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
it_behaves_like 'generic nova service', {
:name => 'nova-consoleauth',
:package_name => 'nova-consoleauth',
:service_name => 'nova-consoleauth' }
when 'RedHat'
it_behaves_like 'generic nova service', {
:name => 'nova-consoleauth',
:package_name => 'openstack-nova-console',
:service_name => 'openstack-nova-consoleauth' }
end
end
end
it_behaves_like 'generic nova service', {
:name => 'nova-consoleauth',
:package_name => 'openstack-nova-console',
:service_name => 'openstack-nova-consoleauth' }
end
end

3
spec/classes/nova_cron_archive_deleted_rows_spec.rb

@ -3,7 +3,7 @@ require 'spec_helper'
describe 'nova::cron::archive_deleted_rows' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
OSDefaults.get_facts({ :osfamily => 'Debian' })
end
let :params do
@ -30,4 +30,5 @@ describe 'nova::cron::archive_deleted_rows' do
:require => 'Anchor[nova::dbsync::end]',
)
end
end

96
spec/classes/nova_db_mysql_api_spec.rb

@ -2,24 +2,20 @@ require 'spec_helper'
describe 'nova::db::mysql_api' do
let :pre_condition do
'include mysql::server'
end
shared_examples_for 'nova::db::mysql_api' do
let :required_params do
{ :password => "qwerty" }
end
let :pre_condition do
'include mysql::server'
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
let :required_params do
{ :password => "qwerty" }
end
context 'with only required parameters' do
context 'with only required params' do
let :params do
required_params
end
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with(
:user => 'nova_api',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
@ -28,23 +24,27 @@ describe 'nova::db::mysql_api' do
)}
end
context 'when overriding charset' do
context 'overriding allowed_hosts param to array' do
let :params do
{ :charset => 'latin1' }.merge(required_params)
{ :password => 'novapass',
:allowed_hosts => ['127.0.0.1','%'],
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with_charset(params[:charset]) }
end
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with(
:user => 'nova_api',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%'],
)}
end
context 'with only required parameters' do
context 'overriding allowed_hosts param to string' do
let :params do
required_params
{ :password => 'novapass2',
:allowed_hosts => '192.168.1.1',
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with(
@ -52,54 +52,34 @@ describe 'nova::db::mysql_api' do
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1',
)}
end
context 'when overriding charset' do
let :params do
{ :charset => 'latin1' }.merge(required_params)
{ :password => 'novapass',
:charset => 'latin1',
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with_charset(params[:charset]) }
end
end
describe "overriding allowed_hosts param to array" do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
let :params do
{
:password => 'novapass',
:allowed_hosts => ['127.0.0.1','%']
}
it { is_expected.to contain_openstacklib__db__mysql('nova_api').with(
:charset => 'latin1',
)}
end
end
describe "overriding allowed_hosts param to string" do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :params do
{
:password => 'novapass2',
:allowed_hosts => '192.168.1.1'
}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
describe "overriding allowed_hosts param equals to host param " do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_configures 'nova::db::mysql_api'
end
let :params do
{
:password => 'novapass2',
:allowed_hosts => '127.0.0.1'
}
end
end
end

96
spec/classes/nova_db_mysql_spec.rb

@ -2,24 +2,20 @@ require 'spec_helper'
describe 'nova::db::mysql' do
let :pre_condition do
'include mysql::server'
end
shared_examples_for 'nova::db::mysql' do
let :required_params do
{ :password => "qwerty" }
end
let :pre_condition do
'include mysql::server'
end
context 'on a Debian osfamily' do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
let :required_params do
{ :password => "qwerty" }
end
context 'with only required parameters' do
context 'with only required params' do
let :params do
required_params
end
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
:user => 'nova',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
@ -28,23 +24,27 @@ describe 'nova::db::mysql' do
)}
end
context 'when overriding charset' do
context 'overriding allowed_hosts param to array' do
let :params do
{ :charset => 'latin1' }.merge(required_params)
{ :password => 'novapass',
:allowed_hosts => ['127.0.0.1','%'],
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
end
end
context 'on a RedHat osfamily' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
:user => 'nova',
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => ['127.0.0.1','%'],
)}
end
context 'with only required parameters' do
context 'overriding allowed_hosts param to string' do
let :params do
required_params
{ :password => 'novapass2',
:allowed_hosts => '192.168.1.1',
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
@ -52,54 +52,34 @@ describe 'nova::db::mysql' do
:password_hash => '*AA1420F182E88B9E5F874F6FBE7459291E8F4601',
:charset => 'utf8',
:collate => 'utf8_general_ci',
:allowed_hosts => '192.168.1.1',
)}
end
context 'when overriding charset' do
let :params do
{ :charset => 'latin1' }.merge(required_params)
{ :password => 'novapass',
:charset => 'latin1',
}.merge(required_params)
end
it { is_expected.to contain_openstacklib__db__mysql('nova').with_charset(params[:charset]) }
end
end
describe "overriding allowed_hosts param to array" do
let :facts do
@default_facts.merge({ :osfamily => "Debian" })
end
let :params do
{
:password => 'novapass',
:allowed_hosts => ['127.0.0.1','%']
}
it { is_expected.to contain_openstacklib__db__mysql('nova').with(
:charset => 'latin1',
)}
end
end
describe "overriding allowed_hosts param to string" do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :params do
{
:password => 'novapass2',
:allowed_hosts => '192.168.1.1'
}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
describe "overriding allowed_hosts param equals to host param " do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_configures 'nova::db::mysql'
end
let :params do
{
:password => 'novapass2',
:allowed_hosts => '127.0.0.1'
}
end
end
end

44
spec/classes/nova_db_spec.rb

@ -78,21 +78,23 @@ describe 'nova::db' do
end
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => 'jessie',
})
shared_examples_for 'nova::db RedHat' do
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://user:pass@db/db', }
end
it { is_expected.not_to contain_package('db_backend_package') }
end
end
it_configures 'nova::db'
shared_examples_for 'nova::db Debian' do
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://user:pass@db/db', }
end
it 'install the proper backend package' do
is_expected.to contain_package('db_backend_package').with(
:ensure => 'present',
@ -104,7 +106,7 @@ describe 'nova::db' do
context 'with sqlite backend' do
let :params do
{ :database_connection => 'sqlite:///var/lib/nova/nova.sqlite', }
{ :database_connection => 'sqlite:///var/lib/nova/nova.sqlite', }
end
it 'install the proper backend package' do
@ -114,26 +116,20 @@ describe 'nova::db' do
:tag => ['openstack'],
)
end
end
end
context 'on Redhat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystemrelease => '7.1',
})
end
it_configures 'nova::db'
end
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://user:pass@db/db', }
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it { is_expected.not_to contain_package('db_backend_package') }
it_configures 'nova::db'
it_configures "nova::db #{facts[:osfamily]}"
end
end

58
spec/classes/nova_init_spec.rb

@ -545,49 +545,31 @@ describe 'nova' do
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Debian'
})
end
let :platform_params do
{ :nova_common_package => 'nova-common',
:lock_path => '/var/lock/nova' }
end
on_supported_os({
:supported_oos => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'nova'
end
case facts[:osfamily]
when 'Debian'
let (:platform_params) do
{ :nova_common_package => 'nova-common',
:lock_path => '/var/lock/nova' }
end
when 'RedHat'
let (:platform_params) do
{ :nova_common_package => 'openstack-nova-common',
:lock_path => '/var/lib/nova/tmp' }
end
end
context 'on Ubuntu platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu'
})
end
it_behaves_like 'nova'
let :platform_params do
{ :nova_common_package => 'nova-common',
:lock_path => '/var/lock/nova' }
end
it_behaves_like 'nova'
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
let :platform_params do
{ :nova_common_package => 'openstack-nova-common',
:lock_path => '/var/lib/nova/tmp' }
end
it_behaves_like 'nova'
end
end

19
spec/classes/nova_logging_spec.rb

@ -120,20 +120,17 @@ describe 'nova::logging' do
}
end
context 'on Debian platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'Debian' })
end
it_configures 'nova-logging'
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
it_configures 'nova-logging'
end
it_configures 'nova-logging'
end
end

19
spec/hosts/test-001_spec.rb

@ -2,11 +2,7 @@ require 'spec_helper'
describe 'test-001.example.org' do
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({ :osfamily => 'RedHat' })
end
shared_examples_for 'both services' do
# Bug #1278452
it 'nova::consoleauth and nova::spicehtml5proxy do not conflict' do
is_expected.to contain_class('nova::consoleauth')
@ -16,4 +12,17 @@ describe 'test-001.example.org' do
is_expected.to contain_nova__generic_service('spicehtml5proxy')
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_configures 'both services'
end
end
end

Loading…
Cancel
Save