Updating to Havana

* updating ChefSpec -> 3.0.2
  * updating Foodcritic -> 3.0.3
  * updating Berkshelf -> 2.0.10

Change-Id: I927f578810b1ece9a574de5eeda2f063a57fb881
This commit is contained in:
galstrom21 2013-12-09 11:22:55 -06:00
parent 5d7b6e7c3c
commit 3b001b7e07
10 changed files with 199 additions and 213 deletions

View File

@ -5,9 +5,9 @@
"path": "."
},
"openstack-common": {
"locked_version": "0.3.0",
"locked_version": "8.0.0",
"git": "git://github.com/stackforge/cookbook-openstack-common.git",
"ref": "ae80d36e8f8d5705e01bb6c14238eccb5450a229"
"ref": "2201bd113ffe1742c19811aa4df59a5790af71e3"
},
"apt": {
"locked_version": "2.0.0"

View File

@ -2,6 +2,10 @@
This file is used to list changes made in each version of cookbook-openstack-identity.
## 8.0.0
* Updating to Havana
* Updating cookbook-openstack-common dep from 0.3.0 to 0.4.7
## 7.2.0:
* Allow orchestration and cloudformation as service/endpoint types.

View File

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

View File

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

View File

@ -4,7 +4,7 @@ maintainer_email "matt@opscode.com"
license "Apache 2.0"
description "The OpenStack Identity service Keystone."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "7.2.0"
version "8.0.0"
recipe "openstack-identity::server", "Installs and Configures Keystone Service"
recipe "openstack-identity::registration", "Adds user, tenant, role and endpoint records to Keystone"
@ -13,4 +13,4 @@ recipe "openstack-identity::registration", "Adds user, tenant, role an
supports os
end
depends "openstack-common", "~> 0.4.0"
depends "openstack-common", "~> 8.0.0"

View File

@ -2,7 +2,7 @@ require_relative "spec_helper"
describe Chef::Provider::Execute do
before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
@chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
@chef_run.converge "openstack-identity::default"
@node = @chef_run.node
@node.set["openstack"] = {
@ -52,29 +52,29 @@ describe Chef::Provider::Execute do
it "should create a tenant" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@tenant_resource, @run_context)
provider.stub!(:identity_uuid).with(@tenant_resource, "tenant", "name", "tenant1")
provider.stub!(:identity_command).with(@tenant_resource, "tenant-create",
provider.stub(:identity_uuid).with(@tenant_resource, "tenant", "name", "tenant1")
provider.stub(:identity_command).with(@tenant_resource, "tenant-create",
{"name" => "tenant1", "description" => "tenant1 Tenant", "enabled" => true})
provider.run_action(:create_tenant)
@tenant_resource.should be_updated
end
it "should not create a new tenant if already exists" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@tenant_resource, @run_context)
provider.stub!(:identity_uuid).with(@tenant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@tenant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.run_action(:create_tenant)
@tenant_resource.should_not be_updated
end
it "should create a service" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@service_resource, @run_context)
provider.stub!(:identity_uuid).with(@service_resource, "service", "type", "compute")
provider.stub!(:identity_command).with(@service_resource, "service-create",
provider.stub(:identity_uuid).with(@service_resource, "service", "type", "compute")
provider.stub(:identity_command).with(@service_resource, "service-create",
{"type" => "compute", "name" => "service1", "description" => "service1 Service"})
provider.run_action(:create_service)
@service_resource.should be_updated
end
it "should not create a service if already exists" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@service_resource, @run_context)
provider.stub!(:identity_uuid).with(@service_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@service_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.run_action(:create_service)
@service_resource.should_not be_updated
end
@ -90,9 +90,9 @@ describe Chef::Provider::Execute do
end
it "should create an endpoint" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@endpoint_resource, @run_context)
provider.stub!(:identity_uuid).with(@endpoint_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@endpoint_resource, "endpoint", "service_id", "1234567890ABCDEFGH")
provider.stub!(:identity_command).with(@endpoint_resource, "endpoint-create", {
provider.stub(:identity_uuid).with(@endpoint_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@endpoint_resource, "endpoint", "service_id", "1234567890ABCDEFGH")
provider.stub(:identity_command).with(@endpoint_resource, "endpoint-create", {
"region" => "Region One", "service_id" => "1234567890ABCDEFGH", "publicurl" => "http://public",
"internalurl" => "http://internal", "adminurl" => "http://admin"})
provider.run_action(:create_endpoint)
@ -100,8 +100,8 @@ describe Chef::Provider::Execute do
end
it "should not create a endpoint if already exists" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@endpoint_resource, @run_context)
provider.stub!(:identity_uuid).with(@endpoint_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@endpoint_resource, "endpoint", "service_id", "1234567890ABCDEFGH").and_return("0987654321HGFEDCBA")
provider.stub(:identity_uuid).with(@endpoint_resource, "service", "type", "compute").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@endpoint_resource, "endpoint", "service_id", "1234567890ABCDEFGH").and_return("0987654321HGFEDCBA")
provider.run_action(:create_endpoint)
@endpoint_resource.should_not be_updated
end
@ -117,79 +117,79 @@ describe Chef::Provider::Execute do
end
it "should create a role" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@role_resource, @run_context)
provider.stub!(:identity_uuid).with(@role_resource, "role", "name", "role1")
provider.stub!(:identity_command).with(@role_resource, "role-create", {"name" => "role1"})
provider.stub(:identity_uuid).with(@role_resource, "role", "name", "role1")
provider.stub(:identity_command).with(@role_resource, "role-create", {"name" => "role1"})
provider.run_action(:create_role)
@role_resource.should be_updated
end
it "should not create a role if already exists" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@role_resource, @run_context)
provider.stub!(:identity_uuid).with(@role_resource, "role", "name", "role1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@role_resource, "role", "name", "role1").and_return("1234567890ABCDEFGH")
provider.run_action(:create_role)
@role_resource.should_not be_updated
end
it "should create a user" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@user_resource, @run_context)
provider.stub!(:identity_uuid).with(@user_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_command).with(@user_resource, "user-list", {"tenant-id" => "1234567890ABCDEFGH"})
provider.stub!(:identity_command).with(@user_resource, "user-create",
provider.stub(:identity_uuid).with(@user_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_command).with(@user_resource, "user-list", {"tenant-id" => "1234567890ABCDEFGH"})
provider.stub(:identity_command).with(@user_resource, "user-create",
{"name" => "user1", "tenant-id" => "1234567890ABCDEFGH", "pass" => "password", "enabled" => true})
provider.stub!(:prettytable_to_array).and_return([])
provider.stub(:prettytable_to_array).and_return([])
provider.run_action(:create_user)
@user_resource.should be_updated
end
it "should not create a user if already exists" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@user_resource, @run_context)
provider.stub!(:identity_uuid).with(@user_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_command).with(@user_resource, "user-list", {"tenant-id" => "1234567890ABCDEFGH"})
provider.stub!(:prettytable_to_array).and_return([{"name" => "user1"}])
provider.stub!(:identity_uuid).with(@user_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.stub(:identity_uuid).with(@user_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_command).with(@user_resource, "user-list", {"tenant-id" => "1234567890ABCDEFGH"})
provider.stub(:prettytable_to_array).and_return([{"name" => "user1"}])
provider.stub(:identity_uuid).with(@user_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.run_action(:create_user)
@user_resource.should_not be_updated
end
it "should grant a role" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@grant_resource, @run_context)
provider.stub!(:identity_uuid).with(@grant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@grant_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.stub!(:identity_uuid).with(@grant_resource, "role", "name", "role1").and_return("ABC1234567890DEF")
provider.stub!(:identity_uuid).with(@grant_resource, "user-role", "name", "role1",
provider.stub(:identity_uuid).with(@grant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@grant_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.stub(:identity_uuid).with(@grant_resource, "role", "name", "role1").and_return("ABC1234567890DEF")
provider.stub(:identity_uuid).with(@grant_resource, "user-role", "name", "role1",
{ "tenant-id" => "1234567890ABCDEFGH", "user-id" => "HGFEDCBA0987654321" }).and_return("ABCD1234567890EFGH")
provider.stub!(:identity_command).with(@grant_resource, "user-role-add",
provider.stub(:identity_command).with(@grant_resource, "user-role-add",
{"tenant-id" => "1234567890ABCDEFGH", "role-id" => "ABC1234567890DEF", "user-id" => "HGFEDCBA0987654321"})
provider.run_action(:grant_role)
@grant_resource.should be_updated
end
it "should not grant a role if already granted" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@grant_resource, @run_context)
provider.stub!(:identity_uuid).with(@grant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@grant_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.stub!(:identity_uuid).with(@grant_resource, "role", "name", "role1").and_return("ABC1234567890DEF")
provider.stub!(:identity_uuid).with(@grant_resource, "user-role", "name", "role1",
provider.stub(:identity_uuid).with(@grant_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@grant_resource, "user", "name", "user1").and_return("HGFEDCBA0987654321")
provider.stub(:identity_uuid).with(@grant_resource, "role", "name", "role1").and_return("ABC1234567890DEF")
provider.stub(:identity_uuid).with(@grant_resource, "user-role", "name", "role1",
{"tenant-id" => "1234567890ABCDEFGH", "user-id" => "HGFEDCBA0987654321" }).and_return("ABC1234567890DEF")
provider.stub!(:identity_command).with(@grant_resource, "user-role-add",
provider.stub(:identity_command).with(@grant_resource, "user-role-add",
{"tenant-id" => "1234567890ABCDEFGH", "role-id" => "ABC1234567890DEF", "user-id" => "HGFEDCBA0987654321"})
provider.run_action(:grant_role)
@grant_resource.should_not be_updated
end
it "should grant ec2 creds" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@ec2_resource, @run_context)
provider.stub!(:identity_uuid).with(@ec2_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@ec2_resource, "user", "name", "user1",
provider.stub(:identity_uuid).with(@ec2_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@ec2_resource, "user", "name", "user1",
{"tenant-id" => "1234567890ABCDEFGH"}).and_return("HGFEDCBA0987654321")
provider.stub!(:identity_uuid).with(@ec2_resource, "ec2-credentials", "tenant", "tenant1",
provider.stub(:identity_uuid).with(@ec2_resource, "ec2-credentials", "tenant", "tenant1",
{"user-id" => "HGFEDCBA0987654321"}, "access")
provider.stub!(:identity_command).with(@ec2_resource, "ec2-credentials-create",
provider.stub(:identity_command).with(@ec2_resource, "ec2-credentials-create",
{"user-id" => "HGFEDCBA0987654321", "tenant-id" => "1234567890ABCDEFGH"})
provider.stub!(:prettytable_to_array).and_return([{"access" => "access", "secret" => "secret"}])
provider.stub(:prettytable_to_array).and_return([{"access" => "access", "secret" => "secret"}])
provider.run_action(:create_ec2_credentials)
@ec2_resource.should be_updated
end
it "should grant ec2 creds if they already exist" do
provider = Chef::Provider::OpenstackIdentityRegister.new(@ec2_resource, @run_context)
provider.stub!(:identity_uuid).with(@ec2_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub!(:identity_uuid).with(@ec2_resource, "user", "name", "user1",
provider.stub(:identity_uuid).with(@ec2_resource, "tenant", "name", "tenant1").and_return("1234567890ABCDEFGH")
provider.stub(:identity_uuid).with(@ec2_resource, "user", "name", "user1",
{"tenant-id" => "1234567890ABCDEFGH"}).and_return("HGFEDCBA0987654321")
provider.stub!(:identity_uuid).with(@ec2_resource, "ec2-credentials", "tenant", "tenant1",
provider.stub(:identity_uuid).with(@ec2_resource, "ec2-credentials", "tenant", "tenant1",
{"user-id" => "HGFEDCBA0987654321"}, "access").and_return("ABC1234567890DEF")
provider.run_action(:create_ec2_credentials)
@ec2_resource.should_not be_updated
@ -200,7 +200,7 @@ describe Chef::Provider::Execute do
provider = Chef::Provider::OpenstackIdentityRegister.new(
@user_resource, @run_context)
provider.stub!(:shell_out).with(
provider.stub(:shell_out).with(
["keystone", "user-create", "--enabled", "false",
"--description", "more than one word"],
{:env => {"OS_SERVICE_ENDPOINT" => nil, "OS_SERVICE_TOKEN" => nil}}

View File

@ -5,12 +5,12 @@ describe "openstack-identity::registration" do
describe "ubuntu" do
let(:chef_run) {
runner = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
runner = ::ChefSpec::Runner.new ::UBUNTU_OPTS
runner.converge "openstack-identity::registration"
}
let(:chef_run_test_users) {
runner = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
runner = ::ChefSpec::Runner.new ::UBUNTU_OPTS
runner.node.set["openstack"]["identity"]["users"] = {
"user1" => {
"default_tenant" => "default_tenant1",
@ -34,7 +34,7 @@ describe "openstack-identity::registration" do
).to_hash
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",
:tenant_name => tenant_name,
:tenant_description => "#{tenant_name} Tenant",
@ -55,7 +55,7 @@ describe "openstack-identity::registration" do
).to_hash
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",
:tenant_name => tenant_name,
:tenant_description => "#{tenant_name} Tenant",
@ -77,7 +77,7 @@ describe "openstack-identity::registration" do
).to_hash
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",
:role_name => role_name,
:action => [:create_role]
@ -98,7 +98,7 @@ describe "openstack-identity::registration" do
).to_hash
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",
:role_name => role_name,
:action => [:create_role]
@ -122,7 +122,7 @@ describe "openstack-identity::registration" do
).to_hash
expect(user_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",
:user_name => user,
:user_pass => nil,
@ -139,7 +139,7 @@ describe "openstack-identity::registration" do
).to_hash
expect(grant_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",
:user_name => user,
:role_name => role,
@ -160,7 +160,7 @@ describe "openstack-identity::registration" do
).to_hash
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",
:user_name => "user1",
:user_pass => "secret1",
@ -176,12 +176,12 @@ describe "openstack-identity::registration" do
).to_hash
expect(grant_resource).to include(
:auth_uri => "https://127.0.0.1:35357/v2.0",
:action => [:grant_role],
:auth_uri => "http://127.0.0.1:35357/v2.0",
:bootstrap_token => "bootstrap-token",
:user_name => "user1",
:role_name => "role1",
:tenant_name => "role_tenant1",
:action => [:grant_role]
:tenant_name => "role_tenant1"
)
end
end

View File

@ -4,12 +4,12 @@ describe "openstack-identity::server" do
before { identity_stubs }
describe "suse" do
before do
@chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
@chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
@chef_run.converge "openstack-identity::server"
end
it "converges when configured to use sqlite db backend" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS
chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS
node = chef_run.node
node.set["openstack"]["db"]["identity"]["db_type"] = "sqlite"
chef_run.converge "openstack-identity::server"
@ -20,7 +20,7 @@ describe "openstack-identity::server" do
end
it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::OPENSUSE_OPTS do |n|
chef_run = ::ChefSpec::Runner.new ::OPENSUSE_OPTS do |n|
n.set["openstack"]["db"]["identity"]["db_type"] = "postgresql"
end
chef_run.converge "openstack-identity::server"
@ -37,7 +37,7 @@ describe "openstack-identity::server" do
end
it "starts keystone on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-keystone"
expect(@chef_run).to enable_service("openstack-keystone")
end
describe "/etc/keystone" do
@ -46,14 +46,14 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@dir).to be_owned_by "openstack-keystone", "openstack-keystone"
expect(@dir.owner).to eq("openstack-keystone")
expect(@dir.group).to eq("openstack-keystone")
end
end
describe "/etc/keystone/ssl" do
before do
opts = ::OPENSUSE_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts do |n|
chef_run = ::ChefSpec::Runner.new(::OPENSUSE_OPTS) do |n|
n.set["openstack"]["auth"]["strategy"] = "pki"
end
chef_run.converge "openstack-identity::server"
@ -61,8 +61,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@dir).
to be_owned_by "openstack-keystone", "openstack-keystone"
expect(@dir.owner).to eq("openstack-keystone")
expect(@dir.group).to eq("openstack-keystone")
end
end
@ -71,14 +71,13 @@ describe "openstack-identity::server" do
end
it "runs pki setup" do
opts = ::OPENSUSE_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts do |n|
chef_run = ::ChefSpec::Runner.new(::OPENSUSE_OPTS) do |n|
n.set["openstack"]["auth"]["strategy"] = "pki"
end
chef_run.converge "openstack-identity::server"
cmd = "keystone-manage pki_setup"
expect(chef_run).to execute_command(cmd).with(
expect(chef_run).to run_execute(cmd).with(
:user => "openstack-keystone"
)
end
@ -89,8 +88,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@template).
to be_owned_by "openstack-keystone", "openstack-keystone"
expect(@template.owner).to eq("openstack-keystone")
expect(@template.group).to eq("openstack-keystone")
end
it "template contents" do
@ -100,8 +99,7 @@ describe "openstack-identity::server" do
describe "default_catalog.templates" do
before do
opts = ::OPENSUSE_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts do |n|
chef_run = ::ChefSpec::Runner.new(::OPENSUSE_OPTS) do |n|
n.set["openstack"]["identity"]["catalog"]["backend"] = "templated"
end
chef_run.converge "openstack-identity::server"
@ -110,8 +108,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@template).
to be_owned_by "openstack-keystone", "openstack-keystone"
expect(@template.owner).to eq("openstack-keystone")
expect(@template.group).to eq("openstack-keystone")
end
it "template contents" do

View File

@ -4,12 +4,12 @@ describe "openstack-identity::server" do
before { identity_stubs }
describe "redhat" do
before do
@chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS
@chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
@chef_run.converge "openstack-identity::server"
end
it "converges when configured to use sqlite db backend" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS
node = chef_run.node
node.set["openstack"]["db"]["identity"]["db_type"] = "sqlite"
chef_run.converge "openstack-identity::server"
@ -20,7 +20,7 @@ describe "openstack-identity::server" do
end
it "installs postgresql python packages if explicitly told" do
chef_run = ::ChefSpec::ChefRunner.new ::REDHAT_OPTS do |n|
chef_run = ::ChefSpec::Runner.new ::REDHAT_OPTS do |n|
n.set["openstack"]["db"]["identity"]["db_type"] = "postgresql"
end
chef_run.converge "openstack-identity::server"
@ -37,7 +37,7 @@ describe "openstack-identity::server" do
end
it "starts keystone on boot" do
expect(@chef_run).to set_service_to_start_on_boot "openstack-keystone"
expect(@chef_run).to enable_service("openstack-keystone")
end
end
end

View File

@ -4,7 +4,7 @@ describe "openstack-identity::server" do
before { identity_stubs }
describe "ubuntu" do
before do
@chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS do |n|
@chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS do |n|
n.set["openstack"]["identity"]["syslog"]["use"] = true
n.set["openstack"]["endpoints"]["identity-api"] = {
"host" => "127.0.1.1",
@ -25,14 +25,14 @@ describe "openstack-identity::server" do
end
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-identity::server"
expect(chef_run).not_to include_recipe "openstack-common::logging"
end
it "converges when configured to use sqlite db backend" do
chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS
chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
node = chef_run.node
node.set["openstack"]["db"]["identity"]["db_type"] = "sqlite"
chef_run.converge "openstack-identity::server"
@ -43,7 +43,7 @@ describe "openstack-identity::server" do
end
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.set["openstack"]["db"]["identity"]["db_type"] = "postgresql"
chef_run.converge "openstack-identity::server"
@ -60,12 +60,12 @@ describe "openstack-identity::server" do
end
it "starts keystone on boot" do
expect(@chef_run).to set_service_to_start_on_boot "keystone"
expect(@chef_run).to enable_service("keystone")
end
it "sleep on keystone service enable" do
expect(@chef_run.service("keystone")).
to notify "execute[Keystone: sleep]", :run
expect(@chef_run.service("keystone")).to notify(
"execute[Keystone: sleep]").to(:run)
end
describe "/etc/keystone" do
@ -74,7 +74,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@dir).to be_owned_by "keystone", "keystone"
expect(@dir.owner).to eq("keystone")
expect(@dir.group).to eq("keystone")
end
it "has proper modes" do
@ -87,8 +88,7 @@ describe "openstack-identity::server" do
describe "without pki" do
it "doesn't create" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts
chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS)
chef_run.converge "openstack-identity::server"
expect(chef_run).not_to create_directory @dir
@ -97,8 +97,7 @@ describe "openstack-identity::server" do
describe "with pki" do
before do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
@chef_run = ::ChefSpec::ChefRunner.new opts do |n|
@chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
n.set["openstack"]["auth"]["strategy"] = "pki"
end
@chef_run.converge "openstack-identity::server"
@ -110,7 +109,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@directory).to be_owned_by "keystone", "keystone"
expect(@directory.owner).to eq("keystone")
expect(@directory.group).to eq("keystone")
end
it "has proper modes" do
@ -124,8 +124,7 @@ describe "openstack-identity::server" do
end
it "does not delete keystone.db when configured to use sqlite" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts
chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS)
node = chef_run.node
node.set["openstack"]["db"]["identity"]["db_type"] = "sqlite"
chef_run.converge "openstack-identity::server"
@ -137,19 +136,16 @@ describe "openstack-identity::server" do
describe "without pki" do
it "doesn't execute" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts
chef_run = ::ChefSpec::Runner.new ::UBUNTU_OPTS
chef_run.converge "openstack-identity::server"
expect(chef_run).not_to execute_command(@cmd).with(
:user => "keystone"
)
expect(chef_run).to_not run_execute(@cmd).with(user: "keystone")
end
end
describe "with pki" do
before do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
@chef_run = ::ChefSpec::ChefRunner.new opts do |n|
@chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
n.set["openstack"]["auth"]["strategy"] = "pki"
end
end
@ -160,7 +156,7 @@ describe "openstack-identity::server" do
and_return(false)
@chef_run.converge "openstack-identity::server"
expect(@chef_run).to execute_command(@cmd).with(
expect(@chef_run).to run_execute(@cmd).with(
:user => "keystone"
)
end
@ -171,7 +167,7 @@ describe "openstack-identity::server" do
and_return(true)
@chef_run.converge "openstack-identity::server"
expect(@chef_run).not_to execute_command(@cmd).with(
expect(@chef_run).not_to run_execute(@cmd).with(
:user => "keystone"
)
end
@ -184,7 +180,8 @@ describe "openstack-identity::server" do
end
it "has proper owner" do
expect(@template).to be_owned_by "keystone", "keystone"
expect(@template.owner).to eq("keystone")
expect(@template.group).to eq("keystone")
end
it "has proper modes" do
@ -192,23 +189,26 @@ describe "openstack-identity::server" do
end
it "has bind host" do
expect(@chef_run).to create_file_with_content @template.name,
"bind_host = 127.0.1.1"
match = "bind_host = 127.0.1.1"
expect(@chef_run).to render_file(@template.name).with_content(match)
end
it "has proper public and admin endpoint" do
expect(@chef_run).to create_file_with_content @template.name,
"public_endpoint = https://127.0.1.1:5000/"
expect(@chef_run).to create_file_with_content @template.name,
"admin_endpoint = https://127.0.1.1:35357/"
pub_endpoint = "public_endpoint = https://127.0.1.1:5000/"
adm_endpoint = "admin_endpoint = https://127.0.1.1:35357/"
expect(@chef_run).to render_file(@template.name).with_content(
pub_endpoint)
expect(@chef_run).to render_file(@template.name).with_content(
adm_endpoint)
end
it "has policy driver" do
expect(@chef_run).to create_file_with_content @template.name,
"driver = keystone.policy.backends.sql.Policy"
match = "driver = keystone.policy.backends.sql.Policy"
expect(@chef_run).to render_file(@template.name).with_content(
match)
end
it "notifies keystone restart" do
expect(@template).to notify "service[keystone]", :restart
expect(@template).to notify("service[keystone]").to(:restart)
end
describe "optional LDAP attributes" do
@ -221,15 +221,13 @@ describe "openstack-identity::server" do
optional_attrs.each do |setting|
it "does not have the optional #{setting} LDAP attribute" do
expect(@chef_run).not_to(
create_file_with_content(
@template.name, /^#{Regexp.quote(setting)} =/))
expect(@chef_run).not_to render_file(@template.name).with_content(
/^#{Regexp.quote(setting)} =/)
end
it "has the optional #{setting} LDAP attribute commented out" do
expect(@chef_run).to(
create_file_with_content(
@template.name, /^# #{Regexp.quote(setting)} =$/))
expect(@chef_run).to render_file(@template.name).with_content(
/^# #{Regexp.quote(setting)} =$/)
end
end
end
@ -258,8 +256,8 @@ describe "openstack-identity::server" do
"group_allow_update", "group_allow_delete",
].each do |setting|
it "has a #{setting} LDAP attribute" do
expect(@chef_run).to create_file_with_content @template.name,
/^#{Regexp.quote(setting)} = \w+/
expect(@chef_run).to render_file(@template.name).with_content(
/^#{Regexp.quote(setting)} = \w+/)
end
end
end
@ -269,18 +267,16 @@ describe "openstack-identity::server" do
describe "without templated" do
it "doesn't create" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new opts
chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS)
chef_run.converge "openstack-identity::server"
expect(chef_run).not_to create_file @file
expect(chef_run).not_to render_file(@file)
end
end
describe "with templated" do
before do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
@chef_run = ::ChefSpec::ChefRunner.new opts do |n|
@chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
n.set["openstack"]["identity"]["catalog"]["backend"] = "templated"
end
@chef_run.converge "openstack-identity::server"
@ -288,11 +284,12 @@ describe "openstack-identity::server" do
end
it "creates" do
expect(@chef_run).to create_file @file
expect(@chef_run).to render_file(@file)
end
it "has proper owner" do
expect(@template).to be_owned_by "keystone", "keystone"
expect(@template.owner).to eq("keystone")
expect(@template.group).to eq("keystone")
end
it "has proper modes" do
@ -304,7 +301,7 @@ describe "openstack-identity::server" do
end
it "notifies keystone restart" do
expect(@template).to notify "service[keystone]", :restart
expect(@template).to notify("service[keystone]").to(:restart)
end
end
end
@ -315,17 +312,16 @@ describe "openstack-identity::server" do
end
it "runs migrations" do
expect(@chef_run).to execute_command @cmd
expect(@chef_run).to run_execute(@cmd)
end
it "doesn't run migrations" do
opts = ::UBUNTU_OPTS.merge(:evaluate_guards => true)
chef_run = ::ChefSpec::ChefRunner.new(opts) do |n|
chef_run = ::ChefSpec::Runner.new(::UBUNTU_OPTS) do |n|
n.set["openstack"]["identity"]["db"]["migrate"] = false
end
chef_run.converge "openstack-identity::server"
expect(chef_run).not_to execute_command @cmd
expect(chef_run).not_to run_execute(@cmd)
end
end
end