Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Update tests so that disabled tls tests just pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
arscan committed Nov 14, 2018
1 parent f2b6556 commit d29c06e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
9 changes: 1 addition & 8 deletions lib/app/sequences/01_conformance_sequence.rb
Expand Up @@ -62,14 +62,7 @@ class ConformanceSequence < SequenceBase
)
}

if @disable_tls_tests
skip 'TLS tests have been disabled by configuration.', %(
Inferno allows users to disable TLS testing if they are using a network configuration
that prevents TLS from tested properly.
)

end
skip_if_tls_disabled

assert_tls_1_2 @instance.url

Expand Down
4 changes: 2 additions & 2 deletions lib/app/sequences/03_patient_standalone_launch_sequence.rb
Expand Up @@ -23,7 +23,7 @@ class StandaloneLaunchSequence < SequenceBase
)
}

skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
skip_if_tls_disabled
assert_tls_1_2 @instance.oauth_authorize_endpoint
warning {
assert_deny_previous_tls @instance.oauth_authorize_endpoint
Expand Down Expand Up @@ -92,7 +92,7 @@ class StandaloneLaunchSequence < SequenceBase
)
}

skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
skip_if_tls_disabled
assert_tls_1_2 @instance.oauth_token_endpoint
warning {
assert_deny_previous_tls @instance.oauth_token_endpoint
Expand Down
4 changes: 2 additions & 2 deletions lib/app/sequences/04_provider_ehr_launch_sequence.rb
Expand Up @@ -56,7 +56,7 @@ class EHRLaunchSequence < SequenceBase
)
}

skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
skip_if_tls_disabled
assert_tls_1_2 @instance.oauth_authorize_endpoint
warning {
assert_deny_previous_tls @instance.oauth_authorize_endpoint
Expand Down Expand Up @@ -120,7 +120,7 @@ class EHRLaunchSequence < SequenceBase
)
}

skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
skip_if_tls_disabled
assert_tls_1_2 @instance.oauth_token_endpoint
warning {
assert_deny_previous_tls @instance.oauth_token_endpoint
Expand Down
2 changes: 1 addition & 1 deletion lib/app/sequences/06_token_introspection_sequence.rb
Expand Up @@ -22,7 +22,7 @@ class TokenIntrospectionSequence < SequenceBase
)
}

skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
skip_if_tls_disabled
assert_tls_1_2 @instance.oauth_introspection_endpoint
warning {
assert_deny_previous_tls @instance.oauth_introspection_endpoint
Expand Down
2 changes: 1 addition & 1 deletion lib/app/utils/skip_helpers.rb
Expand Up @@ -8,7 +8,7 @@ def skip_if_not_supported(resource, methods)
end

def skip_if_tls_disabled
skip 'TLS tests have been disabled by configuration.' if @disable_tls_tests
pass 'Test has passed because TLS tests have been disabled by configuration.' if @disable_tls_tests
end

def skip_if_url_invalid(url, url_name, details = nil)
Expand Down
3 changes: 1 addition & 2 deletions test/sequence/conformance_test.rb
Expand Up @@ -38,8 +38,7 @@ def test_no_metadata_endpoint

sequence_result = @sequence.start
assert sequence_result.result == 'fail'
assert sequence_result.test_results.select{|r| !r.required}.length == 2 #TLS and SMART capabilities
assert sequence_result.test_results.all?{|r| r.result == 'fail' || r.result == 'skip' || !r.required}
assert sequence_result.test_results.select{|r| !r.required}.length == 1 #SMART capabilities
end

end
2 changes: 1 addition & 1 deletion test/sequence/token_introspection_test.rb
Expand Up @@ -97,7 +97,7 @@ def test_no_introspection_endpoint
assert_requested(stub_refresh_register)

assert sequence_result.result == 'fail', 'Sequence should fail.'
assert sequence_result.test_results.all?{|r| r.result == 'fail' || r.result == 'skip'}, 'All tests should fail.'
assert sequence_result.test_results.select{|r| r.result == 'pass'}.length == 1, 'Only one test should pass (the tls testing sequence).'
end

def test_inactive
Expand Down

0 comments on commit d29c06e

Please sign in to comment.