|
127 | 127 | it { should contain_file('mysqlgrant-someuser-10.42.42.0_255.255.255.0-all.sql').with_content(/REVOKE ALL ON \*\.\* FROM 'someuser'@'10.42.42.0\/255.255.255.0';/) }
|
128 | 128 | it { should contain_file('mysqlgrant-someuser-10.42.42.0_255.255.255.0-all.sql').with_content(/FLUSH PRIVILEGES;/) }
|
129 | 129 | end
|
| 130 | + |
| 131 | + describe 'Test grant with initial data' do |
| 132 | + let(:params) { { |
| 133 | + :name => 'sample1', |
| 134 | + :mysql_db => 'example_db', |
| 135 | + :mysql_user => 'someuser', |
| 136 | + :mysql_password => 'somepassword', |
| 137 | + :mysql_db_init_query_file => '/example/42.sql', |
| 138 | + } } |
| 139 | + |
| 140 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-localhost-example_db').with_mysql_file('/example/42.sql') } |
| 141 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-localhost-example_db').with_mysql_host('localhost') } |
| 142 | + end |
| 143 | + |
| 144 | + describe 'Test grant with initial data' do |
| 145 | + let(:params) { { |
| 146 | + :name => 'sample1', |
| 147 | + :mysql_db => 'example_db', |
| 148 | + :mysql_host => '10.42.42.0/255.255.255.0', |
| 149 | + :mysql_user => 'someuser', |
| 150 | + :mysql_password => 'somepassword', |
| 151 | + :mysql_db_init_query_file => '/example/42.sql', |
| 152 | + } } |
| 153 | + |
| 154 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_file('/example/42.sql') } |
| 155 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_host('localhost') } |
| 156 | + end |
| 157 | + |
| 158 | + describe 'Test grant with initial data' do |
| 159 | + let(:params) { { |
| 160 | + :name => 'sample1', |
| 161 | + :mysql_db => 'example_db', |
| 162 | + :mysql_host => '10.42.42.0/255.255.255.0', |
| 163 | + :mysql_user => 'someuser', |
| 164 | + :mysql_password => 'somepassword', |
| 165 | + :mysql_db_init_query_file => '/example/42.sql', |
| 166 | + :remote_host => '10.42.42.42', |
| 167 | + :remote_user => 'user42', |
| 168 | + :remote_password => 'pass42', |
| 169 | + } } |
| 170 | + |
| 171 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_file('/example/42.sql') } |
| 172 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_host('10.42.42.42') } |
| 173 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_user('user42') } |
| 174 | + it { should contain_mysql__queryfile('mysql_db_init_query_file-10.42.42.0_255.255.255.0-example_db').with_mysql_password('pass42') } |
| 175 | + end |
130 | 176 | end
|
0 commit comments