File tree 3 files changed +33
-3
lines changed
3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1
1
source 'https://rubygems.org'
2
2
3
3
group :development , :test do
4
+ gem 'mime-types' , '<2.0' , :require => false
4
5
gem 'rake' , :require => false
5
6
gem 'rspec-puppet' , :require => false
6
7
gem 'puppetlabs_spec_helper' , :require => false
Original file line number Diff line number Diff line change 3
3
@doc = "Manage a MySQL user's rights."
4
4
ensurable
5
5
6
- autorequire ( :file ) do
7
- '/root/.my.cnf'
8
- end
6
+ autorequire ( :file ) { '/root/.my.cnf' }
9
7
10
8
def initialize ( *args )
11
9
super
@@ -38,6 +36,10 @@ def initialize(*args)
38
36
39
37
newproperty ( :privileges , :array_matching => :all ) do
40
38
desc 'Privileges for user'
39
+
40
+ munge do |value |
41
+ value . upcase
42
+ end
41
43
end
42
44
43
45
newproperty ( :table ) do
Original file line number Diff line number Diff line change @@ -283,5 +283,32 @@ class { 'mysql::server': }
283
283
end
284
284
end
285
285
286
+ describe 'lower case privileges' do
287
+ it 'create ALL privs' do
288
+ pp = <<-EOS
289
+ mysql_grant { 'lowercase@localhost/*.*':
290
+ user => 'lowercase@localhost',
291
+ privileges => 'ALL',
292
+ table => '*.*',
293
+ }
294
+ EOS
295
+
296
+ puppet_apply ( pp )
297
+ end
298
+
299
+ it 'create lowercase all privs' do
300
+ pp = <<-EOS
301
+ mysql_grant { 'lowercase@localhost/*.*':
302
+ user => 'lowercase@localhost',
303
+ privileges => 'all',
304
+ table => '*.*',
305
+ }
306
+ EOS
307
+
308
+ puppet_apply ( pp ) do |r |
309
+ r . exit_code . should be_zero
310
+ end
311
+ end
312
+ end
286
313
287
314
end
You can’t perform that action at this time.
0 commit comments