diff --git a/trove/tests/api/backups.py b/trove/tests/api/backups.py index c72d601f1e..654d5e718a 100644 --- a/trove/tests/api/backups.py +++ b/trove/tests/api/backups.py @@ -45,7 +45,7 @@ TIMEOUT_BACKUP_DELETE = 120 backup_info = None incremental_info = None incremental_db = generate_uuid() -restore_instance_id = None +incremental_restore_instance_id = None total_num_dbs = 0 backup_count_prior_to_create = 0 backup_count_for_instance_prior_to_create = 0 @@ -342,18 +342,15 @@ class RestoreUsingBackup(object): assert_equal("BUILD", result.status) return result.id - @test(depends_on=[WaitForBackupCreateToFinish]) - def test_restore(self): - global restore_instance_id - restore_instance_id = self._restore(backup_info.id) - @test(depends_on=[IncrementalBackups]) def test_restore_incremental(self): global incremental_restore_instance_id incremental_restore_instance_id = self._restore(incremental_info.id) -@test(groups=[GROUP, tests.INSTANCES]) +@test(depends_on_classes=[WaitForGuestInstallationToFinish], + runs_after_groups=['dbaas.api.configurations.define'], + groups=[GROUP, tests.INSTANCES]) class WaitForRestoreToFinish(object): @classmethod @@ -375,16 +372,6 @@ class WaitForRestoreToFinish(object): poll_until(result_is_active, time_out=TIMEOUT_INSTANCE_CREATE, sleep_time=10) - """ - Wait until the instance is finished restoring from full backup. - """ - @test(depends_on=[RestoreUsingBackup.test_restore]) - def test_instance_restored(self): - try: - self._poll(restore_instance_id) - except exception.PollTimeOut: - fail('Timed out') - """ Wait until the instance is finished restoring from incremental backup. """ @@ -442,13 +429,6 @@ class DeleteRestoreInstance(object): assert_raises(exceptions.NotFound, instance_info.dbaas.instances.get, instance_id) - @test(runs_after=[WaitForRestoreToFinish.test_instance_restored]) - def test_delete_restored_instance(self): - try: - self._delete(restore_instance_id) - except exception.PollTimeOut: - fail('Timed out') - @test(runs_after=[VerifyRestore.test_database_restored_incremental]) def test_delete_restored_instance_incremental(self): try: diff --git a/trove/tests/api/configurations.py b/trove/tests/api/configurations.py index b44881c594..59888311bb 100644 --- a/trove/tests/api/configurations.py +++ b/trove/tests/api/configurations.py @@ -27,6 +27,7 @@ from proboscis.asserts import assert_true from proboscis.asserts import assert_not_equal from proboscis.decorators import time_out from trove.common.utils import poll_until +from trove.tests.api.backups import RestoreUsingBackup from trove.tests.api.instances import assert_unprocessable from trove.tests.api.instances import InstanceTestInfo from trove.tests.api.instances import instance_info @@ -44,6 +45,7 @@ from troveclient.compat import exceptions GROUP = "dbaas.api.configurations" +GROUP_CONFIG_DEFINE = "dbaas.api.configurations.define" CONFIG_NAME = "test_configuration" CONFIG_DESC = "configuration description" @@ -166,7 +168,9 @@ class ConfigurationsTestBase(object): return datastore_test_configs.get("configurations", {}) -@test(depends_on_classes=[WaitForGuestInstallationToFinish], groups=[GROUP]) +@test(depends_on_classes=[WaitForGuestInstallationToFinish], + runs_after=[RestoreUsingBackup], + groups=[GROUP, GROUP_CONFIG_DEFINE]) class CreateConfigurations(ConfigurationsTestBase): @test @@ -300,7 +304,8 @@ class CreateConfigurations(ConfigurationsTestBase): assert_equal(resp.status, 200) -@test(runs_after=[CreateConfigurations], groups=[GROUP]) +@test(runs_after=[CreateConfigurations], + groups=[GROUP, GROUP_CONFIG_DEFINE]) class AfterConfigurationsCreation(ConfigurationsTestBase): @test @@ -439,7 +444,8 @@ class AfterConfigurationsCreation(ConfigurationsTestBase): configuration_info.id) -@test(runs_after=[AfterConfigurationsCreation], groups=[GROUP]) +@test(runs_after=[AfterConfigurationsCreation], + groups=[GROUP, GROUP_CONFIG_DEFINE]) class ListConfigurations(ConfigurationsTestBase): @test @@ -556,7 +562,8 @@ class ListConfigurations(ConfigurationsTestBase): assert_equal(list_config[0].updated, details_config.updated) -@test(runs_after=[ListConfigurations], groups=[GROUP]) +@test(runs_after=[ListConfigurations], + groups=[GROUP, GROUP_CONFIG_DEFINE]) class StartInstanceWithConfiguration(ConfigurationsTestBase): @test @@ -590,7 +597,9 @@ class StartInstanceWithConfiguration(ConfigurationsTestBase): configuration_instance.id = result.id -@test(runs_after=[StartInstanceWithConfiguration], groups=[GROUP]) +@test(depends_on_classes=[StartInstanceWithConfiguration], + runs_after_groups=['dbaas.api.backups'], + groups=[GROUP]) class WaitForConfigurationInstanceToFinish(ConfigurationsTestBase): @test