Skip to content

Commit

Permalink
Merge pull request puppetlabs#9407 from AriaXLi/skip_md5_collect_test
Browse files Browse the repository at this point in the history
(PUP-12047) Add test to ensure MD5 checksum is skipped for FIPS
  • Loading branch information
joshcooper authored Jul 2, 2024
2 parents a1616ca + fa721be commit 7739378
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/unit/file_serving/http_metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@
expect( metadata.mode ).to be_nil
end

it "skips md5 checksum type in collect on FIPS enabled platforms" do
allow(Puppet::Util::Platform).to receive(:fips_enabled?).and_return(true)
http_response['X-Checksum-Md5'] = 'c58989e9740a748de4f5054286faf99b'
metadata = described_class.new(http_response)
metadata.collect
expect( metadata.checksum_type ).to eq :mtime
end

context "with no Last-Modified or Content-MD5 header from the server" do
it "should use :mtime as the checksum type, based on current time" do
# Stringifying Time.now does some rounding; do so here so we don't end up with a time
Expand Down

0 comments on commit 7739378

Please sign in to comment.