Skip to content

Commit 76b35d7

Browse files
committed
(maint) Change acceptance digest to SHA256
The default digest algorithm was changed in puppet 7 to sha256.[1] Update the acceptance test to work regardless of puppet version. [1] puppetlabs/puppet#8315
1 parent 69cb79c commit 76b35d7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

spec/acceptance/tests/yumrepo_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ def resource(host, type, name)
5858
resource(agent, 'file', deps_repo) do |res|
5959
# absent removes the entry, leaving an empty file with a known checksum
6060
assert_equal(res['ensure'], 'file')
61-
assert_equal(res['content'], '{md5}d41d8cd98f00b204e9800998ecf8427e')
61+
62+
# Puppet 7 uses SHA256 as the default digest algorithm
63+
if on(agent, puppet('--version')).stdout =~ %r{^7\.}
64+
assert_equal(res['content'], '{sha256}e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
65+
else
66+
assert_equal(res['content'], '{md5}d41d8cd98f00b204e9800998ecf8427e')
67+
end
6268
end
6369
end
6470

0 commit comments

Comments
 (0)