Refactor xvp console

Small re-factoring of the xvp console mainly checking
to make sure that we catch exceptions when they haappen.

Change-Id: I0164111ffa4439d82ae26084433901236a4a2ddc
Signed-off-by: Chuck Short <chuck.short@canonical.com>
libvirt: Skip intermediate base files with qcow2.

Instead of having two files in _base (the original and a resized
copy), let's just keep the originals and resize with the qcow2
image in the instance's directory. This will reduce the size of
_base and simplify cleanup. This also simplifies resizing of
instance disk images later.

Resolves bug 1087031.

Change-Id: Id91426e3cb9f75f31339b5156785e3782a4cb98f
Added sample tests to FlavorDisabled API.

Partially implements blueprint nova-api-samples
Fixes bug 1070161

Change-Id: I889a5b2e85d31fda1e9a8a82043ba7e9ddf1b7a6
Fix stack trace on incorrect nova-manage args.

This error reporting needs more work, but this at least stops us
from presenting a stack trace to the user and is as broken as
before.

Resolves bug 1091403.

Change-Id: I941983b60cc3762a916d57b7ea67264e093cfa44
allow for the ability to run partial coverage

the way the coverage exclusion was made previously meant that
if you ran coverage, it would always run all the tests. Fix
this so you can run a subset.

Change-Id: I057587204728d379e2a43b5c5ee14fe91f83f64b
Fix "image_meta" data passed in libvirt test case

The helper method _check_xml_and_uuid expects a disk
image metadata dictionary as its first parameter. The
caller was instead passing a instance dictionary. The
tests pass regardless, but passing the right data
avoids future developer confusion.

Change-Id: Ia594e8aa38a8627d304537c09d0d28a3e3a2b27b
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reliably include OS type in ephemeral filenames.

Either include the OS type, or "default" if this isn't specified.

Also, I don't see why we care what ephemeral disk number this disk
was created as (they're all empty images in base, right?) so I've
removed that.

Resolves bug 1087030.

Change-Id: Iee7f8e9033a2e6a829421763090ed0e67c6b2da8
Fix race condition of resize confirmation

Currently, the db update of migration status is after the db update of
instance's vm_state in _finish_resize, so a race condition occurs when an
instance's vm_state is updated but the migration status doesn't, and at
this moment a resize confirmation is performed, then an exception
'MigrationNotFoundByStatus' is raised.

Fixes: bug #1066140

Change-Id: I1dac98cc99d3491c92faaad2b9dcc40d7c0524b5
Extract image metadata from Cinder

This patch makes nova extract image metadata if it is present in the
volume dict received from Cinder API.

The volume image metadata is received from Cinder when the
volume_image_metadata Cinder extension is loaded.

This patch is part of the work done on blueprint improve-boot-from-volume
as this metadata will be used when booting instances from volumes
without the need to supply an image just for the metadata. Subsequent
patches will make Nova consider this metadata when booting instances
without and image id.

Change-Id: I9e5925ea4147a41c41f9019933a47c5ccf756747
Add get_backdoor_port to consoleauth.

This adds a get_backdoor_port function to the consoleauth
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I7da9cbc8111342b5f49f148a8e3389faf5c4f2ab
Add get_backdoor_port to console.

This adds a get_backdoor_port function to the console
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: I3cb7d199fac8c10e4b5fdc04c403b63e75a69d2d
Add get_backdoor_port to scheduler.

This adds a get_backdoor_port function to the scheduler
service which enables returning the eventlet_backdoor port
from rpc for the service.

Change-Id: Ib88e2a9e709d5240722027c94e6762b4a3bd918c
Add get_backdoor_port to cert.

This adds a get_backdoor_port function to the cert service
which enables returning the eventlet_backdoor port from rpc
for the service.

Change-Id: Iea2b1f9587ea2749c2def921d6a0d1e86f1645ee
fixing the typo of the error message from nbd

bug 1092640

Change-Id: I6743aea8cc96570a4a24e4a34d7b0b7f904c485d
Add API samples tests for the coverage extension.

Partially implements blueprint nova-api-samples
Fixes bug 1089531

Change-Id: I5b287ea210f275a0c316a28d6dc3614d107aff05
Add html reports to report action in coverage extension.

This makes a few minor cleanups and 2 additions to the
coverage extension. First, it adds a new optional field to the
report action: 'html'. This will generate an html report instead
of either the text or xml reports that the extension can
generate.

The second change is that it adds a return for the stop action.
Now upon successful completion of the stop action the directory
where the coverage data files will be returned.

Change-Id: If1aa25fc7237e9bb5100d2a4a8e560f0a68eba61
Provide a configdrive helper which uses contextlib.

As suggested on review of Ib23d117ad4cd5dc92298a0812eb468f7d557417c.

Resolves bug 1092248.

Change-Id: I2829ac60732b86b9853983b03ef6f30f5c5a3283
Eliminate race conditions in floating association

This makes associating and disassociating floating ips atomic and
idempotent. This means multiple concurrent messages will not leave
behind iptables rules and concurrent request will not cause odd
failures.

Fixes bug 1092762 and bug 1092761.

Change-Id: Idbcad6c1d2a3d4881cf7180b848ed3844fac4054
Enable nova exception format checking in tests.

Updates the Nova test runner so that it enables
'fatal_exception_format_errors' for testing.

Fixes a slew of issues in the tests including:
 -adds a whole bunch of missing kwarg's to exception constructors
 -removing an extra print statement in ec2/test_cloud
  (this was causing failures...)
 -removing a duplicate (and misnamed) flavor test case:
    test_remove_tenant_access_with_bad_access
 -removing an odd test case which tested throwing an exception with
  and without kwargs explicitly (the part testing without kwargs was
  removed)
 -explicitly update test/test_misc.py's test_exceptions_raise to disable
  formatting checks for now. This allows it to continue to pass.

Change-Id: Ibb5083c93f1a5de6edadb1b613292ff9eb26ddf0
Makes sure to call crypto scripts with abspath

In some cases __file__ can return a local path instead of an
absolute path. For example when you are running with run_tests.sh
from a checkout that has been setup.py developed on os x. Make
sure that we convert it to an absolute path in case it is relative.

Change-Id: Ie18be6039db56601de18ce4ad48791b4abf118fe