nova/nova/tests/unit/api
Balazs Gibizer 65ada9745c Use admin neutron client to see if instance has qos ports
The nova-api checks at each move* operation if the instance has qos port
attached as not all the move operations are supported for such servers.
Nova uses the request context to initialize the neutron client for the
port query. However neutron does not return the value of the
resource_request of the port if it is queried with a non admin client.
This causes that if the move operation is initiated by a non admin
then nova thinks that the ports do not have resource request.

This patch creates an admin context for this neutron query.

The new functional tests are not added before this patch in a regression
test like way as existing functional tests are reused with different
setup and doing that without the fix causes a lot of different failure
scenarios.

Note that neutron fixture is changed to simulate the different behavior
in case of different request context are used to initialize the client.

*: Note that Id5f2f4f22b856c989e2eef8ed56b9829d1bcefb6 removed the check
   for evacuate in Ussuri but exists in Train and Stein.

Conflicts:
  nova/api/openstack/common.py due to
  I6fc3cb0651f65b2448fbbb58989c920974f076c3 is missing

  nova/api/openstack/compute/migrate_server.py
  nova/tests/unit/api/openstack/compute/test_migrate_server.py
  due to I09cac780b9ee5b5726874d4e6f895fd0cd4bff8c is missing

  nova/api/openstack/compute/servers.py
  due to Ib1a73f5e20b6f9a325d8b24d9253a18f2a46db1f and
  Id0ee10e8d323786f4d79c82e3f05b48e76bd0956 is missing

  nova/tests/unit/api/openstack/compute/test_server_actions.py
  due to Ib1a73f5e20b6f9a325d8b24d9253a18f2a46db1f is missing

  nova/api/openstack/compute/shelve.py due to
  I6381365ff882cf23808e8dabfce41143c5e35192 is missing

Also integrated_helpers.py and test_servers.py needed to be changed due
to Id0ee10e8d323786f4d79c82e3f05b48e76bd0956 is missing. As well as
NonAdminUnsupportedPortResourceRequestBasedSchedulingTest.setUp() needed
to be extended to allow calling migrate and resize for the non admin api
client.

Change-Id: I3cf6eb4654663865d9258c38f05cd05974ffcf9d
Closes-Bug: #1850280
(cherry picked from commit 8999769605)
(cherry picked from commit 4cb493fe4f)
2019-11-25 10:14:56 +00:00
..
openstack Use admin neutron client to see if instance has qos ports 2019-11-25 10:14:56 +00:00
__init__.py
test_auth.py conf: Move api options to a group 2016-11-25 16:32:31 -06:00
test_compute_req_id.py Migrate to oslo request_id middleware - mv 2.46 2017-05-27 10:11:44 +00:00
test_wsgi.py Refactor WSGI apps and utils to limit imports 2018-03-06 22:05:12 +00:00