summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-18 16:17:39 -0700
committerGitHub <noreply@github.com>2017-09-18 16:17:39 -0700
commit8b91c383a5e88d5039163831f50f8bc42673bb61 (patch)
treea7115b0cecc5f27c627a4bff44127b44120c86f1
parent535d83aa9deeca2b33ae6f951e1c9597782da98c (diff)
parent5dde6e6ccad4c11b2b5229a1aa0899e2dfd75b34 (diff)
downloadchef-8b91c383a5e88d5039163831f50f8bc42673bb61.tar.gz
Merge pull request #6421 from chef/bye_bye_webapp
Remove the webapp cookbook from integration tests
-rw-r--r--.travis.yml20
-rw-r--r--kitchen-tests/.kitchen.travis.yml2
-rw-r--r--kitchen-tests/.kitchen.yml2
-rw-r--r--kitchen-tests/Berksfile1
-rw-r--r--kitchen-tests/Berksfile.lock21
-rw-r--r--kitchen-tests/cookbooks/base/recipes/default.rb2
-rw-r--r--kitchen-tests/cookbooks/base/recipes/packages.rb2
-rw-r--r--kitchen-tests/cookbooks/base/recipes/tests.rb2
-rw-r--r--kitchen-tests/cookbooks/webapp/Berksfile3
-rw-r--r--kitchen-tests/cookbooks/webapp/README.md3
-rw-r--r--kitchen-tests/cookbooks/webapp/attributes/default.rb14
-rw-r--r--kitchen-tests/cookbooks/webapp/metadata.rb11
-rw-r--r--kitchen-tests/cookbooks/webapp/recipes/default.rb63
-rw-r--r--kitchen-tests/cookbooks/webapp/templates/index.html.erb5
-rw-r--r--kitchen-tests/cookbooks/webapp/templates/index.php.erb8
-rw-r--r--kitchen-tests/data_bags/passwords/webapp.json4
-rw-r--r--kitchen-tests/test/fixtures/platforms/centos/6.json14
-rw-r--r--kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json14
-rw-r--r--kitchen-tests/test/fixtures/serverspec_helper.rb32
-rw-r--r--kitchen-tests/test/integration/webapp/default_spec.rb118
20 files changed, 15 insertions, 326 deletions
diff --git a/.travis.yml b/.travis.yml
index 20bc47889f..c4562a808e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -103,7 +103,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-ubuntu-1404
+ - bundle exec kitchen test base-ubuntu-1404
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -121,7 +121,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-ubuntu-1604
+ - bundle exec kitchen test base-ubuntu-1604
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -139,7 +139,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-debian-7
+ - bundle exec kitchen test base-debian-7
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -157,7 +157,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-debian-8
+ - bundle exec kitchen test base-debian-8
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -175,7 +175,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-debian-9
+ - bundle exec kitchen test base-debian-9
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -193,7 +193,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-centos-6
+ - bundle exec kitchen test base-centos-6
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -211,7 +211,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - bundle exec kitchen test webapp-centos-7
+ - bundle exec kitchen test base-centos-7
after_failure:
- cat .kitchen/logs/kitchen.log
env:
@@ -229,7 +229,7 @@ matrix:
# - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
# - cd kitchen-tests
# script:
-# - bundle exec kitchen test webapp-fedora-latest
+# - bundle exec kitchen test base-fedora-latest
# after_failure:
# - cat .kitchen/logs/kitchen.log
# env:
@@ -247,7 +247,7 @@ matrix:
# - sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
# - cd kitchen-tests
# script:
-# - travis_wait bundle exec kitchen test webapp-amazonlinux
+# - travis_wait bundle exec kitchen test base-amazonlinux
# after_failure:
# - cat .kitchen/logs/kitchen.log
# env:
@@ -322,7 +322,7 @@ matrix:
- sudo iptables -L DOCKER || ( echo "DOCKER iptables chain missing" ; sudo iptables -N DOCKER )
- cd kitchen-tests
script:
- - travis_wait bundle exec kitchen test webapp-amazonlinux
+ - travis_wait bundle exec kitchen test base-amazonlinux
after_failure:
- cat .kitchen/logs/kitchen.log
env:
diff --git a/kitchen-tests/.kitchen.travis.yml b/kitchen-tests/.kitchen.travis.yml
index 161f227518..720f034cb5 100644
--- a/kitchen-tests/.kitchen.travis.yml
+++ b/kitchen-tests/.kitchen.travis.yml
@@ -111,7 +111,7 @@ platforms:
- RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers
suites:
- - name: webapp
+ - name: base
run_list:
- recipe[base::default]
- name: awesome_customers_ubuntu
diff --git a/kitchen-tests/.kitchen.yml b/kitchen-tests/.kitchen.yml
index 342b547cab..4e570b125e 100644
--- a/kitchen-tests/.kitchen.yml
+++ b/kitchen-tests/.kitchen.yml
@@ -28,7 +28,7 @@ platforms:
- name: centos-6
suites:
- - name: webapp
+ - name: base
run_list:
- recipe[base::default]
- name: awesome_customers_ubuntu
diff --git a/kitchen-tests/Berksfile b/kitchen-tests/Berksfile
index 3996a4aa37..22f838d83e 100644
--- a/kitchen-tests/Berksfile
+++ b/kitchen-tests/Berksfile
@@ -1,6 +1,5 @@
source "https://supermarket.chef.io"
-cookbook "webapp", path: "cookbooks/webapp"
cookbook "base", path: "cookbooks/base"
# Disabled pending updating these test cases for Chef 13.
diff --git a/kitchen-tests/Berksfile.lock b/kitchen-tests/Berksfile.lock
index 7bf9e1164a..6cd1308fcd 100644
--- a/kitchen-tests/Berksfile.lock
+++ b/kitchen-tests/Berksfile.lock
@@ -1,11 +1,8 @@
DEPENDENCIES
base
path: cookbooks/base
- webapp
- path: cookbooks/webapp
GRAPH
- apache2 (4.0.0)
apt (6.1.4)
base (0.1.0)
apt (>= 0.0.0)
@@ -33,29 +30,17 @@ GRAPH
compat_resource (12.19.0)
cron (4.1.3)
compat_resource (>= 0.0.0)
- database (6.1.1)
- postgresql (>= 1.0.0)
iptables (4.2.1)
logrotate (2.2.0)
mingw (2.0.1)
seven_zip (>= 0.0.0)
multipackage (4.0.0)
compat_resource (>= 0.0.0)
- mysql (8.5.1)
nscd (5.0.0)
ntp (3.5.2)
ohai (5.2.0)
openssh (2.5.0)
iptables (>= 1.0)
- openssl (7.1.0)
- php (4.5.0)
- build-essential (>= 0.0.0)
- mysql (>= 6.0.0)
- yum-epel (>= 0.0.0)
- postgresql (6.1.1)
- build-essential (>= 2.0.0)
- compat_resource (>= 12.16.3)
- openssl (>= 4.0)
resolver (2.0.1)
selinux (2.1.0)
seven_zip (2.0.2)
@@ -64,11 +49,5 @@ GRAPH
ubuntu (2.0.1)
apt (>= 0.0.0)
users (5.1.0)
- webapp (0.1.0)
- apache2 (~> 4.0.0)
- database (~> 6.1.1)
- php (~> 4.5.0)
windows (3.1.2)
ohai (>= 4.0.0)
- yum-epel (2.1.2)
- compat_resource (>= 12.16.3)
diff --git a/kitchen-tests/cookbooks/base/recipes/default.rb b/kitchen-tests/cookbooks/base/recipes/default.rb
index 0c8341ca9a..bc98981d5d 100644
--- a/kitchen-tests/cookbooks/base/recipes/default.rb
+++ b/kitchen-tests/cookbooks/base/recipes/default.rb
@@ -1,5 +1,5 @@
#
-# Cookbook:: webapp
+# Cookbook:: base
# Recipe:: default
#
# Copyright:: 2014-2017, Chef Software, Inc.
diff --git a/kitchen-tests/cookbooks/base/recipes/packages.rb b/kitchen-tests/cookbooks/base/recipes/packages.rb
index bb5fa7bb71..a448936acd 100644
--- a/kitchen-tests/cookbooks/base/recipes/packages.rb
+++ b/kitchen-tests/cookbooks/base/recipes/packages.rb
@@ -1,5 +1,5 @@
#
-# Cookbook:: webapp
+# Cookbook:: base
# Recipe:: packages
#
# Copyright:: 2014-2017, Chef Software, Inc.
diff --git a/kitchen-tests/cookbooks/base/recipes/tests.rb b/kitchen-tests/cookbooks/base/recipes/tests.rb
index 8b90b48c5d..c6095eaeb5 100644
--- a/kitchen-tests/cookbooks/base/recipes/tests.rb
+++ b/kitchen-tests/cookbooks/base/recipes/tests.rb
@@ -1,5 +1,5 @@
#
-# Cookbook:: webapp
+# Cookbook:: base
# Recipe:: tests
#
# Copyright:: 2014-2017, Chef Software, Inc.
diff --git a/kitchen-tests/cookbooks/webapp/Berksfile b/kitchen-tests/cookbooks/webapp/Berksfile
deleted file mode 100644
index 967b9a78b6..0000000000
--- a/kitchen-tests/cookbooks/webapp/Berksfile
+++ /dev/null
@@ -1,3 +0,0 @@
-source "https://supermarket.chef.io"
-
-metadata
diff --git a/kitchen-tests/cookbooks/webapp/README.md b/kitchen-tests/cookbooks/webapp/README.md
deleted file mode 100644
index caa0059689..0000000000
--- a/kitchen-tests/cookbooks/webapp/README.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# webapp
-
-A test cookbook that setups up a sample webapp to exercise a common workflow for chef cookbooks.
diff --git a/kitchen-tests/cookbooks/webapp/attributes/default.rb b/kitchen-tests/cookbooks/webapp/attributes/default.rb
deleted file mode 100644
index 2ff7a6c5ff..0000000000
--- a/kitchen-tests/cookbooks/webapp/attributes/default.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-default["apache"]["remote_host_ip"] = "127.0.0.1"
-
-default["webapp"]["database"] = "webapp"
-default["webapp"]["db_username"] = "webapp"
-default["webapp"]["path"] = "/srv/webapp"
-
-# XXX: apache2 cookbook 2.0.0 has bugs around changing the mpm and then attempting a graceful restart
-# which fails and leaves the service down.
-case node["platform"]
-when "ubuntu"
- if node["platform_version"].to_f >= 14.04
- default[:apache][:mpm] = "event"
- end
-end
diff --git a/kitchen-tests/cookbooks/webapp/metadata.rb b/kitchen-tests/cookbooks/webapp/metadata.rb
deleted file mode 100644
index f0ce5ac040..0000000000
--- a/kitchen-tests/cookbooks/webapp/metadata.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-name "webapp"
-maintainer ""
-maintainer_email ""
-license "Apache-2.0"
-description "Installs/Configures webapp"
-long_description "Installs/Configures webapp"
-version "0.1.0"
-
-depends "apache2", "~> 4.0.0"
-depends "database", "~> 6.1.1"
-depends "php", "~> 4.5.0"
diff --git a/kitchen-tests/cookbooks/webapp/recipes/default.rb b/kitchen-tests/cookbooks/webapp/recipes/default.rb
deleted file mode 100644
index 7f3b1804ab..0000000000
--- a/kitchen-tests/cookbooks/webapp/recipes/default.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Cookbook Name:: webapp
-# Recipe:: default
-#
-# Copyright:: Chef Software, Inc. 2016-2017
-#
-
-include_recipe "apache2"
-include_recipe "php"
-
-creds = Hash.new
-%w{mysql webapp}.each do |item_name|
- creds[item_name] = data_bag_item("passwords", item_name)
-end
-
-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
- server_root_password creds["mysql"]["server_root_password"]
- server_repl_password creds["mysql"]["server_repl_password"]
-end
-
-mysql_database node["webapp"]["database"] do
- connection ({
- :host => "localhost",
- :username => "root",
- :password => creds["mysql"]["server_root_password"],
- })
- action :create
-end
-
-mysql_database_user node["webapp"]["db_username"] do
- connection ({
- :host => "localhost",
- :username => "root",
- :password => creds["mysql"]["server_root_password"],
- })
- password creds["webapp"]["db_password"]
- database_name node["webapp"]["database"]
- privileges [:select, :update, :insert, :create, :delete]
- action :grant
-end
-
-directory node["webapp"]["path"] do
- owner "root"
- group "root"
- mode "0755"
- action :create
- recursive true
-end
-
-template "#{node['webapp']['path']}/index.html" do
- source "index.html.erb"
-end
-
-template "#{node['webapp']['path']}/index.php" do
- source "index.php.erb"
-end
diff --git a/kitchen-tests/cookbooks/webapp/templates/index.html.erb b/kitchen-tests/cookbooks/webapp/templates/index.html.erb
deleted file mode 100644
index 6da0629b9e..0000000000
--- a/kitchen-tests/cookbooks/webapp/templates/index.html.erb
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
- <body>
- <h1>Hello, World!</h1>
- </body>
-</html>
diff --git a/kitchen-tests/cookbooks/webapp/templates/index.php.erb b/kitchen-tests/cookbooks/webapp/templates/index.php.erb
deleted file mode 100644
index b08b076614..0000000000
--- a/kitchen-tests/cookbooks/webapp/templates/index.php.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<html>
- <head>
- <title>PHP Test</title>
- </head>
- <body>
- <?php echo '<p>Hello, World!</p>'; ?>
- </body>
-</html>
diff --git a/kitchen-tests/data_bags/passwords/webapp.json b/kitchen-tests/data_bags/passwords/webapp.json
deleted file mode 100644
index 43c0ae1ced..0000000000
--- a/kitchen-tests/data_bags/passwords/webapp.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "id": "webapp",
- "db_password": "supersecretdbpassword"
-}
diff --git a/kitchen-tests/test/fixtures/platforms/centos/6.json b/kitchen-tests/test/fixtures/platforms/centos/6.json
deleted file mode 100644
index 4f74a3ed4a..0000000000
--- a/kitchen-tests/test/fixtures/platforms/centos/6.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "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/14.04.json b/kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json
deleted file mode 100644
index eab46db2e5..0000000000
--- a/kitchen-tests/test/fixtures/platforms/ubuntu/14.04.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "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
deleted file mode 100644
index 900fbe4836..0000000000
--- a/kitchen-tests/test/fixtures/serverspec_helper.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# Shamelessly copied from https://github.com/sous-chefs/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.
-
-require "serverspec"
-require "json"
-require "ffi_yajl"
-
-set :backend, :exec
-
-include Specinfra::Helper::Properties
-
-require "pp"
-pp os
-
-def load_nodestub
- case os[:family]
- when "ubuntu", "debian"
- platform = os[:family]
- platform_version = os[:release]
- when "redhat"
- platform = "centos"
- platform_version = os[:release].to_i
- end
- FFI_Yajl::Parser.parse(IO.read("#{ENV['BUSSER_ROOT']}/../kitchen/data/platforms/#{platform}/#{platform_version}.json"), :symbolize_names => true)
-end
-
-# centos-59 doesn't have /sbin in the default path,
-# so we must ensure it's on serverspec's path
-set :path, "$PATH:/sbin"
-
-set_property load_nodestub
diff --git a/kitchen-tests/test/integration/webapp/default_spec.rb b/kitchen-tests/test/integration/webapp/default_spec.rb
deleted file mode 100644
index f7ce2a2c7c..0000000000
--- a/kitchen-tests/test/integration/webapp/default_spec.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-#describe port(80) do
-# it { should be_listening }
-# its('processes') {should include 'http'}
-#end
-#
-#describe command("curl http://localhost/index.html") do
-# its("stdout") { should match /Hello, World!/ }
-#end
-
-case os[:family]
-when "debian", "ubuntu"
- ssh_package = "openssh-client"
- ssh_service = "ssh"
- ntp_service = "ntp"
-when "centos", "redhat", "fedora", "amazon"
- ssh_package = "openssh-clients"
- ssh_service = "sshd"
- ntp_service = "ntpd"
-else
- raise "i don't know the family #{os[:family]}"
-end
-
-describe package("nscd") do
- it { should be_installed }
-end
-
-describe service("nscd") do
- # broken?
- # it { should be_enabled }
- it { should be_installed }
- it { should be_running }
-end
-
-describe package(ssh_package) do
- it { should be_installed }
-end
-
-describe service(ssh_service) do
- it { should be_enabled }
- it { should be_installed }
- it { should be_running }
-end
-
-describe sshd_config do
- its("Protocol") { should cmp 2 }
- its("GssapiAuthentication") { should cmp "no" }
- its("UseDns") { should cmp "no" }
-end
-
-describe ssh_config do
- its("StrictHostKeyChecking") { should cmp "no" }
- its("GssapiAuthentication") { should cmp "no" }
-end
-
-describe package("ntp") do
- it { should be_installed }
-end
-
-describe service(ntp_service) do
- # broken?
- # it { should be_enabled }
- it { should be_installed }
- it { should be_running }
-end
-
-describe service("chef-client") do
- it { should be_enabled }
- it { should be_installed }
- it { should be_running }
-end
-
-describe file("/etc/resolv.conf") do
- its("content") { should match /search\s+chef.io/ }
- its("content") { should match /nameserver\s+8.8.8.8/ }
- its("content") { should match /nameserver\s+8.8.4.4/ }
-end
-
-describe package("gcc") do
- it { should be_installed }
-end
-
-describe package("flex") do
- it { should be_installed }
-end
-
-describe package("bison") do
- it { should be_installed }
-end
-
-describe package("autoconf") do
- it { should be_installed }
-end
-
-%w{lsof tcpdump strace zsh dmidecode ltrace bc curl wget telnet subversion git traceroute htop tmux }.each do |pkg|
- describe package pkg do
- it { should be_installed }
- end
-end
-
-describe etc_group.where(group_name: "sysadmin") do
- its("users") { should include "adam" }
- its("gids") { should eq [2300] }
-end
-
-describe passwd.users("adam") do
- its("uids") { should eq ["666"] }
-end
-
-describe ntp_conf do
- its("server") { should_not eq nil }
-end
-
-## busted inside of docker containers?
-#describe port(22) do
-# it { should be_listening }
-# its("protocols") { should include "tcp" }
-# its("processes") { should eq ["sshd"] }
-#end