libvirt: convert firewall tests to avoid DB usage

The test_firewall.py test suite had alot of code which created
and accessed database objects. This can all be avoided by making
more use of mock to patch out a handful of object access functions.
The test_cidr_rule_nwfilter_xml was deleted entirely since it was
never actually validating any aspect of the nwfilter execution,
so didn't add any benefits over the other test functions that
run.

Partial-bug: #1369516
Change-Id: I7172edace9e568d961fc1dc9f449cd858551bb0d
libvirt: convert LibvirtNonblockingTestCase to avoid DB usage

The LibvirtNonblockingTestCase test case does not do anything DB
related. Convert it to NoDBTestCase to avoid DB setup penalty.
This improves perf from 1.8s to 0.4s

Partial-bug: #1369516
Change-Id: I6ff4f46a2e8c2e436d40dd47134f5ec496ce153f
libvirt: convert volume usage test case to avoid DB usage

Convert LibvirtVolumeUsageTestCase so that it avoids creating an
instance in the database. This allows it to be switched over to
use NoDBTestCase, improving perf from 1.7s to 0.13s.

Partial-bug: #1369516
Change-Id: If2ab915388c2a1ba0565d4aa8bb66b98db535094
libvirt: convert volume snapshot test case to avoid DB usage

Convert the LibvirtVolumeSnapshotTestCase so that it avoids
creating instance objects in the database. This allows it to
be converted to use NoDBTestCase improving perf from 4.2s
to 2.3s

Partial-bug: #1369516
Change-Id: Idf4d29a0df2280c78fe879fa09632c666ff04436
Fix the os_networks display to show cidr properly

Converting network_get and network_get_all to use objects broke
the display of the os_networks extension, because IPAddress
fields in Network objects are dumped as lists by the jsonutils
extension. We therefore must explicitly convert these object
field values to string.

The tests are updated to use objects so that we pick up bugs
like this in the future. Incorrect assertEqual parameter order
is fixed in the tests too since these are comparing dicts and
it's not fun debugging a MismatchError when the reference/actual
values are backwards.

Change-Id: I0f05a9b4d7bbe5fe0a3b110c191455ca7edefcb5
Closes-Bug: #1376945
Co-authored-by: Matt Riedemann <mriedem@us.ibm.com>
Disable libvirt NUMA topology support if libvirt < 1.0.4

If you're not at a new enough version of libvirt, the compute service
fails on startup because VirtNUMATopologyCellUsage is not fully
populated.

This add a min version check before trying to get host NUMA topology
information.

Closes-Bug: #1376307

Change-Id: I00f6325cb554bc5e34d9f0fe651af39630f35b5d
Merge "libvirt: convert firewall tests to avoid DB usage"
Merge "libvirt: convert LibvirtNonblockingTestCase to avoid DB usage"
Merge "libvirt: convert volume usage test case to avoid DB usage"
Merge "libvirt: convert volume snapshot test case to avoid DB usage"
Merge "Fix the os_networks display to show cidr properly"