Merge "Replace outdated command to create rally db"

This commit is contained in:
Zuul 2023-02-26 17:35:04 +00:00 committed by Gerrit Code Review
commit c9918ca7da
2 changed files with 31 additions and 32 deletions

View File

@ -5,8 +5,8 @@
#
# [*extra_params*]
# (Optional) String of extra command line parameters to append
# to the rally-manage db sync command. These will be inserted
# in the command line between 'rally-manage' and 'db create'.
# to the rally db sync command. These will be inserted in the command line
# between 'rally' and 'db create'.
# Defaults to '--config-file /etc/rally/rally.conf'
#
# [*db_sync_timeout*]
@ -20,8 +20,8 @@ class rally::db::sync(
include rally::deps
exec { 'rally-manage db_sync':
command => "rally-manage ${extra_params} db create",
exec { 'rally db_sync':
command => "rally ${extra_params} db create",
path => '/usr/bin',
user => 'root',
refreshonly => true,

View File

@ -6,9 +6,9 @@ describe 'rally::db::sync' do
it { is_expected.to contain_class('rally::deps') }
it 'runs rally-manage db_sync' do
is_expected.to contain_exec('rally-manage db_sync').with(
:command => 'rally-manage --config-file /etc/rally/rally.conf db create',
it 'runs rally db_sync' do
is_expected.to contain_exec('rally db_sync').with(
:command => 'rally --config-file /etc/rally/rally.conf db create',
:user => 'root',
:path => '/usr/bin',
:refreshonly => 'true',
@ -24,33 +24,32 @@ describe 'rally::db::sync' do
)
end
describe "overriding params" do
let :params do
{
:extra_params => '--config-file /var/lib/rally/rally.conf',
:db_sync_timeout => 750,
context "overriding params" do
let :params do
{
:extra_params => '--config-file /var/lib/rally/rally.conf',
:db_sync_timeout => 750,
}
end
it {
is_expected.to contain_exec('rally db_sync').with(
:command => 'rally --config-file /var/lib/rally/rally.conf db create',
:user => 'root',
:path => '/usr/bin',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 750,
:logoutput => 'on_failure',
:subscribe => ['Anchor[rally::install::end]',
'Anchor[rally::config::end]',
'Anchor[rally::dbsync::begin]'],
:notify => 'Anchor[rally::dbsync::end]',
:tag => 'openstack-db',
)
}
end
it {
is_expected.to contain_exec('rally-manage db_sync').with(
:command => 'rally-manage --config-file /var/lib/rally/rally.conf db create',
:user => 'root',
:path => '/usr/bin',
:refreshonly => 'true',
:try_sleep => 5,
:tries => 10,
:timeout => 750,
:logoutput => 'on_failure',
:subscribe => ['Anchor[rally::install::end]',
'Anchor[rally::config::end]',
'Anchor[rally::dbsync::begin]'],
:notify => 'Anchor[rally::dbsync::end]',
:tag => 'openstack-db',
)
}
end
end
on_supported_os({