Skip to content

Commit

Permalink
Merge pull request #28 from rightscale-cookbooks/st_14_13_acu173881_u…
Browse files Browse the repository at this point in the history
…pdate_new_os

St 14 13 acu173881 update new os
  • Loading branch information
douglaswth committed Oct 10, 2014
2 parents e8e28df + 6c7c2ea commit 92b7cca
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 71 deletions.
33 changes: 25 additions & 8 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,38 @@ driver_config:
require_chef_omnibus: true

platforms:
- name: centos-6.5
run_list: ['recipe[yum-epel]']
driver_config:
box: opscode-centos-6.5
customize:
cpus: 2
memory: 512
- name: rhel-6.5
run_list: ['recipe[yum-epel]', 'recipe[rhsm]']
attributes:
rhsm:
username: <%= ENV['RHSM_USERNAME'] %>
password: <%= ENV['RHSM_PASSWORD'] %>
compile_time: true
additional_repos: ['rhel-6-server-optional-rpms']
driver_config:
box: local-rhel-6.5
box_url: file://<%= File.expand_path('~') %>/opscode_rhel-6.5_chef-provisionerless.box
customize:
cpus: 2
memory: 512
- name: ubuntu-12.04
run_list:
- recipe[apt::default]
run_list: ['recipe[apt]']
driver_config:
box: opscode-ubuntu-12.04
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box
customize:
cpus: 2
memory: 512
- name: centos-6.5
run_list:
- recipe[yum::epel]
- name: ubuntu-14.04
run_list: ['recipe[apt]']
driver_config:
box: opscode-centos-6.5
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
box: opscode-ubuntu-14.04
customize:
cpus: 2
memory: 512
Expand Down
13 changes: 8 additions & 5 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ site :opscode

metadata

cookbook 'collectd', github: 'EfrainOlivares/chef-collectd', branch: 'generalize_install_for_both_centos_and_ubuntu'
cookbook 'mysql', github: 'arangamani-cookbooks/mysql', branch: 'rs-fixes'
cookbook 'dns', github: 'lopakadelp/dns', branch: 'rightscale_development_v2'
cookbook 'collectd', github: 'rightscale-cookbooks-contrib/chef-collectd', branch: 'generalize_install_for_both_centos_and_ubuntu'
cookbook 'mysql', github: 'rightscale-cookbooks-contrib/mysql', branch: 'rs-fixes'
cookbook 'dns', github: 'rightscale-cookbooks-contrib/dns', branch: 'rightscale_development_v2'
cookbook 'build-essential', '~> 1.4.4'
cookbook 'database', github: 'douglaswth-cookbooks/database', branch: 'rs-fixes'
cookbook 'database', github: 'rightscale-cookbooks-contrib/database', branch: 'rs-fixes'


group :integration do
cookbook 'apt', '~> 2.3.0'
cookbook 'yum', '~> 2.4.2'
cookbook 'yum-epel', '~> 0.4.0'
cookbook 'curl', '~> 1.1.0'
cookbook 'fake', path: './test/cookbooks/fake'
cookbook 'rhsm', '~> 1.0.0'
end
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Github Repository: [https://github.com/rightscale-cookbooks/rs-mysql](https://gi
* Cookbooks
* [marker](http://community.opscode.com/cookbooks/marker)
* [mysql](http://community.opscode.com/cookbooks/mysql)
* [collectd](https://github.com/EfrainOlivares/chef-collectd)
* [database](http://community.opscode.com/cookbooks/database)
* [collectd](https://github.com/rightscale-cookbooks-contrib/chef-collectd)
* [database](https://github.com/rightscale-cookbooks-contrib/database)
* [rightscale_tag](http://community.opscode.com/cookbooks/rightscale_tag)
* [filesystem](http://community.opscode.com/cookbooks/filesystem)
* [lvm](http://community.opscode.com/cookbooks/lvm)
* [rightscale_volume](http://community.opscode.com/cookbooks/rightscale_volume)
* [rightscale_backup](http://community.opscode.com/cookbooks/rightscale_backup)
* [chef_handler](http://community.opscode.com/cookbooks/chef_handler)
* [dns](http://community.opscode.com/cookbooks/dns)
* [dns](https://github.com/rightscale-cookbooks-contrib/dns)

See the `Berksfile` and `metadata.rb` for up to date dependency information.

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
depends 'rightscale_volume', '~> 1.2.3'
depends 'rightscale_backup', '~> 1.1.5'
depends 'dns', '~> 0.1.3'
depends 'git', '~> 2.7.0'
depends 'git', '~> 4.0.2'

recipe 'rs-mysql::default', 'Sets up a standalone MySQL server'
recipe 'rs-mysql::collectd', 'Sets up collectd monitoring for MySQL server'
Expand Down
42 changes: 21 additions & 21 deletions test/integration/default/serverspec/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
require 'socket'

mysql_name = ''
case backend.check_os[:family]
when 'Ubuntu'
case os[:family]
when 'ubuntu'
mysql_name = 'mysql'
mysql_config_file = '/etc/mysql/my.cnf'
mysql_server_packages = %w{mysql-server apparmor-utils}
collectd_plugin_dir = '/etc/collectd/plugins'
when 'RedHat'
when 'redhat'
mysql_name = 'mysqld'
mysql_config_file = '/etc/my.cnf'
mysql_server_packages = %w{mysql-server}
Expand Down Expand Up @@ -41,7 +41,7 @@
describe "verify the tuning attributes set in #{mysql_config_file}" do
{
query_cache_size: "4M",
innodb_buffer_pool_size: "392M",
innodb_buffer_pool_size: "39[12]M",
thread_cache_size: 50,
max_connections: 800,
wait_timeout: 28800,
Expand All @@ -62,7 +62,7 @@
myisam_sort_buffer_size: "64M"
}.each do |attribute, value|
describe command("grep -E \"^#{attribute}\\s+\" #{mysql_config_file}") do
it { should return_stdout /#{value}/ }
its(:stdout) { should match /#{value}/ }
end
end
end
Expand All @@ -76,32 +76,32 @@
describe command(
"echo \"SELECT User, Host FROM mysql.user\" | mysql --user=root --password=rootpass"
) do
it { should return_stdout /appuser\tlocalhost/ }
it { should return_stdout /appuser\t%/ }
its(:stdout) { should match /appuser\tlocalhost/ }
its(:stdout) { should match /appuser\t%/ }
end
end

describe "'app_test' database exists" do
describe command(
"echo \"SHOW DATABASES LIKE 'app_test'\" | mysql --user=appuser --password=apppass"
) do
it { should return_stdout /app_test/ }
its(:stdout) { should match /app_test/ }
end
end

describe "select tables from a database" do
describe command(
"echo \"USE app_test; SELECT * FROM app_test\" | mysql --user=appuser --password=apppass"
) do
it { should return_stdout /I am in the db/ }
its(:stdout) { should match /I am in the db/ }
end
end

describe "create database" do
describe command(
"echo \"DROP DATABASE IF EXISTS blah; CREATE DATABASE blah; SHOW DATABASES LIKE 'blah'\" | mysql --user=root --password=rootpass"
) do
it { should return_stdout /blah/ }
its(:stdout) { should match /blah/ }
end
end
end
Expand All @@ -113,19 +113,19 @@

describe "contents of #{collectd_plugin_dir}/mysql.conf" do
describe command("grep LoadPlugin #{collectd_plugin_dir}/mysql.conf") do
it { should return_stdout /mysql/ }
its(:stdout) { should match /mysql/ }
end

describe command("grep \"^<Plugin\" #{collectd_plugin_dir}/mysql.conf") do
it { should return_stdout /mysql/ }
its(:stdout) { should match /mysql/ }
end

describe command("grep Host #{collectd_plugin_dir}/mysql.conf") do
it { should return_stdout /localhost/ }
its(:stdout) { should match /localhost/ }
end

describe command("grep User #{collectd_plugin_dir}/mysql.conf") do
it { should return_stdout /root/ }
its(:stdout) { should match /root/ }
end
end
end
Expand All @@ -140,30 +140,30 @@
end

it "should have a UUID of 1111111" do
default_tags['server:uuid'].first.value.should eq('1111111')
expect(default_tags['server:uuid'].first.value).to eq('1111111')
end

it "should have a public of 10.10.1.1" do
default_tags['server:public_ip_0'].first.value.should eq('10.10.1.1')
expect(default_tags['server:public_ip_0'].first.value).to eq('10.10.1.1')
end

it "should have a bind port of 3306" do
default_tags['database:bind_port'].first.value.should eq('3306')
expect(default_tags['database:bind_port'].first.value).to eq('3306')
end

it "should have a bind IP address of 10.0.2.15" do
default_tags['database:bind_ip_address'].first.value.should eq('10.0.2.15')
expect(default_tags['database:bind_ip_address'].first.value).to eq('10.0.2.15')
end

it "should have 4 database specific entries" do
default_tags['database'].length.should eq(4)
expect(default_tags['database'].length).to eq(4)
end

it "should be active" do
default_tags['database:active'].first.value.should be_true
expect(default_tags['database:active'].first.value).to be_truthy
end

it "should have a lineage of lineage" do
default_tags['database:lineage'].first.value.should eq('lineage')
expect(default_tags['database:lineage'].first.value).to eq('lineage')
end
end
3 changes: 0 additions & 3 deletions test/integration/default/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

installer = Gem::DependencyInstaller.new
installer.install('machine_tag')
Gem.clear_paths
Expand Down
3 changes: 0 additions & 3 deletions test/integration/dump_import_bz2/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
3 changes: 0 additions & 3 deletions test/integration/dump_import_gz/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
3 changes: 0 additions & 3 deletions test/integration/dump_import_plain/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
3 changes: 0 additions & 3 deletions test/integration/dump_import_xz/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
2 changes: 1 addition & 1 deletion test/integration/master/serverspec/master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
end

it "should be active" do
master_tags['database:active'].first.value.should be_true
master_tags['database:active'].first.value.should be_truthy
end

it "should have a lineage of lineage" do
Expand Down
3 changes: 0 additions & 3 deletions test/integration/master/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
10 changes: 5 additions & 5 deletions test/integration/shared_server/serverspec/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

require 'spec_helper'

case backend.check_os[:family]
when 'Ubuntu'
case os[:family]
when 'ubuntu'
mysql_config_file = '/etc/mysql/my.cnf'
when 'RedHat'
when 'redhat'
mysql_config_file = '/etc/my.cnf'
end

describe "verify the tuning attributes set in #{mysql_config_file}" do
{
query_cache_size:"2M",
innodb_buffer_pool_size: "196M",
innodb_buffer_pool_size: "19[56]M",
thread_cache_size: 25,
max_connections: 400,
wait_timeout: 14400,
Expand All @@ -33,7 +33,7 @@
myisam_sort_buffer_size: "32M"
}.each do |attribute, value|
describe command("grep -E \"^#{attribute}\\s+\" #{mysql_config_file}") do
it { should return_stdout /#{value}/ }
its(:stdout) { should match /#{value}/ }
end
end
end
3 changes: 0 additions & 3 deletions test/integration/shared_server/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down
6 changes: 3 additions & 3 deletions test/integration/slave/serverspec/slave_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
describe command(
"echo \"SHOW SLAVE STATUS \\G \" | mysql --user=root --password=rootpass"
) do
it { should return_stdout /Master_Host: 10\.10\.3\.2/ }
its(:stdout) { should match /Master_Host: 10\.10\.3\.2/ }
end
end

describe "Master_Port matches 3306" do
describe command(
"echo \"SHOW SLAVE STATUS \\G \" | mysql --user=root --password=rootpass"
) do
it { should return_stdout /Master_Port: 3306/ }
its(:stdout) { should match /Master_Port: 3306/ }
end
end

Expand Down Expand Up @@ -86,7 +86,7 @@
end

it "should be active" do
slave_tags['database:active'].first.value.should be_true
slave_tags['database:active'].first.value.should be_truthy
end

it "should have a lineage of lineage" do
Expand Down
3 changes: 0 additions & 3 deletions test/integration/slave/serverspec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'json'
require 'rubygems/dependency_installer'

include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

# server_spec requires Gems to be installed in a specific path so the following is needed to make mysql2 & machine_tag
# available for testing
installer = Gem::DependencyInstaller.new
Expand Down

0 comments on commit 92b7cca

Please sign in to comment.