Recently in python 3.10.6, a fix has landed in cpython to respond with
a 301 Moved Permanently to a sanitized URL that has had extra leading
'/' characters removed.
This breaks our existing unit tests which assume a 400 Bad Request as
the only expected response.
This adds handling of a 301 Moved Permanently response and asserts that
the redirect location is the expected sanitized URL. Doing this instead
of checking for a given python version will enable the tests to continue
to work if and when the cpython fix gets backported to older python
versions.
While updating the tests, the opportunity was taken to commonize the
code of two unit tests that were nearly identical.
NOTE(melwitt): The conflict is because change
I58b0382c86d4ef798572edb63d311e0e3e6937bb
(Refactor and rename test_tcp_rst_no_compute_rpcapi) is not in
Victoria.
Related-Bug: #1927677
Closes-Bug: #1986545
Change-Id: I27441d15cc6fa2ff7715ba15aa900961aadbf54a
(cherry picked from commit 15769b883ed4a86d62b141ea30d3f1590565d8e0)
(cherry picked from commit 4a2b44c7cf55d1d79d5a2dd638bd0def3af0f5af)
(cherry picked from commit 0e4a257e8636a979605c614a35e79ba47b74d870)
(cherry picked from commit 3023e162e1a415ddaa70b4b8fbe24b1771dbe424)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /866195 /opendev. org/openstack/ nova/commit/ 77bc3f004e7fe40 77ea035c659630b edef1cfea1
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/victoria
commit 77bc3f004e7fe40 77ea035c659630b edef1cfea1
Author: melanie witt <email address hidden>
Date: Tue Aug 16 06:49:53 2022 +0000
Adapt websocketproxy tests for SimpleHTTPServer fix
In response to bug 1927677 we added a workaround to questHandler to respond with a 400 Bad Request if an open
NovaProxyRe
redirect is attempted:
Ie36401c7 82f023d1d5f2623 732619105dc2cfa 24 6330ff09e5eabb5 ef8dd9a18f55478 66
I95f68be7
Recently in python 3.10.6, a fix has landed in cpython to respond with
a 301 Moved Permanently to a sanitized URL that has had extra leading
'/' characters removed.
This breaks our existing unit tests which assume a 400 Bad Request as
the only expected response.
This adds handling of a 301 Moved Permanently response and asserts that
the redirect location is the expected sanitized URL. Doing this instead
of checking for a given python version will enable the tests to continue
to work if and when the cpython fix gets backported to older python
versions.
While updating the tests, the opportunity was taken to commonize the
code of two unit tests that were nearly identical.
Conflicts:
nova/tests/ unit/console/ test_websocketp roxy.py
NOTE(melwitt): The conflict is because change d4ef798572edb63 d311e0e3e6937bb rst_no_ compute_ rpcapi) is not in
I58b0382c86
(Refactor and rename test_tcp_
Victoria.
Related-Bug: #1927677
Closes-Bug: #1986545
Change-Id: I27441d15cc6fa2 ff7715ba15aa900 961aadbf54a d62b141ea30d3f1 590565d8e0) 79d5a2dd638bd0d ef3af0f5af) 9605c614a35e79b a47b74d870) daa70b4b8fbe24b 1771dbe424)
(cherry picked from commit 15769b883ed4a86
(cherry picked from commit 4a2b44c7cf55d1d
(cherry picked from commit 0e4a257e8636a97
(cherry picked from commit 3023e162e1a415d