Browse Source

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
changes/92/679392/7
Grzegorz Grasza 2 weeks ago
parent
commit
025f6d7d83

+ 5
- 2
novajoin_tempest_plugin/config.py View File

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

+ 6
- 3
novajoin_tempest_plugin/tests/scenario/novajoin_manager.py View File

@@ -300,7 +300,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
300 300
         return self.execute_on_controller(user, host_ip, cmd).rstrip()
301 301
 
302 302
     def verify_mysql_tls_connection(self, user, host_ip):
303
-        cmd = "sudo mysql --ssl -e \"SHOW SESSION STATUS LIKE 'Ssl_version';\""
303
+        cmd = (CONF.novajoin.mysql_command +
304
+               " --ssl -e \"SHOW SESSION STATUS LIKE 'Ssl_version';\"")
304 305
         result = self.execute_on_controller(user, host_ip, cmd)
305 306
         self.assertTrue('TLS' in result)
306 307
 
@@ -311,7 +312,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
311 312
                                      dbhost,
312 313
                                      dbpassword):
313 314
         sql = "SHOW SESSION STATUS LIKE \'Ssl_version\';"
314
-        cmd = ('sudo mysql --ssl -u {user} -h {host} --password={password} '
315
+        cmd = (CONF.novajoin.mysql_command +
316
+               ' --ssl -u {user} -h {host} --password={password} '
315 317
                '-e \"{sql}\"'.format(user=dbuser,
316 318
                                      host=dbhost,
317 319
                                      password=dbpassword,
@@ -325,7 +327,8 @@ class NovajoinScenarioTest(manager.ScenarioTest):
325 327
                                         dbuser,
326 328
                                         dbhost,
327 329
                                         dbpassword):
328
-        cmd = ('sudo mysql -u {user} -h {host} --password={password} '
330
+        cmd = (CONF.novajoin.mysql_command +
331
+               ' -u {user} -h {host} --password={password} '
329 332
                '-e \"SHOW DATABASES;\"'.format(user=dbuser,
330 333
                                                host=dbhost,
331 334
                                                password=dbpassword))

Loading…
Cancel
Save