Open mengesb opened 6 years ago
This is to improve a test like:
describe command('/usr/bin/mysql --login-path=client -e "SHOW DATABASES;"') do
its('exit_status') { should eq 0 }
its('stdout') { should include 'mysql' }
end
to perhaps something like
sql = mysql_session(config: '/root/.mylogin.cnf', login_path: 'client')
describe sql.query('SHOW DATABASES) do
its('stdout') { should include 'mysql' }
end
Use
.my.cnf
or.mylogin.cnf
files/options in mysql_session resource🙋 feature request?
MySQL can use a dotfile (
.my.cnf
) for configuration information or an encrypted file (.mylogin.cnf
) to support logging into a MySQL instance. In the case of the encrypted file, you must pass the profile path (e.x.mysql --login-path=client
if the profile is[client]
)🌍 InSpec and Platform Version
2.1.72
🤔 Replication Case
.mylogin.cnf
file.mysql --login-path=client
because your profile isclient
command()
resources because it isn't loaded by default💁 Possible Solutions
Currently the only solution is to use
command()
💻 Stacktrace
N/A - config loading is unsupported in the resource it appears