Add VirtAPI tests

So far, VirtAPI has only been tested indirectly through the
other tests and modules that use it.

This adds a dedicated set of tests for the VirtAPI abstract class,
the virt/fake.py::FakeVirtAPI implementation, as well as the one
in compute/manager.py::ComputeVirtAPI. This test helps to ensure
that they all have the same method signatures and exhibit the
general behavior we expect. At the very least, this should help
them from getting out of sync in terms of their API. It also ensures
that methods can't be added to VirtAPI without a corresponding test.

Note the slight change in the FakeVirtAPI class to fix passing the
keyword arguments explicitly, which makes Mock happy.

Related (vaguely) to blueprint no-db-compute

Change-Id: Ib44379e17fae4df506b0108e20eb66b19195b1ca
Stop nbd leaks, remove pid race.

With the previous implementation, if a nbd device was found to be in
use by something other than nova it was removed from the class scoped
list of devices, but never re-added. This meant we "leaked" devices
away over time if we were competing with other nbd users on the
machine.

Instead of tracking our use at all, we should rely on the presence of
a user pid in /sys.

Resolves bug 1088083.

Change-Id: If777e270a0dda12034ea7ef1bc7fd688cadde8a9
Fix poll_rescued_instances periodic task

The poll_rescued_instances periodic task now checks the amount of time
that an instance has been in the RESCUED stated before timing out the
rescue.  It also now performs the unrescue through the compute api in
order to make sure the database is left in a consistent state.

The poll_rescued_instances method is no longer necessary in the virt
driver interface and has been removed.  And also removed from the
different virt drivers, since it was just doing a 'pass' in each of
them.

bug 1088625
bug 1088627

Change-Id: I75f7dc188cc49e5f6e5c8a3cb256d1c42ff7d882
Fix errors in used_limits extension

Fixes bug #1062049

There was a typo mapping the security groups resource to floating IPs.

Volumes usage isn't tracked by Nova any more since delete-nova-volume.

Key pairs don't work with the extension because of bug #1089877.

Change-Id: Ifd694b21fef1dc95e67c07dcef0cd6ea3daa8d53
Remove sleep in test_consoleauth.

test_consoleauth:ConsoleauthTestCase.test_tokens_expire called
time.sleep(1.1) in order to test that tokens with a TTL of 1 second
expire after one second. Problem is time.sleep() may return before the
entire sleep period is complete. Remove the sleep and instead use Oslo's
timeutils to override the time and advance it by one second to check
that expired tokens do expire.

Part of blueprint grizzly-testtools

Change-Id: Iae0e678fb12a76757523dc7dbccb4da98cef85e6
Merge "Add VirtAPI tests"
Fix use of osapi_compute_extension option in api_samples.

Change: I682fa491dd1435814b73404d91df3387504c3e39 changed the
scope of the osapi_compute_extension but didn't update it's use
in test_api_samples.py. This prevents the tests from being run
individually because the option is no longer in nova.config.

The CONF.import() for osapi_compute_extension now refers to the
proper location: nova.api.openstack.compute.contrib

Change-Id: I5d0f15c41e2d6e118a075872e706e91d6555dd39
Merge "Stop nbd leaks, remove pid race."
Merge "Fix poll_rescued_instances periodic task"
Merge "Remove sleep in test_consoleauth."
Fix for broken switch for config_drive

There's a wrong check in api.py, we should check if config_drive
is not a boolean string before we try to treat it as an image id

Fixes LP #1090148

Change-Id: I2e0bc49922781138e569471b0dd360fb3918b687
Imported Translations from Transifex

Change-Id: I56f5172f01600c9a8d8789ac0e811b4df3a257d7
Add general mechanism for testing api coverage.

Refactor the VirtAPI test that ensures all api methods have a test
method to work with parallel test runs. In the process, ensure that it's
dead simple to add a similar check for any test covering an API.

Change-Id: Ie5849a28aa4bfb8f5882ef57344e4131317d2e96
Merge "Imported Translations from Transifex"
Merge "Add general mechanism for testing api coverage."
Merge "Fix errors in used_limits extension"
Merge "Fix use of osapi_compute_extension option in api_samples."