Upgrade to Havana release

Also upgrade gems:
- berkshelf, ~> 2.0.10
- chefspec, ~> 3.0.2
- foodcritic, ~> 3.0.3
And update the DEPRECATION keywords

Change-Id: I8f8bf961ec065944696d4c85120aefe6c2bf76bb
This commit is contained in:
Chen Zhiwei
2013-12-11 08:03:49 -05:00
parent 38c8aa5c7a
commit 9cf9a0adfa
21 changed files with 242 additions and 297 deletions

View File

@@ -1,66 +1,55 @@
{ {
"sha": "ba71763fac936d414bd4a63f004357f86f6e1bfb",
"sources": { "sources": {
"openstack-block-storage": { "openstack-block-storage": {
"path": "." "path": "."
}, },
"openstack-image": { "openstack-image": {
"locked_version": "7.0.0", "locked_version": "8.0.0",
"git": "git://github.com/stackforge/cookbook-openstack-image.git", "git": "git://github.com/stackforge/cookbook-openstack-image.git",
"ref": "c4af085fd62b542fee13d3a8a4ffdc1885ce37ed" "ref": "900c9eef120e22368bb27062473ae549643e9594"
}, },
"openstack-identity": { "openstack-identity": {
"locked_version": "7.0.0", "locked_version": "8.0.0",
"git": "git://github.com/stackforge/cookbook-openstack-identity.git", "git": "git://github.com/stackforge/cookbook-openstack-identity.git",
"ref": "029fe8a648939f832f844562d0e18af2a951c783" "ref": "3b001b7e07758e2c81b5ae4d1bff8e4a1472b24a"
}, },
"openstack-common": { "openstack-common": {
"locked_version": "0.3.0", "locked_version": "8.0.0",
"git": "git://github.com/stackforge/cookbook-openstack-common.git", "git": "git://github.com/stackforge/cookbook-openstack-common.git",
"ref": "25b183f2362fa501cfee4db331491b3d984a5c05" "ref": "d5f852daf5d0f3001ddbf1688c43a4bb21e8ca00"
}, },
"apt": { "apt": {
"locked_version": "2.0.0" "locked_version": "2.3.0"
},
"rabbitmq": {
"locked_version": "2.1.2"
},
"erlang": {
"locked_version": "1.3.0",
"constraint": ">= 0.9.0"
},
"yum": {
"locked_version": "2.3.0",
"constraint": ">= 0.5.0"
},
"build-essential": {
"locked_version": "1.4.0"
}, },
"selinux": { "selinux": {
"locked_version": "0.5.6" "locked_version": "0.6.2"
},
"python": {
"locked_version": "1.4.4"
},
"build-essential": {
"locked_version": "1.4.2"
},
"yum": {
"locked_version": "2.4.4"
}, },
"database": { "database": {
"locked_version": "1.4.0" "locked_version": "1.4.0"
}, },
"mysql": { "mysql": {
"locked_version": "3.0.2", "locked_version": "3.0.0"
"constraint": ">= 1.3.0"
}, },
"openssl": { "openssl": {
"locked_version": "1.0.2" "locked_version": "1.1.0"
}, },
"postgresql": { "postgresql": {
"locked_version": "3.0.2", "locked_version": "3.3.4"
"constraint": ">= 1.0.0"
}, },
"aws": { "aws": {
"locked_version": "0.101.2" "locked_version": "1.0.0"
}, },
"xfs": { "xfs": {
"locked_version": "1.1.0" "locked_version": "1.1.0"
},
"python": {
"locked_version": "1.3.4"
} }
} }
} }

View File

@@ -2,7 +2,11 @@ openstack-block-storage Cookbook CHANGELOG
============================== ==============================
This file is used to list changes made in each version of the openstack-block-storage cookbook. This file is used to list changes made in each version of the openstack-block-storage cookbook.
7.2.2 ## 8.0.0
### New version
* Upgrade to upstream Havana release
## 7.2.2
### Bug ### Bug
* fix a bug related to qpid. * fix a bug related to qpid.

View File

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

View File

@@ -1,26 +1,35 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (3.2.13) activesupport (3.2.16)
i18n (= 0.6.1) i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0) multi_json (~> 1.0)
addressable (2.3.4) addressable (2.3.5)
akami (1.2.0) akami (1.2.0)
gyoku (>= 0.4.0) gyoku (>= 0.4.0)
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
berkshelf (2.0.3) berkshelf (2.0.10)
activesupport (>= 3.2.0) activesupport (~> 3.2.0)
addressable (~> 2.3.4) addressable (~> 2.3.4)
celluloid (>= 0.14.0) buff-shell_out (~> 0.1)
chozo (>= 0.6.1) chozo (>= 0.6.1)
faraday (>= 0.8.5) faraday (>= 0.8.5)
hashie (>= 2.0.2) hashie (>= 2.0.2)
minitar (~> 0.5.4) minitar (~> 0.5.4)
rbzip2 (~> 0.2.0)
retryable (~> 1.3.3) retryable (~> 1.3.3)
ridley (~> 1.0.2) ridley (~> 1.5.0)
solve (>= 0.4.4) solve (>= 0.5.0)
test-kitchen (>= 1.0.0.alpha7)
thor (~> 0.18.0) thor (~> 0.18.0)
buff-config (0.4.0)
buff-extensions (~> 0.3)
varia_model (~> 0.1)
buff-extensions (0.5.0)
buff-ignore (1.1.1)
buff-platform (0.1.0)
buff-ruby_engine (0.1.0)
buff-shell_out (0.1.1)
buff-ruby_engine (~> 0.1.0)
builder (3.2.2) builder (3.2.2)
celluloid (0.14.1) celluloid (0.14.1)
timers (>= 1.0.0) timers (>= 1.0.0)
@@ -41,127 +50,112 @@ GEM
ohai (>= 0.6.0) ohai (>= 0.6.0)
rest-client (>= 1.0.4, < 1.7.0) rest-client (>= 1.0.4, < 1.7.0)
yajl-ruby (~> 1.1) yajl-ruby (~> 1.1)
chefspec (1.3.1) chefspec (3.0.2)
chef (>= 10.0) chef (~> 11.0)
erubis fauxhai (~> 2.0)
fauxhai (>= 0.1.1, < 2.0) rspec (~> 2.14)
minitest-chef-handler (>= 0.6.0)
rspec (~> 2.0)
chozo (0.6.1) chozo (0.6.1)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
hashie (>= 2.0.2) hashie (>= 2.0.2)
multi_json (>= 1.3.0) multi_json (>= 1.3.0)
ci_reporter (1.8.4) diff-lcs (1.2.5)
builder (>= 2.1.2)
coderay (1.0.9)
diff-lcs (1.2.4)
erubis (2.7.0) erubis (2.7.0)
faraday (0.8.7) faraday (0.8.8)
multipart-post (~> 1.1) multipart-post (~> 1.2.0)
fauxhai (1.1.1) fauxhai (2.0.1)
httparty
net-ssh net-ssh
ohai ohai
ffi (1.9.0) ffi (1.9.3)
foodcritic (2.1.0) foodcritic (3.0.3)
erubis erubis
gherkin (~> 2.11.7) gherkin (~> 2.11.7)
nokogiri (~> 1.5.4) nokogiri (~> 1.5.4)
rak (~> 1.4) rake
treetop (~> 1.4.10) treetop (~> 1.4.10)
yajl-ruby (~> 1.1.0) yajl-ruby (~> 1.1.0)
gherkin (2.11.8) gherkin (2.11.8)
multi_json (~> 1.3) multi_json (~> 1.3)
gssapi (1.0.3) gssapi (1.0.3)
ffi (>= 1.0.1) ffi (>= 1.0.1)
gyoku (1.0.0) gyoku (1.1.0)
builder (>= 2.1.2) builder (>= 2.1.2)
hashie (2.0.5) hashie (2.0.5)
highline (1.6.19) highline (1.6.20)
httparty (0.11.0) httpclient (2.3.4.1)
multi_json (~> 1.0)
multi_xml (>= 0.5.2)
httpclient (2.2.0.2)
httpi (0.9.7) httpi (0.9.7)
rack rack
i18n (0.6.1) i18n (0.6.9)
ipaddress (0.8.0) ipaddress (0.8.0)
json (1.7.7) json (1.7.7)
little-plugger (1.1.3) little-plugger (1.1.3)
log_switch (0.4.0) log_switch (0.4.0)
logging (1.6.2) logging (1.8.1)
little-plugger (>= 1.1.3) little-plugger (>= 1.1.3)
method_source (0.8.1) multi_json (>= 1.3.6)
mime-types (1.23) mime-types (2.0)
minitar (0.5.4) minitar (0.5.4)
minitest (4.7.4)
minitest-chef-handler (1.0.1)
chef
ci_reporter
minitest (~> 4.7.3)
mixlib-authentication (1.3.0) mixlib-authentication (1.3.0)
mixlib-log mixlib-log
mixlib-cli (1.3.0) mixlib-cli (1.3.0)
mixlib-config (1.1.2) mixlib-config (2.1.0)
mixlib-log (1.6.0) mixlib-log (1.6.0)
mixlib-shellout (1.1.0) mixlib-shellout (1.3.0)
multi_json (1.7.6) multi_json (1.8.2)
multi_xml (0.5.4)
multipart-post (1.2.0) multipart-post (1.2.0)
net-http-persistent (2.8) net-http-persistent (2.9)
net-scp (1.1.1) net-ssh (2.7.0)
net-ssh (>= 2.6.5)
net-ssh (2.6.7)
net-ssh-gateway (1.2.0) net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh-multi (1.1) net-ssh-multi (1.1)
net-ssh (>= 2.1.4) net-ssh (>= 2.1.4)
net-ssh-gateway (>= 0.99.0) net-ssh-gateway (>= 0.99.0)
nio4r (0.4.6) nio4r (0.5.0)
nokogiri (1.5.10) nokogiri (1.5.10)
nori (1.1.5) nori (1.1.5)
ohai (6.16.0) ohai (6.20.0)
ipaddress ipaddress
mixlib-cli mixlib-cli
mixlib-config mixlib-config
mixlib-log mixlib-log
mixlib-shellout mixlib-shellout
systemu systemu (~> 2.5.2)
yajl-ruby yajl-ruby
polyglot (0.3.3) polyglot (0.3.3)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rack (1.5.2) rack (1.5.2)
rak (1.4) rake (10.1.0)
rbzip2 (0.2.0)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
retryable (1.3.3) retryable (1.3.3)
ridley (1.0.2) ridley (1.5.3)
addressable addressable
buff-config (~> 0.2)
buff-extensions (~> 0.3)
buff-ignore (~> 1.1)
buff-shell_out (~> 0.1)
celluloid (~> 0.14.0) celluloid (~> 0.14.0)
celluloid-io (~> 0.14.0) celluloid-io (~> 0.14.0)
chozo (>= 0.6.0)
erubis erubis
faraday (>= 0.8.4) faraday (>= 0.8.4)
hashie (>= 2.0.2) hashie (>= 2.0.2)
json (>= 1.7.7)
mixlib-authentication (>= 1.3.0) mixlib-authentication (>= 1.3.0)
net-http-persistent (>= 2.8) net-http-persistent (>= 2.8)
net-ssh net-ssh
nio4r (>= 0.5.0)
retryable retryable
solve (>= 0.4.4) solve (>= 0.4.4)
varia_model (~> 0.1)
winrm (~> 1.1.0) winrm (~> 1.1.0)
rspec (2.13.0) rspec (2.14.1)
rspec-core (~> 2.13.0) rspec-core (~> 2.14.0)
rspec-expectations (~> 2.13.0) rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.13.0) rspec-mocks (~> 2.14.0)
rspec-core (2.13.1) rspec-core (2.14.7)
rspec-expectations (2.13.0) rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0) diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.13.1) rspec-mocks (2.14.4)
rubyntlm (0.1.1) rubyntlm (0.1.1)
safe_yaml (0.9.3)
savon (0.9.5) savon (0.9.5)
akami (~> 1.0) akami (~> 1.0)
builder (>= 2.1.2) builder (>= 2.1.2)
@@ -170,41 +164,35 @@ GEM
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
nori (~> 1.0) nori (~> 1.0)
wasabi (~> 1.0) wasabi (~> 1.0)
slop (3.4.5) solve (0.8.2)
solve (0.4.4) strainer (3.3.0)
json
strainer (3.0.1)
berkshelf (~> 2.0) berkshelf (~> 2.0)
buff-platform (~> 0.1)
systemu (2.5.2) systemu (2.5.2)
tailor (1.2.1) tailor (1.3.1)
log_switch (>= 0.3.0) log_switch (>= 0.3.0)
term-ansicolor (>= 1.0.5) term-ansicolor (>= 1.0.5)
text-table (>= 1.2.2) text-table (>= 1.2.2)
term-ansicolor (1.2.2) term-ansicolor (1.2.2)
tins (~> 0.8) tins (~> 0.8)
test-kitchen (1.0.0.alpha.7)
celluloid
mixlib-shellout
net-scp
net-ssh
pry
safe_yaml
thor
text-table (1.2.3) text-table (1.2.3)
thor (0.18.1) thor (0.18.1)
timers (1.1.0) timers (1.1.0)
tins (0.8.0) tins (0.13.1)
treetop (1.4.14) treetop (1.4.15)
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
uuidtools (2.1.4) uuidtools (2.1.4)
varia_model (0.2.0)
buff-extensions (~> 0.2)
hashie (>= 2.0.2)
wasabi (1.0.0) wasabi (1.0.0)
nokogiri (>= 1.4.0) nokogiri (>= 1.4.0)
winrm (1.1.2) winrm (1.1.3)
gssapi (~> 1.0.0) gssapi (~> 1.0.0)
httpclient (~> 2.2.0.2) httpclient (~> 2.2, >= 2.2.0.2)
logging (~> 1.6.1) logging (~> 1.6, >= 1.6.1)
nokogiri (~> 1.5.0) nokogiri (~> 1.5)
rubyntlm (~> 0.1.1) rubyntlm (~> 0.1.1)
savon (= 0.9.5) savon (= 0.9.5)
uuidtools (~> 2.1.2) uuidtools (~> 2.1.2)
@@ -214,10 +202,10 @@ PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
berkshelf (~> 2.0.3) berkshelf (~> 2.0.10)
chef (~> 11.4.4) chef (~> 11.4.4)
chefspec (~> 1.3.0) chefspec (~> 3.0.2)
foodcritic foodcritic (~> 3.0.3)
json (<= 1.7.7) json (<= 1.7.7)
strainer strainer
tailor tailor

View File

@@ -137,6 +137,7 @@ License and Author
| **Author** | Ionut Artarisi (<iartarisi@suse.cz>) | | **Author** | Ionut Artarisi (<iartarisi@suse.cz>) |
| **Author** | David Geng (<gengjh@cn.ibm.com>) | | **Author** | David Geng (<gengjh@cn.ibm.com>) |
| **Author** | Salman Baset (<sabaset@us.ibm.com>) | | **Author** | Salman Baset (<sabaset@us.ibm.com>) |
| **Author** | Chen Zhiwei (zhiwchen@cn.ibm.com>) |
| | | | | |
| **Copyright** | Copyright (c) 2012, Rackspace US, Inc. | | **Copyright** | Copyright (c) 2012, Rackspace US, Inc. |
| **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. | | **Copyright** | Copyright (c) 2012-2013, AT&T Services, Inc. |

View File

@@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com"
license "Apache 2.0" license "Apache 2.0"
description "The OpenStack Advanced Volume Management service Cinder." description "The OpenStack Advanced Volume Management service Cinder."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "7.2.2" version "8.0.0"
recipe "openstack-block-storage::common", "Defines the common pieces of repeated code from the other recipes" recipe "openstack-block-storage::common", "Defines the common pieces of repeated code from the other recipes"
recipe "openstack-block-storage::api", "Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone" recipe "openstack-block-storage::api", "Installs the cinder-api, sets up the cinder database, and cinder service/user/endpoints in keystone"
@@ -17,8 +17,8 @@ recipe "openstack-block-storage::volume", "Installs the cinder-volume
end end
depends "apt" depends "apt"
depends "openstack-common", "~> 0.4.0" depends "openstack-common", "~> 8.0"
depends "openstack-identity", "~> 7.0" depends "openstack-identity", "~> 8.0"
depends "openstack-image", "~> 7.0" depends "openstack-image", "~> 8.0"
depends "selinux" depends "selinux"
depends "python" depends "python"

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::api" do
before { block_storage_stubs } before { block_storage_stubs }
describe "opensuse" do describe "opensuse" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
@chef_run.converge "openstack-block-storage::api" @chef_run.converge "openstack-block-storage::api"
end end
@@ -17,7 +17,7 @@ describe "openstack-block-storage::api" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
@@ -27,7 +27,7 @@ describe "openstack-block-storage::api" do
end end
it "starts cinder api on boot" do it "starts cinder api on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-cinder-api" expect(@chef_run).to enable_service "openstack-cinder-api"
end end
expect_creates_policy_json( expect_creates_policy_json(

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::api" do
before { block_storage_stubs } before { block_storage_stubs }
describe "redhat" do describe "redhat" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
@chef_run.converge "openstack-block-storage::api" @chef_run.converge "openstack-block-storage::api"
end end
@@ -17,7 +17,7 @@ describe "openstack-block-storage::api" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
@@ -27,7 +27,7 @@ describe "openstack-block-storage::api" do
end end
it "starts cinder api on boot" do it "starts cinder api on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-cinder-api" expect(@chef_run).to enable_service "openstack-cinder-api"
end end
end end
end end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::api" do
before { block_storage_stubs } before { block_storage_stubs }
describe "ubuntu" do describe "ubuntu" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["syslog"]["use"] = true n.set["openstack"]["block-storage"]["syslog"]["use"] = true
end end
@chef_run.converge "openstack-block-storage::api" @chef_run.converge "openstack-block-storage::api"
@@ -13,7 +13,7 @@ describe "openstack-block-storage::api" do
expect_runs_openstack_common_logging_recipe expect_runs_openstack_common_logging_recipe
it "doesn't run logging recipe" do it "doesn't run logging recipe" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
expect(chef_run).not_to include_recipe "openstack-common::logging" expect(chef_run).not_to include_recipe "openstack-common::logging"
@@ -29,7 +29,7 @@ describe "openstack-block-storage::api" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
@@ -44,7 +44,8 @@ describe "openstack-block-storage::api" do
end end
it "has proper owner" do it "has proper owner" do
expect(@dir).to be_owned_by "cinder", "cinder" expect(@dir.owner).to eq("cinder")
expect(@dir.group).to eq("cinder")
end end
it "has proper modes" do it "has proper modes" do
@@ -53,7 +54,7 @@ describe "openstack-block-storage::api" do
end end
it "starts cinder api on boot" do it "starts cinder api on boot" do
expect(@chef_run).to set_service_to_start_on_boot "cinder-api" expect(@chef_run).to enable_service "cinder-api"
end end
expect_creates_cinder_conf "service[cinder-api]", "cinder", "cinder" expect_creates_cinder_conf "service[cinder-api]", "cinder", "cinder"
@@ -64,51 +65,45 @@ describe "openstack-block-storage::api" do
end end
it "runs logging recipe if node attributes say to" do it "runs logging recipe if node attributes say to" do
expect(@chef_run).to create_file_with_content @file, expect(@chef_run).to render_file(@file).with_content("log_config = /etc/openstack/logging.conf")
"log_config = /etc/openstack/logging.conf"
end end
it "doesn't run logging recipe" do it "doesn't run logging recipe" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
expect(chef_run).not_to create_file_with_content @file, expect(chef_run).not_to render_file(@file).with_content("log_config = /etc/openstack/logging.conf")
"log_config = /etc/openstack/logging.conf"
end end
it "has rbd driver settings" do it "has rbd driver settings" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"] = { n.set["openstack"]["block-storage"]["volume"] = {
"driver" => "cinder.volume.drivers.RBDDriver" "driver" => "cinder.volume.drivers.RBDDriver"
} }
end end
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
expect(chef_run).to create_file_with_content @file, expect(chef_run).to render_file(@file).with_content(/^rbd_/)
/^rbd_/ expect(chef_run).not_to render_file(@file).with_content(/^netapp_/)
expect(chef_run).not_to create_file_with_content @file,
/^netapp_/
end end
it "has netapp driver settings" do it "has netapp driver settings" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"] = { n.set["openstack"]["block-storage"]["volume"] = {
"driver" => "cinder.volume.drivers.netapp.NetAppISCSIDriver" "driver" => "cinder.volume.drivers.netapp.NetAppISCSIDriver"
} }
end end
chef_run.converge "openstack-block-storage::api" chef_run.converge "openstack-block-storage::api"
expect(chef_run).to create_file_with_content @file, expect(chef_run).to render_file(@file).with_content(/^netapp_/)
/^netapp_/ expect(chef_run).not_to render_file(@file).with_content(/^rbd_/)
expect(chef_run).not_to create_file_with_content @file,
/^rbd_/
end end
end end
it "runs db migrations" do it "runs db migrations" do
cmd = "cinder-manage db sync" cmd = "cinder-manage db sync"
expect(@chef_run).to execute_command cmd expect(@chef_run).to run_execute(cmd)
end end
expect_creates_policy_json "service[cinder-api]", "cinder", "cinder" expect_creates_policy_json "service[cinder-api]", "cinder", "cinder"
@@ -119,7 +114,8 @@ describe "openstack-block-storage::api" do
end end
it "has proper owner" do it "has proper owner" do
expect(@file).to be_owned_by "cinder", "cinder" expect(@file.owner).to eq("cinder")
expect(@file.group).to eq("cinder")
end end
it "has proper modes" do it "has proper modes" do
@@ -127,32 +123,27 @@ describe "openstack-block-storage::api" do
end end
it "has signing_dir" do it "has signing_dir" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("signing_dir = /var/cache/cinder/api")
"signing_dir = /var/cache/cinder/api"
end end
it "notifies cinder-api restart" do it "notifies cinder-api restart" do
expect(@file).to notify "service[cinder-api]", :restart expect(@file).to notify("service[cinder-api]").to(:restart)
end end
it "has auth_uri" do it "has auth_uri" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("auth_uri = http://127.0.0.1:5000/v2.0")
"auth_uri = https://127.0.0.1:5000/v2.0"
end end
it "has auth_host" do it "has auth_host" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("auth_host = 127.0.0.1")
"auth_host = 127.0.0.1"
end end
it "has auth_port" do it "has auth_port" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("auth_port = 35357")
"auth_port = 35357"
end end
it "has auth_protocol" do it "has auth_protocol" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("auth_protocol = http")
"auth_protocol = http"
end end
end end
end end

View File

@@ -3,7 +3,7 @@ require_relative "spec_helper"
describe "openstack-block-storage::cinder-common" do describe "openstack-block-storage::cinder-common" do
before { block_storage_stubs } before { block_storage_stubs }
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS do |n|
n.set["openstack"]["mq"] = { n.set["openstack"]["mq"] = {
"host" => "127.0.0.1" "host" => "127.0.0.1"
} }

View File

@@ -3,7 +3,7 @@ require_relative "spec_helper"
describe "openstack-block-storage::cinder-common" do describe "openstack-block-storage::cinder-common" do
before { block_storage_stubs } before { block_storage_stubs }
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS do |n|
n.set["openstack"]["mq"] = { n.set["openstack"]["mq"] = {
"host" => "127.0.0.1" "host" => "127.0.0.1"
} }

View File

@@ -3,7 +3,7 @@ require_relative "spec_helper"
describe "openstack-block-storage::cinder-common" do describe "openstack-block-storage::cinder-common" do
before { block_storage_stubs } before { block_storage_stubs }
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["mq"] = { n.set["openstack"]["mq"] = {
"host" => "127.0.0.1" "host" => "127.0.0.1"
} }
@@ -22,7 +22,8 @@ describe "openstack-block-storage::cinder-common" do
end end
it "has proper owner" do it "has proper owner" do
expect(@dir).to be_owned_by "cinder", "cinder" expect(@dir.owner).to eq("cinder")
expect(@dir.group).to eq("cinder")
end end
it "has proper modes" do it "has proper modes" do
@@ -36,7 +37,8 @@ describe "openstack-block-storage::cinder-common" do
end end
it "has proper owner" do it "has proper owner" do
expect(@file).to be_owned_by "cinder", "cinder" expect(@file.owner).to eq("cinder")
expect(@file.group).to eq("cinder")
end end
it "has proper modes" do it "has proper modes" do
@@ -44,96 +46,80 @@ describe "openstack-block-storage::cinder-common" do
end end
it "has rpc_thread_pool_size" do it "has rpc_thread_pool_size" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rpc_thread_pool_size=64")
"rpc_thread_pool_size=64"
end end
it "has rpc_conn_pool_size" do it "has rpc_conn_pool_size" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rpc_conn_pool_size=30")
"rpc_conn_pool_size=30"
end end
it "has rpc_response_timeout" do it "has rpc_response_timeout" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rpc_response_timeout=60")
"rpc_response_timeout=60"
end end
it "has rabbit_host" do it "has rabbit_host" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_host=127.0.0.1")
"rabbit_host=127.0.0.1"
end end
it "does not have rabbit_hosts" do it "does not have rabbit_hosts" do
expect(@chef_run).not_to create_file_with_content @file.name, expect(@chef_run).not_to render_file(@file.name).with_content("rabbit_hosts=")
"rabbit_hosts="
end end
it "does not have rabbit_ha_queues" do it "does not have rabbit_ha_queues" do
expect(@chef_run).not_to create_file_with_content @file.name, expect(@chef_run).not_to render_file(@file.name).with_content("rabbit_ha_queues=")
"rabbit_ha_queues="
end end
it "has log_file" do it "has log_file" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("log_file = /var/log/cinder/cinder.log")
"log_file = /var/log/cinder/cinder.log"
end end
it "has log_config when syslog is true" do it "has log_config when syslog is true" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["syslog"]["use"] = true n.set["openstack"]["block-storage"]["syslog"]["use"] = true
end end
chef_run.converge "openstack-block-storage::cinder-common" chef_run.converge "openstack-block-storage::cinder-common"
expect(chef_run).to create_file_with_content @file.name, expect(chef_run).to render_file(@file.name).with_content("log_config = /etc/openstack/logging.conf")
"log_config = /etc/openstack/logging.conf"
end end
it "has rabbit_port" do it "has rabbit_port" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_port=5672")
"rabbit_port=5672"
end end
it "has rabbit_userid" do it "has rabbit_userid" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_userid=guest")
"rabbit_userid=guest"
end end
it "has rabbit_password" do it "has rabbit_password" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_password=rabbit-pass")
"rabbit_password=rabbit-pass"
end end
it "has rabbit_virtual_host" do it "has rabbit_virtual_host" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_virtual_host=/")
"rabbit_virtual_host=/"
end end
describe "rabbit ha" do describe "rabbit ha" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new(::UBUNTU_OPTS) do |n| @chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
n.set["openstack"]["block-storage"]["rabbit"]["ha"] = true n.set["openstack"]["block-storage"]["rabbit"]["ha"] = true
end end
@chef_run.converge "openstack-block-storage::cinder-common" @chef_run.converge "openstack-block-storage::cinder-common"
end end
it "has rabbit_hosts" do it "has rabbit_hosts" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_hosts=1.1.1.1:5672,2.2.2.2:5672")
"rabbit_hosts=1.1.1.1:5672,2.2.2.2:5672"
end end
it "has rabbit_ha_queues" do it "has rabbit_ha_queues" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("rabbit_ha_queues=True")
"rabbit_ha_queues=True"
end end
it "does not have rabbit_host" do it "does not have rabbit_host" do
expect(@chef_run).not_to create_file_with_content @file.name, expect(@chef_run).not_to render_file(@file.name).with_content("rabbit_host=127.0.0.1")
"rabbit_host=127.0.0.1"
end end
it "does not have rabbit_port" do it "does not have rabbit_port" do
expect(@chef_run).not_to create_file_with_content @file.name, expect(@chef_run).not_to render_file(@file.name).with_content("rabbit_port=5672")
"rabbit_port=5672"
end end
end end
@@ -144,73 +130,59 @@ describe "openstack-block-storage::cinder-common" do
end end
it "has qpid_hostname" do it "has qpid_hostname" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_hostname=127.0.0.1")
"qpid_hostname=127.0.0.1"
end end
it "has qpid_port" do it "has qpid_port" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_port=5672")
"qpid_port=5672"
end end
it "has qpid_username" do it "has qpid_username" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_username=")
"qpid_username="
end end
it "has qpid_password" do it "has qpid_password" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_password=")
"qpid_password="
end end
it "has qpid_sasl_mechanisms" do it "has qpid_sasl_mechanisms" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_sasl_mechanisms=")
"qpid_sasl_mechanisms="
end end
it "has qpid_reconnect_timeout" do it "has qpid_reconnect_timeout" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect_timeout=0")
"qpid_reconnect_timeout=0"
end end
it "has qpid_reconnect_limit" do it "has qpid_reconnect_limit" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect_limit=0")
"qpid_reconnect_limit=0"
end end
it "has qpid_reconnect_interval_min" do it "has qpid_reconnect_interval_min" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect_interval_min=0")
"qpid_reconnect_interval_min=0"
end end
it "has qpid_reconnect_interval_max" do it "has qpid_reconnect_interval_max" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect_interval_max=0")
"qpid_reconnect_interval_max=0"
end end
it "has qpid_reconnect_interval" do it "has qpid_reconnect_interval" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect_interval=0")
"qpid_reconnect_interval=0"
end end
it "has qpid_reconnect" do it "has qpid_reconnect" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_reconnect=true")
"qpid_reconnect=true"
end end
it "has qpid_heartbeat" do it "has qpid_heartbeat" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_heartbeat=60")
"qpid_heartbeat=60"
end end
it "has qpid_protocol" do it "has qpid_protocol" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_protocol=tcp")
"qpid_protocol=tcp"
end end
it "has qpid_tcp_nodelay" do it "has qpid_tcp_nodelay" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("qpid_tcp_nodelay=true")
"qpid_tcp_nodelay=true"
end end
end end
end end

View File

@@ -3,7 +3,7 @@ require_relative "spec_helper"
describe "openstack-block-storage::identity_registration" do describe "openstack-block-storage::identity_registration" do
before do before do
block_storage_stubs block_storage_stubs
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
@chef_run.converge "openstack-block-storage::identity_registration" @chef_run.converge "openstack-block-storage::identity_registration"
end end
@@ -14,15 +14,15 @@ describe "openstack-block-storage::identity_registration" do
).to_hash ).to_hash
expect(resource).to include( expect(resource).to include(
:auth_uri => "https://127.0.0.1:35357/v2.0", :auth_uri => "http://127.0.0.1:35357/v2.0",
:bootstrap_token => "bootstrap-token", :bootstrap_token => "bootstrap-token",
:service_name => "cinder", :service_name => "cinder",
:service_type => "volume", :service_type => "volume",
:service_description => "Cinder Volume Service", :service_description => "Cinder Volume Service",
:endpoint_region => "RegionOne", :endpoint_region => "RegionOne",
:endpoint_adminurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_adminurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:endpoint_internalurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_internalurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:endpoint_publicurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_publicurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:action => [:create_service] :action => [:create_service]
) )
end end
@@ -34,15 +34,15 @@ describe "openstack-block-storage::identity_registration" do
).to_hash ).to_hash
expect(resource).to include( expect(resource).to include(
:auth_uri => "https://127.0.0.1:35357/v2.0", :auth_uri => "http://127.0.0.1:35357/v2.0",
:bootstrap_token => "bootstrap-token", :bootstrap_token => "bootstrap-token",
:service_name => "cinder", :service_name => "cinder",
:service_type => "volume", :service_type => "volume",
:service_description => "Cinder Volume Service", :service_description => "Cinder Volume Service",
:endpoint_region => "RegionOne", :endpoint_region => "RegionOne",
:endpoint_adminurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_adminurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:endpoint_internalurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_internalurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:endpoint_publicurl => "https://127.0.0.1:8776/v1/%(tenant_id)s", :endpoint_publicurl => "http://127.0.0.1:8776/v1/%(tenant_id)s",
:action => [:create_endpoint] :action => [:create_endpoint]
) )
end end
@@ -54,7 +54,7 @@ describe "openstack-block-storage::identity_registration" do
).to_hash ).to_hash
expect(resource).to include( expect(resource).to include(
:auth_uri => "https://127.0.0.1:35357/v2.0", :auth_uri => "http://127.0.0.1:35357/v2.0",
:bootstrap_token => "bootstrap-token", :bootstrap_token => "bootstrap-token",
:tenant_name => "service", :tenant_name => "service",
:user_name => "cinder", :user_name => "cinder",
@@ -71,7 +71,7 @@ describe "openstack-block-storage::identity_registration" do
).to_hash ).to_hash
expect(resource).to include( expect(resource).to include(
:auth_uri => "https://127.0.0.1:35357/v2.0", :auth_uri => "http://127.0.0.1:35357/v2.0",
:bootstrap_token => "bootstrap-token", :bootstrap_token => "bootstrap-token",
:tenant_name => "service", :tenant_name => "service",
:user_name => "cinder", :user_name => "cinder",

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::scheduler" do
before { block_storage_stubs } before { block_storage_stubs }
describe "opensuse" do describe "opensuse" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
@chef_run.converge "openstack-block-storage::scheduler" @chef_run.converge "openstack-block-storage::scheduler"
end end
@@ -13,7 +13,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "does not upgrade stevedore" do it "does not upgrade stevedore" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
expect(chef_run).not_to upgrade_python_pip "stevedore" expect(chef_run).not_to upgrade_python_pip "stevedore"
@@ -24,7 +24,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
@@ -38,7 +38,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "starts cinder scheduler on boot" do it "starts cinder scheduler on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-cinder-scheduler" expect(@chef_run).to enable_service "openstack-cinder-scheduler"
end end
end end
end end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::scheduler" do
before { block_storage_stubs } before { block_storage_stubs }
describe "redhat" do describe "redhat" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
@chef_run.converge "openstack-block-storage::scheduler" @chef_run.converge "openstack-block-storage::scheduler"
end end
@@ -13,7 +13,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "does not upgrade stevedore" do it "does not upgrade stevedore" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
expect(chef_run).not_to upgrade_python_pip "stevedore" expect(chef_run).not_to upgrade_python_pip "stevedore"
@@ -24,7 +24,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
@@ -38,7 +38,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "starts cinder scheduler on boot" do it "starts cinder scheduler on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-cinder-scheduler" expect(@chef_run).to enable_service "openstack-cinder-scheduler"
end end
end end
end end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::scheduler" do
before { block_storage_stubs } before { block_storage_stubs }
describe "ubuntu" do describe "ubuntu" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["syslog"]["use"] = true n.set["openstack"]["block-storage"]["syslog"]["use"] = true
end end
@chef_run.converge "openstack-block-storage::scheduler" @chef_run.converge "openstack-block-storage::scheduler"
@@ -13,7 +13,7 @@ describe "openstack-block-storage::scheduler" do
expect_runs_openstack_common_logging_recipe expect_runs_openstack_common_logging_recipe
it "doesn't run logging recipe" do it "doesn't run logging recipe" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
expect(chef_run).not_to include_recipe "openstack-common::logging" expect(chef_run).not_to include_recipe "openstack-common::logging"
@@ -28,7 +28,7 @@ describe "openstack-block-storage::scheduler" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
@@ -42,11 +42,11 @@ describe "openstack-block-storage::scheduler" do
end end
it "starts cinder scheduler on boot" do it "starts cinder scheduler on boot" do
expect(@chef_run).to set_service_to_start_on_boot "cinder-scheduler" expect(@chef_run).to enable_service "cinder-scheduler"
end end
it "doesn't run logging recipe" do it "doesn't run logging recipe" do
expect(@chef_run).to set_service_to_start_on_boot "cinder-scheduler" expect(@chef_run).to enable_service "cinder-scheduler"
end end
it "doesn't setup cron when no metering" do it "doesn't setup cron when no metering" do
@@ -57,7 +57,7 @@ describe "openstack-block-storage::scheduler" do
::Chef::Recipe.any_instance.stub(:search). ::Chef::Recipe.any_instance.stub(:search).
with(:node, "roles:os-block-storage-scheduler"). with(:node, "roles:os-block-storage-scheduler").
and_return([OpenStruct.new(:name => "fauxhai.local")]) and_return([OpenStruct.new(:name => "fauxhai.local")])
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["metering"] = true n.set["openstack"]["metering"] = true
end end
chef_run.converge "openstack-block-storage::scheduler" chef_run.converge "openstack-block-storage::scheduler"
@@ -78,7 +78,7 @@ describe "openstack-block-storage::scheduler" do
::Chef::Recipe.any_instance.stub(:search). ::Chef::Recipe.any_instance.stub(:search).
with(:node, "roles:os-block-storage-scheduler"). with(:node, "roles:os-block-storage-scheduler").
and_return([OpenStruct.new(:name => "foobar")]) and_return([OpenStruct.new(:name => "foobar")])
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["metering"] = true n.set["openstack"]["metering"] = true
crontests.each do |k,v| crontests.each do |k,v|
n.set["openstack"]["block-storage"]["cron"][k.to_s] = v n.set["openstack"]["block-storage"]["cron"][k.to_s] = v

View File

@@ -1,5 +1,6 @@
require "chefspec" require "chefspec"
require "chef/application" require "chef/application"
require_relative "support/matcher"
::LOG_LEVEL = :fatal ::LOG_LEVEL = :fatal
::OPENSUSE_OPTS = { ::OPENSUSE_OPTS = {
@@ -49,7 +50,8 @@ def expect_creates_cinder_conf service, user, group, action=:restart
end end
it "has proper owner" do it "has proper owner" do
expect(@file).to be_owned_by user, group expect(@file.owner).to eq(user)
expect(@file.group).to eq(group)
end end
it "has proper modes" do it "has proper modes" do
@@ -57,7 +59,7 @@ def expect_creates_cinder_conf service, user, group, action=:restart
end end
it "notifies service restart" do it "notifies service restart" do
expect(@file).to notify service, action expect(@file).to notify(service).to(action)
end end
end end
end end
@@ -69,7 +71,8 @@ def expect_creates_policy_json service, user, group, action=:restart
end end
it "has proper owner" do it "has proper owner" do
expect(@file).to be_owned_by user, group expect(@file.owner).to eq(user)
expect(@file.group).to eq(group)
end end
it "has proper modes" do it "has proper modes" do
@@ -77,7 +80,7 @@ def expect_creates_policy_json service, user, group, action=:restart
end end
it "notifies service restart" do it "notifies service restart" do
expect(@file).to notify service, action expect(@file).to notify(service).to(action)
end end
end end
end end

3
spec/support/matcher.rb Normal file
View File

@@ -0,0 +1,3 @@
def upgrade_python_pip(pkgname)
ChefSpec::Matchers::ResourceMatcher.new(:python_pip, :upgrade, pkgname)
end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::volume" do
before { block_storage_stubs } before { block_storage_stubs }
describe "opensuse" do describe "opensuse" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS @chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
@chef_run.converge "openstack-block-storage::volume" @chef_run.converge "openstack-block-storage::volume"
end end
@@ -17,7 +17,7 @@ describe "openstack-block-storage::volume" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -36,15 +36,15 @@ describe "openstack-block-storage::volume" do
it "starts cinder volume on boot" do it "starts cinder volume on boot" do
expected = "openstack-cinder-volume" expected = "openstack-cinder-volume"
expect(@chef_run).to set_service_to_start_on_boot expected expect(@chef_run).to enable_service expected
end end
it "starts iscsi target on boot" do it "starts iscsi target on boot" do
expect(@chef_run).to set_service_to_start_on_boot "tgtd" expect(@chef_run).to enable_service "tgtd"
end end
it "installs nfs packages" do it "installs nfs packages" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -56,10 +56,8 @@ describe "openstack-block-storage::volume" do
it "has opensuse include" do it "has opensuse include" do
file = "/etc/tgt/targets.conf" file = "/etc/tgt/targets.conf"
expect(@chef_run).to create_file_with_content file, expect(@chef_run).to render_file(file).with_content("include /var/lib/cinder/volumes/*")
"include /var/lib/cinder/volumes/*" expect(@chef_run).not_to render_file(file).with_content("include /etc/tgt/conf.d/*.conf")
expect(@chef_run).not_to create_file_with_content file,
"include /etc/tgt/conf.d/*.conf"
end end
end end
end end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::volume" do
before { block_storage_stubs } before { block_storage_stubs }
describe "redhat" do describe "redhat" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS @chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
@chef_run.converge "openstack-block-storage::volume" @chef_run.converge "openstack-block-storage::volume"
end end
@@ -13,7 +13,7 @@ describe "openstack-block-storage::volume" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -32,15 +32,15 @@ describe "openstack-block-storage::volume" do
it "starts cinder volume on boot" do it "starts cinder volume on boot" do
expected = "openstack-cinder-volume" expected = "openstack-cinder-volume"
expect(@chef_run).to set_service_to_start_on_boot expected expect(@chef_run).to enable_service expected
end end
it "starts iscsi target on boot" do it "starts iscsi target on boot" do
expect(@chef_run).to set_service_to_start_on_boot "tgtd" expect(@chef_run).to enable_service "tgtd"
end end
it "installs nfs packages" do it "installs nfs packages" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -52,10 +52,8 @@ describe "openstack-block-storage::volume" do
it "has redhat include" do it "has redhat include" do
file = "/etc/tgt/targets.conf" file = "/etc/tgt/targets.conf"
expect(@chef_run).to create_file_with_content file, expect(@chef_run).to render_file(file).with_content("include /var/lib/cinder/volumes/*")
"include /var/lib/cinder/volumes/*" expect(@chef_run).not_to render_file(file).with_content("include /etc/tgt/conf.d/*.conf")
expect(@chef_run).not_to create_file_with_content file,
"include /etc/tgt/conf.d/*.conf"
end end
end end
end end

View File

@@ -4,7 +4,7 @@ describe "openstack-block-storage::volume" do
before { block_storage_stubs } before { block_storage_stubs }
describe "ubuntu" do describe "ubuntu" do
before do before do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| @chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["syslog"]["use"] = true n.set["openstack"]["block-storage"]["syslog"]["use"] = true
end end
@chef_run.converge "openstack-block-storage::volume" @chef_run.converge "openstack-block-storage::volume"
@@ -13,7 +13,7 @@ describe "openstack-block-storage::volume" do
expect_runs_openstack_common_logging_recipe expect_runs_openstack_common_logging_recipe
it "doesn't run logging recipe" do it "doesn't run logging recipe" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
expect(chef_run).not_to include_recipe "openstack-common::logging" expect(chef_run).not_to include_recipe "openstack-common::logging"
@@ -28,7 +28,7 @@ describe "openstack-block-storage::volume" do
end end
it "installs postgresql python packages if explicitly told" do it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
node = chef_run.node node = chef_run.node
node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql" node.set["openstack"]["db"]["volume"]["db_type"] = "postgresql"
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -42,7 +42,7 @@ describe "openstack-block-storage::volume" do
end end
it "installs nfs packages" do it "installs nfs packages" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -51,7 +51,7 @@ describe "openstack-block-storage::volume" do
end end
it "creates the nfs mount point" do it "creates the nfs mount point" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.nfs.NetAppDirect7modeNfsDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -62,7 +62,7 @@ describe "openstack-block-storage::volume" do
it "configures netapp dfm password" do it "configures netapp dfm password" do
::Chef::Recipe.any_instance.stub(:service_password).with("netapp"). ::Chef::Recipe.any_instance.stub(:service_password).with("netapp").
and_return "netapp-pass" and_return "netapp-pass"
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.iscsi.NetAppISCSIDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.netapp.iscsi.NetAppISCSIDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -74,7 +74,7 @@ describe "openstack-block-storage::volume" do
it "configures rbd password" do it "configures rbd password" do
::Chef::Recipe.any_instance.stub(:service_password).with("rbd"). ::Chef::Recipe.any_instance.stub(:service_password).with("rbd").
and_return "rbd-pass" and_return "rbd-pass"
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n| chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.RBDDriver" n.set["openstack"]["block-storage"]["volume"]["driver"] = "cinder.volume.drivers.RBDDriver"
end end
chef_run.converge "openstack-block-storage::volume" chef_run.converge "openstack-block-storage::volume"
@@ -88,13 +88,13 @@ describe "openstack-block-storage::volume" do
end end
it "starts cinder volume on boot" do it "starts cinder volume on boot" do
expect(@chef_run).to set_service_to_start_on_boot "cinder-volume" expect(@chef_run).to enable_service "cinder-volume"
end end
expect_creates_cinder_conf "service[cinder-volume]", "cinder", "cinder" expect_creates_cinder_conf "service[cinder-volume]", "cinder", "cinder"
it "starts iscsi target on boot" do it "starts iscsi target on boot" do
expect(@chef_run).to set_service_to_start_on_boot "tgt" expect(@chef_run).to enable_service "tgt"
end end
describe "targets.conf" do describe "targets.conf" do
@@ -107,14 +107,12 @@ describe "openstack-block-storage::volume" do
end end
it "notifies iscsi restart" do it "notifies iscsi restart" do
expect(@file).to notify "service[iscsitarget]", :restart expect(@file).to notify("service[iscsitarget]").to(:restart)
end end
it "has ubuntu include" do it "has ubuntu include" do
expect(@chef_run).to create_file_with_content @file.name, expect(@chef_run).to render_file(@file.name).with_content("include /etc/tgt/conf.d/*.conf")
"include /etc/tgt/conf.d/*.conf" expect(@chef_run).not_to render_file(@file.name).with_content("include /var/lib/cinder/volumes/*")
expect(@chef_run).not_to create_file_with_content @file.name,
"include /var/lib/cinder/volumes/*"
end end
end end
end end