The NoDBTestCase base class does a lot of env setup that is not needed
for these tests. As we have issues with these tests (see bug 1823251)
this patch tries to decrease the complexity of them to help the
troubleshooting.
Change-Id: I46fafa470b9d378d96c0f364e9b487742bf58cb2
Related-Bug: #1823251
ZeroMQ driver is deprecated, as per the Dublin 2018 PTG decision:
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128055.html
This change simply replaces the zeromq mention with a link to the
other oslo.messaging drivers.
Co-Authored-By: Matt Riedemann <mriedem.os@gmail.com>
Change-Id: I0c8d488c1daecc71d7d2817ffb4ae10727771d19
This release of the Cinder client broke support for the v3
volume-transfer APIs unless microversion 3.55 or higher was requested.
Depends-On https://review.opendev.org/#/c/587877/
Change-Id: Ieb685a476d51d92ad3f153fb3d1fabfb6d5a4376
When hard-deleting an instance we first delete related records
but the code was not taking into account soft-deleted related
records which will result in the instance delete failing due to
a referential constraint because soft-deleted records are not
really deleted when it comes to table constraints.
This fixes the issue by simply passing read_deleted='yes' to the
related record model query in the hard delete path.
The related unit test is updated to cover this scenario and a
typo in that same test is also fixed here.
Change-Id: I9fc5a9cc40ceffc450c1fde1df7fb36581e9cc94
Closes-Bug: #1830438
reno doesn't have stable branches and doesn't version its documentation.
There's no point versioning our links to same.
Change-Id: Id782d3b11715bc3211e7952fb01b42a659d06e36
Closes-Bug: #1830926
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
The server group policy field added in v2.64 is a string but
the API reference says the parameter is an object.
This patch changes it from "object" to "string".
Change-Id: I1b4efe8afb302d94c810389e124c5370cbe72ddf
Closes-bug: #1830800
While the results of invoking libvirt's getCapabilities() API call get
deliberately logged at INFO level[0], doing the same for
getDomainCapabilities() is one bridge too far, because we call it once
per (architecture, default_machine_type) tuple.
So heed the suggestions of Stephen and Eric[1] and reduce it to DEBUG level.
[0] See Ica0dccbfbff89829a7e631adaaf2cde13c449773 at
https://review.opendev.org/#/c/158334/
[1] https://review.opendev.org/#/c/655268/3/nova/virt/libvirt/host.py@777
Change-Id: Idb4c4380c32f78d639f41cb1b5204578e1a19cd3
When the compute host recovers from a failure the compute manager
destroys instances that were evacuated from the host while it was down.
However these code paths only consider evacuated instances that are
still reported by the hypervisor. This means that if the compute
host is recovered in a way that the hypervisor lost the definition
of the instances (for example the compute host was redeployed) then
the allocation of these instances will not be deleted.
This patch makes sure that the instance allocation is cleaned up
even if the driver doesn't return that instance as exists on the
hypervisor.
Note that the functional test coverage will be added on top as it needs
some refactoring that would make the bugfix non backportable.
Change-Id: I4bc81b482380c5778781659c4d167a712316dab4
Closes-Bug: #1724172
Replace mox with mock in the following methods
in the TestNeutronv2 class
in nova/tests/unit/network/test_neutronv2.py.
Then moves the methods to the TestNeutronv2WithMock class.
* test_validate_networks_port_no_subnet_id
* test_validate_networks_no_subnet_id
* test_validate_networks_ports_in_same_network_enable
* test_validate_networks_ports_not_in_same_network
* test_validate_networks_no_quota
Change-Id: Iaeefc1bcfa7df5bfa863dd265840af343b0f76ba
Implements: blueprint mox-removal-train
Replace mox with mock in the following methods
in the TestNeutronv2 class
in nova/tests/unit/network/test_neutronv2.py.
Then moves the methods to the TestNeutronv2WithMock class.
* test_validate_networks_ex_1
* test_validate_networks_ex_2
* test_validate_networks_duplicate_enable
* test_validate_networks_not_specified
* test_validate_networks_port_not_found
* test_validate_networks_port_show_raises_non404
* test_validate_networks_port_in_use
The 'test_validate_networks_ex_1' test case was broken.
The expected behavior of the 'validate_networks' method is raising
the NetworkNotFound exception, but the exception was not raised.
so fix it.
Change-Id: Ifeac24ea65065575c2aaf7946835f70cdb763012
Implements: blueprint mox-removal-train
Replace mox with mock in the following methods
in the TestNeutronv2 class
in nova/tests/unit/network/test_neutronv2.py.
Then moves the methods to the TestNeutronv2WithMock class.
* _test_deallocate_port_for_instance
* test_deallocate_port_for_instance_1
* test_deallocate_port_for_instance_2
* test_list_ports
* test_show_port
* test_validate_networks
* test_validate_networks_without_port_quota_on_network_side
Change-Id: I68eb932c9db150c66f25d82ecdbeec277dbcaed6
Implements: blueprint mox-removal-train
Replace mox with mock in the following methods
in the TestNeutronv2 class
in nova/tests/unit/network/test_neutronv2.py.
Then moves the methods to the TestNeutronv2WithMock class.
* _deallocate_for_instance
* test_deallocate_for_instance_1_with_requested
* test_deallocate_for_instance_2_with_requested
* test_deallocate_for_instance_1
* test_deallocate_for_instance_2
* test_deallocate_for_instance_port_not_found
The '_deallocate_for_instance' method is renamed to
'_test_deallocate_for_instance'.
Change-Id: I87aff2df5b4d8d899782446e2739e6b9fb679a84
Implements: blueprint mox-removal-train
Replace mox with mock in the following methods
in the TestNeutronv2 class
in nova/tests/unit/network/test_neutronv2.py.
Then moves the methods to the TestNeutronv2WithMock class.
* test_allocate_for_instance_ex2
* test_allocate_for_instance_no_port_or_network
* test_allocate_for_instance_with_externalnet_forbidden
* test_allocate_for_instance_with_externalnet_multiple
Change-Id: Ic19074165422d85430211b44fc685d0c2cb6f216
Implements: blueprint mox-removal-train
Several existing tests patch open() to fake the contents of a file
outside the test virtualenv, whilst avoiding interfering with reading
and writing of other files inside the test virtualenv. Currently they
do it by duplicating logic.
Furthermore, in the near future, more tests (specifically, some SEV
tests) will want to do the same selective patching, and similarly will
need to avoid impacting reads of other files within the test
virtualenv, e.g. placement-policy.yaml.
So create new patch_open() context manager / decorator in nova.test
for selectively patching open based on the path parameter, and reuse
this for existing tests.
Also add unit tests for all these cases.
mock >= 3.0.0 is required because configparser.RawConfigParser._read()
uses enumerate() to iterate over the lines of the (mocked)
/etc/nova/release config file, and this uses __iter__() under the hood
which was not supported via mock_open until a bug was fixed and
backported to the external mock library for 3.0.0:
https://bugs.python.org/issue21258https://bugs.python.org/issue3293373f6eed0d6
Change-Id: I19f49c923d2c41eab0c7b4cab28c50498dc07046
NoVNCConsoleTestJSON.test_novnc is intermittently failing
in the multi-cell job when trying to get a vnc console for
an instance in cell2. It looks like requests aren't getting
routed to the novnc-cell2 service properly, so let's skip
novnc tests until the bug is fixed since we want to stabilize
this job to make it voting.
Change-Id: I74a4b392ccec66a7a80a117d1cdf83a418c7dcdc
Related-Bug: #1830417