Add test cases for resume_state_on_host_boot

part of blueprint libvirt-driver-tests

Co-authored-by: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Change-Id: I234c3613eb30a593fd1b0e29655551694b7e24f7
Fix changes_since for V3 API

The V3 API changed the changes-since parameter to changes_since
for consistency with other parameters. However, the db level
expects changes-since as the filter. So this change transforms
changes_since to changes-since before passing it to the compute
layer.

Closes-Bug: 1220045

Change-Id: Id34ffe8aa75b20d11dcb1b4a9ba36e2586dae1e3
Increase volume created checking retries to 60

In some cases 30 retries with 1 sec interval is not enough for
volume to be created.
Increased max tries to 60

Fixes bug 1213953

Change-Id: I6bcd395a4bac940387384cc85691d7219cf90e63
xenapi: Fix download_handler fallback

In order to make image-download a bit more robust, we attempt to download from
a preferred handler and if that fails, we fall back to a default handler.

If the preferred handler *is* the default-handler, then we should just raise
the exception instead of retrying.

The existing code was checking to see with whether the handler *instance*
compared as equal to the default-handler *instance*. Since the two objects are
instantiated separately, they'll always be different objects, so never compare
as equal.

The correct check is to see if the handler is an instance of the default
handler's class.

Fixes bug 1210659

Change-Id: Id038d221fd2f90c36673f30d4ff8acdc8dbf098e
Add V3 API samples for instance-actions,extenions

Partially implements blueprint v3-api-unittests

Change-Id: Ie90973734943b3d22cb288b18916a6ef2d9f51de
Add V3 API samples for flavors,flavor-rxtx,flavor-access

Partially implements blueprint v3-api-unittests

Change-Id: I2b572ec13190b946daebec4e64f9b9b362d5ac6e
Fix console api pass tuple as topic to console rpc api

The topic should be string, not a tuple

Fix bug 1221541

Change-Id: I4bbb9bdeb5108436fe76db69f1546ac2bd0c7a40
Fix migration 211 to downgrade with MySQL

Suspend the Foreign Key Constraint and add it back in to stop from
preventing the unique constraint from being deleted.

Fixes bug/1216706

Change-Id: I7e77c9c5e50ec3580bca3f95f59189b33d9af306
Fix the order of query output for postgres

Sorts the query results and dictionary of expected results by two columns
rather than one which isn't unqiue.

Fixes bug 1208701

Change-Id: Icd21a008f7736a4d9027effb0633a506aae0f602
Only return requested network ID's

Only return the requested network ID's and not all of the
public networks. This will also include 'shared' networks.

Fixes bug 1221320

Change-Id: I21ba4586c6e431b0dd1a87a9e5e493fae1b08357
Add alias as prefix to request params for config_drive v3

fix bug 1215705

DocImpact

Change-Id: Ic236e306c64000a5556a55a0d168f15692c0106b
Change the duplicate class name TestDictMatches in test_matches.py

There are two classes with the same name 'TestDictMatches' ,let's change one to
TestIsSubDictOf.

Change-Id: I1f1059054070228265bca74cb8aaad2c8d3f8812
Remove duplication in disk checks

Split the image and fs resize checks into separate methods since they
are used in different ways. This also strips one redundant size check.

Change-Id: Ie2381fa4ecd5264f2dd3ec3b0350df40376d0e34
Use test.TestingException where possible

Instead of calling 'raise Exception()' in a stub, use
tests.TestingException and only catch that exception.  This will make
sure the test have less false positives and hide other exceptions.

Change-Id: I384c93e220d570abec25dcbacead0aa3bc33cbcf
Partial-Bug: #1223605
VMware: nova-compute crashes if VC not available

The ESX driver gets a connection to vCenter Server on startup.
Currently, if vCenter Server is not available, nova-compute crashes.
This fix adds slow retry when nova-compute starts before vCenter
Server is available.  The errors are logged in case the issue is
a mis-confiugration of vCenter Server

Fixes: bug #1192016

Change-Id: I0801ab4a4e4bf32b8119e131a45a2fdb7884a4fd
Remove extra 'console' key for index in extensions consoles v3

Fix bug 1224294

* remove the extra 'console' key
* remove xml template serializer, because default serializer is enough

Change-Id: If6f17ea7301a06fa6f9400549f875aebdef2ee93
Make Instance.save() log missing save handlers

Also, fix the name of the _save_fault() handler to be what it should
be, which is what triggered the ungraceful handling of this bug in
the first place.

Change-Id: I160f42b130810134135d2a22198fc0b66a7af585
Closes-bug: 1223957
Remove unused and duplicate code

Remove some unused and duplicate code from test_libvirt.py
and test_db_api.py

Change-Id: Ia9e68b68abbf391017a1127c0a15b97d50f147e9
Fix hyper-v vhd real size bigger than flavor issue

In hyper-v, after deploy the image, real vhd file size will be
extended from flavor size plus vhd metadata size, this patch
fix this issue by check the vhd type and minus the vhd metadata
size according to the specific vhd type.

Fixes bug #1177927

Change-Id: I51223f4f778f33e73dce1e0f53e23e8d7ac77904
Better help for generate config

This just adds a sample command line for how to generate the
nova.conf.sample because I keep forgetting how to do it.

Change-Id: Id8bfb859f90d7fde51dd1ffdb40ec383ed5193e6