Files
puppet-neutron/spec/classes/neutron_plugins_cisco_ml2_spec.rb
Gael Chamoulaud ac06cb7c96 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: Ida94605916fe26dd4c5fb328f79c4e787d29dcf5
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-19 16:57:59 +01:00

61 lines
1.2 KiB
Ruby

#
# Unit tests for neutron::plugins::ml2 class
#
require 'spec_helper'
describe 'neutron::plugins::ml2::cisco::nexus' do
let :pre_condition do
"class { 'neutron::server': auth_password => 'password'}
class { 'neutron':
rabbit_password => 'passw0rd',
core_plugin => 'neutron.plugins.ml2.plugin.Ml2Plugin' }"
end
let :default_params do
{
:nexus_config => nil
}
end
let :params do
{}
end
let :facts do
{ :osfamily => 'Debian' }
end
context 'fail when missing nexus_config' do
it_raises 'a Puppet::Error', /No nexus config specified/
end
context 'when using cisco' do
let (:nexus_config) do
{ 'cvf2leaff2' => {'username' => 'prad',
"ssh_port" => 22,
"password" => "password",
"ip_address" => "172.18.117.28",
"servers" => {
"control02" => "portchannel:20",
"control01" => "portchannel:10"
}
}
}
end
before :each do
params.merge!(:nexus_config => nexus_config )
end
it 'installs ncclient package' do
is_expected.to contain_package('python-ncclient').with(
:ensure => 'installed'
)
end
end
end