Merge pull request #272 from mfmsilva/add_mysqldump_to_common
Add mysqldump test to MySqlCommonTests
This commit is contained in:
@@ -114,6 +114,30 @@ class MySQLBaseTest(test_utils.OpenStackBaseTest):
|
||||
class MySQLCommonTests(MySQLBaseTest):
|
||||
"""Common mysql charm tests."""
|
||||
|
||||
def test_110_mysqldump(self):
|
||||
"""Backup mysql.
|
||||
|
||||
Run the mysqldump action.
|
||||
"""
|
||||
_db = "keystone"
|
||||
_file_key = "mysqldump-file"
|
||||
logging.info("Execute mysqldump action")
|
||||
# Need to change strict mode to be able to dump database
|
||||
if self.application_name == "percona-cluster":
|
||||
action = zaza.model.run_action_on_leader(
|
||||
self.application_name,
|
||||
"set-pxc-strict-mode",
|
||||
action_params={"mode": "MASTER"})
|
||||
|
||||
action = zaza.model.run_action_on_leader(
|
||||
self.application,
|
||||
"mysqldump",
|
||||
action_params={"databases": _db})
|
||||
_results = action.data["results"]
|
||||
assert _db in _results[_file_key], (
|
||||
"Mysqldump action failed: {}".format(action.data))
|
||||
logging.info("Passed mysqldump action test.")
|
||||
|
||||
def test_910_restart_on_config_change(self):
|
||||
"""Checking restart happens on config change.
|
||||
|
||||
@@ -305,10 +329,9 @@ class PerconaClusterColdStartTest(PerconaClusterBaseTest):
|
||||
After bootstrapping a non-leader node, notify bootstrapped on the
|
||||
leader node.
|
||||
"""
|
||||
_machines = list(
|
||||
_machines = sorted(
|
||||
juju_utils.get_machine_uuids_for_application(self.application))
|
||||
# Stop Nodes
|
||||
_machines.sort()
|
||||
# Avoid hitting an update-status hook
|
||||
logging.debug("Wait till model is idle ...")
|
||||
zaza.model.block_until_all_units_idle()
|
||||
@@ -457,23 +480,6 @@ class MySQLInnoDBClusterTests(MySQLCommonTests):
|
||||
.format(cluster_status))
|
||||
logging.info("Passed cluster-status action test.")
|
||||
|
||||
def test_110_mysqldump(self):
|
||||
"""Backup mysql.
|
||||
|
||||
Run the mysqldump action.
|
||||
"""
|
||||
_db = "keystone"
|
||||
_file_key = "mysqldump-file"
|
||||
logging.info("Execute mysqldump action")
|
||||
action = zaza.model.run_action_on_leader(
|
||||
self.application,
|
||||
"mysqldump",
|
||||
action_params={"databases": _db})
|
||||
_results = action.data["results"]
|
||||
assert _db in _results[_file_key], (
|
||||
"Mysqldump action failed: {}".format(action.data))
|
||||
logging.info("Passed mysqldump action test.")
|
||||
|
||||
def test_120_set_cluster_option(self):
|
||||
"""Set cluster option.
|
||||
|
||||
@@ -522,10 +528,9 @@ class MySQLInnoDBClusterColdStartTest(MySQLBaseTest):
|
||||
|
||||
After a cold start, reboot cluster from complete outage.
|
||||
"""
|
||||
_machines = list(
|
||||
_machines = sorted(
|
||||
juju_utils.get_machine_uuids_for_application(self.application))
|
||||
# Stop Nodes
|
||||
_machines.sort()
|
||||
# Avoid hitting an update-status hook
|
||||
logging.debug("Wait till model is idle ...")
|
||||
zaza.model.block_until_all_units_idle()
|
||||
|
||||
Reference in New Issue
Block a user