2016-07-03 17:38:21 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'watcher::db::upgrade' do
|
|
|
|
|
|
|
|
shared_examples_for 'watcher-db-manage-upgrade' do
|
|
|
|
|
|
|
|
it 'runs watcher-db-manage' do
|
|
|
|
is_expected.to contain_exec('watcher-db-manage-upgrade').with(
|
2024-03-05 12:32:55 +09:00
|
|
|
:command => 'watcher-db-manage upgrade',
|
2016-07-03 17:38:21 +00:00
|
|
|
:path => '/usr/bin',
|
|
|
|
:user => 'watcher',
|
|
|
|
:refreshonly => 'true',
|
2018-03-16 11:21:20 +08:00
|
|
|
:try_sleep => 5,
|
|
|
|
:tries => 10,
|
2017-04-18 11:39:41 +08:00
|
|
|
:logoutput => 'on_failure',
|
2016-12-01 17:54:42 +08:00
|
|
|
:subscribe => [
|
|
|
|
'Anchor[watcher::install::end]',
|
|
|
|
'Anchor[watcher::config::end]',
|
|
|
|
'Anchor[watcher::db::create_schema::end]',
|
|
|
|
'Anchor[watcher::db::upgrade::begin]'
|
|
|
|
],
|
|
|
|
:notify => 'Anchor[watcher::db::upgrade::end]',
|
2016-07-03 17:38:21 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'overriding extra_params' do
|
|
|
|
let :params do
|
|
|
|
{
|
|
|
|
:extra_params => '--config-file /etc/watcher/watcher01.conf',
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
it {
|
|
|
|
is_expected.to contain_exec('watcher-db-manage-upgrade').with(
|
2017-07-21 04:13:33 +00:00
|
|
|
:command => 'watcher-db-manage --config-file /etc/watcher/watcher01.conf upgrade',
|
2016-07-03 17:38:21 +00:00
|
|
|
:path => '/usr/bin',
|
|
|
|
:user => 'watcher',
|
|
|
|
:refreshonly => 'true',
|
2018-03-16 11:21:20 +08:00
|
|
|
:try_sleep => 5,
|
|
|
|
:tries => 10,
|
2017-04-18 11:39:41 +08:00
|
|
|
:logoutput => 'on_failure',
|
2016-12-01 17:54:42 +08:00
|
|
|
:subscribe => [
|
|
|
|
'Anchor[watcher::install::end]',
|
|
|
|
'Anchor[watcher::config::end]',
|
|
|
|
'Anchor[watcher::db::create_schema::end]',
|
|
|
|
'Anchor[watcher::db::upgrade::begin]'
|
|
|
|
],
|
|
|
|
:notify => 'Anchor[watcher::db::upgrade::end]',
|
2016-07-03 17:38:21 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
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_configures 'watcher-db-manage-upgrade'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|