Current tests do not have good test coverage of existing policies.
Either tests for policies do not exist or if they exist then they
do not cover the actual negative and positive testing.
For Example, if any policy with default rule as admin only then
test should verify:
- policy check pass with context having admin role
- policy check fail with context having any other role than admin
As discussed in policy-defaults-refresh [1], to change the policies
with new default roles and scope_type, we need to have the enough
testing coverage of existing policy behavior.
When we will add the scope_type in policies or new default roles,
then these test coverage will be extended to adopt the new changes
and also make sure we do not break the existing behavior.
This commit covers the testing coverage of existing os-agents
policies.
Partial implement blueprint policy-defaults-refresh
[1] https://specs.openstack.org/openstack/nova-specs/specs/ussuri/approved/policy-defaults-refresh.html#testing
Change-Id: I073900e0d39d3924e82d173ae7cd5a6f24789d5e
APIImpact: Adds 2.82 microversion for /os-server-external-events API.
DocImpact: Adds new version to doc/api_samples/versions/.
Change-Id: I7a626544d8221dc0eeb5672986ca897ce4718be8
Blueprint: nova-cyborg-interaction
nova test job on hacking master is failing
with
2020-02-24 01:14:53.698965 | ubuntu-bionic | ./nova/api/metadata/handler.py:251:55:
H702: Formatting operation should be outside of localization method call
- https://review.opendev.org/#/c/705514/
This is H702 error for localization formatting.
Change-Id: I9eaa90c273327a3ca0ca1722a45017e59e9f0f0c
Libvirt v6.0.0 [1] will now fail to launch a domain when using qcow2
disks where the backing file format is not recorded in the qcow2
metadata.
There are some discussions upstream around relaxing this slightly [2]
but for now any attempt to launch an instance using qcow2 disks will
fail as Nova does not populate this value when creating the disk.
Nova needs to at a minimum start populating this field and depending on
the outcome of the thread upstream in Libvirt also potentially handle
the upgrade case where we may need to rebase existing disks in order to
update the metadata.
For now this change simply adds the backing_fmt option to the qemu-img
command line used to create these disks.
[1] https://github.com/libvirt/libvirt/commit/3615e8b39badf2a526996a69dc91a92b04cf262e
[2] https://www.redhat.com/archives/libvir-list/2020-February/msg00616.html
Partial-Bug: #1864020
Change-Id: I77ebada015f6522a300be4fa043fb8676458402b
The @wsgi.expected_errors decorator can take a list or a single int
as parameter. For some reason there are calls in a form of
@wsgi.expected_errors((<error code>)).
Change-Id: Ief196bb588e53f503c54b2ef0c51bc9a937b4b15
Adds a regression-style test for two cleanup bugs when
'UnexpectedDeletingTaskStateError' is raised during build.
Change-Id: Ief1dfbb6cc9d67b73dfab4c7b63358e76e12866b
Related-Bug: #1848666
Related-Bug: #1831771
During instance build, conductor claim resources to scheduler
and create instance DB entry in cell.
If for any reason conductor is not able to complete a build after
instance claim (ex: AMQP issues, conductor restart before build completes)
and in the mean time user requests deletion of its stuck instance in BUILD,
nova api will delete build_request but let allocation in place resulting
in a leak.
The change proposes that nova api ensures allocation cleanup is made
in case of ongoing/incomplete build.
Note that because build did not reach a cell, compute is not able to heal
allocation during its periodic update_available_resource task.
Furthermore, it ensures that instance mapping is also queued for deletion.
Change-Id: I4d3193d8401614311010ed0e055fcb3aaeeebaed
Closes-Bug: #1859496
These stated they could return None but that wasn't true. Correct this.
Change-Id: I3bbeedef70e4b94225e1a042cf4e59fb12bcaa92
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
When using PlacementFixture, we can pass some arguments to the CRUD operators.
That said, given the fake methods use kwargs, the fixture won't raise a
TypeError if the parameter name is wrong like the reportclient would do.
Adding a new decorator for verifying it.
Change-Id: Icd3f9e16ac31ea7220052770390aaf4b38e1c469
Tests were previously using arbitrary keys that weren't published
anywhere in the codebase. Switch to using meaningful ones.
Change-Id: I8da84b48e4d630eeb91d92346aa2323e25e28e3b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>