Permalink
Browse files

Move features into apache2 cookbook.

  • Loading branch information...
1 parent 56bd27a commit f345c992d9f13441bbf56c1876595350bb10dcc7 Andrew Crump committed May 29, 2012
Showing with 1,831 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +10 −0 Gemfile
  3. +148 −0 Gemfile.lock
  4. +12 −0 test/features/alias_paths.feature
  5. +20 −0 test/features/authenticate_basic.feature
  6. +20 −0 test/features/authenticate_digest.feature
  7. +11 −0 test/features/authenticate_openid.feature
  8. +16 −0 test/features/authorize_groupfile.feature
  9. +17 −0 test/features/authorize_host.feature
  10. +16 −0 test/features/authorize_ldap.feature
  11. +16 −0 test/features/authorize_users.feature
  12. +16 −0 test/features/basic_webserver.feature
  13. +16 −0 test/features/compress_server_response.feature
  14. +11 −0 test/features/control_caching.feature
  15. +19 −0 test/features/directory_listing.feature
  16. +11 −0 test/features/host_cgi_scripts.feature
  17. +11 −0 test/features/host_perl_applications.feature
  18. +11 −0 test/features/host_php_applications.feature
  19. +11 −0 test/features/host_python_applications.feature
  20. +12 −0 test/features/host_source_control_repositories.feature
  21. +12 −0 test/features/proxy_java_applications.feature
  22. +11 −0 test/features/secure_requests.feature
  23. +19 −0 test/features/step_definitions/svn_steps.rb
  24. +148 −0 test/features/step_definitions/webserver_steps.rb
  25. +3 −0 test/features/support/env.rb
  26. +24 −0 test/features/support/svn_helpers.rb
  27. +86 −0 test/features/support/web_helpers.rb
  28. +11 −0 test/features/support_older_browsers.feature
  29. +22 −0 test/kitchen/Kitchenfile
  30. +2 −0 test/kitchen/cookbooks/Cheffile
  31. +1 −0 test/kitchen/cookbooks/apache2_test/.gitignore
  32. +82 −0 test/kitchen/cookbooks/apache2_test/README.md
  33. +35 −0 test/kitchen/cookbooks/apache2_test/attributes/default.rb
  34. +88 −0 test/kitchen/cookbooks/apache2_test/metadata.rb
  35. +20 −0 test/kitchen/cookbooks/apache2_test/recipes/default.rb
  36. +35 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_auth_basic.rb
  37. +37 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_auth_digest.rb
  38. +29 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_auth_openid.rb
  39. +60 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb
  40. +46 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb
  41. +30 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb
  42. +30 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb
  43. +41 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_authz_user.rb
  44. +35 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_cgi.rb
  45. +45 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_dav_svn.rb
  46. +30 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_expires.rb
  47. +69 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_perl.rb
  48. +50 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_php5.rb
  49. +41 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb
  50. +59 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_python.rb
  51. +54 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_ssl.rb
  52. +26 −0 test/kitchen/cookbooks/apache2_test/recipes/mod_status_remote.rb
  53. +18 −0 test/kitchen/cookbooks/apache2_test/recipes/setup.rb
  54. +6 −0 test/kitchen/cookbooks/apache2_test/templates/default/auth_basic.conf.erb
  55. +7 −0 test/kitchen/cookbooks/apache2_test/templates/default/auth_digest.conf.erb
  56. +8 −0 test/kitchen/cookbooks/apache2_test/templates/default/auth_openid.conf.erb
  57. +9 −0 test/kitchen/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb
  58. +7 −0 test/kitchen/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb
  59. +4 −0 test/kitchen/cookbooks/apache2_test/templates/default/authz_host.conf.erb
  60. +6 −0 test/kitchen/cookbooks/apache2_test/templates/default/authz_user.conf.erb
  61. +4 −0 test/kitchen/cookbooks/apache2_test/templates/default/cache_test.conf.erb
  62. +18 −0 test/kitchen/cookbooks/apache2_test/templates/default/entries.ldif.erb
  63. +6 −0 test/kitchen/cookbooks/apache2_test/templates/default/java_env.conf.erb
  64. +9 −0 test/kitchen/cookbooks/apache2_test/templates/default/perl_env.conf.erb
  65. +7 −0 test/kitchen/cookbooks/apache2_test/templates/default/php_env.conf.erb
  66. +8 −0 test/kitchen/cookbooks/apache2_test/templates/default/python_env.conf.erb
  67. +13 −0 test/kitchen/cookbooks/apache2_test/templates/default/ssl.conf.erb
  68. +9 −0 test/kitchen/cookbooks/apache2_test/templates/default/status.conf.erb
  69. +6 −0 test/kitchen/cookbooks/apache2_test/templates/default/svn_repo.conf.erb
View
@@ -0,0 +1 @@
+test/kitchen/.kitchen/
View
10 Gemfile
@@ -0,0 +1,10 @@
+source :rubygems
+
+gem 'cucumber', '~> 1.1.8'
+gem 'httparty', '~> 0.8.3'
+gem 'minitest', '~> 3.0.0'
+gem 'nokogiri', '~> 1.5.0'
+
+group :kitchen do
+ gem 'test-kitchen', :git => 'git@github.com:opscode/test-kitchen.git'
+end
View
@@ -0,0 +1,148 @@
+GIT
+ remote: git@github.com:opscode/test-kitchen.git
+ revision: 76856a73a8a1496e4d40a8c4bf58f72050510af8
+ specs:
+ test-kitchen (0.1.0)
+ foodcritic (~> 1.2.0)
+ hashr (~> 0.0.20)
+ highline (>= 1.6.9)
+ librarian (~> 0.0.20)
+ mixlib-cli (~> 1.2.2)
+ vagrant (~> 1.0.2)
+ yajl-ruby (~> 1.1.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ archive-tar-minitar (0.5.2)
+ builder (3.0.0)
+ bunny (0.7.9)
+ chef (0.10.10)
+ bunny (>= 0.6.0)
+ erubis
+ highline (>= 1.6.9)
+ json (>= 1.4.4, <= 1.6.1)
+ mixlib-authentication (>= 1.1.0)
+ mixlib-cli (>= 1.1.0)
+ mixlib-config (>= 1.1.2)
+ mixlib-log (>= 1.3.0)
+ mixlib-shellout (~> 1.0.0.rc)
+ moneta
+ net-ssh (~> 2.2.2)
+ net-ssh-multi (~> 1.1.0)
+ ohai (>= 0.6.0)
+ rest-client (>= 1.0.4, < 1.7.0)
+ treetop (~> 1.4.9)
+ uuidtools
+ yajl-ruby (>= 1.1.0)
+ childprocess (0.3.2)
+ ffi (~> 1.0.6)
+ coderay (0.9.8)
+ cucumber (1.1.8)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ gherkin (~> 2.8.0)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.6)
+ diff-lcs (1.1.3)
+ erubis (2.7.0)
+ ffi (1.0.11)
+ foodcritic (1.2.0)
+ gherkin (~> 2.8.0)
+ gist (~> 2.0.4)
+ nokogiri (~> 1.5.0, != 1.5.2, != 1.5.1)
+ pry (~> 0.9.7.4)
+ pry-doc (~> 0.3.0)
+ rak (~> 1.4)
+ treetop (~> 1.4.10)
+ yajl-ruby (~> 1.1.0)
+ gherkin (2.8.0)
+ json (>= 1.4.6)
+ gist (2.0.4)
+ hashr (0.0.21)
+ highline (1.6.12)
+ httparty (0.8.3)
+ multi_json (~> 1.0)
+ multi_xml
+ i18n (0.6.0)
+ ipaddress (0.8.0)
+ json (1.5.4)
+ librarian (0.0.23)
+ archive-tar-minitar (>= 0.5.2)
+ chef (>= 0.10)
+ highline
+ thor (~> 0.15)
+ log4r (1.1.10)
+ method_source (0.6.7)
+ ruby_parser (>= 2.3.1)
+ mime-types (1.18)
+ minitest (3.0.1)
+ mixlib-authentication (1.1.4)
+ mixlib-log
+ mixlib-cli (1.2.2)
+ mixlib-config (1.1.2)
+ mixlib-log (1.3.0)
+ mixlib-shellout (1.0.0)
+ moneta (0.6.0)
+ multi_json (1.3.6)
+ multi_xml (0.5.1)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.2.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ net-ssh-multi (1.1)
+ net-ssh (>= 2.1.4)
+ net-ssh-gateway (>= 0.99.0)
+ nokogiri (1.5.0)
+ ohai (0.6.12)
+ ipaddress
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ systemu
+ yajl-ruby
+ polyglot (0.3.3)
+ pry (0.9.7.4)
+ coderay (~> 0.9.8)
+ method_source (~> 0.6.7)
+ ruby_parser (>= 2.3.1)
+ slop (~> 2.1.0)
+ pry-doc (0.3.0)
+ pry (>= 0.9.0)
+ yard (>= 0.6.4)
+ rak (1.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ ruby_parser (2.3.1)
+ sexp_processor (~> 3.0)
+ sexp_processor (3.2.0)
+ slop (2.1.0)
+ systemu (2.5.0)
+ term-ansicolor (1.0.7)
+ thor (0.15.2)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ uuidtools (2.1.2)
+ vagrant (1.0.3)
+ archive-tar-minitar (= 0.5.2)
+ childprocess (~> 0.3.1)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6.0)
+ json (~> 1.5.1)
+ log4r (~> 1.1.9)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.2.2)
+ yajl-ruby (1.1.0)
+ yard (0.8.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ cucumber (~> 1.1.8)
+ httparty (~> 0.8.3)
+ minitest (~> 3.0.0)
+ nokogiri (~> 1.5.0)
+ test-kitchen!
@@ -0,0 +1,12 @@
+Feature: Alias Paths
+
+In order to host a website with the URL structure different to the filesystem structure
+As a developer
+I want to be able to alias paths
+
+ @default @mod_alias
+ Scenario: Aliased directory
+ Given a new webserver with aliasing enabled
+ And an alias defined
+ When I request the alias path
+ Then the aliased resource should be returned successfully
@@ -0,0 +1,20 @@
+@mod_auth_basic
+Feature: Basic Authentication
+
+In order to perform authorization or vary the provided content
+As a developer
+I want to authenticate the remote user
+
+ Scenario: Authenticate access to a page
+ Given a new webserver configured to require authentication to access a page
+ When the user requests the secure page with no credentials
+ Then access will be rejected requiring authentication
+
+ Scenario Outline: Authenticate access to a page (basic authentication)
+ Given a new webserver configured to require authentication to access a page
+ When the user requests the secure page authenticating with <credentials> over basic auth
+ Then access will be <access>
+ Examples:
+ | credentials | access |
+ | valid credentials | granted |
+ | invalid credentials | rejected requiring authentication |
@@ -0,0 +1,20 @@
+@mod_auth_digest
+Feature: Digest Authentication
+
+In order to perform authorization or vary the provided content
+As a developer
+I want to authenticate the remote user
+
+ Scenario: Authenticate access to a page
+ Given a new webserver configured to require authentication to access a page
+ When the user requests the secure page with no credentials
+ Then access will be rejected requiring authentication
+
+ Scenario Outline: Authenticate access to a page (digest authentication)
+ Given a new webserver configured to require authentication to access a page
+ When the user requests the secure page authenticating with <credentials> over digest auth
+ Then access will be <access>
+ Examples:
+ | credentials | access |
+ | valid credentials | granted |
+ | invalid credentials | rejected requiring authentication |
@@ -0,0 +1,11 @@
+@mod_auth_openid
+Feature: OpenID Authentication
+
+In order to perform authorization or vary the provided content
+As a developer
+I want to authenticate the remote user
+
+ Scenario: Authenticate access to a page
+ Given a new webserver configured to require authentication to access a page
+ When the user requests the secure page with no credentials
+ Then access will be rejected requiring OpenID authentication
@@ -0,0 +1,16 @@
+@mod_authz_groupfile
+Feature: Authorize access to content by user
+
+In order to restrict part of my website
+As a developer
+I want to restrict access to specific users
+
+ Scenario: Authorize based on group file
+ Given a new webserver configured to authorize users listed in a group file
+ When the authenticated user is listed in the file
+ Then access will be granted
+
+ Scenario: Valid authentication but not a member of the group
+ Given a new webserver configured to authorize users listed in a group file
+ When the authenticated user is not listed in the file
+ Then access will be rejected requiring authentication
@@ -0,0 +1,17 @@
+Feature: Authorize access to content by host
+
+In order to restrict part of my website
+As a developer
+I want to restrict access to known remote hosts
+
+ @mod_authz_listed_host
+ Scenario: Known remote address
+ Given a new webserver configured to authorize access based on the remote address
+ When the remote address is listed as authorized
+ Then access will be granted
+
+ @mod_authz_unlisted_host
+ Scenario: Unlisted remote address
+ Given a new webserver configured to authorize access based on the remote address
+ When the remote address is not listed as authorized
+ Then access will be denied
@@ -0,0 +1,16 @@
+@mod_authnz_ldap
+Feature: Authorize access to content against corporate directory
+
+In order to restrict part of my website
+As a developer
+I want to restrict access to people in my corporate directory
+
+ Scenario: Authorized user access
+ Given a new webserver configured to authorize against a corporate directory
+ When the authenticated user is listed in the directory as authorized
+ Then access will be granted
+
+ Scenario: User not in directory
+ Given a new webserver configured to authorize against a corporate directory
+ When the authenticated user is not listed in the directory as authorized
+ Then access will be rejected requiring authentication
@@ -0,0 +1,16 @@
+@mod_authz_user
+Feature: Authorize access to content by user
+
+In order to restrict part of my website
+As a developer
+I want to restrict access to specific users
+
+ Scenario: Authorize named users
+ Given a new webserver configured to authorize access to specific named users
+ When the authenticated user is listed as authorized
+ Then access will be granted
+
+ Scenario: Authorize named users
+ Given a new webserver configured to authorize access to specific named users
+ When the authenticated user is not listed as authorized
+ Then access will be rejected requiring authentication
@@ -0,0 +1,16 @@
+@default
+Feature: Serve web pages
+
+In order to run my application
+As a developer
+I want to respond to website requests
+
+ Scenario: Request homepage
+ Given a new webserver
+ When I request the root url
+ Then the default page should be returned
+
+ Scenario: Missing page
+ Given a new webserver
+ When I request a URL known not to exist
+ Then page not found should be returned
@@ -0,0 +1,16 @@
+@default @mod_deflate
+Feature: Compress server response
+
+In order to reduce the time taken to retrieve web pages
+As a developer
+I want to enable compression on server responses
+
+ Scenario: Deflate compression
+ Given a new webserver with deflate compression enabled
+ When the browser requests a page specifying that it supports compression
+ Then the response will be sent compressed
+
+ Scenario: Deflate compression (no client support)
+ Given a new webserver with deflate compression enabled
+ When the browser requests a page specifying that it does not support compression
+ Then the response will be sent uncompressed
@@ -0,0 +1,11 @@
+@mod_expires
+Feature: Control caching
+
+In order to control caching of responses by intermediate servers
+As a developer
+I want to control the expiry times on served pages
+
+ Scenario: Set expiry time
+ Given a new webserver with support for setting expiry times enabled
+ When I request a path which has a cache directive applied
+ Then the expiry time returned will match that configured
@@ -0,0 +1,19 @@
+@default @mod_autoindex
+Feature: Directory listing
+
+In order to allow browsing of the webserver filesystem
+As a developer
+I want to enable directory listing
+
+ Scenario: View directory listing
+ Given a new webserver with directory listing enabled
+ And a path configured to allow directory listing
+ When I request the directory listing path
+ Then the directory listing should be returned successfully
+
+ Scenario: Re-order files listed
+ Given a new webserver with directory listing enabled
+ And a path configured to allow directory listing with fancy indexing
+ When I request the directory listing path
+ Then the directory listing should be returned successfully
+ And I will be able to sort the files by size
@@ -0,0 +1,11 @@
+@mod_cgi
+Feature: Host CGI scripts
+
+In order to host dynamic websites
+As a developer
+I want to be able to host CGI scripts
+
+ Scenario: Host CGI scripts
+ Given a new webserver with CGI support enabled
+ When a request is made to a CGI script that generates a list of environment variables
+ Then the expected environment variables will be present
@@ -0,0 +1,11 @@
+@mod_perl
+Feature: Host Perl applications
+
+In order to host dynamic websites
+As a developer
+I want to be able to host Perl applications
+
+ Scenario: Host Perl application
+ Given a new webserver with Perl support enabled
+ When a request is made to a Perl script that generates a list of environment variables
+ Then the expected environment variables will be present
@@ -0,0 +1,11 @@
+@mod_php5
+Feature: Host PHP applications
+
+In order to host dynamic websites
+As a developer
+I want to be able to host PHP websites
+
+ Scenario: Host PHP website
+ Given a new webserver with PHP support enabled
+ When a request is made to a PHP script that generates a list of environment variables
+ Then the expected environment variables will be present
Oops, something went wrong.

2 comments on commit f345c99

What reads the Kitchenfile? That's a new one on me.

Can't wait. Cookbook testing seems like a pretty serious need to be filled.

Please sign in to comment.