Reorganize scenario test order to speed up run

This changeset stitches together all the different groups
in a way to have 3 instances being created at any given
time (where possible).  The groupings will be:

-- module
|- configuration
-- instance_actions

-- database_actions
|- backup
-- instance_actions

-- user_actions
|- root_actions
-- guest_log

-- replication

Times (on a fast test machine) went from 2230s to 1720s, an
improvement of 23%.

The group labels were moved into the __init__.py file to facilitate
being accessed by different group implementations (to avoid a
circular import issue).

Tests were also cleaned up and homogenized wherever possible.

Change-Id: Idc3daab243261584ac5fa9350d952f5bb3984300
Closes-Bug: #1571092
This commit is contained in:
Peter Stachowski 2016-06-02 13:16:28 -04:00
parent 091c255b67
commit e7bab49214
24 changed files with 607 additions and 376 deletions

View File

@ -32,6 +32,7 @@ from trove.tests.api import root
from trove.tests.api import user_access
from trove.tests.api import users
from trove.tests.api import versions
from trove.tests.scenario import groups
from trove.tests.scenario.groups import backup_group
from trove.tests.scenario.groups import cluster_actions_group
from trove.tests.scenario.groups import configuration_group
@ -142,19 +143,18 @@ instance_create_groups.extend([instance_create_group.GROUP,
instance_delete_group.GROUP])
backup_groups = list(instance_create_groups)
backup_groups.extend([backup_group.GROUP_BACKUP,
backup_group.GROUP_RESTORE])
backup_groups.extend([groups.BACKUP,
groups.BACKUP_INST])
backup_incremental_groups = list(backup_groups)
backup_incremental_groups.extend([backup_group.GROUP_INC_BACKUP,
backup_group.GROUP_INC_RESTORE])
backup_incremental_groups.extend([backup_group.GROUP])
configuration_groups = list(instance_create_groups)
configuration_groups.extend([configuration_group.GROUP])
configuration_create_groups = list(base_groups)
configuration_create_groups.extend([configuration_group.GROUP_CFGGRP_CREATE,
configuration_group.GROUP_CFGGRP_DELETE])
configuration_create_groups.extend([groups.CFGGRP_CREATE,
groups.CFGGRP_DELETE])
database_actions_groups = list(instance_create_groups)
database_actions_groups.extend([database_actions_group.GROUP])
@ -169,8 +169,8 @@ module_groups = list(instance_create_groups)
module_groups.extend([module_group.GROUP])
module_create_groups = list(base_groups)
module_create_groups.extend([module_group.GROUP_MODULE_CREATE,
module_group.GROUP_MODULE_DELETE])
module_create_groups.extend([groups.MODULE_CREATE,
groups.MODULE_DELETE])
replication_groups = list(instance_create_groups)
replication_groups.extend([replication_group.GROUP])

View File

@ -0,0 +1,117 @@
# Copyright 2016 Tesora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# Labels for all the sub-groups are listed here, so that they can be
# referenced by other groups (thus avoiding circular references when
# loading modules). The main GROUP label is still defined in each
# respective group file.
# Backup Group
BACKUP = "scenario.backup_grp"
BACKUP_CREATE = "scenario.backup_create_grp"
BACKUP_DELETE = "scenario.backup_delete_grp"
BACKUP_INST = "scenario.backup_inst_grp"
BACKUP_INST_CREATE = "scenario.backup_inst_create_grp"
BACKUP_INST_CREATE_WAIT = "scenario.backup_inst_create_wait_grp"
BACKUP_INST_DELETE = "scenario.backup_inst_delete_grp"
BACKUP_INST_DELETE_WAIT = "scenario.backup_inst_delete_wait_grp"
BACKUP_INC = "scenario.backup_inc_grp"
BACKUP_INC_CREATE = "scenario.backup_inc_create_grp"
BACKUP_INC_DELETE = "scenario.backup_inc_delete_grp"
BACKUP_INC_INST = "scenario.backup_inc_inst_grp"
BACKUP_INC_INST_CREATE = "scenario.backup_inc_inst_create_grp"
BACKUP_INC_INST_CREATE_WAIT = "scenario.backup_inc_inst_create_wait_grp"
BACKUP_INC_INST_DELETE = "scenario.backup_inc_inst_delete_grp"
BACKUP_INC_INST_DELETE_WAIT = "scenario.backup_inc_inst_delete_wait_grp"
# Configuration Group
CFGGRP_CREATE = "scenario.cfggrp_create_grp"
CFGGRP_DELETE = "scenario.cfggrp_delete_grp"
CFGGRP_INST = "scenario.cfggrp_inst_grp"
CFGGRP_INST_CREATE = "scenario.cfggrp_inst_create_grp"
CFGGRP_INST_CREATE_WAIT = "scenario.cfggrp_inst_create_wait_grp"
CFGGRP_INST_DELETE = "scenario.cfggrp_inst_delete_grp"
CFGGRP_INST_DELETE_WAIT = "scenario.cfggrp_inst_delete_wait_grp"
# Database Actions Group
DB_ACTION_CREATE = "scenario.db_action_create_grp"
DB_ACTION_DELETE = "scenario.db_action_delete_grp"
DB_ACTION_INST = "scenario.db_action_inst_grp"
DB_ACTION_INST_CREATE = "scenario.db_action_inst_create_grp"
DB_ACTION_INST_CREATE_WAIT = "scenario.db_action_inst_create_wait_grp"
DB_ACTION_INST_DELETE = "scenario.db_action_inst_delete_grp"
DB_ACTION_INST_DELETE_WAIT = "scenario.db_action_inst_delete_wait_grp"
# Instance Actions Group
INST_ACTIONS = "scenario.inst_actions_grp"
INST_ACTIONS_RESIZE = "scenario.inst_actions_resize_grp"
INST_ACTIONS_RESIZE_WAIT = "scenario.inst_actions_resize_wait_grp"
# Instance Create Group
INST_CREATE = "scenario.inst_create_grp"
INST_CREATE_WAIT = "scenario.inst_create_wait_grp"
INST_INIT_DELETE = "scenario.inst_init_delete_grp"
INST_INIT_DELETE_WAIT = "scenario.inst_init_delete_wait_grp"
# Instance Delete Group
INST_DELETE = "scenario.inst_delete_grp"
INST_DELETE_WAIT = "scenario.inst_delete_wait_grp"
# Module Group
MODULE_CREATE = "scenario.module_create_grp"
MODULE_DELETE = "scenario.module_delete_grp"
MODULE_INST = "scenario.module_inst_grp"
MODULE_INST_CREATE = "scenario.module_inst_create_grp"
MODULE_INST_CREATE_WAIT = "scenario.module_inst_create_wait_grp"
MODULE_INST_DELETE = "scenario.module_inst_delete_grp"
MODULE_INST_DELETE_WAIT = "scenario.module_inst_delete_wait_grp"
# Replication Group
REPL_INST = "scenario.repl_inst_grp"
REPL_INST_CREATE = "scenario.repl_inst_create_grp"
REPL_INST_CREATE_WAIT = "scenario.repl_inst_create_wait_grp"
REPL_INST_MULTI_CREATE = "scenario.repl_inst_multi_create_grp"
REPL_INST_DELETE_NON_AFFINITY_WAIT = "scenario.repl_inst_delete_noaff_wait_grp"
REPL_INST_MULTI_CREATE_WAIT = "scenario.repl_inst_multi_create_wait_grp"
REPL_INST_DELETE = "scenario.repl_inst_delete_grp"
REPL_INST_DELETE_WAIT = "scenario.repl_inst_delete_wait_grp"
# Root Actions Group
ROOT_ACTION_ENABLE = "scenario.root_action_enable_grp"
ROOT_ACTION_DISABLE = "scenario.root_action_disable_grp"
ROOT_ACTION_INST = "scenario.root_action_inst_grp"
ROOT_ACTION_INST_CREATE = "scenario.root_action_inst_create_grp"
ROOT_ACTION_INST_CREATE_WAIT = "scenario.root_action_inst_create_wait_grp"
ROOT_ACTION_INST_DELETE = "scenario.root_action_inst_delete_grp"
ROOT_ACTION_INST_DELETE_WAIT = "scenario.root_action_inst_delete_wait_grp"
# User Actions Group
USER_ACTION_CREATE = "scenario.user_action_create_grp"
USER_ACTION_DELETE = "scenario.user_action_delete_grp"
USER_ACTION_INST = "scenario.user_action_inst_grp"
USER_ACTION_INST_CREATE = "scenario.user_action_inst_create_grp"
USER_ACTION_INST_CREATE_WAIT = "scenario.user_action_inst_create_wait_grp"
USER_ACTION_INST_DELETE = "scenario.user_action_inst_delete_grp"
USER_ACTION_INST_DELETE_WAIT = "scenario.user_action_inst_delete_wait_grp"

View File

@ -15,29 +15,12 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.backup_restore_group"
GROUP_BACKUP = "scenario.backup_group"
GROUP_BACKUP_CREATE = "scenario.backup_create_group"
GROUP_BACKUP_DELETE = "scenario.backup_delete_group"
GROUP_RESTORE = "scenario.restore_group"
GROUP_RESTORE_CREATE = "scenario.restore_create_group"
GROUP_RESTORE_CREATE_WAIT = "scenario.restore_create_wait_group"
GROUP_RESTORE_DELETE = "scenario.restore_delete_group"
GROUP_RESTORE_DELETE_WAIT = "scenario.restore_delete_wait_group"
GROUP_INC_BACKUP = "scenario.inc_backup_group"
GROUP_INC_BACKUP_CREATE = "scenario.inc_backup_create_group"
GROUP_INC_BACKUP_DELETE = "scenario.inc_backup_delete_group"
GROUP_INC_RESTORE = "scenario.inc_restore_group"
GROUP_INC_RESTORE_CREATE = "scenario.inc_restore_create_group"
GROUP_INC_RESTORE_CREATE_WAIT = "scenario.inc_restore_create_wait_group"
GROUP_INC_RESTORE_DELETE = "scenario.inc_restore_delete_group"
GROUP_INC_RESTORE_DELETE_WAIT = "scenario.inc_restore_delete_wait_group"
GROUP_INCREMENTAL = "scenario.incremental_backup_restore_group"
GROUP_INCREMENTAL_BACKUP = "scenario.incremental_backup_group"
@ -50,13 +33,15 @@ class BackupRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'BackupRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_BACKUP, GROUP_BACKUP_CREATE])
class BackupGroup(TestGroup):
"""Test Backup functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.BACKUP, groups.BACKUP_CREATE],
runs_after_groups=[groups.MODULE_INST_CREATE_WAIT,
groups.CFGGRP_INST_CREATE_WAIT])
class BackupCreateGroup(TestGroup):
"""Test Backup Create functionality."""
def __init__(self):
super(BackupGroup, self).__init__(
super(BackupCreateGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -165,13 +150,13 @@ class BackupGroup(TestGroup):
self.test_runner.run_backup_get_unauthorized_user()
@test(depends_on_groups=[GROUP_BACKUP_CREATE],
groups=[GROUP, GROUP_INC_BACKUP, GROUP_INC_BACKUP_CREATE])
class BackupIncGroup(TestGroup):
"""Test Incremental Backup functionality."""
@test(depends_on_groups=[groups.BACKUP_CREATE],
groups=[GROUP, groups.BACKUP_INC, groups.BACKUP_INC_CREATE])
class BackupIncCreateGroup(TestGroup):
"""Test Backup Incremental Create functionality."""
def __init__(self):
super(BackupIncGroup, self).__init__(
super(BackupIncCreateGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -227,13 +212,15 @@ class BackupIncGroup(TestGroup):
self.test_runner.run_instance_goes_active()
@test(depends_on_groups=[GROUP_BACKUP_CREATE],
groups=[GROUP, GROUP_RESTORE, GROUP_RESTORE_CREATE])
class RestoreCreateGroup(TestGroup):
"""Test Restore Create functionality."""
@test(depends_on_groups=[groups.BACKUP_CREATE],
groups=[GROUP, groups.BACKUP_INST, groups.BACKUP_INST_CREATE],
runs_after_groups=[groups.MODULE_INST_DELETE,
groups.CFGGRP_INST_DELETE])
class BackupInstCreateGroup(TestGroup):
"""Test Backup Instance Create functionality."""
def __init__(self):
super(RestoreCreateGroup, self).__init__(
super(BackupInstCreateGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -242,14 +229,15 @@ class RestoreCreateGroup(TestGroup):
self.test_runner.run_restore_from_backup()
@test(depends_on_groups=[GROUP_INC_BACKUP_CREATE],
groups=[GROUP, GROUP_INC_RESTORE, GROUP_INC_RESTORE_CREATE],
runs_after_groups=[GROUP_RESTORE_CREATE])
class RestoreIncCreateGroup(TestGroup):
"""Test Restore Incremental Create functionality."""
@test(depends_on_groups=[groups.BACKUP_INC_CREATE],
groups=[GROUP, groups.BACKUP_INC_INST,
groups.BACKUP_INC_INST_CREATE],
runs_after_groups=[groups.BACKUP_INST_CREATE])
class BackupIncInstCreateGroup(TestGroup):
"""Test Backup Incremental Instance Create functionality."""
def __init__(self):
super(RestoreIncCreateGroup, self).__init__(
super(BackupIncInstCreateGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -258,14 +246,16 @@ class RestoreIncCreateGroup(TestGroup):
self.test_runner.run_restore_from_inc_1_backup()
@test(depends_on_groups=[GROUP_RESTORE_CREATE],
groups=[GROUP, GROUP_RESTORE, GROUP_RESTORE_CREATE_WAIT],
runs_after_groups=[GROUP_INC_RESTORE_CREATE])
class RestoreCreateWaitGroup(TestGroup):
"""Test Restore Create completes."""
@test(depends_on_groups=[groups.BACKUP_INST_CREATE],
groups=[GROUP, groups.BACKUP_INST, groups.BACKUP_INST_CREATE_WAIT],
runs_after_groups=[groups.BACKUP_INC_INST_CREATE,
groups.DB_ACTION_INST_CREATE,
groups.INST_ACTIONS_RESIZE])
class BackupInstCreateWaitGroup(TestGroup):
"""Test Backup Instance Create completes."""
def __init__(self):
super(RestoreCreateWaitGroup, self).__init__(
super(BackupInstCreateWaitGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -279,14 +269,15 @@ class RestoreCreateWaitGroup(TestGroup):
self.test_runner.run_verify_data_in_restored_instance()
@test(depends_on_groups=[GROUP_INC_RESTORE_CREATE],
groups=[GROUP, GROUP_INC_RESTORE, GROUP_INC_RESTORE_CREATE_WAIT],
runs_after_groups=[GROUP_RESTORE_CREATE])
class RestoreIncCreateWaitGroup(TestGroup):
"""Test Restore Incremental Create completes."""
@test(depends_on_groups=[groups.BACKUP_INC_INST_CREATE],
groups=[GROUP, groups.BACKUP_INC_INST,
groups.BACKUP_INC_INST_CREATE_WAIT],
runs_after_groups=[groups.BACKUP_INST_CREATE_WAIT])
class BackupIncInstCreateWaitGroup(TestGroup):
"""Test Backup Incremental Instance Create completes."""
def __init__(self):
super(RestoreIncCreateWaitGroup, self).__init__(
super(BackupIncInstCreateWaitGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -300,14 +291,14 @@ class RestoreIncCreateWaitGroup(TestGroup):
self.test_runner.run_verify_data_in_restored_inc_1_instance()
@test(depends_on_groups=[GROUP_RESTORE_CREATE_WAIT],
groups=[GROUP, GROUP_RESTORE, GROUP_RESTORE_DELETE],
runs_after_groups=[GROUP_INC_RESTORE_CREATE_WAIT])
class RestoreDeleteGroup(TestGroup):
"""Test Restore Delete functionality."""
@test(depends_on_groups=[groups.BACKUP_INST_CREATE_WAIT],
groups=[GROUP, groups.BACKUP_INST, groups.BACKUP_INST_DELETE],
runs_after_groups=[groups.BACKUP_INC_INST_CREATE_WAIT])
class BackupInstDeleteGroup(TestGroup):
"""Test Backup Instance Delete functionality."""
def __init__(self):
super(RestoreDeleteGroup, self).__init__(
super(BackupInstDeleteGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -316,14 +307,15 @@ class RestoreDeleteGroup(TestGroup):
self.test_runner.run_delete_restored_instance()
@test(depends_on_groups=[GROUP_INC_RESTORE_CREATE_WAIT],
groups=[GROUP, GROUP_INC_RESTORE, GROUP_INC_RESTORE_DELETE],
runs_after_groups=[GROUP_RESTORE_DELETE])
class RestoreIncDeleteGroup(TestGroup):
"""Test Restore Incremental Delete functionality."""
@test(depends_on_groups=[groups.BACKUP_INC_INST_CREATE_WAIT],
groups=[GROUP, groups.BACKUP_INC_INST,
groups.BACKUP_INC_INST_DELETE],
runs_after_groups=[groups.BACKUP_INST_DELETE])
class BackupIncInstDeleteGroup(TestGroup):
"""Test Backup Incremental Instance Delete functionality."""
def __init__(self):
super(RestoreIncDeleteGroup, self).__init__(
super(BackupIncInstDeleteGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -332,13 +324,14 @@ class RestoreIncDeleteGroup(TestGroup):
self.test_runner.run_delete_restored_inc_1_instance()
@test(depends_on_groups=[GROUP_RESTORE_DELETE],
groups=[GROUP, GROUP_RESTORE, GROUP_RESTORE_DELETE_WAIT])
class RestoreDeleteWaitGroup(TestGroup):
"""Test Restore Delete completes."""
@test(depends_on_groups=[groups.BACKUP_INST_DELETE],
groups=[GROUP, groups.BACKUP_INST, groups.BACKUP_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class BackupInstDeleteWaitGroup(TestGroup):
"""Test Backup Instance Delete completes."""
def __init__(self):
super(RestoreDeleteWaitGroup, self).__init__(
super(BackupInstDeleteWaitGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -347,14 +340,15 @@ class RestoreDeleteWaitGroup(TestGroup):
self.test_runner.run_wait_for_restored_instance_delete()
@test(depends_on_groups=[GROUP_INC_RESTORE_DELETE],
groups=[GROUP, GROUP_INC_RESTORE, GROUP_INC_RESTORE_DELETE_WAIT],
runs_after_groups=[GROUP_RESTORE_DELETE_WAIT])
class RestoreIncDeleteWaitGroup(TestGroup):
"""Test Restore Incremental Delete completes."""
@test(depends_on_groups=[groups.BACKUP_INC_INST_DELETE],
groups=[GROUP, groups.BACKUP_INC_INST,
groups.BACKUP_INC_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class BackupIncInstDeleteWaitGroup(TestGroup):
"""Test Backup Incremental Instance Delete completes."""
def __init__(self):
super(RestoreIncDeleteWaitGroup, self).__init__(
super(BackupIncInstDeleteWaitGroup, self).__init__(
BackupRunnerFactory.instance())
@test
@ -363,9 +357,9 @@ class RestoreIncDeleteWaitGroup(TestGroup):
self.test_runner.run_wait_for_restored_inc_1_instance_delete()
@test(depends_on_groups=[GROUP_INC_BACKUP_CREATE],
groups=[GROUP, GROUP_INC_BACKUP, GROUP_INC_BACKUP_DELETE],
runs_after_groups=[GROUP_INC_RESTORE_DELETE_WAIT])
@test(depends_on_groups=[groups.BACKUP_INC_CREATE],
groups=[GROUP, groups.BACKUP_INC, groups.BACKUP_INC_DELETE],
runs_after_groups=[groups.BACKUP_INC_INST_CREATE_WAIT])
class BackupIncDeleteGroup(TestGroup):
"""Test Backup Incremental Delete functionality."""
@ -377,14 +371,15 @@ class BackupIncDeleteGroup(TestGroup):
def delete_inc_2_backup(self):
"""Test deleting the inc 2 backup."""
# We only delete the inc 2 backup, as the inc 1 should be deleted
# by the full backup delete.
# by the full backup delete that runs after.
self.test_runner.run_delete_inc_2_backup()
@test(depends_on_groups=[GROUP_BACKUP_CREATE],
groups=[GROUP, GROUP_BACKUP, GROUP_BACKUP_DELETE],
runs_after_groups=[GROUP_INC_BACKUP_DELETE,
GROUP_RESTORE_DELETE_WAIT])
@test(depends_on_groups=[groups.BACKUP_CREATE],
groups=[GROUP, groups.BACKUP, groups.BACKUP_DELETE],
runs_after_groups=[groups.BACKUP_INST_CREATE_WAIT,
groups.BACKUP_INC_DELETE,
groups.INST_ACTIONS_RESIZE_WAIT])
class BackupDeleteGroup(TestGroup):
"""Test Backup Delete functionality."""

View File

@ -15,19 +15,12 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.configuration_group"
GROUP_CFGGRP_CREATE = "scenario.cfggrp_create_group"
GROUP_CFGGRP_INST = "scenario.cfggrp_inst_group"
GROUP_CFGGRP_INST_CREATE = "scenario.cfggrp_inst_create_group"
GROUP_CFGGRP_INST_CREATE_WAIT = "scenario.cfggrp_inst_create_wait_group"
GROUP_CFGGRP_INST_DELETE = "scenario.cfggrp_inst_delete_group"
GROUP_CFGGRP_INST_DELETE_WAIT = "scenario.cfggrp_inst_delete_wait_group"
GROUP_CFGGRP_DELETE = "scenario.cfggrp_delete_group"
class ConfigurationRunnerFactory(test_runners.RunnerFactory):
@ -36,7 +29,8 @@ class ConfigurationRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'ConfigurationRunner'
@test(groups=[GROUP, GROUP_CFGGRP_CREATE])
@test(groups=[GROUP, groups.CFGGRP_CREATE],
runs_after_groups=[groups.MODULE_CREATE])
class ConfigurationCreateGroup(TestGroup):
"""Test Configuration Group functionality."""
@ -100,9 +94,11 @@ class ConfigurationCreateGroup(TestGroup):
self.test_runner.run_non_dynamic_conf_get_unauthorized_user()
@test(depends_on_groups=[instance_create_group.GROUP,
GROUP_CFGGRP_CREATE],
groups=[GROUP, GROUP_CFGGRP_INST, GROUP_CFGGRP_INST_CREATE])
@test(depends_on_groups=[groups.INST_CREATE_WAIT,
groups.CFGGRP_CREATE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_CREATE],
runs_after_groups=[groups.MODULE_INST_CREATE])
class ConfigurationInstCreateGroup(TestGroup):
"""Test Instance Configuration Group Create functionality."""
@ -235,8 +231,11 @@ class ConfigurationInstCreateGroup(TestGroup):
self.test_runner.run_detach_non_dynamic_group()
@test(depends_on_groups=[GROUP_CFGGRP_INST_CREATE],
groups=[GROUP, GROUP_CFGGRP_INST, GROUP_CFGGRP_INST_CREATE_WAIT])
@test(depends_on_groups=[groups.CFGGRP_INST_CREATE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_CREATE_WAIT],
runs_after_groups=[groups.INST_ACTIONS,
groups.MODULE_INST_CREATE_WAIT])
class ConfigurationInstCreateWaitGroup(TestGroup):
"""Test that Instance Configuration Group Create Completes."""
def __init__(self):
@ -254,8 +253,10 @@ class ConfigurationInstCreateWaitGroup(TestGroup):
self.test_runner.run_verify_instance_values()
@test(depends_on_groups=[GROUP_CFGGRP_INST_CREATE_WAIT],
groups=[GROUP, GROUP_CFGGRP_INST, GROUP_CFGGRP_INST_DELETE])
@test(depends_on_groups=[groups.CFGGRP_INST_CREATE_WAIT],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_DELETE],
runs_after_groups=[groups.MODULE_INST_DELETE])
class ConfigurationInstDeleteGroup(TestGroup):
"""Test Instance Configuration Group Delete functionality."""
@ -269,8 +270,10 @@ class ConfigurationInstDeleteGroup(TestGroup):
self.test_runner.run_delete_conf_instance()
@test(depends_on_groups=[GROUP_CFGGRP_INST_DELETE],
groups=[GROUP, GROUP_CFGGRP_INST, GROUP_CFGGRP_INST_DELETE_WAIT])
@test(depends_on_groups=[groups.CFGGRP_INST_DELETE],
groups=[GROUP, groups.CFGGRP_INST,
groups.CFGGRP_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class ConfigurationInstDeleteWaitGroup(TestGroup):
"""Test that Instance Configuration Group Delete Completes."""
@ -284,9 +287,9 @@ class ConfigurationInstDeleteWaitGroup(TestGroup):
self.test_runner.run_wait_for_delete_conf_instance()
@test(depends_on_groups=[GROUP_CFGGRP_CREATE],
runs_after_groups=[GROUP_CFGGRP_INST_DELETE_WAIT],
groups=[GROUP, GROUP_CFGGRP_DELETE])
@test(depends_on_groups=[groups.CFGGRP_CREATE],
runs_after_groups=[groups.CFGGRP_INST_DELETE_WAIT],
groups=[GROUP, groups.CFGGRP_DELETE])
class ConfigurationDeleteGroup(TestGroup):
"""Test Configuration Group Delete functionality."""

View File

@ -15,17 +15,12 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.database_actions_group"
GROUP_DB_ACTION_INST = "scenario.db_action_inst_group"
GROUP_DB_ACTION_INST_CREATE = "scenario.db_action_inst_create_group"
GROUP_DB_ACTION_INST_CREATE_WAIT = "scenario.db_action_inst_create_wait_group"
GROUP_DB_ACTION_INST_DELETE = "scenario.db_action_inst_delete_group"
GROUP_DB_ACTION_INST_DELETE_WAIT = "scenario.db_action_inst_delete_wait_group"
class DatabaseActionsRunnerFactory(test_runners.RunnerFactory):
@ -40,13 +35,13 @@ class InstanceCreateRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'InstanceCreateRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_DB_ACTION_INST])
class DatabaseActionsGroup(TestGroup):
"""Test Database Actions functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.DB_ACTION_CREATE])
class DatabaseActionsCreateGroup(TestGroup):
"""Test Database Actions Create functionality."""
def __init__(self):
super(DatabaseActionsGroup, self).__init__(
super(DatabaseActionsCreateGroup, self).__init__(
DatabaseActionsRunnerFactory.instance())
@test
@ -77,8 +72,17 @@ class DatabaseActionsGroup(TestGroup):
"""Ensure creating an existing database fails."""
self.test_runner.run_existing_database_create()
@test(depends_on=[create_databases],
runs_after=[create_existing_database])
@test(depends_on_groups=[groups.DB_ACTION_CREATE],
groups=[GROUP, groups.DB_ACTION_DELETE])
class DatabaseActionsDeleteGroup(TestGroup):
"""Test Database Actions Delete functionality."""
def __init__(self):
super(DatabaseActionsDeleteGroup, self).__init__(
DatabaseActionsRunnerFactory.instance())
@test
def delete_database(self):
"""Delete the created databases."""
self.test_runner.run_database_delete()
@ -99,9 +103,10 @@ class DatabaseActionsGroup(TestGroup):
self.test_runner.run_system_database_delete()
@test(groups=[GROUP, GROUP_DB_ACTION_INST_CREATE])
@test(groups=[GROUP, groups.DB_ACTION_INST, groups.DB_ACTION_INST_CREATE],
runs_after_groups=[groups.INST_ACTIONS_RESIZE])
class DatabaseActionsInstCreateGroup(TestGroup):
"""Test Database Actions Create functionality."""
"""Test Database Actions Instance Create functionality."""
def __init__(self):
super(DatabaseActionsInstCreateGroup, self).__init__(
@ -112,13 +117,17 @@ class DatabaseActionsInstCreateGroup(TestGroup):
def create_initialized_instance(self):
"""Create an instance with initial databases."""
self.instance_create_runner.run_initialized_instance_create(
with_dbs=True, with_users=False, configuration_id=None)
with_dbs=True, with_users=False, configuration_id=None,
name_suffix='_db')
@test(depends_on_groups=[GROUP_DB_ACTION_INST_CREATE],
groups=[GROUP, GROUP_DB_ACTION_INST_CREATE_WAIT])
@test(depends_on_groups=[groups.DB_ACTION_INST_CREATE],
groups=[GROUP, groups.DB_ACTION_INST, groups.DB_ACTION_INST_CREATE_WAIT],
runs_after_groups=[groups.BACKUP_INST_CREATE,
groups.BACKUP_INC_INST_CREATE,
groups.INST_ACTIONS_RESIZE])
class DatabaseActionsInstCreateWaitGroup(TestGroup):
"""Wait for Database Actions Create to complete."""
"""Wait for Database Actions Instance Create to complete."""
def __init__(self):
super(DatabaseActionsInstCreateWaitGroup, self).__init__(
@ -141,10 +150,10 @@ class DatabaseActionsInstCreateWaitGroup(TestGroup):
self.instance_create_runner.run_validate_initialized_instance()
@test(depends_on_groups=[GROUP_DB_ACTION_INST_CREATE_WAIT],
groups=[GROUP, GROUP_DB_ACTION_INST_DELETE])
@test(depends_on_groups=[groups.DB_ACTION_INST_CREATE_WAIT],
groups=[GROUP, groups.DB_ACTION_INST, groups.DB_ACTION_INST_DELETE])
class DatabaseActionsInstDeleteGroup(TestGroup):
"""Test Database Actions Delete functionality."""
"""Test Database Actions Instance Delete functionality."""
def __init__(self):
super(DatabaseActionsInstDeleteGroup, self).__init__(
@ -157,10 +166,11 @@ class DatabaseActionsInstDeleteGroup(TestGroup):
self.instance_create_runner.run_initialized_instance_delete()
@test(depends_on_groups=[GROUP_DB_ACTION_INST_DELETE],
groups=[GROUP, GROUP_DB_ACTION_INST_DELETE_WAIT])
@test(depends_on_groups=[groups.DB_ACTION_INST_DELETE],
groups=[GROUP, groups.DB_ACTION_INST, groups.DB_ACTION_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class DatabaseActionsInstDeleteWaitGroup(TestGroup):
"""Wait for Database Actions Delete to complete."""
"""Wait for Database Actions Instance Delete to complete."""
def __init__(self):
super(DatabaseActionsInstDeleteWaitGroup, self).__init__(

View File

@ -14,7 +14,7 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
@ -28,7 +28,10 @@ class GuestLogRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'GuestLogRunner'
@test(depends_on_groups=[instance_create_group.GROUP], groups=[GROUP])
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP],
runs_after_groups=[groups.USER_ACTION_INST_CREATE,
groups.ROOT_ACTION_INST_CREATE])
class GuestLogGroup(TestGroup):
"""Test Guest Log functionality."""

View File

@ -15,14 +15,12 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.instance_actions_group"
GROUP_INST_ACTIONS = "scenario.inst_actions_group"
GROUP_INST_ACTIONS_WAIT = "scenario.inst_actions_wait_group"
class InstanceActionsRunnerFactory(test_runners.RunnerFactory):
@ -31,8 +29,10 @@ class InstanceActionsRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'InstanceActionsRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_INST_ACTIONS])
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.INST_ACTIONS],
runs_after_groups=[groups.MODULE_INST_CREATE,
groups.CFGGRP_INST_CREATE])
class InstanceActionsGroup(TestGroup):
"""Test Instance Actions functionality."""
@ -50,19 +50,37 @@ class InstanceActionsGroup(TestGroup):
"""Resize attached volume."""
self.test_runner.run_instance_resize_volume()
@test(depends_on=[instance_resize_volume])
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.INST_ACTIONS_RESIZE],
runs_after_groups=[groups.INST_ACTIONS,
groups.MODULE_INST_CREATE_WAIT,
groups.CFGGRP_INST_CREATE_WAIT,
groups.BACKUP_CREATE,
groups.BACKUP_INC_CREATE])
class InstanceActionsResizeGroup(TestGroup):
"""Test Instance Actions Resize functionality."""
def __init__(self):
super(InstanceActionsResizeGroup, self).__init__(
InstanceActionsRunnerFactory.instance())
@test
def instance_resize_flavor(self):
"""Resize instance flavor."""
self.test_runner.run_instance_resize_flavor()
@test(depends_on_groups=[GROUP_INST_ACTIONS],
groups=[GROUP, GROUP_INST_ACTIONS_WAIT])
class InstanceActionsWaitGroup(TestGroup):
"""Test that Instance Actions Completes."""
@test(depends_on_groups=[groups.INST_ACTIONS_RESIZE],
groups=[GROUP, groups.INST_ACTIONS_RESIZE_WAIT],
runs_after_groups=[groups.BACKUP_INST_CREATE,
groups.BACKUP_INC_INST_CREATE,
groups.DB_ACTION_INST_CREATE])
class InstanceActionsResizeWaitGroup(TestGroup):
"""Test that Instance Actions Resize Completes."""
def __init__(self):
super(InstanceActionsWaitGroup, self).__init__(
super(InstanceActionsResizeWaitGroup, self).__init__(
InstanceActionsRunnerFactory.instance())
@test

View File

@ -16,15 +16,12 @@
from proboscis import test
from trove.tests import PRE_INSTANCES
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.instance_create_group"
GROUP_INST_CREATE = "scenario.inst_create_group"
GROUP_INST_CREATE_WAIT = "scenario.inst_create_wait_group"
GROUP_INIT_INST_DELETE = "scenario.init_inst_delete_group"
GROUP_INIT_INST_DELETE_WAIT = "scenario.init_inst_delete_wait_group"
class InstanceCreateRunnerFactory(test_runners.RunnerFactory):
@ -35,7 +32,7 @@ class InstanceCreateRunnerFactory(test_runners.RunnerFactory):
@test(depends_on_groups=["services.initialize"],
runs_after_groups=[PRE_INSTANCES],
groups=[GROUP, GROUP_INST_CREATE])
groups=[GROUP, groups.INST_CREATE])
class InstanceCreateGroup(TestGroup):
"""Test Instance Create functionality."""
@ -59,8 +56,9 @@ class InstanceCreateGroup(TestGroup):
self.test_runner.run_initialized_instance_create()
@test(depends_on_groups=[GROUP_INST_CREATE],
groups=[GROUP, GROUP_INST_CREATE_WAIT])
@test(depends_on_groups=[groups.INST_CREATE],
groups=[GROUP, groups.INST_CREATE_WAIT],
runs_after_groups=[groups.MODULE_CREATE, groups.CFGGRP_CREATE])
class InstanceCreateWaitGroup(TestGroup):
"""Test that Instance Create Completes."""
@ -84,8 +82,8 @@ class InstanceCreateWaitGroup(TestGroup):
self.test_runner.run_validate_initialized_instance()
@test(depends_on_groups=[GROUP_INST_CREATE_WAIT],
groups=[GROUP, GROUP_INIT_INST_DELETE])
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.INST_INIT_DELETE])
class InstanceInitDeleteGroup(TestGroup):
"""Test Initialized Instance Delete functionality."""
@ -99,8 +97,8 @@ class InstanceInitDeleteGroup(TestGroup):
self.test_runner.run_initialized_instance_delete()
@test(depends_on_groups=[GROUP_INIT_INST_DELETE],
groups=[GROUP, GROUP_INIT_INST_DELETE_WAIT])
@test(depends_on_groups=[groups.INST_INIT_DELETE],
groups=[GROUP, groups.INST_INIT_DELETE_WAIT])
class InstanceInitDeleteWaitGroup(TestGroup):
"""Test that Initialized Instance Delete Completes."""

View File

@ -15,16 +15,8 @@
from proboscis import test
from trove.tests.scenario.groups import backup_group
from trove.tests.scenario.groups import configuration_group
from trove.tests.scenario.groups import database_actions_group
from trove.tests.scenario.groups import instance_actions_group
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario.groups import module_group
from trove.tests.scenario.groups import replication_group
from trove.tests.scenario.groups import root_actions_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.groups import user_actions_group
from trove.tests.scenario.runners import test_runners
@ -37,17 +29,23 @@ class InstanceDeleteRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'InstanceDeleteRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP],
runs_after_groups=[backup_group.GROUP_BACKUP,
configuration_group.GROUP,
database_actions_group.GROUP,
instance_actions_group.GROUP,
module_group.GROUP,
replication_group.GROUP,
root_actions_group.GROUP,
user_actions_group.GROUP])
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.INST_DELETE],
runs_after_groups=[groups.INST_INIT_DELETE,
groups.INST_ACTIONS,
groups.INST_ACTIONS_RESIZE_WAIT,
groups.BACKUP_INST_DELETE,
groups.BACKUP_INC_INST_DELETE,
groups.CFGGRP_INST_DELETE,
groups.DB_ACTION_DELETE,
groups.DB_ACTION_INST_DELETE,
groups.MODULE_INST_DELETE,
groups.REPL_INST_DELETE_WAIT,
groups.ROOT_ACTION_INST_DELETE,
groups.USER_ACTION_DELETE,
groups.USER_ACTION_INST_DELETE])
class InstanceDeleteGroup(TestGroup):
"""Test Instance Delete functionality."""
def __init__(self):
super(InstanceDeleteGroup, self).__init__(
@ -57,3 +55,26 @@ class InstanceDeleteGroup(TestGroup):
def instance_delete(self):
"""Delete an existing instance."""
self.test_runner.run_instance_delete()
@test(depends_on_groups=[groups.INST_DELETE],
groups=[GROUP, groups.INST_DELETE_WAIT],
runs_after_groups=[groups.BACKUP_INST_DELETE_WAIT,
groups.BACKUP_INC_INST_DELETE_WAIT,
groups.CFGGRP_INST_DELETE_WAIT,
groups.DB_ACTION_INST_DELETE_WAIT,
groups.MODULE_INST_DELETE_WAIT,
groups.REPL_INST_DELETE_WAIT,
groups.ROOT_ACTION_INST_DELETE_WAIT,
groups.USER_ACTION_INST_DELETE_WAIT])
class InstanceDeleteWaitGroup(TestGroup):
"""Test that Instance Delete Completes."""
def __init__(self):
super(InstanceDeleteWaitGroup, self).__init__(
InstanceDeleteRunnerFactory.instance())
@test
def instance_delete_wait(self):
"""Wait for existing instance to be gone."""
self.test_runner.run_instance_delete_wait()

View File

@ -16,19 +16,12 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.module_group"
GROUP_MODULE_CREATE = "scenario.module_create_group"
GROUP_MODULE_INST = "scenario.module_inst_group"
GROUP_MODULE_INST_CREATE = "scenario.module_inst_create_group"
GROUP_MODULE_INST_CREATE_WAIT = "scenario.module_inst_create_wait_group"
GROUP_MODULE_INST_DELETE = "scenario.module_inst_delete_group"
GROUP_MODULE_INST_DELETE_WAIT = "scenario.module_inst_delete_wait_group"
GROUP_MODULE_DELETE = "scenario.module_delete_group"
class ModuleRunnerFactory(test_runners.RunnerFactory):
@ -37,12 +30,12 @@ class ModuleRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'ModuleRunner'
@test(groups=[GROUP, GROUP_MODULE_CREATE])
class ModuleGroup(TestGroup):
"""Test Module functionality."""
@test(groups=[GROUP, groups.MODULE_CREATE])
class ModuleCreateGroup(TestGroup):
"""Test Module Create functionality."""
def __init__(self):
super(ModuleGroup, self).__init__(
super(ModuleCreateGroup, self).__init__(
ModuleRunnerFactory.instance())
@test
@ -292,14 +285,13 @@ class ModuleGroup(TestGroup):
self.test_runner.run_module_update_non_admin_invisible_any()
@test(depends_on_groups=[instance_create_group.GROUP,
GROUP_MODULE_CREATE],
groups=[GROUP, GROUP_MODULE_INST, GROUP_MODULE_INST_CREATE])
class ModuleInstanceCreateGroup(TestGroup):
"""Test Instance Module Create functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT, groups.MODULE_CREATE],
groups=[GROUP, groups.MODULE_INST, groups.MODULE_INST_CREATE])
class ModuleInstCreateGroup(TestGroup):
"""Test Module Instance Create functionality."""
def __init__(self):
super(ModuleInstanceCreateGroup, self).__init__(
super(ModuleInstCreateGroup, self).__init__(
ModuleRunnerFactory.instance())
@test
@ -379,13 +371,14 @@ class ModuleInstanceCreateGroup(TestGroup):
self.test_runner.run_module_query_empty()
@test(depends_on_groups=[GROUP_MODULE_INST_CREATE],
groups=[GROUP, GROUP_MODULE_INST, GROUP_MODULE_INST_CREATE_WAIT])
class ModuleInstanceCreateWaitGroup(TestGroup):
"""Test that Instance Module Create Completes."""
@test(depends_on_groups=[groups.MODULE_INST_CREATE],
groups=[GROUP, groups.MODULE_INST, groups.MODULE_INST_CREATE_WAIT],
runs_after_groups=[groups.INST_ACTIONS])
class ModuleInstCreateWaitGroup(TestGroup):
"""Test that Module Instance Create Completes."""
def __init__(self):
super(ModuleInstanceCreateWaitGroup, self).__init__(
super(ModuleInstCreateWaitGroup, self).__init__(
ModuleRunnerFactory.instance())
@test
@ -423,13 +416,13 @@ class ModuleInstanceCreateWaitGroup(TestGroup):
self.test_runner.run_module_delete_auto_applied()
@test(depends_on_groups=[GROUP_MODULE_INST_CREATE_WAIT],
groups=[GROUP, GROUP_MODULE_INST, GROUP_MODULE_INST_DELETE])
class ModuleInstanceDeleteGroup(TestGroup):
"""Test Instance Module Delete functionality."""
@test(depends_on_groups=[groups.MODULE_INST_CREATE_WAIT],
groups=[GROUP, groups.MODULE_INST, groups.MODULE_INST_DELETE])
class ModuleInstDeleteGroup(TestGroup):
"""Test Module Instance Delete functionality."""
def __init__(self):
super(ModuleInstanceDeleteGroup, self).__init__(
super(ModuleInstDeleteGroup, self).__init__(
ModuleRunnerFactory.instance())
@test
@ -438,13 +431,14 @@ class ModuleInstanceDeleteGroup(TestGroup):
self.test_runner.run_delete_inst_with_mods()
@test(depends_on_groups=[GROUP_MODULE_INST_DELETE],
groups=[GROUP, GROUP_MODULE_INST, GROUP_MODULE_INST_DELETE_WAIT])
class ModuleInstanceDeleteWaitGroup(TestGroup):
"""Test that Instance Module Delete Completes."""
@test(depends_on_groups=[groups.MODULE_INST_DELETE],
groups=[GROUP, groups.MODULE_INST, groups.MODULE_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class ModuleInstDeleteWaitGroup(TestGroup):
"""Test that Module Instance Delete Completes."""
def __init__(self):
super(ModuleInstanceDeleteWaitGroup, self).__init__(
super(ModuleInstDeleteWaitGroup, self).__init__(
ModuleRunnerFactory.instance())
@test
@ -453,9 +447,9 @@ class ModuleInstanceDeleteWaitGroup(TestGroup):
self.test_runner.run_wait_for_delete_inst_with_mods()
@test(depends_on_groups=[GROUP_MODULE_CREATE],
runs_after_groups=[GROUP_MODULE_INST_DELETE_WAIT],
groups=[GROUP, GROUP_MODULE_DELETE])
@test(depends_on_groups=[groups.MODULE_CREATE],
runs_after_groups=[groups.MODULE_INST_DELETE_WAIT],
groups=[GROUP, groups.MODULE_DELETE])
class ModuleDeleteGroup(TestGroup):
"""Test Module Delete functionality."""
@ -463,48 +457,41 @@ class ModuleDeleteGroup(TestGroup):
super(ModuleDeleteGroup, self).__init__(
ModuleRunnerFactory.instance())
@test(groups=[GROUP, GROUP_MODULE_DELETE])
def module_delete_non_existent(self):
"""Ensure delete non-existent module fails."""
self.test_runner.run_module_delete_non_existent()
@test(groups=[GROUP, GROUP_MODULE_DELETE])
def module_delete_unauth_user(self):
"""Ensure delete module by unauth user fails."""
self.test_runner.run_module_delete_unauth_user()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete_unauth_user])
@test(runs_after=[module_delete_unauth_user,
module_delete_non_existent])
def module_delete_hidden_by_non_admin(self):
"""Ensure delete hidden module by non-admin user fails."""
self.test_runner.run_module_delete_hidden_by_non_admin()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete_hidden_by_non_admin])
@test(runs_after=[module_delete_hidden_by_non_admin])
def module_delete_all_tenant_by_non_admin(self):
"""Ensure delete all tenant module by non-admin user fails."""
self.test_runner.run_module_delete_all_tenant_by_non_admin()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete_all_tenant_by_non_admin])
@test(runs_after=[module_delete_all_tenant_by_non_admin])
def module_delete_auto_by_non_admin(self):
"""Ensure delete auto-apply module by non-admin user fails."""
self.test_runner.run_module_delete_auto_by_non_admin()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete_auto_by_non_admin])
@test(runs_after=[module_delete_auto_by_non_admin])
def module_delete(self):
"""Check that delete module works."""
self.test_runner.run_module_delete()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete])
@test(runs_after=[module_delete])
def module_delete_admin(self):
"""Check that delete module works for admin."""
self.test_runner.run_module_delete_admin()
@test(groups=[GROUP, GROUP_MODULE_DELETE],
runs_after=[module_delete_admin])
@test(runs_after=[module_delete_admin])
def module_delete_remaining(self):
"""Delete all remaining test modules."""
self.test_runner.run_module_delete_existing()

View File

@ -15,7 +15,8 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups import guest_log_group
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
@ -35,13 +36,17 @@ class ReplicationRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'ReplicationRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_REPL_CREATE])
class ReplicationCreateGroup(TestGroup):
"""Test Replication Create functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.REPL_INST_CREATE],
runs_after_groups=[groups.INST_ACTIONS_RESIZE_WAIT,
groups.USER_ACTION_INST_DELETE,
groups.ROOT_ACTION_INST_DELETE,
guest_log_group.GROUP])
class ReplicationInstCreateGroup(TestGroup):
"""Test Replication Instance Create functionality."""
def __init__(self):
super(ReplicationCreateGroup, self).__init__(
super(ReplicationInstCreateGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
@ -65,13 +70,14 @@ class ReplicationCreateGroup(TestGroup):
self.test_runner.run_create_single_replica()
@test(depends_on_groups=[GROUP_REPL_CREATE],
groups=[GROUP, GROUP_REPL_CREATE_WAIT])
class ReplicationCreateWaitGroup(TestGroup):
"""Wait for Replication Create to complete."""
@test(depends_on_groups=[groups.REPL_INST_CREATE],
groups=[GROUP, groups.REPL_INST_CREATE_WAIT],
runs_after_groups=[groups.INST_INIT_DELETE_WAIT])
class ReplicationInstCreateWaitGroup(TestGroup):
"""Wait for Replication Instance Create to complete."""
def __init__(self):
super(ReplicationCreateWaitGroup, self).__init__(
super(ReplicationInstCreateWaitGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
@ -110,13 +116,13 @@ class ReplicationCreateWaitGroup(TestGroup):
self.test_runner.run_verify_replica_data_after_single()
@test(depends_on_groups=[GROUP_REPL_CREATE_WAIT],
groups=[GROUP, GROUP_REPL_MULTI_CREATE])
class ReplicationMultiCreateGroup(TestGroup):
"""Test Replication Multi-Create functionality."""
@test(depends_on_groups=[groups.REPL_INST_CREATE_WAIT],
groups=[GROUP, groups.REPL_INST_MULTI_CREATE])
class ReplicationInstMultiCreateGroup(TestGroup):
"""Test Replication Instance Multi-Create functionality."""
def __init__(self):
super(ReplicationMultiCreateGroup, self).__init__(
super(ReplicationInstMultiCreateGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
@ -124,7 +130,19 @@ class ReplicationMultiCreateGroup(TestGroup):
"""Test creating multiple replicas."""
self.test_runner.run_create_multiple_replicas()
@test(runs_after=[create_multiple_replicas])
@test(depends_on_groups=[groups.REPL_INST_CREATE_WAIT],
groups=[GROUP, groups.REPL_INST_DELETE_NON_AFFINITY_WAIT],
runs_after_groups=[groups.REPL_INST_MULTI_CREATE,
groups.USER_ACTION_DELETE])
class ReplicationInstDeleteNonAffReplWaitGroup(TestGroup):
"""Wait for Replication Instance Non-Affinity repl to be gone."""
def __init__(self):
super(ReplicationInstDeleteNonAffReplWaitGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
def wait_for_delete_non_affinity_repl(self):
"""Wait for the non-affinity replica to delete."""
self.test_runner.run_wait_for_delete_non_affinity_repl()
@ -135,13 +153,13 @@ class ReplicationMultiCreateGroup(TestGroup):
self.test_runner.run_delete_non_affinity_master()
@test(depends_on_groups=[GROUP_REPL_MULTI_CREATE],
groups=[GROUP, GROUP_REPL_MULTI_CREATE_WAIT])
class ReplicationMultiCreateWaitGroup(TestGroup):
"""Wait for Replication Multi-Create to complete."""
@test(depends_on_groups=[groups.REPL_INST_DELETE_NON_AFFINITY_WAIT],
groups=[GROUP, groups.REPL_INST_MULTI_CREATE_WAIT])
class ReplicationInstMultiCreateWaitGroup(TestGroup):
"""Wait for Replication Instance Multi-Create to complete."""
def __init__(self):
super(ReplicationMultiCreateWaitGroup, self).__init__(
super(ReplicationInstMultiCreateWaitGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
@ -270,13 +288,13 @@ class ReplicationMultiCreateWaitGroup(TestGroup):
self.test_runner.run_detach_replica_from_source()
@test(depends_on_groups=[GROUP_REPL_MULTI_CREATE_WAIT],
groups=[GROUP, GROUP_REPL_DELETE])
class ReplicationDeleteGroup(TestGroup):
"""Test Replication Delete functionality."""
@test(depends_on_groups=[groups.REPL_INST_MULTI_CREATE_WAIT],
groups=[GROUP, groups.REPL_INST_DELETE])
class ReplicationInstDeleteGroup(TestGroup):
"""Test Replication Instance Delete functionality."""
def __init__(self):
super(ReplicationDeleteGroup, self).__init__(
super(ReplicationInstDeleteGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test
@ -290,13 +308,13 @@ class ReplicationDeleteGroup(TestGroup):
self.test_runner.run_delete_all_replicas()
@test(depends_on_groups=[GROUP_REPL_DELETE],
groups=[GROUP, GROUP_REPL_DELETE_WAIT])
class ReplicationDeleteWaitGroup(TestGroup):
"""Wait for Replication Delete to complete."""
@test(depends_on_groups=[groups.REPL_INST_DELETE],
groups=[GROUP, groups.REPL_INST_DELETE_WAIT])
class ReplicationInstDeleteWaitGroup(TestGroup):
"""Wait for Replication Instance Delete to complete."""
def __init__(self):
super(ReplicationDeleteWaitGroup, self).__init__(
super(ReplicationInstDeleteWaitGroup, self).__init__(
ReplicationRunnerFactory.instance())
@test

View File

@ -15,16 +15,13 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups import guest_log_group
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.root_actions_group"
GROUP_ROOT_ACTION_INST = "scenario.root_action_inst_group"
GROUP_ROOT_ACTION_INST_RESTORE = "scenario.root_action_inst_restore_group"
GROUP_ROOT_ACTION_INST_RESTORE_WAIT = "scenario.root_action_inst_restore_wait"
GROUP_ROOT_ACTION_INST_DELETE = "scenario.root_action_inst_delete_group"
class RootActionsRunnerFactory(test_runners.RunnerFactory):
@ -45,13 +42,13 @@ class BackupRunnerFactory2(test_runners.RunnerFactory):
_runner_cls = 'BackupRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_ROOT_ACTION_INST])
class RootActionsGroup(TestGroup):
"""Test Root Actions functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.ROOT_ACTION_ENABLE])
class RootActionsEnableGroup(TestGroup):
"""Test Root Actions Enable functionality."""
def __init__(self):
super(RootActionsGroup, self).__init__(
super(RootActionsEnableGroup, self).__init__(
RootActionsRunnerFactory.instance())
self.backup_runner = BackupRunnerFactory.instance()
self.backup_runner2 = BackupRunnerFactory2.instance()
@ -101,8 +98,19 @@ class RootActionsGroup(TestGroup):
"""Check the root is still enabled."""
self.test_runner.run_check_root_enabled()
@test(depends_on=[check_root_enabled],
runs_after=[check_root_still_enabled])
@test(depends_on_groups=[groups.ROOT_ACTION_ENABLE],
groups=[GROUP, groups.ROOT_ACTION_DISABLE])
class RootActionsDisableGroup(TestGroup):
"""Test Root Actions Disable functionality."""
def __init__(self):
super(RootActionsDisableGroup, self).__init__(
RootActionsRunnerFactory.instance())
self.backup_runner = BackupRunnerFactory.instance()
self.backup_runner2 = BackupRunnerFactory2.instance()
@test
def disable_root(self):
"""Disable root."""
self.test_runner.check_root_disable_supported()
@ -122,13 +130,14 @@ class RootActionsGroup(TestGroup):
self.backup_runner2.run_backup_create_completed()
@test(depends_on_groups=[GROUP_ROOT_ACTION_INST],
groups=[GROUP, GROUP_ROOT_ACTION_INST_RESTORE])
class RootActionsInstRestoreGroup(TestGroup):
"""Test Root Actions Restore functionality."""
@test(depends_on_groups=[groups.ROOT_ACTION_DISABLE],
groups=[GROUP, groups.ROOT_ACTION_INST, groups.ROOT_ACTION_INST_CREATE],
runs_after_groups=[groups.INST_ACTIONS_RESIZE_WAIT])
class RootActionsInstCreateGroup(TestGroup):
"""Test Root Actions Instance Create functionality."""
def __init__(self):
super(RootActionsInstRestoreGroup, self).__init__(
super(RootActionsInstCreateGroup, self).__init__(
RootActionsRunnerFactory.instance())
self.backup_runner = BackupRunnerFactory.instance()
self.backup_runner2 = BackupRunnerFactory2.instance()
@ -136,22 +145,24 @@ class RootActionsInstRestoreGroup(TestGroup):
@test
def restore_root_enabled_instance(self):
"""Restore the root-enabled instance."""
self.backup_runner.run_restore_from_backup()
self.backup_runner.run_restore_from_backup(suffix='_root_enable')
@test
def restore_root_disabled_instance(self):
"""Restore the root-disabled instance."""
self.test_runner.check_root_disable_supported()
self.backup_runner2.run_restore_from_backup()
self.backup_runner2.run_restore_from_backup(suffix='_root_disable')
@test(depends_on_groups=[GROUP_ROOT_ACTION_INST_RESTORE],
groups=[GROUP, GROUP_ROOT_ACTION_INST_RESTORE_WAIT])
class RootActionsInstRestoreWaitGroup(TestGroup):
"""Wait for Root Actions Restore to complete."""
@test(depends_on_groups=[groups.ROOT_ACTION_INST_CREATE],
groups=[GROUP, groups.ROOT_ACTION_INST,
groups.ROOT_ACTION_INST_CREATE_WAIT],
runs_after_groups=[guest_log_group.GROUP])
class RootActionsInstCreateWaitGroup(TestGroup):
"""Wait for Root Actions Instance Create to complete."""
def __init__(self):
super(RootActionsInstRestoreWaitGroup, self).__init__(
super(RootActionsInstCreateWaitGroup, self).__init__(
RootActionsRunnerFactory.instance())
self.backup_runner = BackupRunnerFactory.instance()
self.backup_runner2 = BackupRunnerFactory2.instance()
@ -184,10 +195,10 @@ class RootActionsInstRestoreWaitGroup(TestGroup):
instance_id, root_creds)
@test(depends_on_groups=[GROUP_ROOT_ACTION_INST_RESTORE_WAIT],
groups=[GROUP, GROUP_ROOT_ACTION_INST_DELETE])
@test(depends_on_groups=[groups.ROOT_ACTION_INST_CREATE_WAIT],
groups=[GROUP, groups.ROOT_ACTION_INST, groups.ROOT_ACTION_INST_DELETE])
class RootActionsInstDeleteGroup(TestGroup):
"""Test Root Actions Delete functionality."""
"""Test Root Actions Instance Delete functionality."""
def __init__(self):
super(RootActionsInstDeleteGroup, self).__init__(
@ -216,3 +227,27 @@ class RootActionsInstDeleteGroup(TestGroup):
"""Delete the root-disabled instance backup."""
self.test_runner.check_root_disable_supported()
self.backup_runner2.run_delete_backup()
@test(depends_on_groups=[groups.ROOT_ACTION_INST_DELETE],
groups=[GROUP, groups.ROOT_ACTION_INST,
groups.ROOT_ACTION_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class RootActionsInstDeleteWaitGroup(TestGroup):
"""Wait for Root Actions Instance Delete to complete."""
def __init__(self):
super(RootActionsInstDeleteWaitGroup, self).__init__(
RootActionsRunnerFactory.instance())
self.backup_runner = BackupRunnerFactory.instance()
self.backup_runner2 = BackupRunnerFactory2.instance()
@test
def wait_for_restored_instance_delete(self):
"""Wait for the root-enabled instance to be deleted."""
self.backup_runner.run_wait_for_restored_instance_delete()
@test
def wait_for_restored_instance2_delete(self):
"""Wait for the root-disabled instance to be deleted."""
self.backup_runner2.run_wait_for_restored_instance_delete()

View File

@ -15,17 +15,13 @@
from proboscis import test
from trove.tests.scenario.groups import instance_create_group
from trove.tests.scenario import groups
from trove.tests.scenario.groups import guest_log_group
from trove.tests.scenario.groups.test_group import TestGroup
from trove.tests.scenario.runners import test_runners
GROUP = "scenario.user_actions_group"
GROUP_USR_ACTION_INST = "scenario.usr_action_inst_group"
GROUP_USR_ACTION_INST_CREATE = "scenario.usr_action_inst_create_group"
GROUP_USR_ACTION_INST_CREATE_WAIT = "scenario.usr_action_inst_create_wait_grp"
GROUP_USR_ACTION_INST_DELETE = "scenario.usr_action_inst_delete_group"
GROUP_USR_ACTION_INST_DELETE_WAIT = "scenario.usr_action_inst_delete_wait_grp"
class UserActionsRunnerFactory(test_runners.RunnerFactory):
@ -46,13 +42,13 @@ class DatabaseActionsRunnerFactory(test_runners.RunnerFactory):
_runner_cls = 'DatabaseActionsRunner'
@test(depends_on_groups=[instance_create_group.GROUP],
groups=[GROUP, GROUP_USR_ACTION_INST])
class UserActionsGroup(TestGroup):
"""Test User Actions functionality."""
@test(depends_on_groups=[groups.INST_CREATE_WAIT],
groups=[GROUP, groups.USER_ACTION_CREATE])
class UserActionsCreateGroup(TestGroup):
"""Test User Actions Create functionality."""
def __init__(self):
super(UserActionsGroup, self).__init__(
super(UserActionsCreateGroup, self).__init__(
UserActionsRunnerFactory.instance())
self.database_actions_runner = DatabaseActionsRunnerFactory.instance()
@ -139,56 +135,67 @@ class UserActionsGroup(TestGroup):
"""Update an existing user."""
self.test_runner.run_user_attribute_update()
@test(depends_on=[create_users],
runs_after=[update_user_attributes])
def delete_user(self):
"""Delete the created users."""
self.test_runner.run_user_delete()
@test(runs_after=[delete_user])
@test
def show_nonexisting_user(self):
"""Delete non-existing users."""
"""Ensure show on non-existing user fails."""
self.test_runner.run_nonexisting_user_show()
@test(runs_after=[show_nonexisting_user])
@test
def update_nonexisting_user(self):
"""Ensure updating a non-existing user fails."""
self.test_runner.run_nonexisting_user_update()
@test(runs_after=[update_nonexisting_user])
@test
def delete_nonexisting_user(self):
"""Ensure deleting a non-existing user fails."""
self.test_runner.run_nonexisting_user_delete()
@test(runs_after=[delete_nonexisting_user])
@test
def create_system_user(self):
"""Ensure creating a system user fails."""
self.test_runner.run_system_user_create()
@test(runs_after=[create_system_user])
@test
def show_system_user(self):
"""Ensure showing a system user fails."""
self.test_runner.run_system_user_show()
@test(runs_after=[show_system_user])
@test
def update_system_user(self):
"""Ensure updating a system user fails."""
self.test_runner.run_system_user_attribute_update()
@test(runs_after=[update_system_user])
@test(depends_on_groups=[groups.USER_ACTION_CREATE],
groups=[GROUP, groups.USER_ACTION_DELETE])
class UserActionsDeleteGroup(TestGroup):
"""Test User Actions Delete functionality."""
def __init__(self):
super(UserActionsDeleteGroup, self).__init__(
UserActionsRunnerFactory.instance())
self.database_actions_runner = DatabaseActionsRunnerFactory.instance()
@test
def delete_user(self):
"""Delete the created users."""
self.test_runner.run_user_delete()
@test
def delete_system_user(self):
"""Ensure deleting a system user fails."""
self.test_runner.run_system_user_delete()
@test(depends_on=[create_user_databases], runs_after=[delete_system_user])
@test
def delete_user_databases(self):
"""Delete the user databases."""
self.database_actions_runner.run_database_delete()
@test(groups=[GROUP, GROUP_USR_ACTION_INST_CREATE])
@test(groups=[GROUP, groups.USER_ACTION_INST, groups.USER_ACTION_INST_CREATE],
runs_after_groups=[groups.INST_ACTIONS_RESIZE_WAIT])
class UserActionsInstCreateGroup(TestGroup):
"""Test User Actions Create functionality."""
"""Test User Actions Instance Create functionality."""
def __init__(self):
super(UserActionsInstCreateGroup, self).__init__(
@ -200,13 +207,15 @@ class UserActionsInstCreateGroup(TestGroup):
"""Create an instance with initial users."""
self.instance_create_runner.run_initialized_instance_create(
with_dbs=False, with_users=True, configuration_id=None,
create_helper_user=False)
create_helper_user=False, name_suffix='_user')
@test(depends_on_groups=[GROUP_USR_ACTION_INST_CREATE],
groups=[GROUP, GROUP_USR_ACTION_INST_CREATE_WAIT])
@test(depends_on_groups=[groups.USER_ACTION_INST_CREATE],
groups=[GROUP, groups.USER_ACTION_INST,
groups.USER_ACTION_INST_CREATE_WAIT],
runs_after_groups=[guest_log_group.GROUP])
class UserActionsInstCreateWaitGroup(TestGroup):
"""Wait for User Actions Create to complete."""
"""Wait for User Actions Instance Create to complete."""
def __init__(self):
super(UserActionsInstCreateWaitGroup, self).__init__(
@ -224,10 +233,10 @@ class UserActionsInstCreateWaitGroup(TestGroup):
self.instance_create_runner.run_validate_initialized_instance()
@test(depends_on_groups=[GROUP_USR_ACTION_INST_CREATE_WAIT],
groups=[GROUP, GROUP_USR_ACTION_INST_DELETE])
@test(depends_on_groups=[groups.USER_ACTION_INST_CREATE_WAIT],
groups=[GROUP, groups.USER_ACTION_INST, groups.USER_ACTION_INST_DELETE])
class UserActionsInstDeleteGroup(TestGroup):
"""Test User Actions Delete functionality."""
"""Test User Actions Instance Delete functionality."""
def __init__(self):
super(UserActionsInstDeleteGroup, self).__init__(
@ -240,10 +249,12 @@ class UserActionsInstDeleteGroup(TestGroup):
self.instance_create_runner.run_initialized_instance_delete()
@test(depends_on_groups=[GROUP_USR_ACTION_INST_DELETE],
groups=[GROUP, GROUP_USR_ACTION_INST_DELETE_WAIT])
@test(depends_on_groups=[groups.USER_ACTION_INST_DELETE],
groups=[GROUP, groups.USER_ACTION_INST,
groups.USER_ACTION_INST_DELETE_WAIT],
runs_after_groups=[groups.INST_DELETE])
class UserActionsInstDeleteWaitGroup(TestGroup):
"""Wait for User Actions Delete to complete."""
"""Wait for User Actions Instance Delete to complete."""
def __init__(self):
super(UserActionsInstDeleteWaitGroup, self).__init__(

View File

@ -55,6 +55,12 @@ class PostgresqlHelper(SqlHelper):
{"vacuum_cost_delay": 'string_value'},
{"standard_conforming_strings": 'string_value'}]
def get_configuration_value(self, property_name, host, *args, **kwargs):
client = self.get_client(host, *args, **kwargs)
cmd = "SHOW %s;" % property_name
row = client.execute(cmd).fetchone()
return row[0]
def get_exposed_user_log_names(self):
return ['general']

View File

@ -365,9 +365,10 @@ class BackupRunner(BackupRunnerMixin):
def run_wait_for_inc_backup_2(self):
self._verify_backup(self.backup_inc_2_info.id)
def run_restore_from_backup(self, expected_http_code=200):
def run_restore_from_backup(self, expected_http_code=200, suffix=''):
self.restore_instance_id = self.assert_restore_from_backup(
self.backup_info.id, expected_http_code=expected_http_code)
self.backup_info.id, suffix=suffix,
expected_http_code=expected_http_code)
def assert_restore_from_backup(self, backup_ref, suffix='',
expected_http_code=200):
@ -391,7 +392,7 @@ class BackupRunner(BackupRunnerMixin):
def run_restore_from_inc_1_backup(self, expected_http_code=200):
self.restore_inc_1_instance_id = self.assert_restore_from_backup(
self.backup_inc_1_info.id, '_inc_1',
self.backup_inc_1_info.id, suffix='_inc_1',
expected_http_code=expected_http_code)
def run_restore_from_backup_completed(

View File

@ -384,3 +384,7 @@ class MongodbClusterActionsRunner(ClusterActionsRunner):
def run_cluster_root_enable(self):
raise SkipTest("Operation is currently not supported.")
@property
def min_cluster_node_count(self):
return 3

View File

@ -506,7 +506,7 @@ class ConfigurationRunner(TestRunner):
def assert_create_instance_with_conf(self, config_id):
# test that a new instance will apply the configuration on create
result = self.auth_client.instances.create(
"TEST_" + str(datetime.now()) + "_config",
self.instance_info.name + "_config",
self.instance_info.dbaas_flavor_href,
self.instance_info.volume,
[], [],

View File

@ -23,12 +23,6 @@ from troveclient.compat import exceptions
class DatabaseActionsRunner(TestRunner):
# TODO(pmalik): I believe the 202 (Accepted) should be replaced by
# 200 (OK) as the actions are generally very fast and their results
# available immediately upon execution of the request. This would
# likely require replacing GA casts with calls which I believe are
# more appropriate anyways.
def __init__(self):
super(DatabaseActionsRunner, self).__init__()
self.db_defs = []

View File

@ -82,7 +82,7 @@ class InstanceCreateRunner(TestRunner):
def run_initialized_instance_create(
self, with_dbs=True, with_users=True, configuration_id=None,
expected_states=['BUILD', 'ACTIVE'], expected_http_code=200,
create_helper_user=True):
create_helper_user=True, name_suffix='_init'):
if self.is_using_existing_instance:
# The user requested to run the tests using an existing instance.
# We therefore skip any scenarios that involve creating new
@ -90,7 +90,7 @@ class InstanceCreateRunner(TestRunner):
raise SkipTest("Using an existing instance.")
configuration_id = configuration_id or self.config_group_id
name = self.instance_info.name + '_init'
name = self.instance_info.name + name_suffix
flavor = self._get_instance_flavor()
trove_volume_size = CONFIG.get('trove_volume_size', 1)
self.init_inst_dbs = (self.test_helper.get_valid_database_definitions()
@ -246,7 +246,7 @@ class InstanceCreateRunner(TestRunner):
def run_add_initialized_instance_data(self):
self.init_inst_data = DataType.small
self.init_inst_host = self.get_instance_host(self.instance_info.id)
self.init_inst_host = self.get_instance_host(self.init_inst_id)
self.test_helper.add_data(self.init_inst_data, self.init_inst_host)
def run_validate_initialized_instance(self):

View File

@ -23,24 +23,26 @@ class InstanceDeleteRunner(TestRunner):
def __init__(self):
super(InstanceDeleteRunner, self).__init__()
def run_instance_delete(
self, expected_states=['SHUTDOWN'],
expected_http_code=202):
def run_instance_delete(self, expected_http_code=202):
if self.has_do_not_delete_instance:
self.report.log("TESTS_DO_NOT_DELETE_INSTANCE=True was "
"specified, skipping delete...")
raise proboscis.SkipTest("TESTS_DO_NOT_DELETE_INSTANCE "
"was specified.")
self.assert_instance_delete(self.instance_info.id, expected_states,
expected_http_code)
self.assert_server_group_gone(self.instance_info.srv_grp_id)
self.assert_instance_delete(self.instance_info.id, expected_http_code)
def assert_instance_delete(self, instance_id, expected_states,
expected_http_code):
def assert_instance_delete(self, instance_id, expected_http_code):
self.report.log("Testing delete on instance: %s" % instance_id)
self.auth_client.instances.delete(instance_id)
self.assert_instance_action(instance_id, expected_states,
expected_http_code)
self.assert_all_gone(instance_id, expected_states[-1])
self.assert_client_code(expected_http_code)
def run_instance_delete_wait(self, expected_states=['SHUTDOWN']):
if self.has_do_not_delete_instance:
self.report.log("TESTS_DO_NOT_DELETE_INSTANCE=True was "
"specified, skipping delete wait...")
raise proboscis.SkipTest("TESTS_DO_NOT_DELETE_INSTANCE "
"was specified.")
self.assert_all_gone(self.instance_info.id, expected_states[-1])
self.assert_server_group_gone(self.instance_info.srv_grp_id)

View File

@ -29,10 +29,7 @@ from trove.tests.scenario.runners.test_runners import TestRunner
class ModuleRunner(TestRunner):
def __init__(self):
self.TIMEOUT_MODULE_APPLY = 60 * 10
super(ModuleRunner, self).__init__(
timeout=self.TIMEOUT_MODULE_APPLY)
super(ModuleRunner, self).__init__()
self.MODULE_CONTENTS_PATTERN = 'Message=%s\n'
self.MODULE_MESSAGE_PATTERN = 'Hello World from: %s'
@ -842,7 +839,7 @@ class ModuleRunner(TestRunner):
def run_create_inst_with_mods(self, expected_http_code=200):
self.mod_inst_id = self.assert_inst_mod_create(
self.main_test_module.id, 'module_1', expected_http_code)
self.main_test_module.id, '_module', expected_http_code)
def assert_inst_mod_create(self, module_id, name_suffix,
expected_http_code):

View File

@ -61,7 +61,7 @@ class ReplicationRunner(TestRunner):
def run_create_non_affinity_master(self, expected_http_code=200):
self.non_affinity_master_id = self.auth_client.instances.create(
self.instance_info.name + 'non-affinity',
self.instance_info.name + '_non-affinity',
self.instance_info.dbaas_flavor_href,
self.instance_info.volume,
datastore=self.instance_info.dbaas_datastore,
@ -78,7 +78,7 @@ class ReplicationRunner(TestRunner):
def assert_replica_create(
self, master_id, replica_name, replica_count, expected_http_code):
replica = self.auth_client.instances.create(
self.instance_info.name + replica_name,
self.instance_info.name + '_' + replica_name,
self.instance_info.dbaas_flavor_href,
self.instance_info.volume, replica_of=master_id,
datastore=self.instance_info.dbaas_datastore,
@ -136,7 +136,7 @@ class ReplicationRunner(TestRunner):
def run_create_non_affinity_replica(self, expected_http_code=200):
self.non_affinity_repl_id = self.auth_client.instances.create(
self.instance_info.name + 'non-affinity-repl',
self.instance_info.name + '_non-affinity-repl',
self.instance_info.dbaas_flavor_href,
self.instance_info.volume,
datastore=self.instance_info.dbaas_datastore,
@ -152,6 +152,7 @@ class ReplicationRunner(TestRunner):
def run_wait_for_multiple_replicas(
self, expected_states=['BUILD', 'ACTIVE']):
replica_ids = self._get_replica_set(self.master_id)
self.report.log("Waiting for replicas: %s" % replica_ids)
self.assert_instance_action(replica_ids, expected_states)
self._assert_is_master(self.master_id, replica_ids)
for replica_id in replica_ids:
@ -306,7 +307,7 @@ class ReplicationRunner(TestRunner):
def assert_remove_replicated_data(self, host):
"""In order for this to work, the corresponding datastore
'helper' class should implement the 'remove_<type>_data' method.
'helper' class should implement the 'remove_actual_data' method.
"""
for data_set in self.used_data_sets:
self.report.log("Removing replicated data set: %s" % data_set)
@ -369,7 +370,7 @@ class ReplicationRunner(TestRunner):
def run_wait_for_delete_replicas(
self, expected_last_status=['SHUTDOWN']):
replica_ids = self._get_replica_set(self.master_id)
replica_ids.update(self.replica_1_id)
replica_ids.add(self.replica_1_id)
self.assert_all_gone(replica_ids,
expected_last_status=expected_last_status)

View File

@ -419,10 +419,16 @@ class TestRunner(object):
"Unexpected client status code")
def assert_all_instance_states(self, instance_ids, expected_states):
tasks = [build_polling_task(
lambda: self._assert_instance_states(instance_id, expected_states),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
for instance_id in instance_ids]
self.report.log("Waiting for states (%s) for instances: %s" %
(expected_states, instance_ids))
def _make_fn(inst_id):
return lambda: self._assert_instance_states(
inst_id, expected_states)
tasks = [build_polling_task(_make_fn(instance_id),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
for instance_id in instance_ids]
poll_until(lambda: all(poll_task.ready() for poll_task in tasks),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
@ -446,6 +452,8 @@ class TestRunner(object):
state.
"""
self.report.log("Waiting for states (%s) for instance: %s" %
(expected_states, instance_id))
found = False
for status in expected_states:
if require_all_states or found or self._has_status(
@ -458,8 +466,9 @@ class TestRunner(object):
fast_fail_status=fast_fail_status),
sleep_time=self.def_sleep_time,
time_out=self.def_timeout)
self.report.log("Instance has gone '%s' in %s." %
(status, self._time_since(start_time)))
self.report.log("Instance '%s' has gone '%s' in %s." %
(instance_id, status,
self._time_since(start_time)))
except exception.PollTimeOut:
self.report.log(
"Status of instance '%s' did not change to '%s' "
@ -488,10 +497,15 @@ class TestRunner(object):
"list section.")
def _wait_all_deleted(self, instance_ids, expected_last_status):
tasks = [build_polling_task(
lambda: self._wait_for_delete(instance_id, expected_last_status),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
for instance_id in instance_ids]
self.report.log("Waiting for instances to be gone: %s (status %s)" %
(instance_ids, expected_last_status))
def _make_fn(inst_id):
return lambda: self._wait_for_delete(inst_id, expected_last_status)
tasks = [build_polling_task(_make_fn(instance_id),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
for instance_id in instance_ids]
poll_until(lambda: all(poll_task.ready() for poll_task in tasks),
sleep_time=self.def_sleep_time, time_out=self.def_timeout)
@ -504,13 +518,14 @@ class TestRunner(object):
self.fail(str(task.poll_exception()))
def _wait_for_delete(self, instance_id, expected_last_status):
self.report.log("Waiting for instance to be gone: %s (status %s)" %
(instance_id, expected_last_status))
start_time = timer.time()
try:
self._poll_while(instance_id, expected_last_status,
sleep_time=self.def_sleep_time,
time_out=self.def_timeout)
except exceptions.NotFound:
self.assert_client_code(404)
self.report.log("Instance was removed in %s." %
self._time_since(start_time))
return True

View File

@ -370,11 +370,6 @@ class UserActionsRunner(TestRunner):
self.auth_client.users.delete(instance_id, user_name, user_host)
self.assert_client_code(expected_http_code)
self.assert_raises(exceptions.NotFound, 404,
self.auth_client.users.get,
instance_id, user_name, user_host)
self._wait_for_user_delete(instance_id, user_name)
def _wait_for_user_delete(self, instance_id, deleted_user_name):