From 2dd7507d2e7b1be052ad8301f951b50422ee51f0 Mon Sep 17 00:00:00 2001 From: Wojciech Dec Date: Tue, 30 Jan 2018 14:35:45 +0100 Subject: Change fdio repo configuration. - Install repo config only when explicitly passed. This implies that when puppet-fdio is used stand alone, it is expected that user will supply a valid repo_branch parameter. Change-Id: Ic2485a66d4ce4fb921304a39fe65f79abed781f0 Signed-off-by: Wojciech Dec Signed-off-by: Feng Pan --- spec/acceptance/fdio_spec.rb | 4 ++-- spec/classes/fdio_spec.rb | 31 +++++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 6 deletions(-) (limited to 'spec') diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb index 400641b..2f3a8e7 100644 --- a/spec/acceptance/fdio_spec.rb +++ b/spec/acceptance/fdio_spec.rb @@ -7,7 +7,7 @@ describe 'fdio' do it 'should work with no errors' do pp= <<-EOS class { '::fdio': - repo_branch => 'stable.1710' + repo_branch => 'release' } EOS @@ -34,7 +34,7 @@ describe 'fdio' do it 'should work with no errors' do pp= <<-EOS class { '::fdio': - repo_branch => 'stable.1710', + repo_branch => 'release', vpp_cpu_main_core => '1', vpp_cpu_corelist_workers => '2', vpp_vhostuser_coalesce_frames => 32, diff --git a/spec/classes/fdio_spec.rb b/spec/classes/fdio_spec.rb index c14fe87..aa56d1d 100644 --- a/spec/classes/fdio_spec.rb +++ b/spec/classes/fdio_spec.rb @@ -3,7 +3,8 @@ require 'spec_helper' describe 'fdio' do let :params do - {} + { :repo_branch => 'release' + } end shared_examples_for 'fdio - default' do @@ -33,7 +34,7 @@ describe 'fdio' do 'enabled' => 1, ) } - it { should contain_package('vpp').that_requires('Yumrepo[fdio-release]') } + it { should contain_package('vpp') } context 'with stable 16.09 branch' do let(:params) {{:repo_branch => 'stable.1609'}} @@ -42,11 +43,33 @@ describe 'fdio' do should contain_yumrepo('fdio-stable.1609').with( 'baseurl' => 'https://nexus.fd.io/content/repositories/fd.io.stable.1609.centos7/', 'enabled' => 1, - ) + ).that_notifies('Package[vpp]') + } + it { should contain_package('vpp') } + it { should contain_package('vpp-plugins').that_requires('Package[vpp]') } + end + + context 'with empty repo' do + let(:params) {{:repo_branch => ''}} + + it { + is_expected.not_to contain_class('yumrepo') } - it { should contain_package('vpp').that_requires('Yumrepo[fdio-stable.1609]') } + it { should contain_package('vpp') } it { should contain_package('vpp-plugins').that_requires('Package[vpp]') } end + + context 'with none repo' do + let(:params) {{:repo_branch => 'none'}} + + it { + is_expected.not_to contain_class('yumrepo') + } + it { should contain_package('vpp') } + it { should contain_package('vpp-plugins').that_requires('Package[vpp]') } + end + + end shared_examples_for 'fdio - config' do -- cgit 1.2.3-korg