update ticket_* tests for 3.2
This commit is contained in:
Родитель
efb3fc402b
Коммит
7b515e4845
|
@ -1,8 +1,8 @@
|
|||
test_name "#6857: redact password hashes when applying in noop mode"
|
||||
|
||||
hosts_to_test = agents.reject do |agent|
|
||||
if agent['platform'].match /(?:ubuntu|centos|debian|el-)/
|
||||
result = on(agent, %q{ruby -e 'require "shadow" or raise'}, :silent => true)
|
||||
if agent['platform'].match /(?:ubuntu|centos|debian|el-|fc-)/
|
||||
result = on(agent, %Q{#{agent['puppetbindir']}/ruby -e 'require "shadow" or raise'}, :silent => true)
|
||||
result.exit_code != 0
|
||||
else
|
||||
false
|
||||
|
|
|
@ -14,7 +14,9 @@ TYPE
|
|||
|
||||
on agent, "cat > #{dir}/lib/puppet/provider/test6907/only.rb", :stdin => <<PROVIDER
|
||||
Puppet::Type.type(:test6907).provide(:only) do
|
||||
commands :anything => "#{dir}/must_exist"
|
||||
# The name of the file is chosen to be *.exe so it works on windows and *nix
|
||||
# becasue windows inspects the PATHEXT environment variable in 1.9.3 and later.
|
||||
commands :anything => "#{dir}/must_exist.exe"
|
||||
require 'fileutils'
|
||||
|
||||
def file
|
||||
|
@ -32,7 +34,9 @@ PROVIDER
|
|||
file => "#{dir}/test_file",
|
||||
}
|
||||
|
||||
file { "#{dir}/must_exist":
|
||||
# The name of the file is chosen to be *.exe so it works on windows and *nix
|
||||
# becasue windows inspects the PATHEXT environment variable in 1.9.3 and later.
|
||||
file { "#{dir}/must_exist.exe":
|
||||
ensure => file,
|
||||
mode => 0755,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
test_name "Bug #7165: Don't refresh service immediately after starting it"
|
||||
|
||||
confine :except, :platform => 'windows'
|
||||
|
||||
agents.each do |host|
|
||||
dir = host.tmpdir('7165-no-refresh')
|
||||
|
||||
manifest = %Q{
|
||||
file { "#{dir}/notify":
|
||||
content => "foo",
|
||||
notify => Service["service"],
|
||||
}
|
||||
|
||||
service { "service":
|
||||
ensure => running,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
status => "test -e #{dir}/service",
|
||||
start => "touch #{dir}/service",
|
||||
stop => "rm -f #{dir}/service",
|
||||
restart => "touch #{dir}/service_restarted",
|
||||
require => File["#{dir}/notify"],
|
||||
provider => base,
|
||||
}
|
||||
}
|
||||
|
||||
apply_manifest_on(host, manifest) do
|
||||
on(host, "test -e #{dir}/service")
|
||||
# service should not restart, since it wasn't running to begin with
|
||||
on(host, "test -e #{dir}/service_restarted", :acceptable_exit_codes => [1])
|
||||
end
|
||||
|
||||
# will trigger a notify next time as the file changes
|
||||
on(host, "echo bar > #{dir}/notify")
|
||||
|
||||
apply_manifest_on(host, manifest) do
|
||||
on(host, "test -e #{dir}/service")
|
||||
# service should restart this time
|
||||
on(host, "test -e #{dir}/service_restarted")
|
||||
end
|
||||
end
|
Загрузка…
Ссылка в новой задаче