Update tests to use rspec-puppet-facts
This change updates the tests to properly use rspec-puppet-facts and on_supported_os. Change-Id: Ia96c837440b1df3785d9abfd3a3ac8bfdf21c9ab
This commit is contained in:
parent
dfe7564169
commit
e8be948eb7
@ -273,36 +273,26 @@ describe 'trove::api' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:os_workers => 8,
|
||||
})
|
||||
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({ :os_workers => 8 }))
|
||||
end
|
||||
|
||||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
{ :api_package_name => 'trove-api',
|
||||
:api_service_name => 'trove-api' }
|
||||
when 'RedHat'
|
||||
{ :api_package_name => 'openstack-trove-api',
|
||||
:api_service_name => 'openstack-trove-api' }
|
||||
end
|
||||
end
|
||||
it_configures 'trove-api'
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :api_package_name => 'trove-api',
|
||||
:api_service_name => 'trove-api' }
|
||||
end
|
||||
|
||||
it_configures 'trove-api'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:os_workers => 8,
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :api_package_name => 'openstack-trove-api',
|
||||
:api_service_name => 'openstack-trove-api' }
|
||||
end
|
||||
|
||||
it_configures 'trove-api'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -37,19 +37,16 @@ describe 'trove::client' do
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
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 'trove client'
|
||||
it_configures 'trove client'
|
||||
end
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it_configures 'trove client'
|
||||
end
|
||||
end
|
||||
|
@ -194,36 +194,26 @@ describe 'trove::conductor' do
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:os_workers => 8,
|
||||
})
|
||||
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({ :os_workers => 8 }))
|
||||
end
|
||||
|
||||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
{ :conductor_package_name => 'trove-conductor',
|
||||
:conductor_service_name => 'trove-conductor' }
|
||||
when 'RedHat'
|
||||
{ :conductor_package_name => 'openstack-trove-conductor',
|
||||
:conductor_service_name => 'openstack-trove-conductor' }
|
||||
end
|
||||
end
|
||||
it_configures 'trove-conductor'
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :conductor_package_name => 'trove-conductor',
|
||||
:conductor_service_name => 'trove-conductor' }
|
||||
end
|
||||
|
||||
it_configures 'trove-conductor'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:os_workers => 8,
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :conductor_package_name => 'openstack-trove-conductor',
|
||||
:conductor_service_name => 'openstack-trove-conductor' }
|
||||
end
|
||||
|
||||
it_configures 'trove-conductor'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -2,62 +2,77 @@ require 'spec_helper'
|
||||
|
||||
describe 'trove::config' do
|
||||
|
||||
let :params do
|
||||
{ :trove_config => {
|
||||
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_taskmanager_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_conductor_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_guestagent_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_api_paste_ini => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
shared_examples_for 'trove::config' do
|
||||
let :params do
|
||||
{ :trove_config => {
|
||||
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_taskmanager_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_conductor_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_guestagent_config => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
},
|
||||
:trove_api_paste_ini => {
|
||||
'DEFAULT/foo2' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar2' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz2' => { 'ensure' => 'absent' }
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove configurations' do
|
||||
is_expected.to contain_trove_config('DEFAULT/foo').with_value('fooValue')
|
||||
is_expected.to contain_trove_config('DEFAULT/bar').with_value('barValue')
|
||||
is_expected.to contain_trove_config('DEFAULT/baz').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove taskmanager configurations' do
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove conductor configurations' do
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove guestagent configurations' do
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove api-paste configurations' do
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove configurations' do
|
||||
is_expected.to contain_trove_config('DEFAULT/foo').with_value('fooValue')
|
||||
is_expected.to contain_trove_config('DEFAULT/bar').with_value('barValue')
|
||||
is_expected.to contain_trove_config('DEFAULT/baz').with_ensure('absent')
|
||||
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 'trove::config'
|
||||
end
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove taskmanager configurations' do
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_taskmanager_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove conductor configurations' do
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_conductor_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove guestagent configurations' do
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_guestagent_config('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
|
||||
it 'configures arbitrary trove api-paste configurations' do
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/foo2').with_value('fooValue')
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/bar2').with_value('barValue')
|
||||
is_expected.to contain_trove_api_paste_ini('DEFAULT/baz2').with_ensure('absent')
|
||||
end
|
||||
end
|
||||
|
@ -91,19 +91,16 @@ describe 'trove::db::mysql' do
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
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 'trove mysql database'
|
||||
it_configures 'trove mysql database'
|
||||
end
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it_configures 'trove mysql database'
|
||||
end
|
||||
end
|
||||
|
@ -29,10 +29,7 @@ describe 'trove::db::postgresql' do
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge(OSDefaults.get_facts({
|
||||
:os_workers => 8,
|
||||
:concat_basedir => '/var/lib/puppet/concat'
|
||||
}))
|
||||
facts.merge(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'trove::db::postgresql'
|
||||
|
@ -73,17 +73,7 @@ describe 'trove::db' do
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => 'jessie',
|
||||
})
|
||||
end
|
||||
|
||||
it_configures 'trove::db'
|
||||
|
||||
shared_examples_for 'trove::db on Debian platforms' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
@ -99,16 +89,7 @@ describe 'trove::db' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'on Redhat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystemrelease => '7.1',
|
||||
})
|
||||
end
|
||||
|
||||
it_configures 'trove::db'
|
||||
|
||||
shared_examples_for 'trove::db on RedHat platforms' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://trove:trove@localhost/trove', }
|
||||
@ -118,4 +99,17 @@ describe 'trove::db' do
|
||||
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 'trove::db'
|
||||
it_configures "trove::db on #{facts[:osfamily]} platforms"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -2,16 +2,33 @@ require 'spec_helper'
|
||||
|
||||
describe 'trove::deps' do
|
||||
|
||||
it 'set up the anchors' do
|
||||
is_expected.to contain_anchor('trove::install::begin')
|
||||
is_expected.to contain_anchor('trove::install::end')
|
||||
is_expected.to contain_anchor('trove::config::begin')
|
||||
is_expected.to contain_anchor('trove::config::end')
|
||||
is_expected.to contain_anchor('trove::db::begin')
|
||||
is_expected.to contain_anchor('trove::db::end')
|
||||
is_expected.to contain_anchor('trove::dbsync::begin')
|
||||
is_expected.to contain_anchor('trove::dbsync::end')
|
||||
is_expected.to contain_anchor('trove::service::begin')
|
||||
is_expected.to contain_anchor('trove::service::end')
|
||||
shared_examples_for 'trove::deps' do
|
||||
context 'defaults' do
|
||||
it 'set up the anchors' do
|
||||
is_expected.to contain_anchor('trove::install::begin')
|
||||
is_expected.to contain_anchor('trove::install::end')
|
||||
is_expected.to contain_anchor('trove::config::begin')
|
||||
is_expected.to contain_anchor('trove::config::end')
|
||||
is_expected.to contain_anchor('trove::db::begin')
|
||||
is_expected.to contain_anchor('trove::db::end')
|
||||
is_expected.to contain_anchor('trove::dbsync::begin')
|
||||
is_expected.to contain_anchor('trove::dbsync::end')
|
||||
is_expected.to contain_anchor('trove::service::begin')
|
||||
is_expected.to contain_anchor('trove::service::end')
|
||||
end
|
||||
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 'trove::deps'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -217,36 +217,26 @@ describe 'trove::guestagent' do
|
||||
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:os_workers => 8
|
||||
})
|
||||
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'
|
||||
{ :guestagent_package_name => 'trove-guestagent',
|
||||
:guestagent_service_name => 'trove-guestagent' }
|
||||
when 'RedHat'
|
||||
{ :guestagent_package_name => 'openstack-trove-guestagent',
|
||||
:guestagent_service_name => 'openstack-trove-guestagent' }
|
||||
end
|
||||
end
|
||||
it_configures 'trove-guestagent'
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :guestagent_package_name => 'trove-guestagent',
|
||||
:guestagent_service_name => 'trove-guestagent' }
|
||||
end
|
||||
|
||||
it_configures 'trove-guestagent'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:os_workers => 8
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :guestagent_package_name => 'openstack-trove-guestagent',
|
||||
:guestagent_service_name => 'openstack-trove-guestagent' }
|
||||
end
|
||||
|
||||
it_configures 'trove-guestagent'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -41,30 +41,35 @@ describe 'trove' do
|
||||
is_expected.to contain_trove_config('DEFAULT/swift_url').with_value('http://localhost:8080/v1/AUTH_')
|
||||
is_expected.to contain_trove_config('DEFAULT/neutron_url').with_value('http://localhost:9696/')
|
||||
}
|
||||
|
||||
it 'installs common package' do
|
||||
is_expected.to contain_package('trove').with(
|
||||
:name => platform_params[:package_name],
|
||||
:ensure => 'present',
|
||||
:tag => ['openstack', 'trove-package'],
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
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 'trove'
|
||||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
{ :package_name => 'trove-common', }
|
||||
when 'RedHat'
|
||||
{ :package_name => 'openstack-trove', }
|
||||
end
|
||||
end
|
||||
it_configures 'trove'
|
||||
end
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it 'installs common package' do
|
||||
is_expected.to contain_package('trove').with(
|
||||
:name => 'openstack-trove',
|
||||
:ensure => 'present',
|
||||
:tag => ['openstack', 'trove-package'],
|
||||
)
|
||||
end
|
||||
|
||||
it_configures 'trove'
|
||||
end
|
||||
end
|
||||
|
@ -22,111 +22,122 @@ require 'spec_helper'
|
||||
|
||||
describe 'trove::keystone::auth' do
|
||||
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
end
|
||||
shared_examples_for 'trove::keystone::auth' do
|
||||
context 'with default class parameters' do
|
||||
let :params do
|
||||
{ :password => 'trove_password',
|
||||
:tenant => 'foobar' }
|
||||
end
|
||||
|
||||
describe 'with default class parameters' do
|
||||
let :params do
|
||||
{ :password => 'trove_password',
|
||||
:tenant => 'foobar' }
|
||||
it { is_expected.to contain_keystone_user('trove').with(
|
||||
:ensure => 'present',
|
||||
:password => 'trove_password',
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_keystone_user_role('trove@foobar').with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_service('trove::database').with(
|
||||
:ensure => 'present',
|
||||
:description => 'Trove Database Service'
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
|
||||
:ensure => 'present',
|
||||
:public_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
|
||||
:admin_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
|
||||
:internal_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s"
|
||||
) }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('trove').with(
|
||||
:ensure => 'present',
|
||||
:password => 'trove_password',
|
||||
) }
|
||||
context 'when configuring trove-server' do
|
||||
let :pre_condition do
|
||||
"class { 'trove::server': auth_password => 'test' }"
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user_role('trove@foobar').with(
|
||||
:ensure => 'present',
|
||||
:roles => ['admin']
|
||||
)}
|
||||
|
||||
it { is_expected.to contain_keystone_service('trove::database').with(
|
||||
:ensure => 'present',
|
||||
:description => 'Trove Database Service'
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
|
||||
:ensure => 'present',
|
||||
:public_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
|
||||
:admin_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s",
|
||||
:internal_url => "http://127.0.0.1:8779/v1.0/%(tenant_id)s"
|
||||
) }
|
||||
end
|
||||
|
||||
describe 'when configuring trove-server' do
|
||||
let :pre_condition do
|
||||
"class { 'trove::server': auth_password => 'test' }"
|
||||
let :params do
|
||||
{ :password => 'trove_password',
|
||||
:tenant => 'foobar' }
|
||||
end
|
||||
end
|
||||
|
||||
let :params do
|
||||
{ :password => 'trove_password',
|
||||
:tenant => 'foobar' }
|
||||
end
|
||||
end
|
||||
context 'when overriding endpoint URLs' do
|
||||
let :params do
|
||||
{ :password => 'passw0rd',
|
||||
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
|
||||
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
|
||||
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s' }
|
||||
end
|
||||
|
||||
describe 'when overriding endpoint URLs' do
|
||||
let :params do
|
||||
{ :password => 'passw0rd',
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
|
||||
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
|
||||
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s' }
|
||||
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s'
|
||||
) }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database').with(
|
||||
:ensure => 'present',
|
||||
:public_url => 'https://10.10.10.10:80/v1.0/%(tenant_id)s',
|
||||
:internal_url => 'http://10.10.10.11:81/v1.0/%(tenant_id)s',
|
||||
:admin_url => 'http://10.10.10.12:81/v1.0/%(tenant_id)s'
|
||||
) }
|
||||
end
|
||||
context 'when overriding auth name' do
|
||||
let :params do
|
||||
{ :password => 'foo',
|
||||
:auth_name => 'trovey' }
|
||||
end
|
||||
|
||||
describe 'when overriding auth name' do
|
||||
let :params do
|
||||
{ :password => 'foo',
|
||||
:auth_name => 'trovey' }
|
||||
it { is_expected.to contain_keystone_user('trovey') }
|
||||
it { is_expected.to contain_keystone_user_role('trovey@services') }
|
||||
it { is_expected.to contain_keystone_service('trove::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database') }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('trovey') }
|
||||
it { is_expected.to contain_keystone_user_role('trovey@services') }
|
||||
it { is_expected.to contain_keystone_service('trove::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database') }
|
||||
end
|
||||
context 'when overriding service name' do
|
||||
let :params do
|
||||
{ :service_name => 'trove_service',
|
||||
:auth_name => 'trove',
|
||||
:password => 'trove_password' }
|
||||
end
|
||||
|
||||
describe 'when overriding service name' do
|
||||
let :params do
|
||||
{ :service_name => 'trove_service',
|
||||
:auth_name => 'trove',
|
||||
:password => 'trove_password' }
|
||||
it { is_expected.to contain_keystone_user('trove') }
|
||||
it { is_expected.to contain_keystone_user_role('trove@services') }
|
||||
it { is_expected.to contain_keystone_service('trove_service::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service::database') }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_keystone_user('trove') }
|
||||
it { is_expected.to contain_keystone_user_role('trove@services') }
|
||||
it { is_expected.to contain_keystone_service('trove_service::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove_service::database') }
|
||||
end
|
||||
context 'when disabling endpoint configuration' do
|
||||
let :params do
|
||||
{ :configure_endpoint => false,
|
||||
:password => 'trove_password' }
|
||||
end
|
||||
|
||||
describe 'when disabling endpoint configuration' do
|
||||
let :params do
|
||||
{ :configure_endpoint => false,
|
||||
:password => 'trove_password' }
|
||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::database') }
|
||||
end
|
||||
|
||||
it { is_expected.to_not contain_keystone_endpoint('RegionOne/neutron::database') }
|
||||
context 'when disabling user and user_role configuration' do
|
||||
let :params do
|
||||
{ :configure_user => false,
|
||||
:configure_user_role => false,
|
||||
:service_name => 'trove',
|
||||
:auth_name => 'trove',
|
||||
:password => 'trove_password' }
|
||||
end
|
||||
it { is_expected.to_not contain_keystone_user('trove') }
|
||||
it { is_expected.to_not contain_keystone_user_role('trove@services') }
|
||||
it { is_expected.to contain_keystone_service('trove::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database') }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when disabling user and user_role configuration' do
|
||||
let :params do
|
||||
{ :configure_user => false,
|
||||
:configure_user_role => false,
|
||||
:service_name => 'trove',
|
||||
:auth_name => 'trove',
|
||||
:password => 'trove_password' }
|
||||
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 'trove::keystone::auth'
|
||||
end
|
||||
it { is_expected.to_not contain_keystone_user('trove') }
|
||||
it { is_expected.to_not contain_keystone_user_role('trove@services') }
|
||||
it { is_expected.to contain_keystone_service('trove::database') }
|
||||
it { is_expected.to contain_keystone_endpoint('RegionOne/trove::database') }
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -124,20 +124,16 @@ describe 'trove::logging' do
|
||||
}
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'Debian' })
|
||||
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 'trove-logging'
|
||||
end
|
||||
|
||||
it_configures 'trove-logging'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({ :osfamily => 'RedHat' })
|
||||
end
|
||||
|
||||
it_configures 'trove-logging'
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -2,38 +2,53 @@ require 'spec_helper'
|
||||
|
||||
describe 'trove::quota' do
|
||||
|
||||
describe 'with default parameters' do
|
||||
it 'contains default values' do
|
||||
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
|
||||
:value => 5)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
|
||||
:value => 5)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
|
||||
:value => 20)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
||||
:value => 50)
|
||||
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
|
||||
:value => 'trove.quota.quota.DbQuotaDriver')
|
||||
shared_examples_for 'trove::quota' do
|
||||
context 'with default parameters' do
|
||||
it 'contains default values' do
|
||||
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
|
||||
:value => 5)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
|
||||
:value => 5)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
|
||||
:value => 20)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
||||
:value => 50)
|
||||
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
|
||||
:value => 'trove.quota.quota.DbQuotaDriver')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with overridden parameters' do
|
||||
let :params do
|
||||
{ :max_instances_per_tenant => 10,
|
||||
:max_accepted_volume_size => 10,
|
||||
:max_volumes_per_tenant => 100,
|
||||
:max_backups_per_tenant => 100,
|
||||
}
|
||||
end
|
||||
it 'contains overrided values' do
|
||||
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
|
||||
:value => 100)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
||||
:value => 100)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with overridden parameters' do
|
||||
let :params do
|
||||
{ :max_instances_per_tenant => 10,
|
||||
:max_accepted_volume_size => 10,
|
||||
:max_volumes_per_tenant => 100,
|
||||
:max_backups_per_tenant => 100,
|
||||
}
|
||||
end
|
||||
it 'contains overrided values' do
|
||||
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
|
||||
:value => 10)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
|
||||
:value => 100)
|
||||
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
|
||||
:value => 100)
|
||||
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 'trove::quota'
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -302,36 +302,26 @@ describe 'trove::taskmanager' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:os_workers => 8
|
||||
})
|
||||
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'
|
||||
{ :taskmanager_package_name => 'trove-taskmanager',
|
||||
:taskmanager_service_name => 'trove-taskmanager' }
|
||||
when 'RedHat'
|
||||
{ :taskmanager_package_name => 'openstack-trove-taskmanager',
|
||||
:taskmanager_service_name => 'openstack-trove-taskmanager' }
|
||||
end
|
||||
end
|
||||
it_configures 'trove-taskmanager'
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :taskmanager_package_name => 'trove-taskmanager',
|
||||
:taskmanager_service_name => 'trove-taskmanager' }
|
||||
end
|
||||
|
||||
it_configures 'trove-taskmanager'
|
||||
end
|
||||
|
||||
context 'on RedHat platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'RedHat',
|
||||
:os_workers => 8
|
||||
})
|
||||
end
|
||||
|
||||
let :platform_params do
|
||||
{ :taskmanager_package_name => 'openstack-trove-taskmanager',
|
||||
:taskmanager_service_name => 'openstack-trove-taskmanager' }
|
||||
end
|
||||
|
||||
it_configures 'trove-taskmanager'
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user