Debian Codegraph @

spec/classes/nova_limit_spec.rb

raw
1 require 'spec_helper'
2
3 describe 'nova::limit' do
4
5 shared_examples_for 'nova::limit' do
6
7 let :params do
8 {
9 :password => 'nova_password',
10 }
11 end
12
13 context 'without endpoint_id' do
14 it 'configure limit default params' do
15 is_expected.to contain_oslo__limit('nova_config').with(
16 :endpoint_id => nil,
17 :endpoint_service_name => 'nova',
18 :endpoint_service_type => 'compute',
19 :endpoint_region_name => '<SERVICE DEFAULT>',
20 :endpoint_interface => '<SERVICE DEFAULT>',
21 :username => 'nova',
22 :password => 'nova_password',
23 :auth_url => 'http://localhost:5000',
24 :project_name => 'services',
25 :user_domain_name => 'Default',
26 :project_domain_name => 'Default',
27 :system_scope => '<SERVICE DEFAULT>',
28 :auth_type => 'password',
29 :service_type => '<SERVICE DEFAULT>',
30 :valid_interfaces => '<SERVICE DEFAULT>',
31 :region_name => '<SERVICE DEFAULT>',
32 :endpoint_override => '<SERVICE DEFAULT>',
33 )
34 end
35 end
36
37 context 'with endpoint_id' do
38 before :each do
39 params.merge!({
40 :endpoint_id => 'b41eeaed-d2ae-4add-9bfd-9ea8ac912d64',
41 })
42 end
43
44 it 'configure limit default params' do
45 is_expected.to contain_oslo__limit('nova_config').with(
46 :endpoint_id => 'b41eeaed-d2ae-4add-9bfd-9ea8ac912d64',
47 :endpoint_service_name => nil,
48 :endpoint_service_type => nil,
49 :endpoint_region_name => '<SERVICE DEFAULT>',
50 :endpoint_interface => '<SERVICE DEFAULT>',
51 :username => 'nova',
52 :password => 'nova_password',
53 :auth_url => 'http://localhost:5000',
54 :project_name => 'services',
55 :user_domain_name => 'Default',
56 :project_domain_name => 'Default',
57 :system_scope => '<SERVICE DEFAULT>',
58 :auth_type => 'password',
59 :service_type => '<SERVICE DEFAULT>',
60 :valid_interfaces => '<SERVICE DEFAULT>',
61 :region_name => '<SERVICE DEFAULT>',
62 :endpoint_override => '<SERVICE DEFAULT>',
63 )
64 end
65 end
66
67 context 'with specific parameters' do
68 before :each do
69 params.merge!({
70 :endpoint_service_name => 'alt_nova',
71 :endpoint_service_type => 'alt_compute',
72 :endpoint_region_name => 'regionOne',
73 :endpoint_interface => 'public',
74 :username => 'alt_nova',
75 :auth_url => 'http://192.168.0.1:5000',
76 :project_name => 'alt_services',
77 :user_domain_name => 'domainX',
78 :project_domain_name => 'domainX',
79 :system_scope => 'all',
80 :auth_type => 'v3password',
81 :service_type => 'identity',
82 :valid_interfaces => 'public',
83 :region_name => 'regionOne',
84 :endpoint_override => 'http://192.168.0.2:5000',
85 })
86 end
87
88 it 'configure limit params' do
89 is_expected.to contain_oslo__limit('nova_config').with(
90 :endpoint_id => nil,
91 :endpoint_service_name => 'alt_nova',
92 :endpoint_service_type => 'alt_compute',
93 :endpoint_region_name => 'regionOne',
94 :endpoint_interface => 'public',
95 :username => 'alt_nova',
96 :password => 'nova_password',
97 :auth_url => 'http://192.168.0.1:5000',
98 :project_name => 'alt_services',
99 :user_domain_name => 'domainX',
100 :project_domain_name => 'domainX',
101 :system_scope => 'all',
102 :auth_type => 'v3password',
103 :service_type => 'identity',
104 :valid_interfaces => 'public',
105 :region_name => 'regionOne',
106 :endpoint_override => 'http://192.168.0.2:5000',
107 )
108 end
109 end
110 end
111
112 on_supported_os({
113 :supported_os => OSDefaults.get_supported_os
114 }).each do |os,facts|
115 context "on #{os}" do
116 let (:facts) do
117 facts.merge!(OSDefaults.get_facts())
118 end
119
120 it_behaves_like 'nova::limit'
121 end
122 end
123
124 end