Skip to content

Commit

Permalink
add test-kitchen suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Baer committed Jan 18, 2014
1 parent 67f5b23 commit f1a0167
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.kitchen/
.kitchen.local.yml
*.lock
tmp/
.bundle/
.librarian/
20 changes: 20 additions & 0 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
driver:
name: vagrant

provisioner:
name: chef_solo

platforms:
- name: ubuntu-12.04
- name: centos-6.4

suites:
- name: default
run_list:
- recipe[route53-test]
attributes:
route53:
zone_id: "foo"
aws_access_key_id: "bar"
aws_secret_access_key: "bangarang"
7 changes: 7 additions & 0 deletions Cheffile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env ruby
#^syntax detection

site 'http://community.opscode.com/api/v1'

cookbook 'route53', path: '.'
cookbook 'route53-test', path: 'test/cookbooks/route53-test'
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source "https://rubygems.org"

gem "test-kitchen"
gem "kitchen-vagrant"
gem "kitchen-docker"
gem "librarian-chef"
1 change: 1 addition & 0 deletions test/cookbooks/route53-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Test cookbook for route53
9 changes: 9 additions & 0 deletions test/cookbooks/route53-test/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name 'route53-test'
maintainer 'Heavy Water Operations'
maintainer_email '[email protected]'
license 'Apache 2.0'
description 'Installs/Configures route53-test'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'

depends 'route53'
32 changes: 32 additions & 0 deletions test/cookbooks/route53-test/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Cookbook Name:: route53-test
# Recipe:: default
#
# Copyright 2014, Heavy Water Operations
#
# 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 "route53"

route53_record "create a record" do
name "test"
value "16.8.4.2"
type "A"

zone_id node[:route53][:zone_id]
aws_access_key_id node[:route53][:aws_access_key_id]
aws_secret_access_key node[:route53][:aws_secret_access_key]

action :create
end

0 comments on commit f1a0167

Please sign in to comment.