Previously some tests were ignored under python 3 environment, this was
due to some design changes introduced by python 3.7 [1] in the SSL
module of the stdlib. These changes reactivate some of them (some other
are still skipped and needs further works).
Indeed, when we try to use requests with SSL in a monkey patched
environment we faced the following issue:
```
TypeError: wrap_socket() got an unexpected keyword argument '_context'
```
This is due to the fact that we are in a monkey patched environment
where `requests` is monkey patched too.
We don't need `request` for our needs. Indeed we can easily send
http requests through low level socket. Our main goal is to test
our wsgi server and not to test the `requests` library, and `requests`
was just used to make the code more simpler.
In our case we can implement a code dedicated to send request to our green
server, unlock our tests and move away from this bug/side effect.
These changes move away from `requests` which is badly monkey patched by
eventlet [1]. Now we use monkey patched socket and ssl to
request the green server which is executed in background. Low level
(monkey patched) modules could help us to skirt layers that are possibly
badly monkey patched on higher level modules (urllib, requests, etc...).
Reviewed: https:/ /review. opendev. org/730884 /git.openstack. org/cgit/ openstack/ oslo.service/ commit/ ?id=bfc81729429 7dddf93fd943264 cc01aa6fd03c82
Committed: https:/
Submitter: Zuul
Branch: master
commit bfc817294297ddd f93fd943264cc01 aa6fd03c82
Author: Hervé Beraud <email address hidden>
Date: Tue May 26 18:39:29 2020 +0200
Fix some SSL tests for wsgi module under python 3
Previously some tests were ignored under python 3 environment, this was
due to some design changes introduced by python 3.7 [1] in the SSL
module of the stdlib. These changes reactivate some of them (some other
are still skipped and needs further works).
Indeed, when we try to use requests with SSL in a monkey patched
environment we faced the following issue:
```
TypeError: wrap_socket() got an unexpected keyword argument '_context'
```
This is due to the fact that we are in a monkey patched environment
where `requests` is monkey patched too.
We don't need `request` for our needs. Indeed we can easily send
http requests through low level socket. Our main goal is to test
our wsgi server and not to test the `requests` library, and `requests`
was just used to make the code more simpler.
In our case we can implement a code dedicated to send request to our green
server, unlock our tests and move away from this bug/side effect.
These changes move away from `requests` which is badly monkey patched by
eventlet [1]. Now we use monkey patched socket and ssl to
request the green server which is executed in background. Low level
(monkey patched) modules could help us to skirt layers that are possibly
badly monkey patched on higher level modules (urllib, requests, etc...).
[1] https:/ /github. com/eventlet/ eventlet/ issues/ 526#issuecommen t-482694279 /github. com/eventlet/ eventlet/ issues/ 526
[2] https:/
Change-Id: Id44ad12a1cf3fd 7090a67bb6e8e42 bfdc47502cf
Partial-Bug: #1482633