diff --git a/.kitchen.yml b/.kitchen.yml index 7319944..f897202 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -1,7 +1,7 @@ --- driver: name: vagrant - vagrantfile_erb: Vagrantfile.erb + require_chef_omnibus: true customize: memory: 512 @@ -11,77 +11,61 @@ provisioner: platforms: - name: ubuntu-12.04 - driver: - box: opscode-ubuntu-12.04 - box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box run_list: - recipe[apt] attributes: riak: package: local: - filename: "riak_2.0.0pre11-1_amd64.deb" - checksum: "ca0c78cdb0a42a07db36a95fcc802e95cb459b2eb51a83b18f8690d619c3e27a" + filename: "riak_2.0.0beta1-1_amd64.deb" + checksum: "fbbd08bcfcef012a7ed9ce6c4744862fdf4642ba7a8eeed7d00beb465466d863" enterprise: - checksum: "" + checksum: "a700c3284a687bb4a8298da99d6c1886ba41e931662bf10075566125544d162d" - name: debian-7.2.0 - driver: - box: opscode-debian-7.2.0 - box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.2.0_chef-provisionerless.box run_list: - recipe[apt] attributes: riak: package: local: - filename: "riak_2.0.0pre11-1_amd64.deb" - checksum: "e14a2a576e85dcb68d01713721b08d31b2dcb64be6a9777562e120564b6e5976" + filename: "riak_2.0.0beta1-1_amd64.deb" + checksum: "076b7bd58f179bed13da8cbb9b6cdaba7b123da8ada14e80b84b4e214bf24781" enterprise: - checksum: "" + checksum: "554e48bc39424c3bf08b357add663ad86bcc618d63755a601efdc608aa016a79" - name: centos-6.5 - driver: - box: opscode-centos-6.5 - box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box run_list: - recipe[yum-epel] attributes: riak: package: local: - filename: "riak-2.0.0pre11-1.el6.x86_64.rpm" - checksum: "24cbd215a123294ac7bbf65e9e76a513e0dca704e7362b86149ce9deebcae9f4" + filename: "riak-2.0.0beta1-1.el6.x86_64.rpm" + checksum: "2789de9a0d5eb536acb6eb5766393239e824b59e7da9055a765dca3c0596e110" enterprise: - checksum: "" + checksum: "7fdd3bca7d4d8961a601dc70925398ddb31c0f56d8f823596e6920d27f26f5db" - name: centos-5.10 - driver: - box: opscode-centos-5.10 - box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box run_list: - recipe[yum-epel] attributes: riak: package: local: - filename: "riak-2.0.0pre11-1.el5.x86_64.rpm" - checksum: "bca839267482db6d290ae6747074a414958dedc3333cc573259d9de511156432" + filename: "riak-2.0.0beta1-1.el5.x86_64.rpm" + checksum: "156401435bd2d0e30d5eec0f39c4e12b29b0bc4d0dc0d9e3c6f3672bcf2956b6" enterprise: - checksum: "" + checksum: "77b1e6c05040f4d47051208a23d85234c4532875a3afdbe451c63e81d175c021" - name: fedora-19 - driver: - box: opscode-fedora-19 - box_url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-19_chef-provisionerless.box attributes: riak: package: local: - checksum: "1672703f40e1d98954f40895c05435385651093e1268905ab46f79f4417b04b4" + checksum: "49264c49e025100126e83530ea8e5b690812da200bc4d5030338229148a43f99" enterprise: - checksum: "" + checksum: "d4381b2e976459b7a5775e4e3e2189b1a75daaf2c8fd825631fb8551a1e9f9b8" suites: - name: default run_list: - - recipe[minitest-handler] - recipe[riak] attributes: riak: @@ -91,10 +75,9 @@ suites: version: major: "2" minor: "0" - incremental: "0pre11" + incremental: "0beta1" - name: enterprise run_list: - - recipe[minitest-handler] - recipe[riak] attributes: riak: @@ -103,23 +86,22 @@ suites: version: major: "2" minor: "0" - incremental: "0pre11" + incremental: "0beta1" enterprise_key: <%= (ENV["RIAK_ENTERPRISE_KEY"].nil? ? "" : ENV["RIAK_ENTERPRISE_KEY"]) %> + excludes: + - fedora-19 - name: custom_package run_list: - - recipe[minitest-handler] - recipe[riak] attributes: {} - name: custom_repository run_list: - - recipe[minitest-handler] - recipe[riak] attributes: riak: install_method: "custom_repository" - name: source run_list: - - recipe[minitest-handler] - recipe[riak] attributes: riak: @@ -127,4 +109,4 @@ suites: source: major: "2" minor: "0" - incremental: "0pre11" + incremental: "0beta1" diff --git a/Berksfile b/Berksfile index 83c1cb8..34a3b2d 100644 --- a/Berksfile +++ b/Berksfile @@ -4,7 +4,5 @@ metadata group :integration do cookbook "apt" - cookbook "yum", "~> 3.0" - cookbook "yum-epel", "~> 0.3" - cookbook "minitest-handler" + cookbook "yum" end diff --git a/README.md b/README.md index 570e65e..54e1d24 100644 --- a/README.md +++ b/README.md @@ -239,8 +239,8 @@ are set appropriately: ```ruby default["riak"]["install_method"] = "package" -default["riak"]["package"]["local"]["filename"] = "riak-2.0.0pre11-1.el6.x86_64.rpm" -default["riak"]["package"]["local"]["checksum"] = "24cbd215a123294ac7bbf65e9e76a513e0dca704e7362b86149ce9deebcae9f4" +default["riak"]["package"]["local"]["filename"] = "riak-2.0.0beta1-1.el6.x86_64.rpm" +default["riak"]["package"]["local"]["checksum"] = "2789de9a0d5eb536acb6eb5766393239e824b59e7da9055a765dca3c0596e110" ``` #### Custom Repository diff --git a/TESTING.md b/TESTING.md deleted file mode 100644 index 2d80b01..0000000 --- a/TESTING.md +++ /dev/null @@ -1,36 +0,0 @@ -This cookbook includes support for running tests via Test Kitchen. This has -some requirements: - -1. You must be using the Git repository, rather than the downloaded cookbook - from the Chef Community Site. -2. You must have Vagrant 1.1+ installed. -3. You must have a Ruby 1.9.3+ environment. - -Once the above requirements are met, install the additional requirements: - -Install the Berkshelf plugin for Vagrant, and Berkshelf to your local Ruby -environment: - -```bash -$ vagrant plugin install vagrant-berkshelf -$ gem install berkshelf -``` - -Install Test Kitchen: - -```bash -gem install test-kitchen --pre -``` - -Install the Vagrant driver for Test Kitchen: - -```bash -gem install kitchen-vagrant -``` - -Once the above are installed, you should be able to run Test Kitchen: - -```bash -kitchen list -kitchen test -``` diff --git a/Vagrantfile.erb b/Vagrantfile.erb deleted file mode 100644 index d56beef..0000000 --- a/Vagrantfile.erb +++ /dev/null @@ -1,52 +0,0 @@ -Vagrant.configure("2") do |c| - c.vm.box = "<%= config[:box] %>" - c.vm.box_url = "<%= config[:box_url] %>" - - # Enable vagrant-omnibus plugin. - c.omnibus.chef_version = :latest - - # Enable vagrant-cachier plugin. - c.cache.auto_detect = true - -<% if config[:vm_hostname] %> - c.vm.hostname = "<%= config[:vm_hostname] %>" -<% end %> -<% if config[:guest] %> - c.vm.guest = <%= config[:guest] %> -<% end %> -<% if config[:username] %> - c.ssh.username = "<%= config[:username] %>" -<% end %> -<% if config[:ssh_key] %> - c.ssh.private_key_path = "<%= config[:ssh_key] %>" -<% end %> - -<% Array(config[:network]).each do |opts| %> - c.vm.network(:<%= opts[0] %>, <%= opts[1..-1].join(", ") %>) -<% end %> - - c.vm.synced_folder ".", "/vagrant", disabled: true -<% config[:synced_folders].each do |source, destination, options| %> - c.vm.synced_folder "<%= source %>", "<%= destination %>", <%= options %> -<% end %> - - c.vm.provider :<%= config[:provider] %> do |p| -<% config[:customize].each do |key, value| %> - <% case config[:provider] - when "virtualbox" %> - p.customize ["modifyvm", :id, "--<%= key %>", "<%= value %>"] - <% when "rackspace", "softlayer" %> - p.<%= key %> = "<%= value%>" - <% when /^vmware_/ %> - <% if key == :memory %> - <% unless config[:customize].include?(:memsize) %> - p.vmx["memsize"] = "<%= value %>" - <% end %> - <% else %> - p.vmx["<%= key %>"] = "<%= value %>" - <% end %> - <% end %> -<% end %> - end - -end diff --git a/attributes/package.rb b/attributes/package.rb index a8f6bbc..cf1d2b9 100644 --- a/attributes/package.rb +++ b/attributes/package.rb @@ -22,7 +22,7 @@ default["riak"]["package"]["url"] = "http://s3.amazonaws.com/downloads.basho.com/riak" default["riak"]["package"]["version"]["major"] = "2" default["riak"]["package"]["version"]["minor"] = "0" -default["riak"]["package"]["version"]["incremental"] = "0pre11" +default["riak"]["package"]["version"]["incremental"] = "0beta1" default["riak"]["package"]["version"]["build"] = "1" default["riak"]["package"]["local"]["filename"] = "" diff --git a/attributes/source.rb b/attributes/source.rb index e91be36..598ce23 100644 --- a/attributes/source.rb +++ b/attributes/source.rb @@ -19,8 +19,8 @@ default["riak"]["source"]["url"] = "http://s3.amazonaws.com/downloads.basho.com/riak" default["riak"]["source"]["version"]["major"] = "2" default["riak"]["source"]["version"]["minor"] = "0" -default["riak"]["source"]["version"]["incremental"] = "0pre11" +default["riak"]["source"]["version"]["incremental"] = "0beta1" default["riak"]["source"]["prefix"] = "/opt" -default["riak"]["source"]["checksum"] = "261c8fb10b62c91ca767d4a64516fa1785a2f2edc501e58bc89f24759190d69f" +default["riak"]["source"]["checksum"] = "d02f550db12261a962fa0c3b5a320db09c2de180fc3a84b80f40b8494b0ce828" diff --git a/files/default/tests/minitest/default_test.rb b/files/default/tests/minitest/default_test.rb deleted file mode 100644 index 27c78b5..0000000 --- a/files/default/tests/minitest/default_test.rb +++ /dev/null @@ -1,28 +0,0 @@ -require File.expand_path("../support/helpers", __FILE__) - -describe "riak::default" do - include Helpers::Riak - - it "installs riak" do - if node["riak"]["install_method"] == "source" - file("#{node["riak"]["source"]["prefix"]}/riak").must_exist - else - package(node["riak"]["package"]["enterprise_key"].empty? ? "riak" : "riak-ee").must_be_installed - end - end - - it "responds to riak ping" do - assert(`riak ping` =~ /pong/) unless node["riak"]["install_method"] == "source" || node["platform"] == "fedora" - end - - it "emits riak stats" do - unless node["riak"]["install_method"] == "source" || node["platform"] == "fedora" - ip, port = node["riak"]["config"]["listener"]["http"]["internal"].split(":") - - sleep 3 - - response = Net::HTTP.get_response(URI.parse("http://#{ip}:#{port}/stats")) - assert(response.body =~ /sys_system_version/) - end - end -end diff --git a/files/default/tests/minitest/support/helpers.rb b/files/default/tests/minitest/support/helpers.rb deleted file mode 100644 index 82dcc66..0000000 --- a/files/default/tests/minitest/support/helpers.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Helpers - module Riak - include MiniTest::Chef::Assertions - include MiniTest::Chef::Context - include MiniTest::Chef::Resources - end -end diff --git a/test/integration/custom_package/serverspec/custom_package_spec.rb b/test/integration/custom_package/serverspec/custom_package_spec.rb new file mode 100644 index 0000000..f62439d --- /dev/null +++ b/test/integration/custom_package/serverspec/custom_package_spec.rb @@ -0,0 +1,26 @@ +require "spec_helper" + +describe package("riak") do + it { should be_installed } +end + +describe service("riak") do + it { should be_enabled } + it { should be_running } +end + +describe port(8098) do + it { should be_listening } +end + +describe port(8087) do + it { should be_listening } +end + +describe file("/etc/riak/riak.conf") do + it { should be_file } +end + +describe command("riak ping") do + it { should return_stdout "pong" } +end diff --git a/test/integration/custom_package/serverspec/spec_helper.rb b/test/integration/custom_package/serverspec/spec_helper.rb new file mode 100644 index 0000000..94e4a44 --- /dev/null +++ b/test/integration/custom_package/serverspec/spec_helper.rb @@ -0,0 +1,4 @@ +require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS diff --git a/test/integration/custom_repository/serverspec/custom_repository_spec.rb b/test/integration/custom_repository/serverspec/custom_repository_spec.rb new file mode 100644 index 0000000..f62439d --- /dev/null +++ b/test/integration/custom_repository/serverspec/custom_repository_spec.rb @@ -0,0 +1,26 @@ +require "spec_helper" + +describe package("riak") do + it { should be_installed } +end + +describe service("riak") do + it { should be_enabled } + it { should be_running } +end + +describe port(8098) do + it { should be_listening } +end + +describe port(8087) do + it { should be_listening } +end + +describe file("/etc/riak/riak.conf") do + it { should be_file } +end + +describe command("riak ping") do + it { should return_stdout "pong" } +end diff --git a/test/integration/custom_repository/serverspec/spec_helper.rb b/test/integration/custom_repository/serverspec/spec_helper.rb new file mode 100644 index 0000000..94e4a44 --- /dev/null +++ b/test/integration/custom_repository/serverspec/spec_helper.rb @@ -0,0 +1,4 @@ +require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS diff --git a/test/integration/default/serverspec/default_spec.rb b/test/integration/default/serverspec/default_spec.rb new file mode 100644 index 0000000..f62439d --- /dev/null +++ b/test/integration/default/serverspec/default_spec.rb @@ -0,0 +1,26 @@ +require "spec_helper" + +describe package("riak") do + it { should be_installed } +end + +describe service("riak") do + it { should be_enabled } + it { should be_running } +end + +describe port(8098) do + it { should be_listening } +end + +describe port(8087) do + it { should be_listening } +end + +describe file("/etc/riak/riak.conf") do + it { should be_file } +end + +describe command("riak ping") do + it { should return_stdout "pong" } +end diff --git a/test/integration/default/serverspec/spec_helper.rb b/test/integration/default/serverspec/spec_helper.rb new file mode 100644 index 0000000..94e4a44 --- /dev/null +++ b/test/integration/default/serverspec/spec_helper.rb @@ -0,0 +1,4 @@ +require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS diff --git a/test/integration/enterprise/serverspec/enterprise_spec.rb b/test/integration/enterprise/serverspec/enterprise_spec.rb new file mode 100644 index 0000000..f61914d --- /dev/null +++ b/test/integration/enterprise/serverspec/enterprise_spec.rb @@ -0,0 +1,26 @@ +require "spec_helper" + +describe package("riak-ee") do + it { should be_installed } +end + +describe service("riak") do + it { should be_enabled } + it { should be_running } +end + +describe port(8098) do + it { should be_listening } +end + +describe port(8087) do + it { should be_listening } +end + +describe file("/etc/riak/riak.conf") do + it { should be_file } +end + +describe command("riak ping") do + it { should return_stdout "pong" } +end diff --git a/test/integration/enterprise/serverspec/spec_helper.rb b/test/integration/enterprise/serverspec/spec_helper.rb new file mode 100644 index 0000000..94e4a44 --- /dev/null +++ b/test/integration/enterprise/serverspec/spec_helper.rb @@ -0,0 +1,4 @@ +require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS diff --git a/test/integration/source/serverspec/source_spec.rb b/test/integration/source/serverspec/source_spec.rb new file mode 100644 index 0000000..7b577d7 --- /dev/null +++ b/test/integration/source/serverspec/source_spec.rb @@ -0,0 +1,9 @@ +require "spec_helper" + +describe file("/opt/riak") do + it { should be_directory } +end + +describe file("/opt/riak/etc/riak.conf") do + it { should be_file } +end diff --git a/test/integration/source/serverspec/spec_helper.rb b/test/integration/source/serverspec/spec_helper.rb new file mode 100644 index 0000000..94e4a44 --- /dev/null +++ b/test/integration/source/serverspec/spec_helper.rb @@ -0,0 +1,4 @@ +require "serverspec" + +include Serverspec::Helper::Exec +include Serverspec::Helper::DetectOS