Files
cookbook-openstack-common/spec/default_spec.rb
Mark Vanderwiel abd313ac8d Setting up repo for master Juno branch
* Update metadata versions
* Updates for icehouse specific attributes
* Removing Strainer file
* Updating Gems
  * chef (11.12.0)
  * chefspec (4.0.0)
  * rspec (3.0.0)
* Cleanup specs for 4.x

Change-Id: I9a495cdb90feaf7508a5b861557856dd19340272
Partial-Bug: 1349865
2014-07-29 11:09:11 -05:00

35 lines
1.2 KiB
Ruby

# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-common::default' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) do
node.set['lsb']['codename'] = 'precise'
runner.converge(described_recipe)
end
it 'upgrades ubuntu-cloud-keyring package' do
expect(chef_run).to upgrade_package 'ubuntu-cloud-keyring'
end
it 'configures openstack repository' do
# Using cookbook(apt) LWRP custom matcher
# https://github.com/sethvargo/chefspec#packaging-custom-matchers
node.set['openstack']['apt']['live_updates_enabled'] = true
expect(chef_run).to add_apt_repository('openstack-ppa').with(
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
components: ['precise-updates/juno', 'main'])
end
it 'disables openstack live updates' do
node.set['openstack']['apt']['live_updates_enabled'] = false
expect(chef_run).to_not add_apt_repository('openstack-ppa').with(
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
components: ['precise-updates/juno', 'main'])
end
end
end