aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorWojciech Dec <wdec@cisco.com>2018-01-30 14:35:45 +0100
committerFeng Pan <fpan@redhat.com>2018-06-10 21:19:52 -0400
commit2dd7507d2e7b1be052ad8301f951b50422ee51f0 (patch)
treebf78eeabba48e7615f087ec5f734d373abf39e72 /spec
parent13398d85161374a062b958dbf30596b29b8629e5 (diff)
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 <wdec@cisco.com> Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/fdio_spec.rb4
-rw-r--r--spec/classes/fdio_spec.rb31
2 files changed, 29 insertions, 6 deletions
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