Files
puppet-nova/spec/classes/nova_compute_xenserver_spec.rb
Sebastien Badia b8a187f54c spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the
rspec-puppet release 2.0.0, in the mean time, we update rspec syntax
order to be prepared for rspec 3.x move.

In details:

 * Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
 * Use shared_examples "a Puppet::Error" for puppet::error tests *
 * Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x) *
 * Fix spec tests for rspec-puppet 2.0.0
 * Clean Gemfile (remove over-specificication of runtime deps of puppetlabs_spec_helper)

Change-Id: I172439c6ed185bb38b325b2524cab1475cdc7504
2015-03-19 18:45:08 +01:00

30 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'nova::compute::xenserver' do
let :params do
{ :xenapi_connection_url => 'https://127.0.0.1',
:xenapi_connection_username => 'root',
:xenapi_connection_password => 'passw0rd' }
end
context 'with required parameters' do
it 'configures xenapi in nova.conf' do
is_expected.to contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.XenAPIDriver')
is_expected.to contain_nova_config('DEFAULT/connection_type').with_value('xenapi')
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_url').with_value(params[:xenapi_connection_url])
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_username').with_value(params[:xenapi_connection_username])
is_expected.to contain_nova_config('DEFAULT/xenapi_connection_password').with_value(params[:xenapi_connection_password])
is_expected.to contain_nova_config('DEFAULT/xenapi_inject_image').with_value(false)
end
it 'installs xenapi with pip' do
is_expected.to contain_package('xenapi').with(
:ensure => 'present',
:provider => 'pip'
)
end
end
end