Skip to content

Commit 29acbbc

Browse files
committed
re-define config-file for this test and change test name
(cherry picked from commit 7966575)
1 parent 4eb3cd4 commit 29acbbc

File tree

1 file changed

+12
-4
lines changed
  • zaza/openstack/charm_tests/mysql

1 file changed

+12
-4
lines changed

zaza/openstack/charm_tests/mysql/tests.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ def setUpClass(cls, application_name="keystone-mysql-router"):
11051105
cls.services = ["mysqlrouter"]
11061106
# Config file affected by juju set config change
11071107
cls.conf_file = (
1108-
"/var/lib/mysql/{}/mysqlrouter.conf"
1108+
"/var/lib/mysql/{}-mysql-router/mysqlrouter.conf"
11091109
.format(application_name))
11101110

11111111
def test_910_restart_on_config_change(self):
@@ -1128,11 +1128,19 @@ def test_910_restart_on_config_change(self):
11281128
self.services)
11291129
logging.info("Passed restart on changed test.")
11301130

1131-
def test_action_bootstrap_mysqlrouter(self):
1131+
def test_920_bootstrap_mysqlrouter_action(self):
11321132
"""Checking bootstrap-mysqlrouter action.
11331133
11341134
Run the bootstrap-mysqlrouter action
11351135
"""
1136+
# application_name on test is keystone-mysql-router
1137+
# using self.conf_file introduces error.
1138+
# instead of changing current self.conf_file,
1139+
# define one (it could introduce another issue)
1140+
config_file = (
1141+
"/var/lib/mysql/{}/mysqlrouter.conf"
1142+
.format(self.application_name))
1143+
11361144
logging.info("Starting bootstrap-mysqlrouter test")
11371145

11381146
# put empty string to conf_file and make it wrong
@@ -1141,7 +1149,7 @@ def test_action_bootstrap_mysqlrouter(self):
11411149
"echo '[DEFAULT]\n \
11421150
[metadata_cache:[\\w$]+$] \
11431151
' > {}".format(
1144-
self.conf_file))
1152+
config_file))
11451153

11461154
# verify it is in error state
11471155
for attempt in tenacity.Retrying(
@@ -1186,7 +1194,7 @@ def test_action_bootstrap_mysqlrouter(self):
11861194
logging.info("Getting configuration file")
11871195
recovered = zaza.model.run_on_leader(self.application,
11881196
"cat {}".format(
1189-
self.conf_file))['Stdout']
1197+
config_file))['Stdout']
11901198

11911199
# Checking bootstrap action result
11921200
assert "Success" in action.data["results"]["outcome"], (

0 commit comments

Comments
 (0)