Tests for compute service
Bases: nova.test.TestCase
Bases: nova.tests.compute.test_compute.BaseTestCase
This is for unit coverage of aggregate-related methods defined in nova.compute.api.
Ensure we can add a host to an aggregate.
Ensure we can add multiple hosts to an aggregate.
Ensure ComputeHostNotFound is raised when adding invalid host.
Ensure InvalidAggregateAction is raised when zones don’t match.
Ensure InvalidAggregateAction is raised with wrong avail_zone.
Ensure we can delete an aggregate.
Ensure InvalidAggregateAction is raised when non empty aggregate.
Ensure we can remove a host from an aggregate.
Ensure ComputeHostNotFound is raised when removing invalid host.
Ensure metadata can be updated
Bases: nova.tests.compute.test_compute.BaseTestCase
Ensure instance can be soft rebooted
Can’t backup an instance which is already being backed up.
Can’t backup an instance which is already being backed up.
Make sure create associates security groups
Verify that an instance cannot be created without a display_name.
Make sure image properties are copied into system metadata.
Test an instance type with just enough ram and disk space
Test an instance type with ok much user data.
Test an instance type with too much user data.
Test an instance type with malformed user data.
Test an instance type with no min_ram or min_disk
Test an instance type with too little disk space
Test an instance type with too little memory
Make sure destroying disassociates security groups
Make sure destroying security groups disassociates instances
Ensure instance can be deleted after a soft delete
Test get instance
Test searching instances by image
Test searching instances by image
Test searching instances by metadata
Test searching by multiple options at once
Test searching instances by name (display_name)
Test searching instances by state
Get an instances latest fault
Test get instance with an integer id
Ensure instance can be hard rebooted while soft rebooting
Ensure instance hostname is set during creation.
Ensure we can write a file to an instance
Test the instance architecture
Test the instance_name template
Test if the architecture is unknown.
Ensure instance can be paused
Ensure instance can be hard rebooted
Ensure instance can be soft rebooted
Verify building an instance has a reservation_id that matches return value from create
Verify building 2 instances at once results in a reservation_id being returned equal to reservation id set in both instances
Ensure invalid flavors raise
Ensure invalid flavors raise
Ensure instance can be restored from a soft delete
Ensure instance can be resumed (if suspended)
Ensure instance can have its admin password set
Ensure a snapshot of an instance can be created
Can’t snapshot an instance which is already being snapshotted.
Ensure a snapshots min_ram and min_disk are correct.
A snapshot of an instance should have min_ram and min_disk set to that of the instances original image unless that image had a disk format of vhd.
Ensure a snapshots min_ram and min_disk are correct.
A snapshot of a non-shrinkable VHD should have min_ram and min_disk set to that of the original instances flavor.
Ensure a snapshots min_ram and min_disk are correct.
Do not show an attribute that the orig img did not have.
Ensure a snapshots min_ram and min_disk are correct.
A snapshots min_ram and min_disk should be set to default if an instances original image cannot be found.
Ensure instance can’t be soft rebooted while rebooting
Ensure instance can be suspended
Ensure instance can be unpaused
Make sure we can a vnc console for an instance.
Bases: nova.tests.compute.test_compute.BaseTestCase
This is for unit coverage of aggregate-related methods defined in nova.compute.manager.
Bases: nova.tests.compute.test_compute.BaseTestCase
Bases: nova.tests.compute.test_compute.BaseTestCase
Bases: nova.tests.compute.test_compute.BaseTestCase
Tests for re-scheduling exception handling logic
Test with no rescheduling and an additional exception occurs clearing the original build error’s exception context.
Spawn fails and re-scheduling is disabled.
Spawn fails and re-scheduling is enabled. Original exception should not be re-raised.
Bases: nova.tests.compute.test_compute.BaseTestCase
Tests related to re-scheduling build requests
no filter_properties will disable re-scheduling
no request spec will also disable re-scheduling
no retry info will also disable re-scheduling
Bases: nova.tests.compute.test_compute.BaseTestCase
Make sure that the instance can be terminated in ERROR state
Confirm check_can_live_migrate_destination works on positive path
Confirm check_can_live_migrate_destination works on positive path
Confirm check_can_live_migrate_destination works on positive path
Confirm check_can_live_migrate_source works on positive path
Make sure we can get console output from instance
Make sure we can get console output from instance
Make sure create associates a config drive.
Default of memory limit=None is unlimited
Make sure create associates a config drive.
Test passing of oversubscribed cpu policy from the scheduler.
Test passing of oversubscribed disk policy from the scheduler.
Test passing of oversubscribed disk policy from the scheduler, but with insufficient disk.
Test passing of oversubscribed ram policy from the scheduler.
Test passing of oversubscribed ram policy from the scheduler, but with insufficient memory.
Make sure we can get diagnostics for an instance.
check the persistence of the ERROR(scheduling) state
Contrived test to ensure finish_resize doesn’t raise anything
Make sure we don’t leave the instance in RESIZE on error
Ensure notifications on instance migrate/resize
Ensure that the flavor is reverted to the original on revert
Ensure we can write a file to an instance
Ensure we can inject network info
Test that instance is set to error state when exception is raised
Test that we handle InstanceTerminationFailure which is propagated up from the underlying driver.
Raise useful error if console type is an unrecognised string
Confirm exception when pre_live_migration fails.
Confirm live_migration() works as expected correctly.
ensure locked instance cannot be changed
Raise useful error is console type is None
When a spawn fails the network must be deallocated
Make sure we can a vnc console for an instance.
Ensure instance can be paused and unpaused
Confirm post_live_migration() works as expected correctly.
Ensure instance can be powered off
Ensure instance can be powered on
Confirm raising exception if instance doesn’t have fixed_ip.
Confirm setup_compute_volume is called when volume is mounted.
Ensure prep_resize raise a migration error if destination host is not defined
Ensure prep_resize raise a migration error if destination is set on the same source host and allow_resize_to_same_host is false
Ensure instance can be hard rebooted
Ensure instance can be soft rebooted
Ensure instance can be rebuilt
Ensure notifications on instance migrate/resize
Ensure instance can be rebuilt
Ensure instance can be rescued and unrescued
Ensure we can reset networking on an instance
Ensure instance can be migrated/resized
Ensure instance status set to Error on resize error
Ensure vm_state is ERROR when error occurs
Ensure notifications on instance migrate/resize
Ensure instance fails to migrate when source and destination are the same host
spawn network deallocate test.
Make sure that when an instance is not found during spawn that the network is deallocated
Ensure failure when running an instance that already exists
block device mapping failure test.
Make sure that when there is a block device mapping problem, the instance goes to ERROR state, keeping the task state
spawn failure test.
Make sure that when there is a spawning problem, the instance goes to ERROR state, keeping the task state
Ensure run instance generates appropriate usage notification
Detect when a vm is terminated behind the scenes
Make sure it is possible to run and terminate instance
Make sure timestamps are set for launched and destroyed
Make sure it is possible to run and terminate instance with volume attached
Ensure instance can have its admin password set
Test setting password while instance is rebuilding.
Ensure expected exception is raised if set_admin_password not authorized.
Ensure expected exception is raised if set_admin_password not implemented by driver.
Ensure instance can be snapshotted
Ensure task_state is set to None if snapshot fails
Ensure instance can be started
ensure that task_state is reverted after a failed operation
Ensure instance can be stopped
ensure instance can be suspended and resumed
Ensure vm_state is ERROR when suspend error occurs
Ensure that a failure in terminate_instance does not result in the task state being reverted from DELETING (see LP 1046236).
Ensure terminate_instance generates correct usage notification
Make sure we can a vnc console for an instance.
Bases: nova.tests.compute.test_compute.BaseTestCase
Some instance-types are marked ‘disabled’ which means that they will not show up in customer-facing listings. We do, however, want those instance-types to be availble for emergency migrations and for rebuilding of existing instances.
One legitimate use of the ‘disabled’ field would be when phasing out a particular instance-type. We still want customers to be able to use an instance that of the old type, and we want Ops to be able perform migrations against it, but we don’t want customers building new slices with ths phased-out instance-type.
We don’t want to require a customers instance-type to change when ops is migrating a failed server.
A rebuild or a restore should only change the ‘image’, not the ‘instance_type’. Therefore, should be allowed even when the slice is on disabled type already.
Bases: object
Bases: nova.tests.compute.test_compute.BaseTestCase
Bases: exceptions.Exception