Add rspec tests for nova::compute::xenserver
Add missing rspec tests for nova::compute::xenserver Change-Id: I903898292fc2a540eb52e9bb27edcce3368b243f
This commit is contained in:
@@ -6,12 +6,12 @@ class nova::compute::xenserver(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
nova_config {
|
nova_config {
|
||||||
'DEFAULT/compute_driver': value => 'xenapi.XenAPIDriver';
|
'DEFAULT/compute_driver': value => 'xenapi.XenAPIDriver';
|
||||||
'DEFAULT/connection_type': value => 'xenapi';
|
'DEFAULT/connection_type': value => 'xenapi';
|
||||||
'DEFAULT/xenapi_connection_url': value => $xenapi_connection_url;
|
'DEFAULT/xenapi_connection_url': value => $xenapi_connection_url;
|
||||||
'DEFAULT/xenapi_connection_username': value => $xenapi_connection_username;
|
'DEFAULT/xenapi_connection_username': value => $xenapi_connection_username;
|
||||||
'DEFAULT/xenapi_connection_password': value => $xenapi_connection_password;
|
'DEFAULT/xenapi_connection_password': value => $xenapi_connection_password;
|
||||||
'DEFAULT/xenapi_inject_image': value => $xenapi_inject_image;
|
'DEFAULT/xenapi_inject_image': value => $xenapi_inject_image;
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'xenapi':
|
package { 'xenapi':
|
||||||
|
29
spec/classes/nova_compute_xenserver_spec.rb
Normal file
29
spec/classes/nova_compute_xenserver_spec.rb
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
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
|
||||||
|
should contain_nova_config('DEFAULT/compute_driver').with_value('xenapi.XenAPIDriver')
|
||||||
|
should contain_nova_config('DEFAULT/connection_type').with_value('xenapi')
|
||||||
|
should contain_nova_config('DEFAULT/xenapi_connection_url').with_value(params[:xenapi_connection_url])
|
||||||
|
should contain_nova_config('DEFAULT/xenapi_connection_username').with_value(params[:xenapi_connection_username])
|
||||||
|
should contain_nova_config('DEFAULT/xenapi_connection_password').with_value(params[:xenapi_connection_password])
|
||||||
|
should contain_nova_config('DEFAULT/xenapi_inject_image').with_value(false)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'installs xenapi with pip' do
|
||||||
|
should contain_package('xenapi').with(
|
||||||
|
:ensure => 'present',
|
||||||
|
:provider => 'pip'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Reference in New Issue
Block a user