Merge "Add support for setting a timeout for service_validation"

This commit is contained in:
Jenkins
2016-09-20 20:56:10 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -37,6 +37,10 @@
# The provider to use for the exec command;
# string; optional; default to 'shell'
#
# [*timeout*]
# The maximum time the command should take;
# string; optional; default to '60'
#
# [*tries*]
# Number of times to retry validation;
# string; optional; default to '10'
@@ -62,6 +66,7 @@ define openstacklib::service_validation(
$try_sleep = '2',
$onlyif = undef,
$unless = undef,
$timeout = '60',
) {
if $onlyif and $unless {
@@ -72,6 +77,7 @@ define openstacklib::service_validation(
path => $path,
provider => $provider,
command => $command,
timeout => $timeout,
tries => $tries,
try_sleep => $try_sleep,
onlyif => $onlyif,

View File

@@ -36,6 +36,7 @@ describe 'openstacklib::service_validation' do
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
:provider => 'shell',
:command => 'nova list',
:timeout => '60',
:tries => '10',
:try_sleep => '2',
:logoutput => 'on_failure',
@@ -56,6 +57,7 @@ describe 'openstacklib::service_validation' do
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
:provider => 'shell',
:command => 'nova list',
:timeout => '60',
:tries => '10',
:try_sleep => '2',
:unless => 'pwd',
@@ -76,6 +78,7 @@ describe 'openstacklib::service_validation' do
:path => '/usr/bin:/bin:/usr/sbin:/sbin',
:provider => 'shell',
:command => 'nova list',
:timeout => '60',
:tries => '10',
:try_sleep => '2',
:onlyif => 'pwd',