summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMark Vanderwiel <vanderwl@us.ibm.com>2015-03-25 17:46:17 -0500
committerMa Wen Cheng <wenchma@cn.ibm.com>2015-04-07 06:14:57 +0000
commitab8aa01421b8d3fdb4ed99be7ce66744628759b3 (patch)
tree68fb81e5caeb91efc0682dac62c7a83a9824b653 /spec
parent440f32f4fb030a03aa3e9c92cefa434d92809ee5 (diff)
Use identity_uri_transform
Remove deprecated keys and use identity_uri via the new transform helper method. Also, cleanup specs for endpoint testing to make sure Common is fully tested. Change-Id: I5a26d8cb83193e4bf66bb952f7973838d6acba40 Implements: blueprint identity-uri
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Zhiwei Chen <zhiwchen@cn.ibm.com> Workflow+1: Zhiwei Chen <zhiwchen@cn.ibm.com> Code-Review+2: JJ Asghar <jj@getchef.com> Submitted-by: Jenkins Submitted-at: Sat, 18 Apr 2015 03:51:55 +0000 Reviewed-on: https://review.openstack.org/167825 Project: stackforge/cookbook-openstack-block-storage Branch: refs/heads/master
Diffstat (limited to 'spec')
-rw-r--r--spec/cinder_common_spec.rb45
1 files changed, 12 insertions, 33 deletions
diff --git a/spec/cinder_common_spec.rb b/spec/cinder_common_spec.rb
index f8217ac..95e3cf2 100644
--- a/spec/cinder_common_spec.rb
+++ b/spec/cinder_common_spec.rb
@@ -42,21 +42,6 @@ describe 'openstack-block-storage::cinder-common' do
42 let(:file) { chef_run.template('/etc/cinder/cinder.conf') } 42 let(:file) { chef_run.template('/etc/cinder/cinder.conf') }
43 let(:test_pass) { 'test_pass' } 43 let(:test_pass) { 'test_pass' }
44 before do 44 before do
45 endpoint = double(port: 'port', host: 'host', scheme: 'scheme')
46 allow_any_instance_of(Chef::Recipe).to receive(:internal_endpoint)
47 .with('image-api')
48 .and_return(endpoint)
49 allow_any_instance_of(Chef::Recipe).to receive(:admin_endpoint)
50 .with('identity-admin')
51 .and_return(endpoint)
52 allow_any_instance_of(Chef::Recipe).to receive(:internal_endpoint)
53 .with('identity-internal')
54 .and_return(endpoint)
55 allow_any_instance_of(Chef::Recipe).to receive(:endpoint)
56 .with('block-storage-api-bind')
57 .and_return(endpoint)
58 allow_any_instance_of(Chef::Recipe).to receive(:auth_uri_transform)
59 .and_return('auth_uri_transform')
60 allow_any_instance_of(Chef::Recipe).to receive(:get_password) 45 allow_any_instance_of(Chef::Recipe).to receive(:get_password)
61 .with('user', anything) 46 .with('user', anything)
62 .and_return(test_pass) 47 .and_return(test_pass)
@@ -141,19 +126,11 @@ describe 'openstack-block-storage::cinder-common' do
141 context 'endpoint related' do 126 context 'endpoint related' do
142 127
143 it 'has auth_uri' do 128 it 'has auth_uri' do
144 expect(chef_run).to render_file(file.name).with_content(/^auth_uri = auth_uri_transform$/) 129 expect(chef_run).to render_file(file.name).with_content(%r(^auth_uri = http://127.0.0.1:5000/v2.0$))
145 end 130 end
146 131
147 it 'has auth_host' do 132 it 'has identity_uri' do
148 expect(chef_run).to render_file(file.name).with_content(/^auth_host = host$/) 133 expect(chef_run).to render_file(file.name).with_content(%r(^identity_uri = http://127.0.0.1:35357/$))
149 end
150
151 it 'has auth_port' do
152 expect(chef_run).to render_file(file.name).with_content(/^auth_port = port$/)
153 end
154
155 it 'has auth_protocol' do
156 expect(chef_run).to render_file(file.name).with_content(/^auth_protocol = scheme$/)
157 end 134 end
158 end 135 end
159 136
@@ -263,7 +240,7 @@ describe 'openstack-block-storage::cinder-common' do
263 240
264 context 'glance endpoint' do 241 context 'glance endpoint' do
265 it 'has a glance_api_servers attribute' do 242 it 'has a glance_api_servers attribute' do
266 expect(chef_run).to render_file(file.name).with_content(%r{^glance_api_servers=scheme://host:port$}) 243 expect(chef_run).to render_file(file.name).with_content(%r{^glance_api_servers=http://127.0.0.1:9292$})
267 end 244 end
268 245
269 it 'has glance_api_version attribute' do 246 it 'has glance_api_version attribute' do
@@ -288,10 +265,12 @@ describe 'openstack-block-storage::cinder-common' do
288 expect(chef_run).to render_file(file.name).with_content(%r{^glance_ca_certificates_file=dir/to/path$}) 265 expect(chef_run).to render_file(file.name).with_content(%r{^glance_ca_certificates_file=dir/to/path$})
289 end 266 end
290 267
291 %w(host port).each do |glance_attr| 268 it 'has a glance host attribute' do
292 it "has a glance #{glance_attr} attribute" do 269 expect(chef_run).to render_file(file.name).with_content(/^glance_host=127.0.0.1$/)
293 expect(chef_run).to render_file(file.name).with_content(/^glance_#{glance_attr}=#{glance_attr}$/) 270 end
294 end 271
272 it 'has a glance port attribute' do
273 expect(chef_run).to render_file(file.name).with_content(/^glance_port=9292$/)
295 end 274 end
296 end 275 end
297 276
@@ -302,11 +281,11 @@ describe 'openstack-block-storage::cinder-common' do
302 281
303 context 'cinder endpoint' do 282 context 'cinder endpoint' do
304 it 'has osapi_volume_listen set' do 283 it 'has osapi_volume_listen set' do
305 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen=host$/) 284 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen=127.0.0.1$/)
306 end 285 end
307 286
308 it 'has osapi_volume_listen_port set' do 287 it 'has osapi_volume_listen_port set' do
309 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port=port$/) 288 expect(chef_run).to render_file(file.name).with_content(/^osapi_volume_listen_port=8776$/)
310 end 289 end
311 end 290 end
312 291