try again, with puppetforge modules, correctly included now
[mirror/dsa-puppet.git] / 3rdparty / modules / glance / spec / classes / glance_backend_swift_spec.rb
1 require 'spec_helper'
2
3 describe 'glance::backend::swift' do
4   let :facts do
5     {
6       :osfamily => 'Debian'
7     }
8   end
9
10   let :params do
11     {
12       :swift_store_user => 'user',
13       :swift_store_key  => 'key',
14     }
15   end
16
17   let :pre_condition do
18     'class { "glance::api": keystone_password => "pass" }'
19   end
20
21   describe 'when default parameters' do
22
23     it 'configures glance-api.conf' do
24       should contain_glance_api_config('glance_store/default_store').with_value('swift')
25       should contain_glance_api_config('glance_store/swift_store_key').with_value('key')
26       should contain_glance_api_config('glance_store/swift_store_user').with_value('user')
27       should contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('2')
28       should contain_glance_api_config('DEFAULT/swift_store_large_object_size').with_value('5120')
29       should contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
30       should contain_glance_api_config('DEFAULT/swift_store_container').with_value('glance')
31       should contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value(false)
32     end
33
34     it 'configures glance-cache.conf' do
35       should contain_glance_cache_config('glance_store/swift_store_key').with_value('key')
36       should contain_glance_cache_config('glance_store/swift_store_user').with_value('user')
37       should contain_glance_cache_config('DEFAULT/swift_store_auth_version').with_value('2')
38       should contain_glance_cache_config('DEFAULT/swift_store_large_object_size').with_value('5120')
39       should contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.1:5000/v2.0/')
40       should contain_glance_cache_config('DEFAULT/swift_store_container').with_value('glance')
41       should contain_glance_cache_config('DEFAULT/swift_store_create_container_on_put').with_value(false)
42     end
43   end
44
45   describe 'when overriding parameters' do
46     let :params do
47       {
48         :swift_store_user                    => 'user',
49         :swift_store_key                     => 'key',
50         :swift_store_auth_version            => '1',
51         :swift_store_large_object_size       => '100',
52         :swift_store_auth_address            => '127.0.0.2:8080/v1.0/',
53         :swift_store_container               => 'swift',
54         :swift_store_create_container_on_put => true
55       }
56     end
57
58     it 'configures glance-api.conf' do
59       should contain_glance_api_config('DEFAULT/swift_store_container').with_value('swift')
60       should contain_glance_api_config('DEFAULT/swift_store_create_container_on_put').with_value(true)
61       should contain_glance_api_config('DEFAULT/swift_store_auth_version').with_value('1')
62       should contain_glance_api_config('DEFAULT/swift_store_large_object_size').with_value('100')
63       should contain_glance_api_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
64     end
65
66     it 'configures glance-cache.conf' do
67       should contain_glance_cache_config('DEFAULT/swift_store_container').with_value('swift')
68       should contain_glance_cache_config('DEFAULT/swift_store_create_container_on_put').with_value(true)
69       should contain_glance_cache_config('DEFAULT/swift_store_auth_version').with_value('1')
70       should contain_glance_cache_config('DEFAULT/swift_store_large_object_size').with_value('100')
71       should contain_glance_cache_config('glance_store/swift_store_auth_address').with_value('127.0.0.2:8080/v1.0/')
72     end
73   end
74 end