This Page

Psst... hey. You're reading the latest content, but it might be out of sync with code. You can read Nova 2011.2 docs or all OpenStack docs too.

The nova.tests.scheduler.test_scheduler Module

Tests For Scheduler

class nova.tests.scheduler.test_scheduler.CallZoneMethodTest(methodName='runTest')

Bases: nova.test.TestCase

setUp()
tearDown()
test_call_zone_method()
test_call_zone_method_generates_exception()
test_call_zone_method_not_present()
class nova.tests.scheduler.test_scheduler.DynamicNovaClientTest(methodName='runTest')

Bases: nova.test.TestCase

test_issue_novaclient_command_found()
test_issue_novaclient_command_not_found()
class nova.tests.scheduler.test_scheduler.FakeEmptyServerCollection

Bases: object

find(name)
get(f)
class nova.tests.scheduler.test_scheduler.FakeNovaClient(collection, *args, **kwargs)

Bases: object

class nova.tests.scheduler.test_scheduler.FakeNovaClientZones(*args, **kwargs)

Bases: object

authenticate()
class nova.tests.scheduler.test_scheduler.FakeRerouteCompute(method_name, id_to_return=1)

Bases: nova.scheduler.api.reroute_compute

get_collection_context_and_id(args, kwargs)
unmarshall_result(zone_responses)
class nova.tests.scheduler.test_scheduler.FakeResource(attribute_dict)

Bases: object

pause()
class nova.tests.scheduler.test_scheduler.FakeServerCollection

Bases: object

find(name)
get(instance_id)
class nova.tests.scheduler.test_scheduler.FakeZone(id, api_url, username, password)

Bases: object

class nova.tests.scheduler.test_scheduler.FakeZonesProxy

Bases: object

do_something(*args, **kwargs)
raises_exception(*args, **kwargs)
class nova.tests.scheduler.test_scheduler.MultiDriverTestCase(methodName='runTest')

Bases: nova.tests.scheduler.test_scheduler.SimpleDriverTestCase

Test case for multi driver.

setUp()
class nova.tests.scheduler.test_scheduler.SchedulerTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test case for scheduler

setUp()
test_fallback()
test_named_method()
test_show_host_resources_host_not_exit()

A host given as an argument does not exists.

test_show_host_resources_no_project()

No instance are running on the given host.

test_show_host_resources_works_correctly()

Show_host_resources() works correctly as expected.

class nova.tests.scheduler.test_scheduler.SimpleDriverTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test case for simple driver

setUp()
test_block_migration_dest_check_service_lack_disk()

Confirms exception raises when dest doesn’t have enough disk.

test_doesnt_report_disabled_hosts_as_up2()

Ensures driver doesn’t find hosts before they are enabled

test_doesnt_report_disabled_hosts_as_up_no_queue()

Ensures driver doesn’t find hosts before they are enabled

test_least_busy_host_gets_instance()

Ensures the host with less cores gets the next one

test_least_busy_host_gets_instance_no_queue()

Ensures the host with less cores gets the next one

test_least_busy_host_gets_volume()

Ensures the host with less gigabytes gets the next one

test_least_busy_host_gets_volume_no_queue()

Ensures the host with less gigabytes gets the next one

test_live_migration_common_check_checking_cpuinfo_fail()

Raise excetion when original host doen’t have compatible cpu.

test_live_migration_common_check_service_different_hypervisor()

Original host and dest host has different hypervisor type.

test_live_migration_common_check_service_different_version()

Original host and dest host has different hypervisor version.

test_live_migration_common_check_service_orig_not_exists()

Destination host does not exist.

test_live_migration_dest_check_not_alive()

Confirms exception raises in case dest host does not exist.

test_live_migration_dest_check_service_lack_memory()

Confirms exception raises when dest doesn’t have enough memory.

test_live_migration_dest_check_service_same_host()

Confirms exceptioin raises in case dest and src is same host.

test_live_migration_dest_check_service_works_correctly()

Confirms method finishes with no error.

test_live_migration_src_check_compute_node_not_alive()

Confirms src-compute node is alive.

test_live_migration_src_check_instance_not_running()

The instance given by instance_id is not running.

test_live_migration_src_check_volume_node_not_alive()

Raise exception when volume node is not alive.

test_live_migration_src_check_works_correctly()

Confirms this method finishes with no error.

test_reports_enabled_hosts_as_up()

Ensures driver can find the hosts that are up

test_reports_enabled_hosts_as_up_no_queue()

Ensures driver can find the hosts that are up

test_scheduler_live_migration_with_volume()

scheduler_live_migration() works correctly as expected.

Also, checks instance state is changed from ‘running’ -> ‘migrating’.

test_specific_host_gets_instance()

Ensures if you set availability_zone it launches on that zone

test_specific_host_gets_instance_no_queue()

Ensures if you set availability_zone it launches on that zone

test_too_many_cores()

Ensures we don’t go over max cores

test_too_many_cores_no_queue()

Ensures we don’t go over max cores

test_too_many_gigabytes()

Ensures we don’t go over max gigabytes

test_will_schedule_on_disabled_host_if_specified()
test_will_schedule_on_disabled_host_if_specified_no_queue()
test_wont_schedule_if_specified_host_is_down_no_queue()
test_wont_sechedule_if_specified_host_is_down()
class nova.tests.scheduler.test_scheduler.TestDriver

Bases: nova.scheduler.driver.Scheduler

Scheduler Driver for Tests

schedule(context, topic, *args, **kwargs)
schedule_named_method(context, topic, num)
class nova.tests.scheduler.test_scheduler.ZoneRedirectTest(methodName='runTest')

Bases: nova.test.TestCase

setUp()
tearDown()
test_get_collection_context_and_id()
test_one_zone_down_got_instance()
test_one_zone_down_no_instances()
test_routing_flags()
test_trap_found_locally()
test_trap_not_found_locally_id_passed()

When an integer ID is not found locally, we cannot reroute to another zone, so just return InstanceNotFound exception

test_trap_not_found_locally_uuid_passed()

When a UUID is found, if the item isn’t found locally, we should try to reroute to a child zone to see if they have it

test_unmarshal_single_server()
test_zones_up_no_instances()
class nova.tests.scheduler.test_scheduler.ZoneSchedulerTestCase(methodName='runTest')

Bases: nova.test.TestCase

Test case for zone scheduler

setUp()
test_with_two_zones()
nova.tests.scheduler.test_scheduler.fake_instance_get_by_uuid(context, uuid)
nova.tests.scheduler.test_scheduler.found_instance(self, context, instance)
nova.tests.scheduler.test_scheduler.go_boom(self, context, instance)
nova.tests.scheduler.test_scheduler.zone_get_all(context)