The testing strategy doc was linking to the hacking repo docs
on creating unit tests, which are very specific to creating
unit tests for hacking rules.
This changes the link to the 'creating unit tests' section in
the HACKING.rst file, which has more information on testing
within nova.
Along with that change, the HACKING.rst testing section is
updated a bit to point out that we use stestr now instead of
testr and adds a proper link to the development environment
quickstart docs.
The nova/tests/unit/README.rst actually needs a lot of work,
but that's left for another day.
Change-Id: Ie5106d87d632286162b31ce132e947c306d21abd
Closes-Bug: #1732024
When a security group is removed from a port nova
incorrectly logs this as a security group addition
Change-Id: If525313c63c4553abe8bea6f2bfaf75431ed18ea
Closes-bug: 1731889
This patch adds `key_name` param to instance rebuild
API. Then the user could reset the instance keypair
when rebuilding. If set key_name to None, the API
will unset the keypair of the instance.
APIImpact
Implements blueprint: rebuild-keypair-reset
Change-Id: I23886a89c25f811cfbe7e2500ce7ff52f9162966
This change set contains a functional test demonstrating broken-ness
in AllocationCandidates.get_by_filters when all the providers in the
database are sharing providers.
Change-Id: Ifc5f0b11e54d937d960d5dd9102e6287ee7320d8
Related-Bug: #1730730
This change set adds a couple of failing test cases that demonstrate
holes in the design of GET /allocation_candidates when inventory from
the same resource class is present on both the compute node (the "main"
resource provider) and a shared resource provider.
The example being used is where the compute node has some local disk,
and is also associated with a shared storage pool. Both the compute
node RP and the shared storage RP will provide inventory of DISK_GB.
Test case test_common_rc demonstrates bug #1724613: when I ask for
DISK_GB in this setup, the shared storage pool is ignored. I expect to
get two candidates back: one with the storage from the compute node; the
other with the storage from the shared storage pool. But I actually
only get the former candidate back.
Test case test_common_rc_traits_split shows bug #1724633: that placement
can't tell which traits are supposed to apply to which resources. In
the above scenario, if the local storage is SSD and the shared storage
is RAID, and I ask for SSD + RAID, I "expect" to get back no hits. But
I would in fact get back a candidate with the storage from the shared
storage pool, because the cumulative set of traits would satisfy my
requested SSD + RAID.
Note that the two tests are functionally identical (traits are ignored
entirely) until https://review.openstack.org/#/c/479766/ lands. At that
point, depending on how we decide to implement the code that would deal
with this scenario, the test may fail *differently* until bug #1724613
is fixed.
Related-Bug: #1724613
Related-Bug: #1724633
Change-Id: I42edf102379cf329aa2252ab779a9f945f5fc155
This reverts commit ee7858ffca.
Looks like heat gate is broken with this change, and the
revert fixes it. Tested with https://review.openstack.org/#/c/518834/
Change-Id: I3fefcda93e496e97474bd419d50bd9753a4d1fed
Closes-Bug: #1731395
For the sake of code deduplication, LOC reduction, and readability
(improved signal:noise ratio), this change set implements some
convenience methods in AllocationCandidatesTestCase for creation of
placement artifacts such as resource providers, inventory, and
allocations, as well as for extracting and comparing results of
get_allocation_candidates.
This only changes test code; and is just a refactor - no tests are
added, removed, or substantively changed.
Change-Id: I34527a3b2ac33ec3b1c6cce2c4a2163eea1ada4d
block_device_mapping_v2.bus_type is missing from
POST /servers API reference. This patch add it.
Change-Id: I998cf6195d72c80649e9e0fd43be0cf37f8e2f48
Closes-Bug: #1713895
Currently when providing existing direct port, nova-compute
will overwrite the binding-profile information with pci_vendor_info
and pci_slot. The binding-profile will be used to request
NIC capabilities for SR-IOV ports [1]. This also allows to distinguish
which neutron mechanism driver will bind the port [2].
This patch updates the behaviour that on update port it will update,
rather than overwrite, the binding-profile information with
pci_vendor_info and pci_slot. And on unbind port it will remove
only the pci_vendor_info and pci_slot from the port binding-profile
rather than unsetting the entire field.
[1] https://review.openstack.org/#/c/435954/
[2] https://review.openstack.org/#/c/499203/
Closes-Bug: #1719327
Change-Id: I80106707a037d567d0f690570f2cf9cfcd30d594
When setting an instance password via the metadata service, if the
instance is not found it results in a 500 response to the caller.
This change handles the InstanceNotFound error and returns it as
a 400. Note it's a 400 since the instance uuid is part of the POST
request body, not on the URL path so it's not a 404 response.
Change-Id: I4aa99b563e1a5a87aa3e3dfb28800f107676df92
Partial-Bug: #1696848
This change set pulls AllocationCandidatesTestCase out of
test_resource_provider and into its own test_allocation_candidates
module.
There is no change to the code. This is just a refactor. We're going
to add a bunch more test cases for allocation candidates, and the
test_resource_provider module was already getting out of hand.
Change-Id: Iedfb712d4668a2d34112449aa6ef0263d02e24a4
This patch refactors the sample files of instance.reboot notifications
to use the previously introduced common sample data.
Change-Id: I6a9e8af79153a9b7825aef0838b60a8d1f97a421