Initial Liberty Updates
MetaData Changes: - bump metadata version to 12 Other codes changes - change juno to kilo where appropriate - rubocop todo file updates - removed db2 refs Bootstrap Changes - Updated to 0.7.0 release of the ChefDK Change-Id: I65745eae2e430ced0c25e8f05dd490fdad840623
This commit is contained in:
committed by
Mark Vanderwiel
parent
2955ee7ac3
commit
9218fee097
20
.rubocop.yml
20
.rubocop.yml
@@ -2,14 +2,14 @@ inherit_from: .rubocop_todo.yml
|
|||||||
|
|
||||||
AllCops:
|
AllCops:
|
||||||
Include:
|
Include:
|
||||||
- metadata.rb
|
- ./metadata.rb
|
||||||
- Gemfile
|
- ./Gemfile
|
||||||
- attributes/**
|
- attributes/**/*
|
||||||
- libraries/**
|
- libraries/**/*
|
||||||
- providers/**
|
- providers/**/*
|
||||||
- recipes/**
|
- recipes/**/*
|
||||||
- resources/**
|
- resources/**/*
|
||||||
- spec/**
|
- spec/**/*
|
||||||
Exclude:
|
Exclude:
|
||||||
- .cookbooks/**/*
|
- .cookbooks/**/*
|
||||||
- berks-cookbooks/**/*
|
- berks-cookbooks/**/*
|
||||||
@@ -17,8 +17,8 @@ AllCops:
|
|||||||
|
|
||||||
Encoding:
|
Encoding:
|
||||||
Exclude:
|
Exclude:
|
||||||
- metadata.rb
|
- ./metadata.rb
|
||||||
- Gemfile
|
- ./Gemfile
|
||||||
|
|
||||||
NumericLiterals:
|
NumericLiterals:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
# This configuration was generated by `rubocop --auto-gen-config`
|
# This configuration was generated by `rubocop --auto-gen-config`
|
||||||
# on 2015-06-04 16:44:34 +0200 using RuboCop version 0.28.0.
|
# on 2015-08-28 09:19:29 -0500 using RuboCop version 0.32.1.
|
||||||
# The point is for the user to remove these configuration records
|
# The point is for the user to remove these configuration records
|
||||||
# one by one as the offenses are removed from the code base.
|
# one by one as the offenses are removed from the code base.
|
||||||
# Note that changes in the inspected code, or installation of new
|
# Note that changes in the inspected code, or installation of new
|
||||||
# versions of RuboCop, may require this file to be generated again.
|
# versions of RuboCop, may require this file to be generated again.
|
||||||
|
|
||||||
|
# Offense count: 2
|
||||||
|
Lint/NestedMethodDefinition:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
# Offense count: 9
|
# Offense count: 9
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 31
|
Max: 31
|
||||||
|
|
||||||
# Offense count: 1
|
# Offense count: 2
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
Max: 14
|
Max: 14
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
# used in an OpenStack deployment.
|
# used in an OpenStack deployment.
|
||||||
#
|
#
|
||||||
# There is no 'scheme' key. Instead, there is a 'service_type' key that should
|
# There is no 'scheme' key. Instead, there is a 'service_type' key that should
|
||||||
# contain one of 'sqlite', 'mysql', 'db2' or 'postgresql'
|
# contain one of 'sqlite', 'mysql', or 'postgresql'
|
||||||
#
|
#
|
||||||
# The ::Openstack::db(<SERVICE_NAME>) library routine allows a lookup from any recipe
|
# The ::Openstack::db(<SERVICE_NAME>) library routine allows a lookup from any recipe
|
||||||
# to this array, returning the host information for the server that contains
|
# to this array, returning the host information for the server that contains
|
||||||
@@ -90,7 +90,6 @@ default['openstack']['db']['charset'] = {
|
|||||||
postgresql: nil,
|
postgresql: nil,
|
||||||
pgsql: nil,
|
pgsql: nil,
|
||||||
sqlite: nil,
|
sqlite: nil,
|
||||||
db2: 'utf8',
|
|
||||||
nosql: nil,
|
nosql: nil,
|
||||||
galera: 'utf8'
|
galera: 'utf8'
|
||||||
}
|
}
|
||||||
@@ -102,7 +101,6 @@ default['openstack']['db']['options'] = {
|
|||||||
mariadb: "?charset=#{node['openstack']['db']['charset']['mariadb']}",
|
mariadb: "?charset=#{node['openstack']['db']['charset']['mariadb']}",
|
||||||
postgresql: '',
|
postgresql: '',
|
||||||
sqlite: '',
|
sqlite: '',
|
||||||
db2: "?charset=#{node['openstack']['db']['charset']['db2']}",
|
|
||||||
nosql: '',
|
nosql: '',
|
||||||
galera: "?charset=#{node['openstack']['db']['charset']['galera']}"
|
galera: "?charset=#{node['openstack']['db']['charset']['galera']}"
|
||||||
}
|
}
|
||||||
@@ -118,7 +116,6 @@ when 'rhel'
|
|||||||
default['openstack']['db']['python_packages']['mysql'] = ['MySQL-python']
|
default['openstack']['db']['python_packages']['mysql'] = ['MySQL-python']
|
||||||
default['openstack']['db']['python_packages']['mariadb'] = ['MySQL-python']
|
default['openstack']['db']['python_packages']['mariadb'] = ['MySQL-python']
|
||||||
default['openstack']['db']['python_packages']['percona-cluster'] = ['MySQL-python']
|
default['openstack']['db']['python_packages']['percona-cluster'] = ['MySQL-python']
|
||||||
default['openstack']['db']['python_packages']['db2'] = ['python-ibm-db', 'python-ibm-db-sa']
|
|
||||||
default['openstack']['db']['python_packages']['galera'] = ['MySQL-python']
|
default['openstack']['db']['python_packages']['galera'] = ['MySQL-python']
|
||||||
when 'suse'
|
when 'suse'
|
||||||
default['openstack']['db']['service_type'] = 'mysql'
|
default['openstack']['db']['service_type'] = 'mysql'
|
||||||
@@ -131,7 +128,6 @@ when 'debian'
|
|||||||
default['openstack']['db']['python_packages']['mysql'] = ['python-mysqldb']
|
default['openstack']['db']['python_packages']['mysql'] = ['python-mysqldb']
|
||||||
default['openstack']['db']['python_packages']['mariadb'] = ['python-mysqldb']
|
default['openstack']['db']['python_packages']['mariadb'] = ['python-mysqldb']
|
||||||
default['openstack']['db']['python_packages']['percona-cluster'] = ['python-mysqldb']
|
default['openstack']['db']['python_packages']['percona-cluster'] = ['python-mysqldb']
|
||||||
default['openstack']['db']['python_packages']['db2'] = ['ibm-db', 'ibm-db-sa']
|
|
||||||
default['openstack']['db']['python_packages']['galera'] = ['python-mysqldb']
|
default['openstack']['db']['python_packages']['galera'] = ['python-mysqldb']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ default['openstack']['secret']['user_passwords_data_bag'] = 'user_passwords'
|
|||||||
# needs.
|
# needs.
|
||||||
|
|
||||||
# The coordinated release of OpenStack codename
|
# The coordinated release of OpenStack codename
|
||||||
default['openstack']['release'] = 'kilo'
|
default['openstack']['release'] = 'liberty'
|
||||||
|
|
||||||
# The Ubuntu Cloud Archive has packages for multiple Ubuntu releases. For
|
# The Ubuntu Cloud Archive has packages for multiple Ubuntu releases. For
|
||||||
# more information, see: https://wiki.ubuntu.com/ServerTeam/CloudArchive.
|
# more information, see: https://wiki.ubuntu.com/ServerTeam/CloudArchive.
|
||||||
@@ -134,10 +134,10 @@ default['openstack']['zypp']['uri'] = 'http://download.opensuse.org/repositories
|
|||||||
|
|
||||||
default['openstack']['yum']['rdo_enabled'] = true
|
default['openstack']['yum']['rdo_enabled'] = true
|
||||||
default['openstack']['yum']['rdo_delorean_enabled'] = false
|
default['openstack']['yum']['rdo_delorean_enabled'] = false
|
||||||
default['openstack']['yum']['uri'] = 'http://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7'
|
default['openstack']['yum']['uri'] = 'http://repos.fedorapeople.org/repos/openstack/openstack-liberty/el7'
|
||||||
# Add rdo-testing repo from rdo-release.rpm
|
# Add rdo-testing repo from rdo-release.rpm
|
||||||
default['openstack']['yum']['testing-uri'] = 'http://repos.fedorapeople.org/repos/openstack/openstack-kilo/testing/el7'
|
default['openstack']['yum']['testing-uri'] = 'http://repos.fedorapeople.org/repos/openstack/openstack-liberty/testing/el7'
|
||||||
default['openstack']['yum']['repo-key'] = 'https://raw.githubusercontent.com/redhat-openstack/rdo-release/master/RPM-GPG-KEY-RDO-kilo'
|
default['openstack']['yum']['repo-key'] = 'https://raw.githubusercontent.com/redhat-openstack/rdo-release/master/RPM-GPG-KEY-RDO-liberty'
|
||||||
# Enforcing GnuPG signature check for RDO repo. Set this to false if you want to disable the check.
|
# Enforcing GnuPG signature check for RDO repo. Set this to false if you want to disable the check.
|
||||||
default['openstack']['yum']['gpgcheck'] = true
|
default['openstack']['yum']['gpgcheck'] = true
|
||||||
# ======================== OpenStack Endpoints ================================
|
# ======================== OpenStack Endpoints ================================
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
sudo apt-get -y install build-essential liblzma-dev zlib1g-dev
|
sudo apt-get -y install build-essential liblzma-dev zlib1g-dev
|
||||||
|
|
||||||
# install chefdk
|
# install chefdk
|
||||||
chefdk=chefdk_0.4.0-1_amd64.deb
|
chefdk=chefdk_0.7.0-1_amd64.deb
|
||||||
wget -nv -t 3 https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/$chefdk
|
wget -nv -t 3 https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/$chefdk
|
||||||
sudo dpkg -i $chefdk
|
sudo dpkg -i $chefdk
|
||||||
rm $chefdk
|
rm $chefdk
|
||||||
|
|||||||
@@ -69,15 +69,6 @@ module ::Openstack
|
|||||||
|
|
||||||
# Normalize to the SQLAlchemy standard db type identifier
|
# Normalize to the SQLAlchemy standard db type identifier
|
||||||
case type
|
case type
|
||||||
when 'db2'
|
|
||||||
# NoSQL is used for telemetry in the DB2 case
|
|
||||||
if service == 'telemetry' && node['openstack']['db']['telemetry']['nosql']['used']
|
|
||||||
options = info['options']['nosql']
|
|
||||||
port = info['nosql']['port']
|
|
||||||
type = 'db2'
|
|
||||||
else
|
|
||||||
type = 'ibm_db_sa'
|
|
||||||
end
|
|
||||||
when 'pgsql'
|
when 'pgsql'
|
||||||
type = 'postgresql'
|
type = 'postgresql'
|
||||||
when 'mariadb', 'galera', 'percona-cluster'
|
when 'mariadb', 'galera', 'percona-cluster'
|
||||||
@@ -86,7 +77,7 @@ module ::Openstack
|
|||||||
|
|
||||||
# Build uri
|
# Build uri
|
||||||
case type
|
case type
|
||||||
when 'mysql', 'postgresql', 'db2', 'ibm_db_sa'
|
when 'mysql', 'postgresql'
|
||||||
"#{type}://#{user}:#{pass}@#{host}:#{port}/#{name}#{options}"
|
"#{type}://#{user}:#{pass}@#{host}:#{port}/#{name}#{options}"
|
||||||
when 'sqlite'
|
when 'sqlite'
|
||||||
# SQLite uses filepaths not db name
|
# SQLite uses filepaths not db name
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ module ::Openstack
|
|||||||
#
|
#
|
||||||
# @param [String] The role or recipe to be found.
|
# @param [String] The role or recipe to be found.
|
||||||
# @return [Array] The matching result or an empty list.
|
# @return [Array] The matching result or an empty list.
|
||||||
def search_for(r, &block) # rubocop:disable MethodLength
|
def search_for(r, &block)
|
||||||
role_query = "(chef_environment:#{node.chef_environment} AND roles:#{r})"
|
role_query = "(chef_environment:#{node.chef_environment} AND roles:#{r})"
|
||||||
recipe_query = "(chef_environment:#{node.chef_environment} AND recipes:#{r})".sub('::', '\:\:')
|
recipe_query = "(chef_environment:#{node.chef_environment} AND recipes:#{r})".sub('::', '\:\:')
|
||||||
query = "#{role_query} OR #{recipe_query}"
|
query = "#{role_query} OR #{recipe_query}"
|
||||||
@@ -45,7 +45,7 @@ module ::Openstack
|
|||||||
# @param [String] role The role to be found (optional).
|
# @param [String] role The role to be found (optional).
|
||||||
# @return [Array] A list of memcached servers in format
|
# @return [Array] A list of memcached servers in format
|
||||||
# '<ip>:<port>'.
|
# '<ip>:<port>'.
|
||||||
def memcached_servers(role = 'infra-caching') # rubocop:disable MethodLength
|
def memcached_servers(role = 'infra-caching')
|
||||||
if !node['openstack']['memcached_servers']
|
if !node['openstack']['memcached_servers']
|
||||||
search_for(role).map do |n|
|
search_for(role).map do |n|
|
||||||
listen = n['memcached']['listen']
|
listen = n['memcached']['listen']
|
||||||
@@ -68,7 +68,7 @@ module ::Openstack
|
|||||||
#
|
#
|
||||||
# @return [String] Rabbit servers joined by a comma in
|
# @return [String] Rabbit servers joined by a comma in
|
||||||
# the format of '<ip>:<port>'.
|
# the format of '<ip>:<port>'.
|
||||||
def rabbit_servers # rubocop:disable MethodLength
|
def rabbit_servers
|
||||||
if node['openstack']['mq']['servers']
|
if node['openstack']['mq']['servers']
|
||||||
servers = node['openstack']['mq']['servers']
|
servers = node['openstack']['mq']['servers']
|
||||||
port = node['openstack']['endpoints']['mq']['port']
|
port = node['openstack']['endpoints']['mq']['port']
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ module ::Openstack
|
|||||||
return nil if paths.length == 0
|
return nil if paths.length == 0
|
||||||
leadingslash = paths[0][0] == '/' ? '/' : ''
|
leadingslash = paths[0][0] == '/' ? '/' : ''
|
||||||
trailingslash = paths[-1][-1] == '/' ? '/' : ''
|
trailingslash = paths[-1][-1] == '/' ? '/' : ''
|
||||||
paths.map! { |path| path.sub(/^\/+/, '').sub(/\/+$/, '') }
|
paths.map! { |path| path.sub(%r{^\/+}, '').sub(%r{\/+$}, '') }
|
||||||
leadingslash + paths.join('/') + trailingslash
|
leadingslash + paths.join('/') + trailingslash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
name 'openstack-common'
|
name 'openstack-common'
|
||||||
maintainer 'openstack-chef'
|
maintainer 'openstack-chef'
|
||||||
maintainer_email 'opscode-chef-openstack@googlegroups.com'
|
maintainer_email 'openstack-dev@lists.openstack.org'
|
||||||
license 'Apache 2.0'
|
license 'Apache 2.0'
|
||||||
description 'Common OpenStack attributes, libraries and recipes.'
|
description 'Common OpenStack attributes, libraries and recipes.'
|
||||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||||
version '11.5.1'
|
version '12.0.0'
|
||||||
|
|
||||||
recipe 'openstack-common', 'Installs/Configures common recipes'
|
recipe 'openstack-common', 'Installs/Configures common recipes'
|
||||||
recipe 'openstack-common::set_endpoints_by_interface', 'Set endpoints by interface'
|
recipe 'openstack-common::set_endpoints_by_interface', 'Set endpoints by interface'
|
||||||
|
|||||||
@@ -13,15 +13,9 @@ use_inline_resources if defined?(use_inline_resources)
|
|||||||
|
|
||||||
action :create do
|
action :create do
|
||||||
info
|
info
|
||||||
### db2 can only be used with an IBM internal cookbook
|
create_db(@db_name, @db_prov, @connection_info, @db_type) # create database
|
||||||
if @db_type == 'db2'
|
create_db_user(@user, @user_prov, @connection_info, @pass) # create user
|
||||||
create_db2(@db_name) # create database
|
grant_db_privileges(@user, @user_prov, @connection_info, @pass, @db_name) # grant privileges
|
||||||
create_db2_user(@user, @pass, @db_name) # create user
|
|
||||||
else
|
|
||||||
create_db(@db_name, @db_prov, @connection_info, @db_type) # create database
|
|
||||||
create_db_user(@user, @user_prov, @connection_info, @pass) # create user
|
|
||||||
grant_db_privileges(@user, @user_prov, @connection_info, @pass, @db_name) # grant privileges
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@@ -37,7 +31,7 @@ def info
|
|||||||
@db_name = service_info['db_name']
|
@db_name = service_info['db_name']
|
||||||
@user = new_resource.user
|
@user = new_resource.user
|
||||||
@pass = new_resource.pass
|
@pass = new_resource.pass
|
||||||
db_types unless @db_type == 'db2' ## db2 is only IBM internal
|
db_types
|
||||||
connection_info
|
connection_info
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -65,24 +59,6 @@ def connection_info
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
### this db2 resource does only exist in an IBM internal cookbook
|
|
||||||
def create_db2(db_name)
|
|
||||||
db2_database "create database #{db_name}" do
|
|
||||||
db_name db_name
|
|
||||||
action :create
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
### this db2 resource does only exist in an IBM internal cookbook
|
|
||||||
def create_db2_user(user, pass, db_name)
|
|
||||||
db2_user "create database user #{user}" do
|
|
||||||
db_user user
|
|
||||||
db_pass pass
|
|
||||||
db_name db_name
|
|
||||||
action :create
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def create_db(db_name, db_prov, connection_info, db_type)
|
def create_db(db_name, db_prov, connection_info, db_type)
|
||||||
database "create database #{db_name}" do
|
database "create database #{db_name}" do
|
||||||
provider db_prov
|
provider db_prov
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ describe 'openstack-common::default' do
|
|||||||
allow(subject).to receive(:shell_out).with(
|
allow(subject).to receive(:shell_out).with(
|
||||||
['keystone', 'user-list'],
|
['keystone', 'user-list'],
|
||||||
env: env
|
env: env
|
||||||
).and_return double('shell_out', exitstatus: 0, stdout: 'good', stderr: '')
|
).and_return double('shell_out', exitstatus: 0, stdout: 'good', stderr: '')
|
||||||
|
|
||||||
result = subject.openstack_command('keystone', 'user-list', env)
|
result = subject.openstack_command('keystone', 'user-list', env)
|
||||||
expect(result).to eq('good')
|
expect(result).to eq('good')
|
||||||
@@ -59,7 +59,7 @@ describe 'openstack-common::default' do
|
|||||||
allow(subject).to receive(:shell_out).with(
|
allow(subject).to receive(:shell_out).with(
|
||||||
%w(keystone --key1 value1 --key2 value2 --key3 user-list),
|
%w(keystone --key1 value1 --key2 value2 --key3 user-list),
|
||||||
env: env
|
env: env
|
||||||
).and_return double('shell_out', exitstatus: 0, stdout: 'good', stderr: '')
|
).and_return double('shell_out', exitstatus: 0, stdout: 'good', stderr: '')
|
||||||
|
|
||||||
result = subject.openstack_command('keystone', 'user-list', env, 'key1' => 'value1', 'key2' => 'value2', 'key3' => '')
|
result = subject.openstack_command('keystone', 'user-list', env, 'key1' => 'value1', 'key2' => 'value2', 'key3' => '')
|
||||||
expect(result).to eq('good')
|
expect(result).to eq('good')
|
||||||
@@ -76,7 +76,7 @@ describe 'openstack-common::default' do
|
|||||||
allow(subject).to receive(:shell_out).with(
|
allow(subject).to receive(:shell_out).with(
|
||||||
['keystone', 'user-list'],
|
['keystone', 'user-list'],
|
||||||
env: env
|
env: env
|
||||||
).and_return double('shell_out', exitstatus: 123, stdout: 'fail', stderr: '')
|
).and_return double('shell_out', exitstatus: 123, stdout: 'fail', stderr: '')
|
||||||
|
|
||||||
# TODO: need to figure out why this won't work.
|
# TODO: need to figure out why this won't work.
|
||||||
# expect(subject.openstack_command('keystone', 'user-list', env)).to fail
|
# expect(subject.openstack_command('keystone', 'user-list', env)).to fail
|
||||||
|
|||||||
@@ -94,29 +94,6 @@ describe 'test-openstack-common-database::default' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'db2' do
|
|
||||||
before do
|
|
||||||
node.override['openstack']['db']['service'] = { service_type: 'db2', db_name: 'service_db2' }
|
|
||||||
end
|
|
||||||
it 'creates the database with the db2 resource' do
|
|
||||||
pending('db2 resource is currently only available from an IBM internal cookbook')
|
|
||||||
expect(chef_run).to create_db2_database('create database service_db2')
|
|
||||||
.with(
|
|
||||||
database_name: 'service_db'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'creates the database use with the db2_user resource' do
|
|
||||||
pending('db2 resource is currently only available from an IBM internal cookbook')
|
|
||||||
expect(chef_run).to create_database_user('create database user db_user')
|
|
||||||
.with(
|
|
||||||
db_user: 'db_user',
|
|
||||||
db_pass: 'db_pass',
|
|
||||||
db_name: 'service_db2'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'galera' do
|
context 'galera' do
|
||||||
before do
|
before do
|
||||||
node.override['openstack']['db']['service'] = { service_type: 'galera', port: 3306, db_name: 'service_db' }
|
node.override['openstack']['db']['service'] = { service_type: 'galera', port: 3306, db_name: 'service_db' }
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe 'openstack-common::default' do
|
|||||||
allow(Mixlib::ShellOut).to receive_message_chain(
|
allow(Mixlib::ShellOut).to receive_message_chain(
|
||||||
new: 'rpm -qa gpg-pubkey', run_command: nil, stdout: nil,
|
new: 'rpm -qa gpg-pubkey', run_command: nil, stdout: nil,
|
||||||
new: 'zypper repos --export -').and_return(
|
new: 'zypper repos --export -').and_return(
|
||||||
'http://download.opensuse.org/repositories/Cloud:/OpenStack:/Kilo/SLE_11_SP3/')
|
'http://download.opensuse.org/repositories/Cloud:/OpenStack:/Liberty/SLE_11_SP3/')
|
||||||
|
|
||||||
expect(chef_run).to run_bash('add repository key')
|
expect(chef_run).to run_bash('add repository key')
|
||||||
expect(chef_run).not_to run_execute('add repository').with(command: /zypper addrepo/)
|
expect(chef_run).not_to run_execute('add repository').with(command: /zypper addrepo/)
|
||||||
@@ -30,7 +30,7 @@ describe 'openstack-common::default' do
|
|||||||
expect(chef_run).to run_execute('add repository').with(
|
expect(chef_run).to run_execute('add repository').with(
|
||||||
command: 'zypper addrepo --check '\
|
command: 'zypper addrepo --check '\
|
||||||
"http://download.opensuse.org/repositories/Cloud:/OpenStack:/#{node['openstack']['release'].capitalize}/SLE_11_SP3/ "\
|
"http://download.opensuse.org/repositories/Cloud:/OpenStack:/#{node['openstack']['release'].capitalize}/SLE_11_SP3/ "\
|
||||||
'Cloud:OpenStack:Kilo')
|
'Cloud:OpenStack:Liberty')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not add the repository nor the key' do
|
it 'does not add the repository nor the key' do
|
||||||
@@ -38,7 +38,7 @@ describe 'openstack-common::default' do
|
|||||||
new: 'rpm -qa gpg-pubkey', run_command: nil, stdout: nil,
|
new: 'rpm -qa gpg-pubkey', run_command: nil, stdout: nil,
|
||||||
new: 'zypper repos --export -').and_return(
|
new: 'zypper repos --export -').and_return(
|
||||||
'd85f9316',
|
'd85f9316',
|
||||||
'http://download.opensuse.org/repositories/Cloud:/OpenStack:/Kilo/SLE_11_SP3/')
|
'http://download.opensuse.org/repositories/Cloud:/OpenStack:/Liberty/SLE_11_SP3/')
|
||||||
expect(chef_run).not_to run_bash('add repository key')
|
expect(chef_run).not_to run_bash('add repository key')
|
||||||
expect(chef_run).not_to run_execute('add repository').with(command: /zypper addrepo/)
|
expect(chef_run).not_to run_execute('add repository').with(command: /zypper addrepo/)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ describe 'openstack-common::default' do
|
|||||||
node.set['openstack']['apt']['live_updates_enabled'] = true
|
node.set['openstack']['apt']['live_updates_enabled'] = true
|
||||||
expect(chef_run).to add_apt_repository('openstack-ppa').with(
|
expect(chef_run).to add_apt_repository('openstack-ppa').with(
|
||||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||||
components: ['trusty-updates/kilo', 'main'])
|
components: ['trusty-updates/liberty', 'main'])
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'disables openstack live updates' do
|
it 'disables openstack live updates' do
|
||||||
node.set['openstack']['apt']['live_updates_enabled'] = false
|
node.set['openstack']['apt']['live_updates_enabled'] = false
|
||||||
expect(chef_run).to_not add_apt_repository('openstack-ppa').with(
|
expect(chef_run).to_not add_apt_repository('openstack-ppa').with(
|
||||||
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||||
components: ['trusty-updates/kilo', 'main'])
|
components: ['trusty-updates/liberty', 'main'])
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not install the gem chef-vault by default' do
|
it 'does not install the gem chef-vault by default' do
|
||||||
|
|||||||
@@ -353,37 +353,6 @@ describe 'openstack-common::set_endpoints_by_interface' do
|
|||||||
).to eq(expected)
|
).to eq(expected)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns block-storage db info hash when service found for db2 with options' do
|
|
||||||
node.set['openstack']['db']['service_type'] = 'db2'
|
|
||||||
node.set['openstack']['db']['options'] = { 'db2' => '?options' }
|
|
||||||
allow(subject).to receive(:node).and_return(chef_run.node)
|
|
||||||
expected = 'ibm_db_sa://user:pass@127.0.0.1:3306/cinder?options'
|
|
||||||
expect(
|
|
||||||
subject.db_uri('block-storage', 'user', 'pass')
|
|
||||||
).to eq(expected)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns telemetry db info hash when service found for db2' do
|
|
||||||
node.set['openstack']['db']['service_type'] = 'db2'
|
|
||||||
node.set['openstack']['db']['telemetry']['nosql']['used'] = true
|
|
||||||
allow(subject).to receive(:node).and_return(chef_run.node)
|
|
||||||
expected = 'db2://user:pass@127.0.0.1:27017/ceilometer'
|
|
||||||
expect(
|
|
||||||
subject.db_uri('telemetry', 'user', 'pass')
|
|
||||||
).to eq(expected)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns telemetry db info hash when service found for db2 with options' do
|
|
||||||
node.set['openstack']['db']['service_type'] = 'db2'
|
|
||||||
node.set['openstack']['db']['options'] = { 'nosql' => '?options' }
|
|
||||||
node.set['openstack']['db']['telemetry']['nosql']['used'] = true
|
|
||||||
allow(subject).to receive(:node).and_return(chef_run.node)
|
|
||||||
expected = 'db2://user:pass@127.0.0.1:27017/ceilometer?options'
|
|
||||||
expect(
|
|
||||||
subject.db_uri('telemetry', 'user', 'pass')
|
|
||||||
).to eq(expected)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns compute db info hash when service found for mariadb' do
|
it 'returns compute db info hash when service found for mariadb' do
|
||||||
node.set['openstack']['db']['service_type'] = 'mariadb'
|
node.set['openstack']['db']['service_type'] = 'mariadb'
|
||||||
allow(subject).to receive(:node).and_return(chef_run.node)
|
allow(subject).to receive(:node).and_return(chef_run.node)
|
||||||
@@ -413,17 +382,6 @@ describe 'openstack-common::set_endpoints_by_interface' do
|
|||||||
).to eq(expected)
|
).to eq(expected)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns block-storage slave db info hash when service found for db2 with options' do
|
|
||||||
node.set['openstack']['endpoints']['db']['enabled_slave'] = true
|
|
||||||
node.set['openstack']['db']['service_type'] = 'db2'
|
|
||||||
node.set['openstack']['db']['options'] = { 'db2' => '?options' }
|
|
||||||
allow(subject).to receive(:node).and_return(chef_run.node)
|
|
||||||
expected = 'ibm_db_sa://user:pass@127.0.0.1:3316/cinder?options'
|
|
||||||
expect(
|
|
||||||
subject.db_uri('block-storage', 'user', 'pass', true)
|
|
||||||
).to eq(expected)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'returns image slave db info hash when service found for mariadb' do
|
it 'returns image slave db info hash when service found for mariadb' do
|
||||||
node.set['openstack']['db']['service_type'] = 'mariadb'
|
node.set['openstack']['db']['service_type'] = 'mariadb'
|
||||||
node.set['openstack']['endpoints']['db']['enabled_slave'] = true
|
node.set['openstack']['endpoints']['db']['enabled_slave'] = true
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ shared_context 'common-stubs' do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
)
|
)
|
||||||
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
|
||||||
.with('user', 'admin')
|
.with('user', 'admin')
|
||||||
.and_return('admin')
|
.and_return('admin')
|
||||||
|
|||||||
Reference in New Issue
Block a user