Permalink
Browse files

Add tests for COOK-2045, COOK-2121

  • Loading branch information...
1 parent 8d5fd67 commit 04dd8ee2b9b41db743161deac9548382f337fd52 @jtimberman jtimberman committed Jan 8, 2013
View
@@ -20,4 +20,6 @@ cookbook "yum" do
configuration "ius"
configuration "repoforge"
configuration "yum"
+ configuration "remi"
+ configuration "cook-2121"
end
@@ -0,0 +1 @@
+This cookbook is used with test-kitchen to test the parent, yum cookbok
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: yum_test
+#
+# Copyright 2013, Opscode, Inc.
+#
+# 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.
+#
+
+require File.expand_path('../support/helpers', __FILE__)
+
+describe "yum_test::default" do
+ include Helpers::YumTest
+
+ it 'doesnt update the zenos-add.repo file if it exists' do
+ assert File.zero?('/etc/yum.repos.d/zenoss-add.repo')
+ end
+
+ it 'updates the zenoss-create file' do
+ file('/etc/yum.repos.d/zenoss-create.repo').must_match %r[baseurl=http://dev.zenoss.com/yum/stable/]
+ end
+end
@@ -0,0 +1,25 @@
+#
+# Cookbook Name:: yum_test
+# Recipe:: default
+#
+# Copyright 2013, Opscode, Inc.
+#
+# 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.
+#
+
+require File.expand_path('../support/helpers', __FILE__)
+
+describe "yum_test::default" do
+ include Helpers::YumTest
+
+end
@@ -0,0 +1,27 @@
+#
+# Cookbook Name:: yum_test
+# Recipe:: default
+#
+# Copyright 2013, Opscode, Inc.
+#
+# 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.
+#
+
+module Helpers
+ module YumTest
+ include MiniTest::Chef::Assertions
+ include MiniTest::Chef::Context
+ include MiniTest::Chef::Resources
+
+ end
+end
@@ -0,0 +1,6 @@
+name "yum"
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "This cookbook is used with test-kitchen to test the parent, yum cookbok"
+version "1.0.0"
@@ -0,0 +1,31 @@
+#
+# Cookbook Name:: yum_test
+# Recipe:: cook-2121
+#
+# Copyright 2013, Opscode, Inc.
+#
+# 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.
+#
+
+%w{add create}.each do |act|
+ file "/etc/yum.repos.d/zenoss-#{act}.repo" do
+ action :create
+ end
+
+ yum_repository "zenoss-#{act}" do
+ description "Zenoss Stable repo"
+ url "http://dev.zenoss.com/yum/stable/"
+ key "RPM-GPG-KEY-zenoss"
+ action act.to_sym
+ end
+end
@@ -0,0 +1,20 @@
+#
+# Cookbook Name:: yum_test
+# Recipe:: default
+#
+# Copyright 2013, Opscode, Inc.
+#
+# 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.
+#
+
+include_recipe "yum::default"

0 comments on commit 04dd8ee

Please sign in to comment.