@@ -27,14 +27,56 @@ class { 'mysql::server': }
27
27
r . exit_code . should be_zero
28
28
end
29
29
end
30
+
31
+ describe package ( package_name ) do
32
+ it { should be_installed }
33
+ end
34
+
35
+ describe service ( service_name ) do
36
+ it { should be_running }
37
+ it { should be_enabled }
38
+ end
30
39
end
31
40
32
- describe package ( package_name ) do
33
- it { should be_installed }
41
+ describe 'my.cnf' do
42
+ it 'should contain sensible values' do
43
+ pp = <<-EOS
44
+ class { 'mysql::server': }
45
+ EOS
46
+ puppet_apply ( pp ) do |r |
47
+ r . exit_code . should_not == 1
48
+ end
49
+ end
50
+
51
+ describe file ( '/etc/my.cnf' ) do
52
+ it { should contain 'key_buffer = 16M' }
53
+ it { should contain 'max_binlog_size = 100M' }
54
+ it { should contain 'query_cache_size = 16M' }
55
+ end
34
56
end
35
57
36
- describe service ( service_name ) do
37
- it { should be_running }
38
- it { should be_enabled }
58
+ describe 'my.cnf changes' do
59
+ it 'sets values' do
60
+ pp = <<-EOS
61
+ class { 'mysql::server':
62
+ override_options => { 'mysqld' =>
63
+ { 'key_buffer' => '32M',
64
+ 'max_binlog_size' => '200M',
65
+ 'query_cache_size' => '32M',
66
+ }
67
+ }
68
+ }
69
+ EOS
70
+ puppet_apply ( pp ) do |r |
71
+ r . exit_code . should_not == 1
72
+ end
73
+ end
74
+
75
+ describe file ( '/etc/my.cnf' ) do
76
+ it { should contain 'key_buffer = 32M' }
77
+ it { should contain 'max_binlog_size = 200M' }
78
+ it { should contain 'query_cache_size = 32M' }
79
+ end
39
80
end
81
+
40
82
end
0 commit comments