puppet-cinder/spec/defines/cinder_backend_veritas_hyperscale_spec.rb
SolKuczala ae0c571a52 Convert specs to RSpec 3.8.0 syntax with Transpec
This conversion is done by Transpec 3.4.0
This patch complements c09a93456e
adding all files inside defines/ dir.

Partial-Bug: #1816857
Change-Id: Ic00f8b38c5b84ff19fc945512f4f13aa11221c8b
2019-03-08 20:18:29 +00:00

56 lines
1.6 KiB
Ruby

require 'spec_helper'
describe 'cinder::backend::veritas_hyperscale' do
let (:title) { 'Veritas_HyperScale' }
let :params do
{
:backend_availability_zone => 'my_zone',
:manage_volume_type => true,
}
end
shared_examples 'cinder::backend::veritas_hyperscale' do
it { is_expected.to contain_cinder_config("#{title}/volume_driver").with(
:value => 'cinder.volume.drivers.veritas.vrtshyperscale.HyperScaleDriver'
)}
it {
is_expected.to contain_cinder_config("#{title}/volume_backend_name").with_value(title)
is_expected.to contain_cinder_config("#{title}/backend_availability_zone").with_value('my_zone')
is_expected.to contain_cinder_config("#{title}/image_volume_cache_enabled").with_value(true)
}
context 'veritas_hyperscale backend with additional configuration' do
before do
params.merge!( :extra_options => {"#{title}/param1" => {'value' => 'value1'}} )
end
it { is_expected.to contain_cinder_config("#{title}/param1").with_value('value1') }
end
context 'veritas_hyperScale backend with cinder type' do
before :each do
params.merge!( :manage_volume_type => true )
end
it { is_expected.to contain_cinder_type(title).with(
:ensure => 'present',
:properties => ["volume_backend_name=#{title}"]
)}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'cinder::backend::veritas_hyperscale'
end
end
end