From 302415b5c271ecb13919136df9bb5a2e1e623e88 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Fri, 14 Jul 2017 10:28:53 +0800 Subject: [PATCH] Fix unit tests The unit tests were broken by a change to openstacklib Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b which renamed some of the resources in the openstacklib classes. The problem is that our tests in this module should not have been testing what occurs within the modules so this fix updates the tests to only check what we are doing within this module. Depends-On: I9d535ab38afea852559df2b3073bd4b74a2a3947 Change-Id: I96d6f822665b06265fe685554c275512f480de37 --- spec/classes/glance_api_spec.rb | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/spec/classes/glance_api_spec.rb b/spec/classes/glance_api_spec.rb index b61fbf26..b57e741e 100644 --- a/spec/classes/glance_api_spec.rb +++ b/spec/classes/glance_api_spec.rb @@ -364,17 +364,11 @@ describe 'glance::api' do :validate => true, }) end - it { is_expected.to contain_exec('execute glance-api validation').with( - :path => '/usr/bin:/bin:/usr/sbin:/sbin', - :provider => 'shell', - :tries => '10', - :try_sleep => '2', - :command => 'glance --os-auth-url http://127.0.0.1:5000 --os-project-name services --os-username glance --os-password ChangeMe image-list', + it { is_expected.to contain_openstacklib__service_validation('glance-api').with( + :command => 'glance --os-auth-url http://127.0.0.1:5000 --os-project-name services --os-username glance --os-password ChangeMe image-list', + :subscribe => 'Service[glance-api]', )} - it { is_expected.to contain_anchor('create glance-api anchor').with( - :require => 'Exec[execute glance-api validation]', - )} end describe 'Support IPv6' do @@ -395,17 +389,11 @@ describe 'glance::api' do :validation_options => { 'glance-api' => { 'command' => 'my-script' } } }) end - it { is_expected.to contain_exec('execute glance-api validation').with( - :path => '/usr/bin:/bin:/usr/sbin:/sbin', - :provider => 'shell', - :tries => '10', - :try_sleep => '2', - :command => 'my-script', + it { is_expected.to contain_openstacklib__service_validation('glance-api').with( + :command => 'my-script', + :subscribe => 'Service[glance-api]', )} - it { is_expected.to contain_anchor('create glance-api anchor').with( - :require => 'Exec[execute glance-api validation]', - )} end end