Skip to content

Commit b75c44f

Browse files
committed
(PUP-12047) Add test to ensure MD5 checksum is skipped for FIPS
This commit adds a test to http_metadata_spec.rb that checks that the MD5 checksum type is skipped in the collect method on FIPS enabled platforms.
1 parent 36bdec0 commit b75c44f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/unit/file_serving/http_metadata_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@
2929
expect( metadata.mode ).to be_nil
3030
end
3131

32+
it "skips md5 checksum type in collect on FIPS enabled platforms" do
33+
allow(Puppet::Util::Platform).to receive(:fips_enabled?).and_return(true)
34+
metadata = described_class.new(http_response)
35+
allow(http_response).to receive(:[]).with('X-Checksum-Md5').and_return("c58989e9740a748de4f5054286faf99b")
36+
metadata.collect
37+
expect( metadata.checksum_type ).to eq :mtime
38+
end
39+
3240
context "with no Last-Modified or Content-MD5 header from the server" do
3341
it "should use :mtime as the checksum type, based on current time" do
3442
# Stringifying Time.now does some rounding; do so here so we don't end up with a time

0 commit comments

Comments
 (0)