summaryrefslogtreecommitdiffstats
path: root/acceptance
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-07-22 13:21:12 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-07-22 13:21:12 -0700
commitf309e1e45c456cc1d53469863f59cbad0df37241 (patch)
tree447c4a02bad6f0f04a79d3dba9b2e3a88357e3e8 /acceptance
parent5e2a3d200b74eef9549e3e2a5bdbe2a23ae7fac1 (diff)
parent69acbb026145f7c5042cbb32ea0fbcfe88865897 (diff)
downloadpuppet-f309e1e45c456cc1d53469863f59cbad0df37241.tar.gz
puppet-f309e1e45c456cc1d53469863f59cbad0df37241.tar.xz
puppet-f309e1e45c456cc1d53469863f59cbad0df37241.zip
Merge branch '2.6.x' into 2.7.x
* 2.6.x: Confine password disclosure acceptance test to hosts with required libraries
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb b/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb
index f1e100c2e..d3b415691 100644
--- a/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb
+++ b/acceptance/tests/ticket_6857_password-disclosure-when-changing-a-users-password.rb
@@ -1,5 +1,15 @@
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|rhel)/
+ result = on(agent, %q{ruby -e 'require "shadow" or raise'}, :silent => true)
+ result.exit_code != 0
+ else
+ false
+ end
+end
+skip_test "No suitable hosts found" if hosts_to_test.empty?
+
adduser_manifest = <<MANIFEST
user { 'passwordtestuser':
ensure => 'present',
@@ -15,9 +25,9 @@ user { 'passwordtestuser':
}
MANIFEST
-apply_manifest_on(agents, adduser_manifest )
-results = apply_manifest_on(agents, changepass_manifest )
+apply_manifest_on(hosts_to_test, adduser_manifest )
+results = apply_manifest_on(hosts_to_test, changepass_manifest )
results.each do |result|
- assert_match( /current_value \[old password hash redacted\], should be \[new password hash redacted\]/ , "#{result.stdout}" )
+ assert_match( /current_value \[old password hash redacted\], should be \[new password hash redacted\]/ , "#{result.host}: #{result.stdout}" )
end