Browse Source

upgrade to Havana release

also upgrade gems:
- berkshelf, ~> 2.0.10
- chefspec, ~> 3.0.2
- foodcritic, ~> 3.0.3

Change-Id: I732f73d02263e3257167898826dbb8d0f60a064d
tags/eol-havana
Ionuț Arțăriși 5 years ago
parent
commit
9423f6110d

+ 4
- 4
Berksfile.lock View File

@@ -4,14 +4,14 @@
4 4
       "path": "."
5 5
     },
6 6
     "openstack-common": {
7
-      "locked_version": "0.4.3",
7
+      "locked_version": "8.0.0",
8 8
       "git": "git://github.com/stackforge/cookbook-openstack-common.git",
9
-      "ref": "eb5eed7126b6a6efbaf803e8a594d610cf661e97"
9
+      "ref": "d5f852daf5d0f3001ddbf1688c43a4bb21e8ca00"
10 10
     },
11 11
     "openstack-identity": {
12
-      "locked_version": "7.0.0",
12
+      "locked_version": "8.0.0",
13 13
       "git": "git://github.com/stackforge/cookbook-openstack-identity.git",
14
-      "ref": "b881af26095cfa869a6970067c49597a0ee63586"
14
+      "ref": "3b001b7e07758e2c81b5ae4d1bff8e4a1472b24a"
15 15
     },
16 16
     "apt": {
17 17
       "locked_version": "2.0.0"

+ 4
- 0
CHANGELOG.md View File

@@ -2,6 +2,10 @@ openstack-metering Cookbook CHANGELOG
2 2
 ==============================
3 3
 This file is used to list changes made in each version of the openstack-metering cookbook.
4 4
 
5
+## 8.0.0
6
+### New version
7
+* Upgrade to upstream Havana release
8
+
5 9
 ## 7.1.1
6 10
 ### Bug
7 11
 * Relax the dependency on openstack-identity to the 7.x series

+ 3
- 3
Gemfile View File

@@ -2,8 +2,8 @@ source "https://rubygems.org"
2 2
 
3 3
 gem "chef", "~> 11.4.4"
4 4
 gem "json", "<= 1.7.7" # chef 11 dependency
5
-gem "berkshelf", "~> 2.0.3"
6
-gem "chefspec", "~> 1.3.0"
7
-gem "foodcritic"
5
+gem "berkshelf", "~> 2.0.10"
6
+gem "chefspec", "~> 3.0.2"
7
+gem "foodcritic", "~> 3.0.3"
8 8
 gem "strainer"
9 9
 gem "tailor"

+ 56
- 59
Gemfile.lock View File

@@ -1,30 +1,34 @@
1 1
 GEM
2 2
   remote: https://rubygems.org/
3 3
   specs:
4
-    activesupport (3.2.14)
4
+    activesupport (3.2.16)
5 5
       i18n (~> 0.6, >= 0.6.4)
6 6
       multi_json (~> 1.0)
7 7
     addressable (2.3.5)
8 8
     akami (1.2.0)
9 9
       gyoku (>= 0.4.0)
10 10
       nokogiri (>= 1.4.0)
11
-    berkshelf (2.0.7)
11
+    berkshelf (2.0.10)
12 12
       activesupport (~> 3.2.0)
13 13
       addressable (~> 2.3.4)
14 14
       buff-shell_out (~> 0.1)
15
-      celluloid (>= 0.14.0)
16 15
       chozo (>= 0.6.1)
17 16
       faraday (>= 0.8.5)
18 17
       hashie (>= 2.0.2)
19 18
       minitar (~> 0.5.4)
20 19
       rbzip2 (~> 0.2.0)
21 20
       retryable (~> 1.3.3)
22
-      ridley (~> 1.2.1)
21
+      ridley (~> 1.5.0)
23 22
       solve (>= 0.5.0)
24 23
       thor (~> 0.18.0)
24
+    buff-config (0.4.0)
25
+      buff-extensions (~> 0.3)
26
+      varia_model (~> 0.1)
25 27
     buff-extensions (0.5.0)
28
+    buff-ignore (1.1.1)
29
+    buff-platform (0.1.0)
26 30
     buff-ruby_engine (0.1.0)
27
-    buff-shell_out (0.1.0)
31
+    buff-shell_out (0.1.1)
28 32
       buff-ruby_engine (~> 0.1.0)
29 33
     builder (3.2.2)
30 34
     celluloid (0.14.1)
@@ -46,97 +50,88 @@ GEM
46 50
       ohai (>= 0.6.0)
47 51
       rest-client (>= 1.0.4, < 1.7.0)
48 52
       yajl-ruby (~> 1.1)
49
-    chefspec (1.3.1)
50
-      chef (>= 10.0)
51
-      erubis
52
-      fauxhai (>= 0.1.1, < 2.0)
53
-      minitest-chef-handler (>= 0.6.0)
54
-      rspec (~> 2.0)
53
+    chefspec (3.0.2)
54
+      chef (~> 11.0)
55
+      fauxhai (~> 2.0)
56
+      rspec (~> 2.14)
55 57
     chozo (0.6.1)
56 58
       activesupport (>= 3.2.0)
57 59
       hashie (>= 2.0.2)
58 60
       multi_json (>= 1.3.0)
59
-    ci_reporter (1.9.0)
60
-      builder (>= 2.1.2)
61
-    diff-lcs (1.2.4)
61
+    diff-lcs (1.2.5)
62 62
     erubis (2.7.0)
63
-    faraday (0.8.7)
64
-      multipart-post (~> 1.1)
65
-    fauxhai (1.1.1)
66
-      httparty
63
+    faraday (0.8.8)
64
+      multipart-post (~> 1.2.0)
65
+    fauxhai (2.0.0)
67 66
       net-ssh
68 67
       ohai
69
-    ffi (1.9.0)
70
-    foodcritic (2.2.0)
68
+    ffi (1.9.3)
69
+    foodcritic (3.0.3)
71 70
       erubis
72 71
       gherkin (~> 2.11.7)
73 72
       nokogiri (~> 1.5.4)
73
+      rake
74 74
       treetop (~> 1.4.10)
75 75
       yajl-ruby (~> 1.1.0)
76 76
     gherkin (2.11.8)
77 77
       multi_json (~> 1.3)
78 78
     gssapi (1.0.3)
79 79
       ffi (>= 1.0.1)
80
-    gyoku (1.0.0)
80
+    gyoku (1.1.0)
81 81
       builder (>= 2.1.2)
82 82
     hashie (2.0.5)
83
-    highline (1.6.19)
84
-    httparty (0.11.0)
85
-      multi_json (~> 1.0)
86
-      multi_xml (>= 0.5.2)
87
-    httpclient (2.2.0.2)
83
+    highline (1.6.20)
84
+    httpclient (2.3.4.1)
88 85
     httpi (0.9.7)
89 86
       rack
90
-    i18n (0.6.4)
87
+    i18n (0.6.9)
91 88
     ipaddress (0.8.0)
92 89
     json (1.7.7)
93 90
     little-plugger (1.1.3)
94 91
     log_switch (0.4.0)
95
-    logging (1.6.2)
92
+    logging (1.8.1)
96 93
       little-plugger (>= 1.1.3)
97
-    mime-types (1.23)
94
+      multi_json (>= 1.3.6)
95
+    mime-types (2.0)
98 96
     minitar (0.5.4)
99
-    minitest (4.7.5)
100
-    minitest-chef-handler (1.0.1)
101
-      chef
102
-      ci_reporter
103
-      minitest (~> 4.7.3)
104 97
     mixlib-authentication (1.3.0)
105 98
       mixlib-log
106 99
     mixlib-cli (1.3.0)
107
-    mixlib-config (1.1.2)
100
+    mixlib-config (2.1.0)
108 101
     mixlib-log (1.6.0)
109
-    mixlib-shellout (1.2.0)
110
-    multi_json (1.7.7)
111
-    multi_xml (0.5.4)
102
+    mixlib-shellout (1.3.0)
103
+    multi_json (1.8.2)
112 104
     multipart-post (1.2.0)
113 105
     net-http-persistent (2.9)
114
-    net-ssh (2.6.8)
106
+    net-ssh (2.7.0)
115 107
     net-ssh-gateway (1.2.0)
116 108
       net-ssh (>= 2.6.5)
117 109
     net-ssh-multi (1.1)
118 110
       net-ssh (>= 2.1.4)
119 111
       net-ssh-gateway (>= 0.99.0)
120
-    nio4r (0.4.6)
112
+    nio4r (0.5.0)
121 113
     nokogiri (1.5.10)
122 114
     nori (1.1.5)
123
-    ohai (6.18.0)
115
+    ohai (6.20.0)
124 116
       ipaddress
125 117
       mixlib-cli
126 118
       mixlib-config
127 119
       mixlib-log
128 120
       mixlib-shellout
129
-      systemu
121
+      systemu (~> 2.5.2)
130 122
       yajl-ruby
131 123
     polyglot (0.3.3)
132 124
     rack (1.5.2)
125
+    rake (10.1.0)
133 126
     rbzip2 (0.2.0)
134 127
     rest-client (1.6.7)
135 128
       mime-types (>= 1.16)
136 129
     retryable (1.3.3)
137
-    ridley (1.2.4)
130
+    ridley (1.5.3)
138 131
       addressable
132
+      buff-config (~> 0.2)
139 133
       buff-extensions (~> 0.3)
134
+      buff-ignore (~> 1.1)
140 135
       buff-shell_out (~> 0.1)
141 136
       celluloid (~> 0.14.0)
142 137
       celluloid-io (~> 0.14.0)
@@ -147,6 +142,7 @@ GEM
147 142
       mixlib-authentication (>= 1.3.0)
148 143
       net-http-persistent (>= 2.8)
149 144
       net-ssh
145
+      nio4r (>= 0.5.0)
150 146
       retryable
151 147
       solve (>= 0.4.4)
152 148
       varia_model (~> 0.1)
@@ -155,10 +151,10 @@ GEM
155 151
       rspec-core (~> 2.14.0)
156 152
       rspec-expectations (~> 2.14.0)
157 153
       rspec-mocks (~> 2.14.0)
158
-    rspec-core (2.14.4)
159
-    rspec-expectations (2.14.0)
154
+    rspec-core (2.14.7)
155
+    rspec-expectations (2.14.4)
160 156
       diff-lcs (>= 1.1.3, < 2.0)
161
-    rspec-mocks (2.14.1)
157
+    rspec-mocks (2.14.4)
162 158
     rubyntlm (0.1.1)
163 159
     savon (0.9.5)
164 160
       akami (~> 1.0)
@@ -168,11 +164,12 @@ GEM
168 164
       nokogiri (>= 1.4.0)
169 165
       nori (~> 1.0)
170 166
       wasabi (~> 1.0)
171
-    solve (0.6.1)
172
-    strainer (3.0.5)
167
+    solve (0.8.2)
168
+    strainer (3.3.0)
173 169
       berkshelf (~> 2.0)
170
+      buff-platform (~> 0.1)
174 171
     systemu (2.5.2)
175
-    tailor (1.2.1)
172
+    tailor (1.3.1)
176 173
       log_switch (>= 0.3.0)
177 174
       term-ansicolor (>= 1.0.5)
178 175
       text-table (>= 1.2.2)
@@ -181,21 +178,21 @@ GEM
181 178
     text-table (1.2.3)
182 179
     thor (0.18.1)
183 180
     timers (1.1.0)
184
-    tins (0.8.3)
185
-    treetop (1.4.14)
181
+    tins (0.13.1)
182
+    treetop (1.4.15)
186 183
       polyglot
187 184
       polyglot (>= 0.3.1)
188 185
     uuidtools (2.1.4)
189
-    varia_model (0.1.1)
186
+    varia_model (0.2.0)
190 187
       buff-extensions (~> 0.2)
191 188
       hashie (>= 2.0.2)
192 189
     wasabi (1.0.0)
193 190
       nokogiri (>= 1.4.0)
194
-    winrm (1.1.2)
191
+    winrm (1.1.3)
195 192
       gssapi (~> 1.0.0)
196
-      httpclient (~> 2.2.0.2)
197
-      logging (~> 1.6.1)
198
-      nokogiri (~> 1.5.0)
193
+      httpclient (~> 2.2, >= 2.2.0.2)
194
+      logging (~> 1.6, >= 1.6.1)
195
+      nokogiri (~> 1.5)
199 196
       rubyntlm (~> 0.1.1)
200 197
       savon (= 0.9.5)
201 198
       uuidtools (~> 2.1.2)
@@ -205,10 +202,10 @@ PLATFORMS
205 202
   ruby
206 203
 
207 204
 DEPENDENCIES
208
-  berkshelf (~> 2.0.3)
205
+  berkshelf (~> 2.0.10)
209 206
   chef (~> 11.4.4)
210
-  chefspec (~> 1.3.0)
211
-  foodcritic
207
+  chefspec (~> 3.0.2)
208
+  foodcritic (~> 3.0.3)
212 209
   json (<= 1.7.7)
213 210
   strainer
214 211
   tailor

+ 2
- 0
README.md View File

@@ -65,11 +65,13 @@ License and Author
65 65
 | **Author**           |  John Dewey (<jdewey@att.com>)                     |
66 66
 | **Author**           |  Justin Shepherd (<jshepher@rackspace.com>)        |
67 67
 | **Author**           |  Salman Baset (<sabaset@us.ibm.com>)               |
68
+| **Author**           |  Ionut Artarisi (<iartarisi@suse.cz>)              |
68 69
 |                      |                                                    |
69 70
 | **Copyright**        |  Copyright (c) 2013, Opscode, Inc.                 |
70 71
 | **Copyright**        |  Copyright (c) 2013, AT&T Services, Inc.           |
71 72
 | **Copyright**        |  Copyright (c) 2013, Rackspace US, Inc.            |
72 73
 | **Copyright**        |  Copyright (c) 2013, IBM Corp. 	            |
74
+| **Copyright**        |  Copyright (c) 2013, SUSE Linux GmbH               |
73 75
 
74 76
 
75 77
 Licensed under the Apache License, Version 2.0 (the "License");

+ 3
- 3
metadata.rb View File

@@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com"
4 4
 license          "Apache 2.0"
5 5
 description      "The OpenStack Metering service Ceilometer."
6 6
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
-version          "7.1.1"
7
+version          "8.0.0"
8 8
 
9 9
 recipe "openstack-metering::agent-central", "Installs agent central service."
10 10
 recipe "openstack-metering::agent-compute", "Installs agent compute service."
@@ -17,5 +17,5 @@ recipe "openstack-metering::identity_registration", "Registers the endpoints wit
17 17
   supports os
18 18
 end
19 19
 
20
-depends "openstack-common", "~> 0.4.0"
21
-depends "openstack-identity", "~> 7.0"
20
+depends "openstack-common", "~> 8.0"
21
+depends "openstack-identity", "~> 8.0"

+ 1
- 1
spec/agent-central-opensuse_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::agent-central" do
4 4
   before { metering_stubs }
5 5
   describe "opensuse" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
8 8
       @chef_run.converge "openstack-metering::agent-central"
9 9
     end
10 10
 

+ 1
- 1
spec/agent-central_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::agent-central" do
4 4
   before { metering_stubs }
5 5
   describe "ubuntu" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
8 8
       @chef_run.converge "openstack-metering::agent-central"
9 9
     end
10 10
 

+ 1
- 1
spec/agent-compute-opensuse_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::agent-compute" do
4 4
   before { metering_stubs }
5 5
   describe "opensuse" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
8 8
       @chef_run.converge "openstack-metering::agent-compute"
9 9
     end
10 10
 

+ 1
- 1
spec/agent-compute_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::agent-compute" do
4 4
   before { metering_stubs }
5 5
   describe "ubuntu" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
8 8
       @chef_run.converge "openstack-metering::agent-compute"
9 9
     end
10 10
 

+ 1
- 1
spec/api-opensuse_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::api" do
4 4
   before { metering_stubs }
5 5
   describe "opensuse" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
8 8
       @chef_run.converge "openstack-metering::api"
9 9
     end
10 10
 

+ 7
- 13
spec/api_spec.rb View File

@@ -4,24 +4,18 @@ describe "openstack-metering::api" do
4 4
   before { metering_stubs }
5 5
   describe "ubuntu" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
8 8
       @chef_run.converge "openstack-metering::api"
9 9
     end
10 10
 
11 11
     expect_runs_common_recipe
12 12
 
13
-    describe "/var/cache/ceilometer" do
14
-      before do
15
-        @dir = @chef_run.directory "/var/cache/ceilometer"
16
-      end
17
-
18
-      it "has proper owner" do
19
-        expect(@dir).to be_owned_by "ceilometer", "ceilometer"
20
-      end
21
-
22
-      it "has proper modes" do
23
-        expect(sprintf("%o", @dir.mode)).to eq "700"
24
-      end
13
+    it "creates the /var/cache/ceilometer directory" do
14
+      expect(@chef_run).to create_directory("/var/cache/ceilometer").with(
15
+        user: "ceilometer",
16
+        group: "ceilometer",
17
+        mode: 0700
18
+        )
25 19
     end
26 20
 
27 21
     it "starts api service" do

+ 1
- 1
spec/collector-opensuse_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::collector" do
4 4
   before { metering_stubs }
5 5
   describe "opensuse" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
8 8
       @chef_run.converge "openstack-metering::collector"
9 9
     end
10 10
 

+ 1
- 1
spec/collector_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::collector" do
4 4
   before { metering_stubs }
5 5
   describe "ubuntu" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
8 8
       @chef_run.converge "openstack-metering::collector"
9 9
     end
10 10
 

+ 1
- 1
spec/common-opensuse_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::common" do
4 4
   before { metering_stubs }
5 5
   describe "opensuse" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
7
+      @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
8 8
       @chef_run.converge "openstack-metering::common"
9 9
     end
10 10
 

+ 66
- 160
spec/common_spec.rb View File

@@ -4,7 +4,7 @@ describe "openstack-metering::common" do
4 4
   before { metering_stubs }
5 5
   describe "ubuntu" do
6 6
     before do
7
-      @chef_run = ::ChefSpec::ChefRunner.new(::UBUNTU_OPTS) do |n|
7
+      @chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
8 8
         n.set["openstack"]["metering"]["syslog"]["use"] = true
9 9
       end
10 10
       @chef_run.converge "openstack-metering::common"
@@ -18,173 +18,79 @@ describe "openstack-metering::common" do
18 18
       expect(@chef_run).to install_package "ceilometer-common"
19 19
     end
20 20
 
21
-    describe "/etc/ceilometer" do
22
-      before do
23
-        @dir = @chef_run.directory "/etc/ceilometer"
24
-      end
25
-
26
-      it "has proper owner" do
27
-        expect(@dir).to be_owned_by "ceilometer", "ceilometer"
28
-      end
29
-
30
-      it "has proper modes" do
31
-        expect(sprintf("%o", @dir.mode)).to eq "750"
32
-      end
21
+    it "creates the /etc/ceilometer directory" do
22
+      expect(@chef_run).to create_directory("/etc/ceilometer").with(
23
+        user: "ceilometer",
24
+        group: "ceilometer",
25
+        mode: 0750
26
+        )
33 27
     end
34 28
 
35 29
     describe "/etc/ceilometer" do
36 30
       before do
37
-        @file = @chef_run.template "/etc/ceilometer/ceilometer.conf"
38
-      end
39
-
40
-      it "has proper owner" do
41
-        expect(@file).to be_owned_by("ceilometer", "ceilometer")
42
-      end
43
-
44
-      it "has proper modes" do
45
-        expect(sprintf("%o", @file.mode)).to eq("640")
46
-      end
47
-
48
-      it "has rabbit_user" do
49
-        expect(@chef_run).to create_file_with_content @file.name,
50
-          "rabbit_userid = guest"
51
-      end
52
-
53
-      it "has rabbit_password" do
54
-        expect(@chef_run).to create_file_with_content @file.name,
55
-          "rabbit_password = rabbit-pass"
56
-      end
57
-
58
-      it "has rabbit_port" do
59
-        expect(@chef_run).to create_file_with_content @file.name,
60
-          "rabbit_port = 5672"
61
-      end
62
-
63
-      it "has rabbit_host" do
64
-        expect(@chef_run).to create_file_with_content @file.name,
65
-          "rabbit_host = 127.0.0.1"
66
-      end
67
-
68
-      it "has rabbit_virtual_host" do
69
-        expect(@chef_run).to create_file_with_content @file.name,
70
-          "rabbit_virtual_host = /"
71
-      end
72
-
73
-      it "has auth_uri" do
74
-        expect(@chef_run).to create_file_with_content @file.name,
75
-          "auth_uri = http://127.0.0.1:5000/v2.0"
76
-      end
77
-
78
-      it "has auth_host" do
79
-        expect(@chef_run).to create_file_with_content @file.name,
80
-          "auth_host = 127.0.0.1"
81
-      end
82
-
83
-      it "has auth_port" do
84
-        expect(@chef_run).to create_file_with_content @file.name,
85
-          "auth_port = 35357"
86
-      end
87
-
88
-      it "has auth_protocol" do
89
-        expect(@chef_run).to create_file_with_content @file.name,
90
-          "auth_protocol = http"
91
-      end
92
-    end
93
-
94
-    describe "qpid" do
95
-      before do
96
-        @file = @chef_run.template "/etc/ceilometer/ceilometer.conf"
97
-        @chef_run.node.set['openstack']['metering']['mq']['service_type'] = "qpid"
98
-      end
99
-
100
-      it "has qpid_hostname" do
101
-        expect(@chef_run).to create_file_with_content @file.name,
102
-          "qpid_hostname=127.0.0.1"
103
-      end
104
-
105
-      it "has qpid_port" do
106
-        expect(@chef_run).to create_file_with_content @file.name,
107
-          "qpid_port=5672"
108
-      end
109
-
110
-      it "has qpid_username" do
111
-        expect(@chef_run).to create_file_with_content @file.name,
112
-          "qpid_username="
113
-      end
114
-
115
-      it "has qpid_password" do
116
-        expect(@chef_run).to create_file_with_content @file.name,
117
-          "qpid_password="
118
-      end
119
-
120
-      it "has qpid_sasl_mechanisms" do
121
-        expect(@chef_run).to create_file_with_content @file.name,
122
-          "qpid_sasl_mechanisms="
123
-      end
124
-
125
-      it "has qpid_reconnect" do
126
-        expect(@chef_run).to create_file_with_content @file.name,
127
-          "qpid_reconnect=true"
128
-      end
129
-
130
-      it "has qpid_reconnect_timeout" do
131
-        expect(@chef_run).to create_file_with_content @file.name,
132
-          "qpid_reconnect_timeout=0"
133
-      end
134
-
135
-      it "has qpid_reconnect_limit" do
136
-        expect(@chef_run).to create_file_with_content @file.name,
137
-          "qpid_reconnect_limit=0"
138
-      end
139
-
140
-      it "has qpid_reconnect_interval_min" do
141
-        expect(@chef_run).to create_file_with_content @file.name,
142
-          "qpid_reconnect_interval_min=0"
143
-      end
144
-
145
-      it "has qpid_reconnect_interval_max" do
146
-        expect(@chef_run).to create_file_with_content @file.name,
147
-          "qpid_reconnect_interval_max=0"
148
-      end
149
-
150
-      it "has qpid_reconnect_interval_max" do
151
-        expect(@chef_run).to create_file_with_content @file.name,
152
-          "qpid_reconnect_interval_max=0"
153
-      end
154
-
155
-      it "has qpid_reconnect_interval" do
156
-        expect(@chef_run).to create_file_with_content @file.name,
157
-          "qpid_reconnect_interval=0"
158
-      end
159
-
160
-      it "has qpid_heartbeat" do
161
-        expect(@chef_run).to create_file_with_content @file.name,
162
-          "qpid_heartbeat=60"
163
-      end
164
-
165
-      it "has qpid_protocol" do
166
-        expect(@chef_run).to create_file_with_content @file.name,
167
-          "qpid_protocol=tcp"
168
-      end
169
-
170
-      it "has qpid_tcp_nodelay" do
171
-        expect(@chef_run).to create_file_with_content @file.name,
172
-          "qpid_tcp_nodelay=true"
31
+        @filename = "/etc/ceilometer/ceilometer.conf"
32
+      end
33
+
34
+      it "creates the file" do
35
+        expect(@chef_run).to create_template(@filename).with(
36
+          user: "ceilometer",
37
+          group: "ceilometer",
38
+          mode: 0640
39
+          )
40
+      end
41
+
42
+      context "with rabbitmq default" do
43
+        [/^rabbit_userid = guest$/,
44
+          /^rabbit_password = rabbit-pass$/,
45
+          /^rabbit_port = 5672$/,
46
+          /^rabbit_host = 127.0.0.1$/,
47
+          /^rabbit_virtual_host = \/$/,
48
+          /^auth_uri = http:\/\/127.0.0.1:5000\/v2.0$/,
49
+          /^auth_host = 127.0.0.1$/,
50
+          /^auth_port = 35357$/,
51
+          /^auth_protocol = http$/
52
+        ].each do |content|
53
+          it "has a \#{content.source[1...-1]}\" line" do
54
+            expect(@chef_run).to render_file(@filename).with_content(content)
55
+          end
56
+        end
57
+      end
58
+
59
+      context "with qpid enabled" do
60
+        before do
61
+          @chef_run.node.set['openstack']['metering']['mq']['service_type'] = "qpid"
62
+        end
63
+
64
+        [/^qpid_hostname=127.0.0.1$/,
65
+          /^qpid_port=5672$/,
66
+          /^qpid_username=$/,
67
+          /^qpid_password=$/,
68
+          /^qpid_sasl_mechanisms=$/,
69
+          /^qpid_reconnect=true$/,
70
+          /^qpid_reconnect_timeout=0$/,
71
+          /^qpid_reconnect_limit=0$/,
72
+          /^qpid_reconnect_interval_min=0$/,
73
+          /^qpid_reconnect_interval_max=0$/,
74
+          /^qpid_reconnect_interval_max=0$/,
75
+          /^qpid_reconnect_interval=0$/,
76
+          /^qpid_heartbeat=60$/,
77
+          /^qpid_protocol=tcp$/,
78
+          /^qpid_tcp_nodelay=true$/
79
+        ].each do |content|
80
+          it "has a \#{content.source[1...-1]}\" line" do
81
+            expect(@chef_run).to render_file(@filename).with_content(content)
82
+          end
83
+        end
173 84
       end
174 85
     end
175 86
 
176
-    describe "/etc/ceilometer/policy.json" do
177
-      before do
178
-        @dir = @chef_run.cookbook_file "/etc/ceilometer/policy.json"
179
-      end
180
-
181
-      it "has proper owner" do
182
-        expect(@dir).to be_owned_by "ceilometer", "ceilometer"
183
-      end
184 87
 
185
-      it "has proper modes" do
186
-        expect(sprintf("%o", @dir.mode)).to eq "640"
187
-      end
88
+    it "installs the /etc/ceilometer/policy.json file" do
89
+      expect(@chef_run).to create_cookbook_file("/etc/ceilometer/policy.json").with(
90
+        user: "ceilometer",
91
+        group: "ceilometer",
92
+        mode: 0640
93
+        )
188 94
     end
189 95
   end
190 96
 end

+ 1
- 1
spec/identity_registration_spec.rb View File

@@ -3,7 +3,7 @@ require_relative "spec_helper"
3 3
 describe "openstack-metering::identity_registration" do
4 4
   before do
5 5
     metering_stubs
6
-    @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
6
+    @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
7 7
     @chef_run.converge "openstack-metering::identity_registration"
8 8
   end
9 9
 

Loading…
Cancel
Save