Skip to content

Commit aed2e77

Browse files
committed
Fix for review.
1 parent 3ffff4c commit aed2e77

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/openssl/test_fips.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,25 @@
55

66
class OpenSSL::TestFIPS < OpenSSL::TestCase
77
def test_fips_mode_get_is_true_on_fips_mode_enabled
8-
unless ENV["CI"] && ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"]
9-
omit "Only for on FIPS mode environment on CI"
8+
unless ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"]
9+
omit "Only for FIPS mode environment"
1010
end
1111

1212
assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
13-
assert OpenSSL.fips_mode == true, ".fips_mode returns true on FIPS mode enabled"
13+
assert OpenSSL.fips_mode == true, ".fips_mode should return true on FIPS mode enabled"
1414
end;
1515
end
1616

1717
def test_fips_mode_get_is_false_on_fips_mode_disabled
18-
unless ENV["CI"] && !ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"]
19-
omit "Only for non-FIPS mode environment on CI"
18+
if ENV["TEST_RUBY_OPENSSL_FIPS_ENABLED"]
19+
omit "Only for non-FIPS mode environment"
2020
end
2121

2222
assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
23-
assert OpenSSL.fips_mode == false, ".fips_mode returns false on FIPS mode disabled"
23+
message = ".fips_mode should return false on FIPS mode disabled. " \
24+
"If you run the test on FIPS mode, please set " \
25+
"TEST_RUBY_OPENSSL_FIPS_ENABLED=true"
26+
assert OpenSSL.fips_mode == false, message
2427
end;
2528
end
2629

@@ -35,10 +38,10 @@ def test_fips_mode_get_with_fips_mode_set
3538
assert_separately([{ "OSSL_MDEBUG" => nil }, "-ropenssl"], <<~"end;")
3639
begin
3740
OpenSSL.fips_mode = true
38-
assert OpenSSL.fips_mode == true, ".fips_mode returns true when .fips_mode=true"
41+
assert OpenSSL.fips_mode == true, ".fips_mode should return true when .fips_mode=true"
3942
4043
OpenSSL.fips_mode = false
41-
assert OpenSSL.fips_mode == false, ".fips_mode returns false when .fips_mode=false"
44+
assert OpenSSL.fips_mode == false, ".fips_mode should return false when .fips_mode=false"
4245
rescue OpenSSL::OpenSSLError
4346
pend "Could not set FIPS mode (OpenSSL::OpenSSLError: \#$!); skipping"
4447
end

0 commit comments

Comments
 (0)