Files
cookbook-openstack-common/spec/spec_helper.rb
Samuel Cassiba b2881c3a80 common refactor for Pike and Chef 13
- changed the default RDBMS to MariaDB in accordance with install docs[0]
- removed deprecated database, apt and yum cookbooks
- incorporated `database' and MySQL-specific abstractions from database
  cookbook
- implemented foodcritic and cookstyle corrections
- deprecated node.foo.bar method access for node['foo']['bar'] bracket syntax
- updated default recipe for core apt resource
- use /etc/apt/apt.conf.d on Ubuntu instead of passing the dpkg overrides as
  command line options in every cookbook

[0]: https://docs.openstack.org/install-guide/environment-sql-database.html

Implements blueprint modern-chef

Change-Id: I143e0ed0a2bdd76269fc0c402052696426d96d81
Depends-On: I00e2237cef0c9aa35f78d3ccec04a1c7b9271ce8
Depends-On: I7ee0f5eae4e79e5c70ee8de4a0094a7c34fdd18f
2018-01-11 17:42:41 +00:00

48 lines
1.1 KiB
Ruby

# encoding: UTF-8
require 'chefspec'
require 'chefspec/berkshelf'
ChefSpec::Coverage.start! { add_filter 'openstack-common' }
LOG_LEVEL = :fatal
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '16.04',
log_level: LOG_LEVEL,
}.freeze
REDHAT_OPTS = {
platform: 'redhat',
version: '7.3',
log_level: LOG_LEVEL,
}.freeze
# We set a default platform for non-platform specific test cases
CHEFSPEC_OPTS = UBUNTU_OPTS
shared_context 'library-stubs' do
before do
allow(subject).to receive(:node).and_return(chef_run.node)
end
end
shared_context 'common-stubs' do
before do
allow_any_instance_of(Chef::Recipe).to receive(:search_for)
.with('os-identity').and_return(
[{
'openstack' => {
'identity' => {
'admin_tenant_name' => 'admin',
'admin_user' => 'admin',
},
},
}]
)
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('user', 'admin')
.and_return('admin')
allow_any_instance_of(Chef::Recipe).to receive(:get_password)
.with('user', 'admin-user-override')
.and_return('admin-user-override')
end
end