aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2017-10-06 00:54:44 -0400
committerFeng Pan <fpan@redhat.com>2017-10-06 00:54:44 -0400
commit51d315eed319df4e325aed4ed6ae585004273533 (patch)
tree70f69660fdb747405c69756952d9a083386a494f /spec
parentf7af7a686b888828808786a219dbed45c932d130 (diff)
Update honeycomb config for 17.10
In 17.10, honeycomb configuration files are split to multiple json files. Change honeycomb config to write to the new files, also change from using template to augeas. Change-Id: Ie4a1289de261b54f8f8cd71779c58361b9e0f7d3 Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/acceptance/fdio_spec.rb4
-rw-r--r--spec/acceptance/honeycomb_spec.rb12
-rw-r--r--spec/classes/honeycomb_spec.rb23
3 files changed, 25 insertions, 14 deletions
diff --git a/spec/acceptance/fdio_spec.rb b/spec/acceptance/fdio_spec.rb
index 250de9a..293707f 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.1707'
+ repo_branch => 'stable.1710'
}
EOS
@@ -35,7 +35,7 @@ describe 'fdio' do
it 'should work with no errors' do
pp= <<-EOS
class { '::fdio':
- repo_branch => 'stable.1707',
+ repo_branch => 'stable.1710',
vpp_cpu_main_core => '1',
vpp_cpu_corelist_workers => '2',
vpp_vhostuser_coalesce_frames => 32,
diff --git a/spec/acceptance/honeycomb_spec.rb b/spec/acceptance/honeycomb_spec.rb
index 36f8a2e..27358b8 100644
--- a/spec/acceptance/honeycomb_spec.rb
+++ b/spec/acceptance/honeycomb_spec.rb
@@ -17,14 +17,20 @@ describe 'fdio::honeycomb' do
it { should be_installed }
end
- describe file('/opt/honeycomb/config/honeycomb.json') do
+ describe file('/opt/honeycomb/config/credentials.json') do
it { is_expected.to exist }
- its(:content) { should match /"restconf-port":\s+8181/ }
- its(:content) { should match /"restconf-websocket-port":\s+7779/ }
its(:content) { should match /"username":\s+"admin"/}
its(:content) { should match /"password":\s+"admin"/}
end
+ describe file('/opt/honeycomb/config/restconf.json') do
+ it { is_expected.to exist }
+ its(:content) { should match /"restconf-port":\s+8181/ }
+ its(:content) { should match /"restconf-websocket-port":\s+7779/ }
+ its(:content) { should match /"restconf-https-binding-address":\s+"127.0.0.1"/ }
+ its(:content) { should match /"restconf-binding-address":\s+"127.0.0.1"/ }
+ end
+
describe service('honeycomb') do
it { should be_running }
it { should be_enabled }
diff --git a/spec/classes/honeycomb_spec.rb b/spec/classes/honeycomb_spec.rb
index 8fc2252..a1968bf 100644
--- a/spec/classes/honeycomb_spec.rb
+++ b/spec/classes/honeycomb_spec.rb
@@ -14,21 +14,26 @@ describe 'fdio::honeycomb' do
it { should contain_class('fdio::honeycomb') }
it { should contain_class('fdio::install').that_comes_before('Class[fdio::config]') }
it { should contain_package('honeycomb').that_requires('Package[vpp]') }
- it { should contain_file('honeycomb.json').that_requires('Package[honeycomb]') }
- it { should contain_file('honeycomb.json').that_notifies('Service[honeycomb]') }
+ it { should contain_augeas('credential.json').that_requires('Package[honeycomb]') }
+ it { should contain_augeas('credential.json').that_comes_before('Service[honeycomb]') }
+ it { should contain_augeas('restconf.json').that_requires('Package[honeycomb]') }
+ it { should contain_augeas('restconf.json').that_comes_before('Service[honeycomb]') }
it { should contain_service('honeycomb').that_requires('Package[honeycomb]') }
it { should contain_service('honeycomb').that_requires('Service[vpp]') }
- it { should contain_file('honeycomb.json').with(
- 'ensure' => 'file',
- 'path' => '/opt/honeycomb/config/honeycomb.json',
- 'owner' => 'honeycomb',
- 'group' => 'honeycomb',
+ it { should contain_augeas('credential.json').with(
+ 'lens' => 'Json.lns',
+ 'incl' => '/opt/honeycomb/config/credentials.json',
+ )
+ }
+ it { should contain_augeas('restconf.json').with(
+ 'lens' => 'Json.lns',
+ 'incl' => '/opt/honeycomb/config/restconf.json',
)
}
it { should contain_service('honeycomb').with(
- 'ensure' => 'running',
- 'enable' => 'true',
+ 'ensure' => 'running',
+ 'enable' => 'true',
)
}
end