Support newer mysql in tests
Newer mysql cli clients emit a warning when you put a password on the cli. This warning was being interpreted as a failure by the test framework. Change the framework to accept the warning or empty string as valid responses when running the mysql cli client to support using the cli client in the trove tests. I am not entirely sure when this new behavior arrived in mysql but it is present in Ubuntu Xenial's Mysql 5.7 packages. Change-Id: Ia148d72a7646f4c424139232d6388ff14d1d8686
This commit is contained in:
parent
d58baf220a
commit
c4f29c0e17
|
@ -129,11 +129,16 @@ class TestTroveMigrations(object):
|
|||
def _execute_cmd(self, cmd=None):
|
||||
"""Shell out and run the given command."""
|
||||
out, err = processutils.trycmd(cmd, shell=True)
|
||||
assert_equal('', err,
|
||||
"Failed to run: '%(cmd)s' "
|
||||
"Output: '%(stdout)s' "
|
||||
"Error: '%(stderr)s'" %
|
||||
{'cmd': cmd, 'stdout': out, 'stderr': err})
|
||||
# Until someone wants to rewrite this to avoid the warning
|
||||
# we need to handle it for newer versions of mysql
|
||||
valid_err = err == '' or \
|
||||
err == 'mysql: [Warning] Using a password on the ' \
|
||||
'command line interface can be insecure.\n'
|
||||
assert_true(valid_err,
|
||||
"Failed to run: '%(cmd)s' "
|
||||
"Output: '%(stdout)s' "
|
||||
"Error: '%(stderr)s'" %
|
||||
{'cmd': cmd, 'stdout': out, 'stderr': err})
|
||||
|
||||
def _reset_mysql(self):
|
||||
"""Reset the MySQL test database
|
||||
|
|
Loading…
Reference in New Issue