Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[COOK-2151] - add tests for new feature.
* Found issue in the template via testing :D * Add cook-2151 configuration with matching tests
- Loading branch information
jtimberman
committed
Jan 8, 2013
1 parent
f1a49e8
commit eb9ce30
Showing
5 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
test/kitchen/cookbooks/rabbitmq_test/files/default/tests/minitest/cook-2151_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# | ||
# Copyright 2012, Opscode, Inc. <legal@opscode.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
describe "rabbitmq_test::cook-2151" do | ||
include MiniTest::Chef::Assertions | ||
include MiniTest::Chef::Context | ||
include MiniTest::Chef::Resources | ||
|
||
it 'includes the disk_free_limit configuration setting' do | ||
file("#{node['rabbitmq']['config_root']}/rabbitmq.config"). | ||
must_match /\{disk_free_limit, \{mem_relative, #{node['rabbitmq']['disk_free_limit_relative']}/ | ||
end | ||
|
||
it 'includes the vm_memory_high_watermark configuration setting' do | ||
file("#{node['rabbitmq']['config_root']}/rabbitmq.config"). | ||
must_match /\{vm_memory_high_watermark, #{node['rabbitmq']['vm_memory_high_watermark']}/ | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Cookbook Name:: rabbitmq_test | ||
# Recipe:: cook-2151 | ||
# | ||
# Copyright 2012, Opscode, Inc. <legal@opscode.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
node.set['rabbitmq']['disk_free_limit_relative'] = 1.0 | ||
node.set['rabbitmq']['vm_memory_high_watermark'] = 0.5 | ||
|
||
log "#{cookbook_name}::#{recipe_name} tests that COOK-2151 is implemented." | ||
|
||
include_recipe "yum::epel" if node['platform_family'] == 'rhel' | ||
include_recipe "rabbitmq::default" |