Bug 1444929

Summary: ruby self-test failing on File primitives
Product: Red Hat Enterprise Linux 6 Reporter: Neil Wilson <neil>
Component: rubyAssignee: ruby maint <ruby-maint>
Status: CLOSED NOTABUG QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.9CC: vondruch
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-24 16:04:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of self-test none

Description Neil Wilson 2017-04-24 14:46:35 UTC
Created attachment 1273629 [details]
Output of self-test

Description of problem:

After some oddities arose with the File primitives on ruby 1.8.7 we rebuilt the srpm and found that the self test is not passing - including some of the file primitives. 


Version-Release number of selected component (if applicable):

Version     : 1.8.7.374
Release     : 5.el6


How reproducible:

always

Steps to Reproduce:

1. install source rpm
   - rpm -ihv ruby-1.8.7.374-5.el6.src.rpm

3. change directory into rpm topdir
   - cd ~/rpmbuild

3. build it
   - rpmbuild -vv -bc SPECS/ruby.spec

4. execute self-test
   - make -C BUILD/ruby-1.8.7.374/ruby-1.8.7-p374 check
  
Actual results:

2310 tests, 1673100 assertions, 12 failures, 2 errors
make: *** [test-all] Error 1


Expected results:

X tests, Y assertions, 0 failures, 0 errors


Additional info:

Output of self-test is attached.

Comment 2 Neil Wilson 2017-04-24 14:48:56 UTC
Bug https://bugzilla.redhat.com/show_bug.cgi?id=635588 and https://bugzilla.redhat.com/show_bug.cgi?id=602435#c44 suggest that the self-test has passed cleanly earlier in the RHEL6 cycle.

Comment 3 Vít Ondruch 2017-04-24 16:04:04 UTC
Hi Niel,

Thanks for your report.

(In reply to Neil Wilson from comment #2)
> Bug https://bugzilla.redhat.com/show_bug.cgi?id=635588 and
> https://bugzilla.redhat.com/show_bug.cgi?id=602435#c44 suggest that the
> self-test has passed cleanly earlier in the RHEL6 cycle.

Quite contrary, the test suite of Ruby 1.8.7 never passed. Initially, there was just small subset of the test suite enabled, which probably passed, while later the more thorough "test-all" was enabled and the test suite never passed.

The latest ruby-1.8.7.374-5.el6 finished with this test suite result:

~~~
2310 tests, 1673012 assertions, 3 failures, 51 errors
make: *** [test-all] Error 1
~~~

where the majority of the test failures were WSDL/SOAP issues caused by missing network connectivity of our build infrastructure.

Please also note the test suite instability. The number of test failures is slightly changing from build to build.

Nevertheless I just compared you log with the output of the last build and non of the "TestFileExhaustive" failed, so it probably depends on your setup. I am going to close this ticket as WONTFIX ATM, but please don't hesitate to reopen this ticket (or preferably contact RH support to help us prioritize) in case you have you need more help.

Comment 4 Neil Wilson 2017-04-24 16:12:09 UTC
I've done a bit more digging and it turns out that the build has to run as a non-privileged user *and* have a prior version of ruby installed (some tests depends upon /usr/bin/ruby). 

If you set that up you get:

Finished in 465.549782 seconds.

  1) Error:
test_sign_and_verify(OpenSSL::TestX509Certificate):
OpenSSL::X509::CertificateError: unknown message digest algorithm
    ./test/openssl/test_x509cert.rb:162:in `verify'
    ./test/openssl/test_x509cert.rb:162:in `test_sign_and_verify'

  2) Error:
test_sign_and_verify(OpenSSL::TestX509Request):
OpenSSL::X509::RequestError: unknown message digest algorithm
    ./test/openssl/test_x509req.rb:132:in `verify'
    ./test/openssl/test_x509req.rb:132:in `test_sign_and_verify'

2310 tests, 1673114 assertions, 0 failures, 2 errors
make: *** [test-all] Error 1
make: Leaving directory `/home/mockbuild/rpmbuild/BUILD/ruby-1.8.7.374/ruby-1.8.7-p374'

but if there's no interest in fixing those tests at this stage in the cycle, I'll leave it there.

Thanks.

Comment 5 Vít Ondruch 2017-04-25 06:52:43 UTC
(In reply to Neil Wilson from comment #4)
> I've done a bit more digging and it turns out that the build has to run as a
> non-privileged user

Yes, that is right.

> *and* have a prior version of ruby installed (some tests
> depends upon /usr/bin/ruby).

I'm not sure this is needed. It is definitely not needed for Ruby 2.x. Anyway, if this is the case, this is no-go for Ruby SRPM and I'd need to tweak/disable those tests.
 
> If you set that up you get:
> 
> Finished in 465.549782 seconds.
> 
>   1) Error:
> test_sign_and_verify(OpenSSL::TestX509Certificate):
> OpenSSL::X509::CertificateError: unknown message digest algorithm
>     ./test/openssl/test_x509cert.rb:162:in `verify'
>     ./test/openssl/test_x509cert.rb:162:in `test_sign_and_verify'
> 
>   2) Error:
> test_sign_and_verify(OpenSSL::TestX509Request):
> OpenSSL::X509::RequestError: unknown message digest algorithm
>     ./test/openssl/test_x509req.rb:132:in `verify'
>     ./test/openssl/test_x509req.rb:132:in `test_sign_and_verify'
> 
> 2310 tests, 1673114 assertions, 0 failures, 2 errors
> make: *** [test-all] Error 1
> make: Leaving directory
> `/home/mockbuild/rpmbuild/BUILD/ruby-1.8.7.374/ruby-1.8.7-p374'

These two appears to be related to the latest OpenSSL. The last official build was done against openssl-1.0.1e-48.el6_8.3 and the test passed at that time. Now I am testing with openssl-1.0.1e-57.el6 and these two apparently fails :/

If I may guess, this is related to "- deprecate and disable verification of insecure hash algorithms" change in OpenSSL. In this case, this is very likely issue of the test suite, which is testing weak digest algorithms now disabled in OpenSSL. This is not a reason for fix ATM, since it does not impact runtime.