Fix config parameters test for fake mode
This commit makes the config parameters tests run in fake mode. Closes-Bug: 1370237 Change-Id: I6ce228a627b35ee418c290a9f19baa163261fb7c
This commit is contained in:
parent
d2d648f46d
commit
108fbc5ef3
25
run_tests.py
25
run_tests.py
|
@ -73,16 +73,19 @@ def initialize_trove(config_file):
|
|||
def datastore_init():
|
||||
# Adds the datastore for mysql (needed to make most calls work).
|
||||
from trove.datastore import models
|
||||
from trove.configuration.models import DatastoreConfigurationParameters
|
||||
|
||||
models.DBDatastore.create(id=CONFIG.dbaas_datastore_id,
|
||||
name=CONFIG.dbaas_datastore,
|
||||
default_version_id=
|
||||
CONFIG.dbaas_datastore_version_id)
|
||||
|
||||
models.DBDatastore.create(id=CONFIG.dbaas_datastore_id_no_versions,
|
||||
name='Test_Datastore_1',
|
||||
default_version_id=None)
|
||||
|
||||
models.DBDatastoreVersion.create(id=CONFIG.dbaas_datastore_version_id,
|
||||
main_dsv = models.DBDatastoreVersion.create(
|
||||
id=CONFIG.dbaas_datastore_version_id,
|
||||
datastore_id=
|
||||
CONFIG.dbaas_datastore_id,
|
||||
name=CONFIG.dbaas_datastore_version,
|
||||
|
@ -100,6 +103,25 @@ def datastore_init():
|
|||
'c00000c0-00c0-0c00-00c0-000c000000cc',
|
||||
packages=None, active=0)
|
||||
|
||||
def add_parm(name, data_type, max_size, min_size=0, restart_required=0):
|
||||
DatastoreConfigurationParameters.create(
|
||||
datastore_version_id=main_dsv.id,
|
||||
name=name,
|
||||
restart_required=restart_required,
|
||||
max_size=max_size,
|
||||
min_size=0,
|
||||
data_type=data_type,
|
||||
deleted=0,
|
||||
deleted_at=None)
|
||||
|
||||
add_parm('key_buffer_size', 'integer', 4294967296)
|
||||
add_parm('connect_timeout', 'integer', 65535)
|
||||
add_parm('join_buffer_size', 'integer', 4294967296)
|
||||
add_parm('local_infile', 'integer', 1)
|
||||
add_parm('collation_server', 'string', None, None)
|
||||
add_parm('innodb_buffer_pool_size', 'integer', 57671680,
|
||||
restart_required=1)
|
||||
|
||||
|
||||
def initialize_database():
|
||||
from trove.db import get_db_api
|
||||
|
@ -172,6 +194,7 @@ if __name__ == "__main__":
|
|||
from trove.tests.api import instances_delete # noqa
|
||||
from trove.tests.api import instances_mysql_down # noqa
|
||||
from trove.tests.api import instances_resize # noqa
|
||||
from trove.tests.api import configurations # noqa
|
||||
from trove.tests.api import databases # noqa
|
||||
from trove.tests.api import datastores # noqa
|
||||
from trove.tests.api import replication # noqa
|
||||
|
|
|
@ -33,7 +33,6 @@ from trove.tests.api.instances import TIMEOUT_INSTANCE_DELETE
|
|||
from trove.tests.api.instances import WaitForGuestInstallationToFinish
|
||||
from trove.tests.config import CONFIG
|
||||
from trove.tests.util import create_dbaas_client
|
||||
from trove.tests.util import test_config
|
||||
from trove.tests.util.check import AttrCheck
|
||||
from trove.tests.util.check import CollectionCheck
|
||||
from trove.tests.util.check import TypeCheck
|
||||
|
@ -279,6 +278,7 @@ class CreateConfigurations(ConfigurationsTestBase):
|
|||
expected_configs = self.expected_default_datastore_configs()
|
||||
values = json.dumps(expected_configs.get('appending_values'))
|
||||
# ensure updated timestamp is different than created
|
||||
if not CONFIG.fake_mode:
|
||||
sleep(1)
|
||||
instance_info.dbaas.configurations.edit(configuration_info.id,
|
||||
values)
|
||||
|
@ -358,6 +358,7 @@ class AfterConfigurationsCreation(ConfigurationsTestBase):
|
|||
# check that created and updated timestamps differ, since
|
||||
# test_appending_to_existing_configuration should have changed the
|
||||
# updated timestamp
|
||||
if not CONFIG.fake_mode:
|
||||
assert_not_equal(result.created, result.updated)
|
||||
|
||||
assert_equal(result.instance_count, 1)
|
||||
|
@ -520,9 +521,6 @@ class StartInstanceWithConfiguration(ConfigurationsTestBase):
|
|||
@test
|
||||
def test_start_instance_with_configuration(self):
|
||||
# test that a new instance will apply the configuration on create
|
||||
if test_config.auth_strategy == "fake":
|
||||
raise SkipTest("Skipping instance start with configuration "
|
||||
"test for fake mode.")
|
||||
global configuration_instance
|
||||
databases = []
|
||||
databases.append({"name": "firstdbconfig", "character_set": "latin2",
|
||||
|
@ -558,9 +556,6 @@ class WaitForConfigurationInstanceToFinish(ConfigurationsTestBase):
|
|||
@time_out(TIMEOUT_INSTANCE_CREATE)
|
||||
def test_instance_with_configuration_active(self):
|
||||
# wait for the instance to become active
|
||||
if test_config.auth_strategy == "fake":
|
||||
raise SkipTest("Skipping instance start with configuration "
|
||||
"test for fake mode.")
|
||||
|
||||
def result_is_active():
|
||||
instance = instance_info.dbaas.instances.get(
|
||||
|
|
Loading…
Reference in New Issue