Remove all redundant `setUp` methods.

It would be better if we remove all redundant `setUp` methods
and should be added as needed.

Change-Id: If6072894f1ced83c8bcf7fd44f8b67ea17a847f1
libvirt: avoid 30 second long test in LXC mount setup

The test_create_propagates_exceptions test case in the libvirt
driver test has a 30 second delay while disk setup times out.

  File "nova/virt/libvirt/driver.py", line 4412, in _create_domain_and_network
    disk_info):
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "nova/virt/libvirt/driver.py", line 4308, in _lxc_disk_handler
    self._create_domain_setup_lxc(instance, block_device_info, disk_info)
  File "nova/virt/libvirt/driver.py", line 4260, in _create_domain_setup_lxc
    use_cow=use_cow)
  File "nova/virt/disk/api.py", line 386, in setup_container
    dev = img.mount()
  File "nova/virt/disk/api.py", line 306, in mount
    if mounter.do_mount():
  File "nova/virt/disk/mount/api.py", line 218, in do_mount
    status = self.get_dev() and self.map_dev() and self.mnt_dev()
  File "nova/virt/disk/mount/nbd.py", line 120, in get_dev
    return self._get_dev_retry_helper()
  File "nova/virt/disk/mount/api.py", line 121, in _get_dev_retry_helper
    time.sleep(2)

Mock out the _create_domain_setup_lxc & _create_domain_cleanup_lxc
methods to avoid exercising this codepath which is irrelevant to the
goals of the test case.

Resolves-bug: #1369537
Change-Id: Ic860f83ac0b3b7242658640618b223d89c4db253
virt: move assertPublicAPISignatures into base test class

The nova/tests/virt/test_driver.py has a useful method for
validating subclass APIs vs the base class contract. This
can be used in many places in Nova, so move it into the
base TestCase class for broader reuse.

Related-bug: #1369151
Change-Id: Ib49e888aae31fb0d47c1d11f35648e9cb2595c75
ironic/baremetal: add validation of host manager/state APIs

Add tests to ensure the ironic & baremetal HostManager and
HostState sub-classes comply with the API contract defined
in their parent class.

Related-bug: #1369151
Change-Id: Ic2cf17c59c06fe2222db4bc5ea0e68f87c4399e9
Merge "correct inverted subtraction in quota check"
Merge "delete python bytecode before every test run"
Record instance faults during boot process

Once a build makes it to the compute manager build_and_run_instance
method no instance faults were being recorded.  This stores the instance
faults appropriately when an instance is placed into the ERROR state.

Change-Id: I348b539d0b5874bac3f7443e6dd4524264ce9766
Closes-Bug: #1355922
Merge "Fix object version hash test"
Merge "Make obj_make_compatible consistent"
Split up libvirt volume's connect_volume method

The connect_volume method in libvirt/volume.py does a couple of
things. It does the host OS integration/setup tasks, and it returns
the libvirt xml. In some cases, only the libvirt xml is required,
and the setup tasks are not necessary.

The following patch separates the setup tasks and libvirt xml return
in connect_volume. A new method, called get_config, is added to just
return the xml config, separate from the connect_volume method.
The connect_volume method will continue to return the libvirt xml,
so that existing functionality is not broken. This way, get_config
can be used to get the libvirt xml without any side-effects, e.g.
re-running shell commands to setup the volume.

There will be a follow up patch, where libvirt's driver.py will
switch over to use get_config and connect_volume will no longer
need to return the libvirt xml.

Change-Id: I5d300f8fe99f714d63d51197dc89f556c3a5d43b
Related-Bug: #1359617
Remove stale code from ObjectListBase

This patch removes some old attribute handlers, leftover from the time before
we had fields.

Change-Id: Ief8a37e1fd3a3079babc35595f6345984432cb4b
Merge "virt: use compute.virttype constants and validate virt type"
Remove unused elevated context param from quota helper methods

The elevated context being passed to the _quota_usage_create and
_reservation_create methods is not used, so remove it from the formal
parameter list of those methods and related usage.

This is part of a larger series to refactor the quota_reserve method.

Partial-Bug: #1369605

Change-Id: I50749402177eda29ae006ec4fd11a9a8125765ec
Merge "Fix EC2 instance type for a volume backed instance."
Merge "check network ambiguity before external network auth"
Merge "Improve secgroup create error message"
Merge "Don't swallow exceptions in deallocate_port_for_instance"
Merge "Cells: Update set_admin_password for objects"
default=None is unneeded in config definitions

It's not required for setting config options, as it's the default, and
there were only 2 final places where it was set in the code, so we
should just clear that out.

Change-Id: I33dd0c002e48a5f5d26047b7f87643fce67f9e64
Closes-Bug: #1323975
Merge "Make sure libvirt VIR_ERR_NO_DOMAIN errors are handled correctly"