|
4 | 4 | on_pe_supported_platforms(PLATFORMS).each do |pe_version,pe_platforms|
|
5 | 5 | pe_platforms.each do |pe_platform,facts|
|
6 | 6 | describe "on #{pe_version} #{pe_platform}" do
|
7 |
| - let(:facts) { facts } |
| 7 | + let(:facts) { {'mysql_version' => '5.1.6'}.merge(facts) } |
8 | 8 |
|
9 | 9 | let(:default_params) {
|
10 | 10 | { 'backupuser' => 'testuser',
|
|
26 | 26 | it { is_expected.to contain_mysql_grant('testuser@localhost/*.*').with(
|
27 | 27 | :privileges => ['SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS', 'TRIGGER']
|
28 | 28 | ).that_requires('Mysql_user[testuser@localhost]') }
|
29 |
| - |
| 29 | + context 'mysql < 5.1.6' do |
| 30 | + let(:facts) { {'mysql_version' => '5.0.95'}.merge(facts) } |
| 31 | + it { is_expected.to contain_mysql_grant('testuser@localhost/*.*').with( |
| 32 | + :privileges => ['SELECT', 'RELOAD', 'LOCK TABLES', 'SHOW VIEW', 'PROCESS'] |
| 33 | + ).that_requires('Mysql_user[testuser@localhost]') } |
| 34 | + end |
30 | 35 | context 'with triggers excluded' do
|
31 | 36 | let(:params) do
|
32 | 37 | { :include_triggers => false }.merge(default_params)
|
|
275 | 280 | /ADDITIONAL_OPTIONS="\$ADDITIONAL_OPTIONS --triggers"/
|
276 | 281 | )
|
277 | 282 | end
|
| 283 | + describe 'mysql_version < 5.0.11' do |
| 284 | + let(:facts) { facts.merge({'mysql_version' => '5.0.10'}) } |
| 285 | + it 'should backup triggers when asked' do |
| 286 | + is_expected.to contain_file('mysqlbackup.sh').with_content( |
| 287 | + /ADDITIONAL_OPTIONS="\$ADDITIONAL_OPTIONS --triggers"/ |
| 288 | + ) |
| 289 | + end |
| 290 | + end |
| 291 | + |
278 | 292 | end
|
279 | 293 |
|
280 | 294 | context 'with include_triggers set to false' do
|
|
0 commit comments