@@ -1105,7 +1105,7 @@ def setUpClass(cls, application_name="keystone-mysql-router"):
1105
1105
cls .services = ["mysqlrouter" ]
1106
1106
# Config file affected by juju set config change
1107
1107
cls .conf_file = (
1108
- "/var/lib/mysql/{}/mysqlrouter.conf"
1108
+ "/var/lib/mysql/{}-mysql-router /mysqlrouter.conf"
1109
1109
.format (application_name ))
1110
1110
1111
1111
def test_910_restart_on_config_change (self ):
@@ -1128,11 +1128,19 @@ def test_910_restart_on_config_change(self):
1128
1128
self .services )
1129
1129
logging .info ("Passed restart on changed test." )
1130
1130
1131
- def test_action_bootstrap_mysqlrouter (self ):
1131
+ def test_920_bootstrap_mysqlrouter_action (self ):
1132
1132
"""Checking bootstrap-mysqlrouter action.
1133
1133
1134
1134
Run the bootstrap-mysqlrouter action
1135
1135
"""
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
+
1136
1144
logging .info ("Starting bootstrap-mysqlrouter test" )
1137
1145
1138
1146
# put empty string to conf_file and make it wrong
@@ -1141,7 +1149,7 @@ def test_action_bootstrap_mysqlrouter(self):
1141
1149
"echo '[DEFAULT]\n \
1142
1150
[metadata_cache:[\\ w$]+$] \
1143
1151
' > {}" .format (
1144
- self . conf_file ))
1152
+ config_file ))
1145
1153
1146
1154
# verify it is in error state
1147
1155
for attempt in tenacity .Retrying (
@@ -1186,7 +1194,7 @@ def test_action_bootstrap_mysqlrouter(self):
1186
1194
logging .info ("Getting configuration file" )
1187
1195
recovered = zaza .model .run_on_leader (self .application ,
1188
1196
"cat {}" .format (
1189
- self . conf_file ))['Stdout' ]
1197
+ config_file ))['Stdout' ]
1190
1198
1191
1199
# Checking bootstrap action result
1192
1200
assert "Success" in action .data ["results" ]["outcome" ], (
0 commit comments