Fix running mysql client on containerized deployment

This adds mysql_executable configuration option and changes it to run
inside the galera container.

Related: rhbz#1730072
Co-Authored-By: Ade Lee <alee@redhat.com>
Change-Id: Iac82bd23c45e9200f4bc7049b6eafb26afbd7397
This commit is contained in:
Grzegorz Grasza 2019-08-30 10:14:51 +02:00
parent baf78c5d5b
commit 025f6d7d83
2 changed files with 11 additions and 5 deletions

View File

@ -44,6 +44,9 @@ NovajoinGroup = [
help='List of overcloud compute short host names'),
cfg.StrOpt('tripleo_undercloud',
default='undercloud',
help='Undercloud short host name'
)
help='Undercloud short host name'),
cfg.StrOpt('mysql_command',
default=("sudo podman exec galera-bundle-podman-0"
" /usr/bin/mysql"),
help='mysql client executable')
]

View File

@ -300,7 +300,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
return self.execute_on_controller(user, host_ip, cmd).rstrip()
def verify_mysql_tls_connection(self, user, host_ip):
cmd = "sudo mysql --ssl -e \"SHOW SESSION STATUS LIKE 'Ssl_version';\""
cmd = (CONF.novajoin.mysql_command +
" --ssl -e \"SHOW SESSION STATUS LIKE 'Ssl_version';\"")
result = self.execute_on_controller(user, host_ip, cmd)
self.assertTrue('TLS' in result)
@ -311,7 +312,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
dbhost,
dbpassword):
sql = "SHOW SESSION STATUS LIKE \'Ssl_version\';"
cmd = ('sudo mysql --ssl -u {user} -h {host} --password={password} '
cmd = (CONF.novajoin.mysql_command +
' --ssl -u {user} -h {host} --password={password} '
'-e \"{sql}\"'.format(user=dbuser,
host=dbhost,
password=dbpassword,
@ -325,7 +327,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
dbuser,
dbhost,
dbpassword):
cmd = ('sudo mysql -u {user} -h {host} --password={password} '
cmd = (CONF.novajoin.mysql_command +
' -u {user} -h {host} --password={password} '
'-e \"SHOW DATABASES;\"'.format(user=dbuser,
host=dbhost,
password=dbpassword))