Files
cookbook-openstack-block-st…/spec/api-redhat_spec.rb
galstrom21 92fdeed919 Refactoring ChefSpec tests
Adding strict dependency on python cookbook version. This removes the
requirement for carrying a matcher in this cookbook for the python
LWRPs.

Change-Id: I3e58c029044aa76fef71372e6a06f8f307d29df7
2014-03-21 22:17:43 -05:00

43 lines
1.2 KiB
Ruby

# encoding: UTF-8
#
# Cookbook Name:: openstack-block-storage
require_relative 'spec_helper'
describe 'openstack-block-storage::api' do
describe 'redhat' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'block-storage-stubs'
it 'installs cinder api packages' do
expect(chef_run).to upgrade_package 'python-cinderclient'
end
it 'installs mysql python packages by default' do
expect(chef_run).to upgrade_package 'MySQL-python'
end
it 'installs db2 python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'db2'
['python-ibm-db', 'python-ibm-db-sa'].each do |pkg|
expect(chef_run).to upgrade_package pkg
end
end
it 'installs postgresql python packages if explicitly told' do
node.set['openstack']['db']['block-storage']['service_type'] = 'postgresql'
expect(chef_run).to upgrade_package 'python-psycopg2'
expect(chef_run).not_to upgrade_package 'MySQL-python'
end
it 'starts cinder api on boot' do
expect(chef_run).to enable_service 'openstack-cinder-api'
end
end
end