Try to add some checks so the test doesn't do an rm -rf /

This commit is contained in:
Morgan Haskel 2014-05-09 13:58:46 -04:00
parent a6bacbd144
commit 7c16c52ef4

View file

@ -18,7 +18,7 @@ describe 'mysql::server::root_password class', :unless => UNSUPPORTED_PLATFORMS.
it 'deletes all databases' do
case fact('osfamily')
when 'RedHat', 'Suse'
shell('rm -rf `grep datadir /etc/my.cnf | cut -d" " -f 3`/*')
shell('grep -q datadir /etc/my.cnf && rm -rf `grep datadir /etc/my.cnf | cut -d" " -f 3`/*')
when 'Debian'
shell('rm -rf `grep datadir /etc/mysql/my.cnf | cut -d" " -f 3`/*')
shell('mysql_install_db')