有没有办法通过命令输出检查服务器上安装的软件包?
describe command('mysql -e "select version();"') do
if its(:stdout) { should =~ /5.6.27-76.0-log/ }
describe package('MySQL-client') do
it { should be_installed }
else
describe package('Percona-client') do
it { should be_installed }
end
end
谢谢,
好吧,我想不出比这更好的方法了: