classification
Title: test_ssl: try more protocols in test_options()
Type: enhancement Stage: patch review
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, marcosptf, martin.panter, r.david.murray
Priority: normal Keywords: patch

Created on 2015-08-24 23:18 by marcosptf, last changed 2016-09-08 15:39 by christian.heimes. This issue is now closed.

Files
File name Uploaded Description Edit
test_options.patch marcosptf, 2015-08-24 23:18 test fixed from test_ssl.py review
Messages (6)
msg249078 - (view) Author: marcos paulo (marcosptf) * Date: 2015-08-24 23:18
Hello to everyone!!!

This test https://hg.python.org/cpython/file/2.7/Lib/test/test_ssl.py on method
ContextTests.test_options, is broker becouse has a error between lines 717 ~ 719;

On 717 line, has a comment about # OP_ALL | OP_NO_SSLv2 is the default value, but
it's not true, becouse this method is fail when i run it => 
py.test Lib/test/test_ssl.py -k ContextTests 
results ===>
https://hg.python.org/cpython/file/2.7/Lib/test/test_ssl.py#l717
*** AssertionError: 2164261887 != 2197816319L

I fixed this method and i wrote new cases about test_options using a lot of options 
from ssl.PROTOCOL, for example:
ssl.PROTOCOL_TLSv1                 
ssl.PROTOCOL_TLSv1_1                
ssl.PROTOCOL_TLSv1_2
ssl.PROTOCOL_SSLv2                
ssl.PROTOCOL_SSLv23
ssl.PROTOCOL_SSLv3  


on this test_options.patch, is the test fixed!

thanks
Att

:-)
marcosptf
msg249094 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-08-25 01:14
Most likely you ran the test using a different version of python from the one the test is from.  All the tests in that file pass on our buildbots when run by the python version they are for.
msg249096 - (view) Author: marcos paulo (marcosptf) * Date: 2015-08-25 01:29
the version that i ran the test, is python 2.7.10
msg249097 - (view) Author: marcos paulo (marcosptf) * Date: 2015-08-25 01:38
anyway, this changes that i did, make this test more resilent!
this test now is more complete than before!

:-)
msg258774 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-21 22:24
Your patch removes the testing of getting ctx.options. However, OP_NO_SSLv3 was enabled by default and added to the test in Issue 25530, so I suspect that problem is no longer valid.

I guess that leaves the rest of your patch which exercises other protocol values.
msg275053 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2016-09-08 15:39
This ticket is no longer relevant. All but TLS_METHOD (old name SSLv23_METHOD) have been deprecated by OpenSSL. In the future Python will use auto-negotiation.
History
Date User Action Args
2016-09-08 15:39:40christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg275053

resolution: out of date
2016-01-21 22:24:52martin.pantersettype: crash -> enhancement
components: + Tests, - Library (Lib)
title: test_ssl broker was fixed -> test_ssl: try more protocols in test_options()
nosy: + martin.panter

messages: + msg258774
stage: patch review
2015-08-25 01:38:20marcosptfsetmessages: + msg249097
2015-08-25 01:29:18marcosptfsetmessages: + msg249096
2015-08-25 01:14:40r.david.murraysetnosy: + r.david.murray
messages: + msg249094
2015-08-24 23:20:39marcosptfsettitle: fix -> test_ssl broker was fixed
2015-08-24 23:18:03marcosptfcreate