Refactor Ironic driver tests as per review comment

During the Ironic driver merge into Nova, there were some
suggestions on refactoring the tests as per this review
(https://review.openstack.org/#/c/111425/19/nova/...
...tests/virt/ironic/test_driver.py)

This patch implements these suggestions.

Change-Id: I05e8b3d01bffebe2f68bbd50fc775e1ef48616cc
hardware: make get_constraints to return topology for hugepages

Whether a numa node is defined or not, if using hugepages we
should create an numa instance topology.

Work-Item: Enhance libvirt driver to report available
           large pages per NUMA node in the host state data

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I23e0ca58bd8c6a16bff5d36c5d108056e4135351
objects: add method to verify requested hugepages

Introduces a new method can_fit_hugepages to numa cell object

Work-Item: Enhance libvirt driver to configure guests based on
           the flavour parameter for page sizes

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: I600840a96b13c1de4f2f409069f452e18e1c1c52
hardware: determine whether a pagesize request is acceptable

Enhances numa_fit_isintance_cell to return whether the cell host
can handle the page size request

Work-Item: Enhance libvirt driver to configure guests based on
           the flavour parameter for page sizes

Partial-Implement: blueprint virt-driver-large-pages
Change-Id: Ib8546c2a22017f738f644b94dcf00f4afd3582fc
virt: pass instance object to block_stats & get_instance_disk_info

The block_stats and get_instance_disk_info methods are the last
two virt driver methods which do not take a full Nova Instance
object. They are trivially convertable.

Blueprint: libvirt-driver-class-refactor
Change-Id: I87ef651383c9b4ab3abe4bf8a5c49501e353abc4
Merge "hardware: make get_constraints to return topology for hugepages"
Merge "virt: pass instance object to block_stats & get_instance_disk_info"
libvirt: introduce a fixture for mocking out libvirt connections

The various libvirt test suites all have different ways of mocking
out libvirt connections. Some use fakelibvirt, others create their
own lame re-implementation of fakelibvirt, others mock random
methods. To improve sanity, introduce a standard fixture to be used
by all libvirt tests for mocking libvirt. This will ensure that the
libvirt.openAuth method always returns an instance of fakelibvirt
virConnect object. This should allow for a number of the fakelibvirt
reimplementations to be eliminated eventually.

Blueprint: libvirt-driver-class-refactor
Change-Id: I2a61dba5a273455d6b3c15e9cae0f3bff7f641fa
libvirt: convert test_host.py to use FakeLibvirtFixture

Instead of monkey patching the Host class to use fakelibvirt,
just use the FakeLibvirtFixture. Also create an instance of
the Host class in setUp since every test case needs it.

Blueprint: libvirt-driver-class-refactor
Change-Id: I1d737fc22bc26b686790c06362eb7c61b26bd39d
libvirt: sanitize use of mocking in test_host.py

Tidy up the test_host.py test suite, so that it uses mock
exclusively instead of stubs. Also annotate test methods
in preference to using nested contexts since it leads to
clearer test methods.

Blueprint: libvirt-driver-class-refactor
Change-Id: Idc536e408b22cadf8b12ec2bd4ed978f1110fd83
libvirt: remove unused get_connection parameter from VIF driver

Previously the VIF driver would have to take different action
for OpenVSwitch depending on the libvirt version. Since we
bumped the min libvirt version this is no longer required, so
the get_connection parameter to the VIF driver is unused.

Blueprint: libvirt-driver-class-refactor
Change-Id: I1925a433a00f5ea3b65899ecb64d904045519340
Fix recent regression filling in flavor extra_specs

In commit cb338cb7692e12cc94515f1f09008d0e328c1505, we dropped an extra
DB query to fill in flavor extra_specs because the object should already
have those set. However, if we pulled the flavor from the instance,
extra_specs are mostly not stored, which means we effectively cut off
the scheduler filters from access to those things.

This adds that back in for that case, but only temporarily. Soon we will
be merging a change to stash real flavor objects with the instance, which
will make this moot. However, that may take a while to merge and this is
broken now.

Change-Id: Ia728025345b09687da9744004f0f47ad73ce196c
Closes-Bug: #1403547
Merge "Refactor Ironic driver tests as per review comment"
Merge "objects: add method to verify requested hugepages"
Merge "hardware: determine whether a pagesize request is acceptable"
Merge "Fix recent regression filling in flavor extra_specs"
Merge "libvirt: introduce a fixture for mocking out libvirt connections"
Merge "libvirt: convert test_host.py to use FakeLibvirtFixture"
Merge "libvirt: sanitize use of mocking in test_host.py"
Merge "libvirt: remove unused get_connection parameter from VIF driver"