- Shell 94.2%
- Ruby 5.8%
Add a test to test Ruby OpenSSL to respect cypto-policies TLS minimal version, and test the issue identified at the ticket RHEL-21019. https://issues.redhat.com/browse/RHEL-21019 If Ruby OpenSSL doesn't include the following upstream patch, the test fails as follows. https://github.com/ruby/openssl/pull/710 ``` $ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide tests -n '^/tls-minimal-version$' /var/tmp/tmt/run-007 ... total: 1 test failed $ tmt run --id run-007 report -vvv ... :: [ 16:03:29 ] :: [ BEGIN ] :: Running Ruby OpenSSL client :: actually running 'ruby /var/tmp/tmt/run-007/plans/all/discover/default-0/tests/tls-minimal-version/test.rb -v' STDOUT: Loaded suite /var/tmp/tmt/run-007/plans/all/discover/default-0/tests/tls-minimal-version/test STDOUT: Started STDOUT: TestRubyOpenSSLTLSMin: STDOUT: test_connection_to_tls_1_2_server_to_fail: F STDOUT: =============================================================================== STDOUT: Failure: test_connection_to_tls_1_2_server_to_fail(TestRubyOpenSSLTLSMin): <OpenSSL::SSL::SSLError> exception was expected but none was thrown. STDOUT: /var/tmp/tmt/run-007/plans/all/discover/default-0/tests/tls-minimal-version/test.rb:13:in `test_connection_to_tls_1_2_server_to_fail' STDOUT: 10: STDOUT: 11: class TestRubyOpenSSLTLSMin < Test::Unit::TestCase STDOUT: 12: def test_connection_to_tls_1_2_server_to_fail STDOUT: => 13: assert_raise_with_message(OpenSSL::SSL::SSLError, STDOUT: 14: /tlsv1 alert protocol version/) do STDOUT: 15: connect(CONFIG_ITEMS[:tls_1_2][:host], CONFIG_ITEMS[:tls_1_2][:port]) STDOUT: 16: end STDOUT: =============================================================================== STDOUT: : (0.075125) STDOUT: test_onnection_to_tls_1_3_server_to_pass: .: (0.013862) STDOUT: STDOUT: Finished in 0.089378126 seconds. STDOUT: ------------------------------------------------------------------------------- STDOUT: 2 tests, 2 assertions, 1 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications STDOUT: 50% passed STDOUT: ------------------------------------------------------------------------------- STDOUT: 22.38 tests/s, 22.38 assertions/s :: [ 16:03:30 ] :: [ FAIL ] :: Running Ruby OpenSSL client (Expected 0, got 1) ... total: 1 test failed ``` |
||
|---|---|---|
| .fmf | ||
| run-basic-rails-application | ||
| Sanity/native-extension-gem-is-installed-without-error | ||
| systemtap-static-probes-in-ruby | ||
| tls-minimal-version | ||
| .gitignore | ||
| main.fmf | ||
| plans.fmf | ||
| README.md | ||
Shared ruby tests
This repository contains shared ruby tests.
Contributing
Testing
You can run the tests in your local environment.
Install tmt.
$ sudo dnf install tmt+all
Run the following command to run the tests for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide
/var/tmp/tmt/run-NNN
...
The tmt's provisioning method virtual (tmt run provision -h virtual) must be used, otherwise the tests fail due to known issues with container provisioning method (tmt run provision -h container). Also note the run-NNN printed on the output of the command. This represents the run ID used with tmt run --id option in later steps.
Run the following command to see the report, setting the value of the above run ID to the --id option. As this repository doesn't have tmt's plans to run the tests, we need to set the plans --default to use the default plans. See this tmt's document about the tmt run report options.
$ tmt run --id run-NNN report -vvv
Running a specific test
You can run a specific test.
List available tests.
$ tmt tests ls
/Sanity/native-extension-gem-is-installed-without-error/ruby25
/Sanity/native-extension-gem-is-installed-without-error/ruby26
/Sanity/native-extension-gem-is-installed-without-error/ruby27
/Sanity/native-extension-gem-is-installed-without-error/ruby30
/Sanity/native-extension-gem-is-installed-without-error/ruby31
/Sanity/native-extension-gem-is-installed-without-error/system
/run-basic-rails-application
/systemtap-static-probes-in-ruby
Run the following command to run a specific test with -n option to specify a regular expression to match the test name for Fedora rawhide:
$ tmt -c distro=fedora-rawhide run --all provision -h virtual -i fedora-rawhide tests -n '^/systemtap-static-probes-in-ruby$'