puppet-keystone/spec/classes/keystone_db_sync_spec.rb
Tobias Urdin 7def56f92f Convert to rspec-puppet-facts and cleanup docs/testing
This converts some more testing to rspec-puppet-facts
so there is only these three missing now until done:

* keystone_init_spec.rb
* keystone_federation_identity_provider_spec.rb
* keystone_ldap_spec.rb

Also does cleanup of some formatting for documentation
and testing specs.

Change-Id: Ifd74aa8cedf630d98f9e12ab276300409a68eecd
2020-02-04 09:36:53 +01:00

63 lines
2.0 KiB
Ruby

require 'spec_helper'
describe 'keystone::db::sync' do
shared_examples 'keystone::db::sync' do
describe 'with only required params' do
it {
is_expected.to contain_exec('keystone-manage db_sync').with(
:command => 'keystone-manage db_sync',
:path => '/usr/bin',
:user => 'keystone',
:try_sleep => 5,
:tries => 10,
:refreshonly => true,
:logoutput => 'on_failure',
:subscribe => ['Anchor[keystone::install::end]',
'Anchor[keystone::config::end]',
'Anchor[keystone::dbsync::begin]'],
:notify => 'Anchor[keystone::dbsync::end]',
:tag => ['keystone-exec', 'openstack-db'],
)
}
end
describe "overriding extra_params and keystone user" do
let :params do
{
:extra_params => '--config-file /etc/keystone/keystone.conf',
:keystone_user => 'test_user',
}
end
it {
is_expected.to contain_exec('keystone-manage db_sync').with(
:command => 'keystone-manage --config-file /etc/keystone/keystone.conf db_sync',
:path => '/usr/bin',
:user => 'test_user',
:try_sleep => 5,
:tries => 10,
:refreshonly => true,
:logoutput => 'on_failure',
:subscribe => ['Anchor[keystone::install::end]',
'Anchor[keystone::config::end]',
'Anchor[keystone::dbsync::begin]'],
:notify => 'Anchor[keystone::dbsync::end]',
:tag => ['keystone-exec', 'openstack-db'],
)
}
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_behaves_like 'keystone::db::sync'
end
end
end