|
6 | 6 | describe "on #{pe_version} #{pe_platform}" do |
7 | 7 | let(:facts) { facts.merge({:fqdn => 'myhost.mydomain', :hostname => 'myhost'}) } |
8 | 8 |
|
9 | | - it 'should remove Mysql_User[root@myhost.mydomain]' do |
10 | | - is_expected.to contain_mysql_user('root@myhost.mydomain').with_ensure('absent') |
| 9 | + [ 'root@myhost.mydomain', |
| 10 | + 'root@127.0.0.1', |
| 11 | + 'root@::1', |
| 12 | + '@myhost.mydomain', |
| 13 | + '@localhost', |
| 14 | + '@%', |
| 15 | + ].each do |user| |
| 16 | + it 'removes Mysql_User[#{user}]' do |
| 17 | + is_expected.to contain_mysql_user(user).with_ensure('absent') |
| 18 | + end |
11 | 19 | end |
12 | | - it 'should remove Mysql_User[root@myhost]' do |
13 | | - is_expected.to contain_mysql_user('root@myhost').with_ensure('absent') |
14 | | - end |
15 | | - it 'should remove Mysql_User[root@127.0.0.1]' do |
16 | | - is_expected.to contain_mysql_user('root@127.0.0.1').with_ensure('absent') |
17 | | - end |
18 | | - it 'should remove Mysql_User[root@::1]' do |
19 | | - is_expected.to contain_mysql_user('root@::1').with_ensure('absent') |
20 | | - end |
21 | | - it 'should remove Mysql_User[@myhost.mydomain]' do |
22 | | - is_expected.to contain_mysql_user('@myhost.mydomain').with_ensure('absent') |
23 | | - end |
24 | | - it 'should remove Mysql_User[@myhost]' do |
25 | | - is_expected.to contain_mysql_user('@myhost').with_ensure('absent') |
26 | | - end |
27 | | - it 'should remove Mysql_User[@localhost]' do |
28 | | - is_expected.to contain_mysql_user('@localhost').with_ensure('absent') |
29 | | - end |
30 | | - it 'should remove Mysql_User[@%]' do |
31 | | - is_expected.to contain_mysql_user('@%').with_ensure('absent') |
| 20 | + |
| 21 | + # When the hostname doesn't match the fqdn we also remove these. |
| 22 | + # We don't need to test the inverse as when they match they are |
| 23 | + # covered by the above list. |
| 24 | + [ 'root@myhost', '@myhost' ].each do |user| |
| 25 | + it 'removes Mysql_User[#{user}]' do |
| 26 | + is_expected.to contain_mysql_user(user).with_ensure('absent') |
| 27 | + end |
32 | 28 | end |
33 | 29 |
|
34 | 30 | it 'should remove Mysql_database[test]' do |
|
0 commit comments