@@ -29,20 +29,6 @@ function ct_pull_or_import_postgresql() {
2929 fi
3030}
3131
32- # "0" if system is not FIPS enabled, "1" if it is.
33- function fips_enabled() {
34- local is_fips_enabled
35-
36- # Read fips mode from host in case exists
37- if [[ -f /proc/sys/crypto/fips_enabled ]]; then
38- is_fips_enabled=$( cat /proc/sys/crypto/fips_enabled)
39- else
40- is_fips_enabled=" 0"
41- fi
42-
43- return " $is_fips_enabled "
44- }
45-
4632function rails_ex_branch() {
4733 # Ruby 3.3 introduced too many incompatibilities to be able
4834 # to use the same Gemfile for RHEL 7 and also newer RHELs.
@@ -60,10 +46,6 @@ function rails_ex_branch() {
6046 echo " $rails_example_repo_branch "
6147}
6248
63- run_s2i_build_fips () {
64- ct_s2i_build_as_df file://${test_dir} /test-fips ${IMAGE_NAME} ${IMAGE_NAME} -testfips ${s2i_args} $1
65- }
66-
6749function run_test_application() {
6850 case " $1 " in
6951 fips)
@@ -77,33 +59,6 @@ function run_test_application() {
7759 esac
7860}
7961
80- function test_run_fips_app() {
81- # Verify that the HTTP connection can be established to test application container
82- run_test_application fips
83- # Wait for the container to write it's CID file
84- wait_for_cid
85- ct_test_response " http://localhost:4567/symmetric/aes-256-cbc" 200 " "
86- ct_test_response " http://localhost:4567/symmetric/des-ede-cbc" 200 " "
87- ct_test_response " http://localhost:4567/symmetric/sha256" 200 " "
88- ct_test_response " http://localhost:4567/symmetric/md5" 200 " "
89- curl " http://localhost:4567/"
90- ct_check_testcase_result $?
91- kill_test_application
92- }
93-
94- function test_ruby_fips_mode() {
95- if [[ " $( fips_enabled) " == " 0" ]]; then
96- # FIPS disabled -> OpenSSL#fips_enabled returns false
97- echo " Fips should be disabled"
98- docker run --rm " $IMAGE_NAME " /bin/bash -c ' ruby -ropenssl -e "exit !OpenSSL.fips_enabled"'
99- ct_check_testcase_result " $? "
100- else
101- echo " Fips should be enabled"
102- # FIPS enabled -> OpenSSL#fips_enabled returns true
103- docker run --rm " $IMAGE_NAME " /bin/bash -c ' ruby -ropenssl -e "exit OpenSSL.fips_enabled"'
104- ct_check_testcase_result " $? "
105- fi
106- }
10762
10863function test_ruby_integration() {
10964 ct_os_test_s2i_app " ${IMAGE_NAME} " \
0 commit comments