summaryrefslogtreecommitdiff
path: root/kitchen-tests
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-10-07 10:57:32 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-10-27 16:24:36 -0700
commitc50046851b5e2af3cfef6c7b02b69e3c36a51db1 (patch)
treec1ae5d267cb3d1017079f6599c534e98f9d262af /kitchen-tests
parentcb978d59239e7fcfea48749334185caa7064b9ea (diff)
downloadchef-c50046851b5e2af3cfef6c7b02b69e3c36a51db1.tar.gz
WIP
Diffstat (limited to 'kitchen-tests')
-rw-r--r--kitchen-tests/.kitchen.travis.yml14
-rw-r--r--kitchen-tests/.kitchen.yml18
-rw-r--r--kitchen-tests/cookbooks/webapp/attributes/default.rb2
-rw-r--r--kitchen-tests/cookbooks/webapp/recipes/default.rb7
-rw-r--r--kitchen-tests/test/fixtures/platforms/centos/5.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/centos/6.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json52
-rw-r--r--kitchen-tests/test/fixtures/serverspec_helper.rb2
-rw-r--r--kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb12
9 files changed, 81 insertions, 54 deletions
diff --git a/kitchen-tests/.kitchen.travis.yml b/kitchen-tests/.kitchen.travis.yml
index 4fd6a78900..66bbe23f64 100644
--- a/kitchen-tests/.kitchen.travis.yml
+++ b/kitchen-tests/.kitchen.travis.yml
@@ -6,18 +6,28 @@ driver_config:
iam_profile_name: <%= ENV['IAM_PROFILE_NAME'] %>
provisioner:
- name: chef_solo
+ name: chef_zero
github: <%= ENV['TRAVIS_REPO_SLUG'] %>
branch: <%= ENV['TRAVIS_COMMIT'] %>
require_chef_omnibus: true
data_path: test/fixtures
+# disable file provider diffs so we don't overflow travis' line limit
+ client_rb:
+ diff_disabled: true
platforms:
- name: ubuntu-12.04
driver_plugin: ec2
driver_config:
region: "us-west-2"
- availability_zone: "us-west-2b"
+ availability_zone: "us-west-2a"
+ ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
+ security_group_ids: ["travis-ci"]
+ - name: centos-6.4
+ driver_plugin: ec2
+ driver_config:
+ region: "us-west-2"
+ availability_zone: "us-west-2a"
ssh_key: <%= ENV['EC2_SSH_KEY_PATH'] %>
security_group_ids: ["travis-ci"]
diff --git a/kitchen-tests/.kitchen.yml b/kitchen-tests/.kitchen.yml
index 651a606502..5a93822b5d 100644
--- a/kitchen-tests/.kitchen.yml
+++ b/kitchen-tests/.kitchen.yml
@@ -1,14 +1,28 @@
---
+driver:
+ name: vagrant
+ customize:
+ cpus: 4
+ memory: 2048
+
provisioner:
- name: chef_solo
+ name: chef_zero
github: "opscode/chef"
branch: <%= %x(git rev-parse HEAD) %>
require_chef_omnibus: true
data_path: test/fixtures
platforms:
+# - name: ubuntu-10.04
+# run_list: apt::default
- name: ubuntu-12.04
- driver_plugin: vagrant
+ run_list: apt::default
+# - name: ubuntu-13.04
+# run_list: apt::default
+ - name: centos-6.4
+ run_list: yum-epel::default
+ - name: centos-5.10
+ run_list: yum-epel::default
suites:
- name: webapp
diff --git a/kitchen-tests/cookbooks/webapp/attributes/default.rb b/kitchen-tests/cookbooks/webapp/attributes/default.rb
index efe06b6549..76c300211f 100644
--- a/kitchen-tests/cookbooks/webapp/attributes/default.rb
+++ b/kitchen-tests/cookbooks/webapp/attributes/default.rb
@@ -4,4 +4,4 @@ default['mysql']['version'] = "5.5"
default['webapp']['database'] = 'webapp'
default['webapp']['db_username'] = 'webapp'
-default['webapp']['path'] = '/var/www/'
+default['webapp']['path'] = '/srv/webapp'
diff --git a/kitchen-tests/cookbooks/webapp/recipes/default.rb b/kitchen-tests/cookbooks/webapp/recipes/default.rb
index 82479e5137..839b0ad8d8 100644
--- a/kitchen-tests/cookbooks/webapp/recipes/default.rb
+++ b/kitchen-tests/cookbooks/webapp/recipes/default.rb
@@ -14,8 +14,11 @@ creds = Hash.new
creds[item_name] = data_bag_item('passwords', item_name)
end
-apache_site "default" do
- enable true
+web_app "webapp" do
+ server_name 'localhost'
+ server_aliases [node['fqdn'], node['hostname'], 'localhost.localdomain']
+ docroot node['webapp']['path']
+ cookbook 'apache2'
end
mysql_service "default" do
diff --git a/kitchen-tests/test/fixtures/platforms/centos/5.json b/kitchen-tests/test/fixtures/platforms/centos/5.json
new file mode 100644
index 0000000000..9d324a2f03
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/centos/5.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "httpd",
+ "service_name": "httpd"
+ },
+ "mysql": {
+ "server_package": "mysql-server",
+ "client_package": "mysql",
+ "service_name": "mysqld"
+ },
+ "php" : {
+ "package": "php53"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/centos/6.json b/kitchen-tests/test/fixtures/platforms/centos/6.json
new file mode 100644
index 0000000000..4f74a3ed4a
--- /dev/null
+++ b/kitchen-tests/test/fixtures/platforms/centos/6.json
@@ -0,0 +1,14 @@
+{
+ "apache": {
+ "package": "httpd",
+ "service_name": "httpd"
+ },
+ "mysql": {
+ "server_package": "mysql-server",
+ "client_package": "mysql",
+ "service_name": "mysqld"
+ },
+ "php" : {
+ "package": "php"
+ }
+}
diff --git a/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json b/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
index 5e436a3cb0..eab46db2e5 100644
--- a/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
+++ b/kitchen-tests/test/fixtures/platforms/ubuntu/12.04.json
@@ -1,42 +1,14 @@
{
- "apache": {
- "package": "apache2",
- "binary": "/usr/sbin/apache2",
- "dir": "/etc/apache2",
- "lib_dir": "/usr/lib/apache2",
- "libexec_dir": "/usr/lib/apache2/modules",
- "cache_dir": "/var/cache/apache2",
- "cgibin_dir": "/usr/lib/cgi-bin",
- "docroot_dir": "/var/www",
- "conf": "/etc/apache2/apache2.conf",
- "perl_pkg": "perl",
- "log_dir": "/var/log/apache2",
- "root_group": "root",
- "service_name": "apache2",
- "service_restart_command": "/usr/sbin/invoke-rc.d apache2 restart && sleep 1",
- "service_reload_command": "/usr/sbin/invoke-rc.d apache2 reload && sleep 1",
- "default_site_name": "000-default",
- "default_site_enabled": false,
- "default_modules": [
- "status",
- "alias",
- "auth_basic",
- "authn_file",
- "authz_core",
- "authz_groupfile",
- "authz_host",
- "authz_user",
- "autoindex",
- "dir",
- "env",
- "mime",
- "negotiation",
- "setenvif"
- ]
- },
- "mysql": {
- "server": {
- "version": "5.5"
- }
- }
+ "apache": {
+ "package": "apache2",
+ "service_name": "apache2"
+ },
+ "mysql": {
+ "server_package": "mysql-server-5.5",
+ "client_package": "mysql-client-5.5",
+ "service_name": "mysql"
+ },
+ "php" : {
+ "package": "php5"
+ }
}
diff --git a/kitchen-tests/test/fixtures/serverspec_helper.rb b/kitchen-tests/test/fixtures/serverspec_helper.rb
index 48963dc45d..ad1f866775 100644
--- a/kitchen-tests/test/fixtures/serverspec_helper.rb
+++ b/kitchen-tests/test/fixtures/serverspec_helper.rb
@@ -1,4 +1,4 @@
-# Shamelessly copied from opscode/onehealth-cookbooks/apache2/test/fixtures/serverspec_helper.rb
+# Shamelessly copied from https://github.com/onehealth-cookbooks/apache2/blob/master/test/fixtures/serverspec_helper.rb
# The commented-out platforms in the osmapping hash can be added once we have added them into
# our .kitchen.yml and .kitchen.travis.yml and added the appropriate JSON under test/fixtures/platforms.
diff --git a/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb b/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
index 05da3ff337..64c9121a6f 100644
--- a/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
+++ b/kitchen-tests/test/integration/webapp/serverspec/localhost/default_spec.rb
@@ -19,21 +19,21 @@ describe "webapp::default", :end_to_end => true do
end
end
- describe "mysql-server-#{property[:mysql][:server][:version]} package" do
+ describe "#{property[:mysql][:server_package]} package" do
include_examples "a package" do
- let(:package_name) { "mysql-server-#{property[:mysql][:server][:version]}" }
+ let(:package_name) { property[:mysql][:server_package] }
end
end
- describe "mysql-client-5.5 package" do
+ describe "#{property[:mysql][:client_package]} package" do
include_examples "a package" do
- let(:package_name) { "mysql-client-5.5" }
+ let(:package_name) { property[:mysql][:client_package] }
end
end
describe "php package" do
include_examples "a package" do
- let(:package_name) { "php5" }
+ let(:package_name) { property[:php][:package] }
end
end
end
@@ -57,7 +57,7 @@ describe "webapp::default", :end_to_end => true do
describe "mysql service" do
include_examples "a service" do
- let(:service_name) { "mysql" }
+ let(:service_name) { property[:mysql][:service_name] }
end
end