unit tests: make Keystone_endpoint match service by name/type

Since a chance in puppet-keystone (1], we now match an endpoint with a
service name/type.
)
[1] http://git.openstack.org/cgit/openstack/puppet-keystone/commit/?id=0a4e06abb0f5b3f324464ff5219d2885816311ce

Closes-Bug: #1528308

Change-Id: Ide3e42afb6ab5729b2c9d15ee519f7c1733e6d41
changes/63/260163/2
Emilien Macchi 7 years ago
parent 3b46e6845a
commit 8ec5fbc3e9
  1. 21
      spec/classes/gnocchi_keystone_auth_spec.rb

@ -26,13 +26,12 @@ describe 'gnocchi::keystone::auth' do
:roles => ['admin']
)}
it { is_expected.to contain_keystone_service('gnocchi').with(
it { is_expected.to contain_keystone_service('gnocchi::metric').with(
:ensure => 'present',
:type => 'metric',
:description => 'OpenStack Metric Service'
) }
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi').with(
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi::metric').with(
:ensure => 'present',
:public_url => 'http://127.0.0.1:8041',
:admin_url => 'http://127.0.0.1:8041',
@ -48,7 +47,7 @@ describe 'gnocchi::keystone::auth' do
:admin_url => 'http://10.10.10.12:81' }
end
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi').with(
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi::metric').with(
:ensure => 'present',
:public_url => 'https://10.10.10.10:80',
:internal_url => 'http://10.10.10.11:81',
@ -64,8 +63,8 @@ describe 'gnocchi::keystone::auth' do
it { is_expected.to contain_keystone_user('gnocchiany') }
it { is_expected.to contain_keystone_user_role('gnocchiany@services') }
it { is_expected.to contain_keystone_service('gnocchiany') }
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchiany') }
it { is_expected.to contain_keystone_service('gnocchiany::metric') }
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchiany::metric') }
end
describe 'when overriding service name' do
@ -77,8 +76,8 @@ describe 'gnocchi::keystone::auth' do
it { is_expected.to contain_keystone_user('gnocchi') }
it { is_expected.to contain_keystone_user_role('gnocchi@services') }
it { is_expected.to contain_keystone_service('gnocchi_service') }
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi_service') }
it { is_expected.to contain_keystone_service('gnocchi_service::metric') }
it { is_expected.to contain_keystone_endpoint('RegionOne/gnocchi_service::metric') }
end
describe 'when disabling user configuration' do
@ -92,9 +91,8 @@ describe 'gnocchi::keystone::auth' do
it { is_expected.not_to contain_keystone_user('gnocchi') }
it { is_expected.to contain_keystone_user_role('gnocchi@services') }
it { is_expected.to contain_keystone_service('gnocchi').with(
it { is_expected.to contain_keystone_service('gnocchi::metric').with(
:ensure => 'present',
:type => 'metric',
:description => 'OpenStack Metric Service'
) }
@ -112,9 +110,8 @@ describe 'gnocchi::keystone::auth' do
it { is_expected.not_to contain_keystone_user('gnocchi') }
it { is_expected.not_to contain_keystone_user_role('gnocchi@services') }
it { is_expected.to contain_keystone_service('gnocchi').with(
it { is_expected.to contain_keystone_service('gnocchi::metric').with(
:ensure => 'present',
:type => 'metric',
:description => 'OpenStack Metric Service'
) }

Loading…
Cancel
Save