From b16f1f977e9dcc9a1319f4095a3d35c7379d7e2b Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 12 Dec 2016 19:31:11 +0100 Subject: [PATCH 1/8] first iteration inspec --- .kitchen.cloud.yml | 3 + .kitchen.docker.yml | 3 + .kitchen.yml | 3 + Gemfile | 1 + test/fixtures/serverspec_helper.rb | 67 ------------------- .../localhost/controls}/default_spec.rb | 6 +- .../localhost/controls}/mod_cgi_spec.rb | 4 +- .../localhost/controls}/mod_cgid_spec.rb | 4 +- .../localhost/controls}/mod_fastcgi_spec.rb | 4 +- .../localhost/controls}/mod_include_spec.rb | 4 +- .../localhost/controls}/mod_ssl_spec.rb | 4 +- .../controls}/standard_modules_spec.rb | 4 +- .../default/inspec/localhost/inspec.yml | 3 + .../inspec/localhost/libraries/apache_info.rb | 15 +++++ .../libraries}/platforms/amazon/2016.09.json | 0 .../libraries}/platforms/centos/7.2.1511.json | 0 .../libraries}/platforms/debian/8.6.json | 0 .../libraries}/platforms/fedora/24.json | 0 .../libraries}/platforms/freebsd/10.3.json | 0 .../libraries}/platforms/opensuse/13.2.json | 0 .../libraries}/platforms/redhat/7.2.json | 0 .../libraries}/platforms/ubuntu/14.04.json | 0 .../libraries}/platforms/ubuntu/16.04.json | 0 23 files changed, 50 insertions(+), 75 deletions(-) delete mode 100644 test/fixtures/serverspec_helper.rb rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/default_spec.rb (96%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/mod_cgi_spec.rb (92%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/mod_cgid_spec.rb (92%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/mod_fastcgi_spec.rb (92%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/mod_include_spec.rb (93%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/mod_ssl_spec.rb (94%) rename test/integration/default/{serverspec/localhost => inspec/localhost/controls}/standard_modules_spec.rb (92%) create mode 100644 test/integration/default/inspec/localhost/inspec.yml create mode 100644 test/integration/default/inspec/localhost/libraries/apache_info.rb rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/amazon/2016.09.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/centos/7.2.1511.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/debian/8.6.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/fedora/24.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/freebsd/10.3.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/opensuse/13.2.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/redhat/7.2.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/ubuntu/14.04.json (100%) rename test/{fixtures => integration/default/inspec/localhost/libraries}/platforms/ubuntu/16.04.json (100%) diff --git a/.kitchen.cloud.yml b/.kitchen.cloud.yml index 641399fd3..17ed3062c 100644 --- a/.kitchen.cloud.yml +++ b/.kitchen.cloud.yml @@ -18,6 +18,9 @@ provisioner: name: chef_zero require_chef_omnibus: 11.12.8 +verifier: + name: inspec + platforms: - name: centos-5.8 driver_plugin: digitalocean diff --git a/.kitchen.docker.yml b/.kitchen.docker.yml index fa6bd56b0..1d4005f91 100644 --- a/.kitchen.docker.yml +++ b/.kitchen.docker.yml @@ -11,6 +11,9 @@ driver: provisioner: data_path: test/fixtures +verifier: + name: inspec + platforms: - name: centos-7.2 driver: diff --git a/.kitchen.yml b/.kitchen.yml index 7c7c89036..cd0ce9e9b 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -6,6 +6,9 @@ provisioner: name: chef_zero data_path: test/fixtures +verifier: + name: inspec + platforms: - name: centos-7.2 run_list: diff --git a/Gemfile b/Gemfile index c9d452253..27054530a 100644 --- a/Gemfile +++ b/Gemfile @@ -18,4 +18,5 @@ group :integration do gem 'kitchen-ec2', :require => false gem 'kitchen-vagrant', '~> 0.20', :require => false gem 'test-kitchen', '~> 1.13.2' + gem 'kitchen-inspec' end diff --git a/test/fixtures/serverspec_helper.rb b/test/fixtures/serverspec_helper.rb deleted file mode 100644 index 21bff102e..000000000 --- a/test/fixtures/serverspec_helper.rb +++ /dev/null @@ -1,67 +0,0 @@ -require 'serverspec' -require 'json' - -# centos-59 doesn't have /sbin in the default path, -# so we must ensure it's on serverspec's path -set :path, '/sbin:/usr/local/sbin:$PATH' -set :backend, :exec - -# http://serverspec.org/host_inventory.html -# os[:family] # RedHat, Ubuntu, Debian and so on -# os[:release] # OS release version (cleaned up in v2) -# os[:arch] -osmapping = { - 'redhat' => { - :platform_family => 'rhel', - :platform => 'centos', - :platform_version => '7.2.1511' - }, - 'fedora' => { - :platform_family => 'rhel', - :platform => 'fedora', - :platform_version => '24' - }, - 'ubuntu' => { - :platform_family => 'debian', - :platform => 'ubuntu', - :platform_version => '12.04' - }, - 'debian' => { - :platform_family => 'debian', - :platform => 'debian', - :platform_version => '8.6' - }, - 'freebsd' => { - :platform_family => 'freebsd', - :platform => 'freebsd', - :platform_version => '10.3' - }, - 'opensuse' => { - :platform_family => 'suse', - :platform => 'opensuse', - :platform_version => '13.2' - } -} - -def ohai_platform(os, osmapping) - puts "serverspec os detected as: #{os[:family]} #{os[:release]} [#{os[:arch]}]" - ohaistub = {} - ohaistub[:platform_family] = osmapping[os[:family]][:platform_family] - ohaistub[:platform] = osmapping[os[:family]][:platform] - # Hack: avoid freebsd to just use a release of 10 and force 10.0 instead to match chefspec - if os[:release] && os[:family] != 'freebsd' - ohaistub[:platform_version] = os[:release] - else - ohaistub[:platform_version] = osmapping[os[:family]][:platform_version] - end - ohaistub -end - -def load_nodestub(ohai) - puts "loading #{ohai[:platform]}/#{ohai[:platform_version]}" - JSON.parse(IO.read("#{ENV['BUSSER_ROOT']}/../kitchen/data/platforms/#{ohai[:platform]}/#{ohai[:platform_version]}.json"), :symbolize_names => true) -end - -RSpec.configure do |config| - set_property load_nodestub(ohai_platform(os, osmapping)) -end diff --git a/test/integration/default/serverspec/localhost/default_spec.rb b/test/integration/default/inspec/localhost/controls/default_spec.rb similarity index 96% rename from test/integration/default/serverspec/localhost/default_spec.rb rename to test/integration/default/inspec/localhost/controls/default_spec.rb index e6c83b2a9..5d2aefffc 100644 --- a/test/integration/default/serverspec/localhost/default_spec.rb +++ b/test/integration/default/inspec/localhost/controls/default_spec.rb @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::default' do @@ -66,7 +68,7 @@ end end - it file("#{property[:apache][:dir]}/sites-enabled/000-default.conf") do + it "#{property[:apache][:dir]}/sites-enabled/000-default.conf" do if property[:apache][:default_site_enabled] expect(file("#{property[:apache][:dir]}/sites-enabled/000-default.conf")).to be_linked_to "#{property[:apache][:dir]}/sites-available/default.conf" else diff --git a/test/integration/default/serverspec/localhost/mod_cgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb similarity index 92% rename from test/integration/default/serverspec/localhost/mod_cgi_spec.rb rename to test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb index 09f8e9232..a14e51c6a 100644 --- a/test/integration/default/serverspec/localhost/mod_cgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::mod_cgi', :if => property[:apache][:mpm] == 'prefork' do expected_module = 'cgi' diff --git a/test/integration/default/serverspec/localhost/mod_cgid_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb similarity index 92% rename from test/integration/default/serverspec/localhost/mod_cgid_spec.rb rename to test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb index 3fc1d75c3..2388e0f0c 100644 --- a/test/integration/default/serverspec/localhost/mod_cgid_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::mod_cgid', :unless => property[:apache][:mpm] == 'prefork' do expected_module = 'cgid' diff --git a/test/integration/default/serverspec/localhost/mod_fastcgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb similarity index 92% rename from test/integration/default/serverspec/localhost/mod_fastcgi_spec.rb rename to test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb index af15d9f62..6a3dfe5b2 100644 --- a/test/integration/default/serverspec/localhost/mod_fastcgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::mod_fastcgi' do expected_module = 'fastcgi' diff --git a/test/integration/default/serverspec/localhost/mod_include_spec.rb b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb similarity index 93% rename from test/integration/default/serverspec/localhost/mod_include_spec.rb rename to test/integration/default/inspec/localhost/controls/mod_include_spec.rb index 9dbef25e4..57dc5d327 100644 --- a/test/integration/default/serverspec/localhost/mod_include_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::mod_include' do expected_module = 'include' diff --git a/test/integration/default/serverspec/localhost/mod_ssl_spec.rb b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb similarity index 94% rename from test/integration/default/serverspec/localhost/mod_ssl_spec.rb rename to test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb index 836ed0bbe..b793c92c7 100644 --- a/test/integration/default/serverspec/localhost/mod_ssl_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) describe 'apache2::mod_ssl' do diff --git a/test/integration/default/serverspec/localhost/standard_modules_spec.rb b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb similarity index 92% rename from test/integration/default/serverspec/localhost/standard_modules_spec.rb rename to test/integration/default/inspec/localhost/controls/standard_modules_spec.rb index 28318cc31..7a1221448 100644 --- a/test/integration/default/serverspec/localhost/standard_modules_spec.rb +++ b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb @@ -13,7 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" + +platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') +property = apache_info(platform_path) property[:apache][:default_modules].each do |expected_module| expected_module = 'authz_default' if expected_module == 'authz_core' && property[:apache][:version] != '2.4' diff --git a/test/integration/default/inspec/localhost/inspec.yml b/test/integration/default/inspec/localhost/inspec.yml new file mode 100644 index 000000000..5b3cda519 --- /dev/null +++ b/test/integration/default/inspec/localhost/inspec.yml @@ -0,0 +1,3 @@ +name: apache2-integration-tests +title: Integration tests for apache2 cookbook +summary: This InSpec profile contains integration tests for apache2 cookbook diff --git a/test/integration/default/inspec/localhost/libraries/apache_info.rb b/test/integration/default/inspec/localhost/libraries/apache_info.rb new file mode 100644 index 000000000..0de14edc0 --- /dev/null +++ b/test/integration/default/inspec/localhost/libraries/apache_info.rb @@ -0,0 +1,15 @@ +class A2Helper < Inspec.resource(1) + name 'apache_info' + + def initialize(platform_path) + filename = "%{platform}/%{release}.json" % { :platform => inspec.os.name, :release => inspec.os.release } + # TODO: the platform path stuff should also work from here + # platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') + path = File.join(platform_path, filename ) + @params = JSON.parse(IO.read(path), :symbolize_names => true) + end + + def [](name) + @params[name] + end +end diff --git a/test/fixtures/platforms/amazon/2016.09.json b/test/integration/default/inspec/localhost/libraries/platforms/amazon/2016.09.json similarity index 100% rename from test/fixtures/platforms/amazon/2016.09.json rename to test/integration/default/inspec/localhost/libraries/platforms/amazon/2016.09.json diff --git a/test/fixtures/platforms/centos/7.2.1511.json b/test/integration/default/inspec/localhost/libraries/platforms/centos/7.2.1511.json similarity index 100% rename from test/fixtures/platforms/centos/7.2.1511.json rename to test/integration/default/inspec/localhost/libraries/platforms/centos/7.2.1511.json diff --git a/test/fixtures/platforms/debian/8.6.json b/test/integration/default/inspec/localhost/libraries/platforms/debian/8.6.json similarity index 100% rename from test/fixtures/platforms/debian/8.6.json rename to test/integration/default/inspec/localhost/libraries/platforms/debian/8.6.json diff --git a/test/fixtures/platforms/fedora/24.json b/test/integration/default/inspec/localhost/libraries/platforms/fedora/24.json similarity index 100% rename from test/fixtures/platforms/fedora/24.json rename to test/integration/default/inspec/localhost/libraries/platforms/fedora/24.json diff --git a/test/fixtures/platforms/freebsd/10.3.json b/test/integration/default/inspec/localhost/libraries/platforms/freebsd/10.3.json similarity index 100% rename from test/fixtures/platforms/freebsd/10.3.json rename to test/integration/default/inspec/localhost/libraries/platforms/freebsd/10.3.json diff --git a/test/fixtures/platforms/opensuse/13.2.json b/test/integration/default/inspec/localhost/libraries/platforms/opensuse/13.2.json similarity index 100% rename from test/fixtures/platforms/opensuse/13.2.json rename to test/integration/default/inspec/localhost/libraries/platforms/opensuse/13.2.json diff --git a/test/fixtures/platforms/redhat/7.2.json b/test/integration/default/inspec/localhost/libraries/platforms/redhat/7.2.json similarity index 100% rename from test/fixtures/platforms/redhat/7.2.json rename to test/integration/default/inspec/localhost/libraries/platforms/redhat/7.2.json diff --git a/test/fixtures/platforms/ubuntu/14.04.json b/test/integration/default/inspec/localhost/libraries/platforms/ubuntu/14.04.json similarity index 100% rename from test/fixtures/platforms/ubuntu/14.04.json rename to test/integration/default/inspec/localhost/libraries/platforms/ubuntu/14.04.json diff --git a/test/fixtures/platforms/ubuntu/16.04.json b/test/integration/default/inspec/localhost/libraries/platforms/ubuntu/16.04.json similarity index 100% rename from test/fixtures/platforms/ubuntu/16.04.json rename to test/integration/default/inspec/localhost/libraries/platforms/ubuntu/16.04.json From 669e71444f85e53b57aad453d59a225e6112f88d Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 13 Dec 2016 11:28:36 +0100 Subject: [PATCH 2/8] use files directory --- .../default/inspec/localhost/controls/default_spec.rb | 4 ++-- .../default/inspec/localhost/controls/mod_cgi_spec.rb | 6 +++--- .../default/inspec/localhost/controls/mod_cgid_spec.rb | 6 +++--- .../default/inspec/localhost/controls/mod_fastcgi_spec.rb | 6 +++--- .../default/inspec/localhost/controls/mod_include_spec.rb | 6 +++--- .../default/inspec/localhost/controls/mod_ssl_spec.rb | 6 +++--- .../inspec/localhost/controls/standard_modules_spec.rb | 6 +++--- .../{libraries => files}/platforms/amazon/2016.09.json | 0 .../{libraries => files}/platforms/centos/7.2.1511.json | 0 .../{libraries => files}/platforms/debian/8.6.json | 0 .../{libraries => files}/platforms/fedora/24.json | 0 .../{libraries => files}/platforms/freebsd/10.3.json | 0 .../{libraries => files}/platforms/opensuse/13.2.json | 0 .../{libraries => files}/platforms/redhat/7.2.json | 0 .../{libraries => files}/platforms/ubuntu/14.04.json | 0 .../{libraries => files}/platforms/ubuntu/16.04.json | 0 .../default/inspec/localhost/libraries/apache_info.rb | 7 ++++--- 17 files changed, 24 insertions(+), 23 deletions(-) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/amazon/2016.09.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/centos/7.2.1511.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/debian/8.6.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/fedora/24.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/freebsd/10.3.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/opensuse/13.2.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/redhat/7.2.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/ubuntu/14.04.json (100%) rename test/integration/default/inspec/localhost/{libraries => files}/platforms/ubuntu/16.04.json (100%) diff --git a/test/integration/default/inspec/localhost/controls/default_spec.rb b/test/integration/default/inspec/localhost/controls/default_spec.rb index 5d2aefffc..934f9580a 100644 --- a/test/integration/default/inspec/localhost/controls/default_spec.rb +++ b/test/integration/default/inspec/localhost/controls/default_spec.rb @@ -14,8 +14,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::default' do diff --git a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb index a14e51c6a..947b4e609 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb @@ -15,8 +15,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::mod_cgi', :if => property[:apache][:mpm] == 'prefork' do expected_module = 'cgi' @@ -29,7 +29,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb index 2388e0f0c..ed4ea85fc 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb @@ -15,8 +15,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::mod_cgid', :unless => property[:apache][:mpm] == 'prefork' do expected_module = 'cgid' @@ -29,7 +29,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb index 6a3dfe5b2..d3bb22c4f 100644 --- a/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb @@ -15,8 +15,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::mod_fastcgi' do expected_module = 'fastcgi' @@ -29,7 +29,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } xit "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb index 57dc5d327..eeb24400c 100644 --- a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb @@ -14,8 +14,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::mod_include' do expected_module = 'include' @@ -28,7 +28,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb index b793c92c7..18f24c68f 100644 --- a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb @@ -14,8 +14,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) describe 'apache2::mod_ssl' do @@ -36,7 +36,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb index 7a1221448..586a3f07f 100644 --- a/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb +++ b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb @@ -14,8 +14,8 @@ # limitations under the License. # -platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') -property = apache_info(platform_path) +# read platform information, see https://github.com/chef/inspec/issues/1396 +property = apache_info(File.dirname(__FILE__)) property[:apache][:default_modules].each do |expected_module| expected_module = 'authz_default' if expected_module == 'authz_core' && property[:apache][:version] != '2.4' @@ -29,7 +29,7 @@ subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") + expect(enabled).to be_linked_to("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") end subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } diff --git a/test/integration/default/inspec/localhost/libraries/platforms/amazon/2016.09.json b/test/integration/default/inspec/localhost/files/platforms/amazon/2016.09.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/amazon/2016.09.json rename to test/integration/default/inspec/localhost/files/platforms/amazon/2016.09.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/centos/7.2.1511.json b/test/integration/default/inspec/localhost/files/platforms/centos/7.2.1511.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/centos/7.2.1511.json rename to test/integration/default/inspec/localhost/files/platforms/centos/7.2.1511.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/debian/8.6.json b/test/integration/default/inspec/localhost/files/platforms/debian/8.6.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/debian/8.6.json rename to test/integration/default/inspec/localhost/files/platforms/debian/8.6.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/fedora/24.json b/test/integration/default/inspec/localhost/files/platforms/fedora/24.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/fedora/24.json rename to test/integration/default/inspec/localhost/files/platforms/fedora/24.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/freebsd/10.3.json b/test/integration/default/inspec/localhost/files/platforms/freebsd/10.3.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/freebsd/10.3.json rename to test/integration/default/inspec/localhost/files/platforms/freebsd/10.3.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/opensuse/13.2.json b/test/integration/default/inspec/localhost/files/platforms/opensuse/13.2.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/opensuse/13.2.json rename to test/integration/default/inspec/localhost/files/platforms/opensuse/13.2.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/redhat/7.2.json b/test/integration/default/inspec/localhost/files/platforms/redhat/7.2.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/redhat/7.2.json rename to test/integration/default/inspec/localhost/files/platforms/redhat/7.2.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/ubuntu/14.04.json b/test/integration/default/inspec/localhost/files/platforms/ubuntu/14.04.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/ubuntu/14.04.json rename to test/integration/default/inspec/localhost/files/platforms/ubuntu/14.04.json diff --git a/test/integration/default/inspec/localhost/libraries/platforms/ubuntu/16.04.json b/test/integration/default/inspec/localhost/files/platforms/ubuntu/16.04.json similarity index 100% rename from test/integration/default/inspec/localhost/libraries/platforms/ubuntu/16.04.json rename to test/integration/default/inspec/localhost/files/platforms/ubuntu/16.04.json diff --git a/test/integration/default/inspec/localhost/libraries/apache_info.rb b/test/integration/default/inspec/localhost/libraries/apache_info.rb index 0de14edc0..b1e313dc8 100644 --- a/test/integration/default/inspec/localhost/libraries/apache_info.rb +++ b/test/integration/default/inspec/localhost/libraries/apache_info.rb @@ -1,10 +1,11 @@ class A2Helper < Inspec.resource(1) name 'apache_info' - def initialize(platform_path) + # TODO: temporary we use the controls_dir until + # https://github.com/chef/inspec/issues/1396 is resolved + def initialize(controls_dir) + platform_path = File.expand_path File.join(controls_dir, '..', 'files', 'platforms') filename = "%{platform}/%{release}.json" % { :platform => inspec.os.name, :release => inspec.os.release } - # TODO: the platform path stuff should also work from here - # platform_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'libraries', 'platforms') path = File.join(platform_path, filename ) @params = JSON.parse(IO.read(path), :symbolize_names => true) end From 10b76025a572bd982e6150c3bcae290722f337bb Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 12 Dec 2016 21:43:10 +0100 Subject: [PATCH 3/8] fix octal numbers for file permission tests --- .../inspec/localhost/controls/default_spec.rb | 12 ++++++------ .../inspec/localhost/controls/mod_cgi_spec.rb | 2 +- .../inspec/localhost/controls/mod_cgid_spec.rb | 2 +- .../inspec/localhost/controls/mod_fastcgi_spec.rb | 2 +- .../inspec/localhost/controls/mod_include_spec.rb | 2 +- .../inspec/localhost/controls/mod_ssl_spec.rb | 2 +- .../localhost/controls/standard_modules_spec.rb | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/integration/default/inspec/localhost/controls/default_spec.rb b/test/integration/default/inspec/localhost/controls/default_spec.rb index 934f9580a..90e7ed9bc 100644 --- a/test/integration/default/inspec/localhost/controls/default_spec.rb +++ b/test/integration/default/inspec/localhost/controls/default_spec.rb @@ -30,34 +30,34 @@ it "directory #{property[:apache][:dir]} exists and is mode 755" do expect(file(property[:apache][:dir])).to be_directory - expect(file(property[:apache][:dir])).to be_mode 755 + expect(file(property[:apache][:dir])).to be_mode 0755 end %w(sites-enabled sites-available mods-enabled mods-available conf-available conf-enabled).each do |dir| it "directory #{property[:apache][:dir]}/#{dir} exists and is mode 755" do expect(file("#{property[:apache][:dir]}/#{dir}")).to be_directory - expect(file("#{property[:apache][:dir]}/#{dir}")).to be_mode 755 + expect(file("#{property[:apache][:dir]}/#{dir}")).to be_mode 0755 end end it "log dir #{property[:apache][:log_dir]} exists and is mode 755" do expect(file(property[:apache][:log_dir])).to be_directory - expect(file(property[:apache][:log_dir])).to be_mode 755 + expect(file(property[:apache][:log_dir])).to be_mode 0755 end it "lib dir #{property[:apache][:lib_dir]} exists and is mode 755" do expect(file(property[:apache][:lib_dir])).to be_directory - expect(file(property[:apache][:lib_dir])).to be_mode 755 + expect(file(property[:apache][:lib_dir])).to be_mode 0755 end it "docroot dir #{property[:apache][:docroot_dir]} exists and is mode 755" do expect(file(property[:apache][:docroot_dir])).to be_directory - expect(file(property[:apache][:docroot_dir])).to be_mode 755 + expect(file(property[:apache][:docroot_dir])).to be_mode 0755 end it "cgi-bin dir #{property[:apache][:cgibin_dir]} exists and is mode 755" do expect(file(property[:apache][:cgibin_dir])).to be_directory - expect(file(property[:apache][:cgibin_dir])).to be_mode 755 + expect(file(property[:apache][:cgibin_dir])).to be_mode 0755 end it "default site #{property[:apache][:dir]}/sites-available/default is a file" do diff --git a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb index 947b4e609..b894c5929 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb @@ -23,7 +23,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end diff --git a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb index ed4ea85fc..1167a0c93 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb @@ -23,7 +23,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end diff --git a/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb index d3bb22c4f..1fe7c5eec 100644 --- a/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_fastcgi_spec.rb @@ -23,7 +23,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } xit "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end diff --git a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb index eeb24400c..1f06932cd 100644 --- a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb @@ -22,7 +22,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end diff --git a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb index 18f24c68f..94fe54001 100644 --- a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb @@ -30,7 +30,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end diff --git a/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb index 586a3f07f..0ce64d08b 100644 --- a/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb +++ b/test/integration/default/inspec/localhost/controls/standard_modules_spec.rb @@ -23,7 +23,7 @@ subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do expect(available).to be_file - expect(available).to be_mode 644 + expect(available).to be_mode 0644 expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" end From a049e69d560efb4b7e59980a3ba9b2ba08eae3df Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 13 Dec 2016 11:09:03 +0100 Subject: [PATCH 4/8] replace deprecated contain matcher --- .../inspec/localhost/controls/default_spec.rb | 22 +++++++++---------- .../localhost/controls/mod_include_spec.rb | 4 ++-- .../inspec/localhost/controls/mod_ssl_spec.rb | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/integration/default/inspec/localhost/controls/default_spec.rb b/test/integration/default/inspec/localhost/controls/default_spec.rb index 90e7ed9bc..804cff32e 100644 --- a/test/integration/default/inspec/localhost/controls/default_spec.rb +++ b/test/integration/default/inspec/localhost/controls/default_spec.rb @@ -88,7 +88,7 @@ end it "listening on port 80 is defined in #{property[:apache][:dir]}/ports.conf" do - expect(file("#{property[:apache][:dir]}/ports.conf")).to contain(/^Listen .*[: ]80$/) + expect(file("#{property[:apache][:dir]}/ports.conf").content).to match(/^Listen .*[: ]80$/) end # it 'only listens on port 443 when SSL is enabled' do @@ -111,18 +111,18 @@ subject(:config) { file(property[:apache][:conf]) } it "#{property[:apache][:conf]} is the config file dropped by the cookbook" do expect(config).to be_file - expect(config).to contain '# Generated by Chef' - expect(config).to contain %Q(ServerRoot "#{property[:apache][:dir]}") - expect(config).to contain 'AccessFileName .htaccess' - expect(config).to contain 'Files ~ "^\.ht"' - expect(config).to contain 'LogLevel warn' + expect(config.content).to include '# Generated by Chef' + expect(config.content).to include %Q(ServerRoot "#{property[:apache][:dir]}") + expect(config.content).to include 'AccessFileName .htaccess' + expect(config.content).to include 'Files ~ "^\.ht"' + expect(config.content).to include 'LogLevel warn' if property[:apache][:version] == '2.4' - expect(config).to contain "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" - expect(config).to_not contain "Include #{property[:apache][:dir]}/conf.d/*.conf" + expect(config.content).to include "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" + expect(config.content).to_not include "Include #{property[:apache][:dir]}/conf.d/*.conf" else - expect(config).to contain "Include #{property[:apache][:dir]}/conf-enabled/*.conf" - expect(config).to_not contain "Include #{property[:apache][:dir]}/conf.d/*.conf" - expect(config).to_not contain "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" + expect(config.content).to include "Include #{property[:apache][:dir]}/conf-enabled/*.conf" + expect(config.content).to_not include "Include #{property[:apache][:dir]}/conf.d/*.conf" + expect(config.content).to_not include "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" end end diff --git a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb index 1f06932cd..15cb66b33 100644 --- a/test/integration/default/inspec/localhost/controls/mod_include_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_include_spec.rb @@ -40,7 +40,7 @@ subject(:configfile) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.conf") } it "mods-enabled/#{expected_module}.conf adds .shtml handlers" do expect(configfile).to be_file - expect(configfile).to contain(/AddType text\/html .shtml/) - expect(configfile).to contain(/AddOutputFilter INCLUDES .shtml/) + expect(configfile.content).to match(/AddType text\/html .shtml/) + expect(configfile.content).to match(/AddOutputFilter INCLUDES .shtml/) end end diff --git a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb index 94fe54001..e3afdd4a1 100644 --- a/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_ssl_spec.rb @@ -45,9 +45,9 @@ expect(loaded_modules.stdout).to match(/#{expected_module}_module/) end - subject(:portsconf) { file("#{property[:apache][:dir]}/ports.conf") } + subject(:portsconf) { file("#{property[:apache][:dir]}/ports.conf").content } it 'ports.conf specifies listening on port 443' do - expect(portsconf).to contain(/^Listen .*[: ]443$/) + expect(portsconf).to match(/^Listen .*[: ]443$/) end subject(:configfile) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.conf") } From 8a658179ed150f98072da32f6123d71f8aecc4dc Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 13 Dec 2016 11:10:11 +0100 Subject: [PATCH 5/8] handler if/unless attached to describe blocks --- .../default/inspec/localhost/controls/mod_cgi_spec.rb | 4 ++-- .../default/inspec/localhost/controls/mod_cgid_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb index b894c5929..c94ae6e01 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgi_spec.rb @@ -18,7 +18,7 @@ # read platform information, see https://github.com/chef/inspec/issues/1396 property = apache_info(File.dirname(__FILE__)) -describe 'apache2::mod_cgi', :if => property[:apache][:mpm] == 'prefork' do +describe 'apache2::mod_cgi' do expected_module = 'cgi' subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do @@ -37,4 +37,4 @@ expect(loaded_modules.exit_status).to eq 0 expect(loaded_modules.stdout).to match(/#{expected_module}_module/) end -end +end if property[:apache][:mpm] == 'prefork' diff --git a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb index 1167a0c93..fb8650a12 100644 --- a/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb +++ b/test/integration/default/inspec/localhost/controls/mod_cgid_spec.rb @@ -18,7 +18,7 @@ # read platform information, see https://github.com/chef/inspec/issues/1396 property = apache_info(File.dirname(__FILE__)) -describe 'apache2::mod_cgid', :unless => property[:apache][:mpm] == 'prefork' do +describe 'apache2::mod_cgid' do expected_module = 'cgid' subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } it "mods-available/#{expected_module}.load is accurate" do @@ -37,4 +37,4 @@ expect(loaded_modules.exit_status).to eq 0 expect(loaded_modules.stdout).to match(/#{expected_module}_module/) end -end +end unless property[:apache][:mpm] == 'prefork' From 624c7cf58f6c266ca541b259cf5fcea829022c19 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 4 Jan 2017 14:06:25 +0100 Subject: [PATCH 6/8] run the same tests for prefork suite as well --- .kitchen.docker.yml | 3 + .kitchen.yml | 3 + .../serverspec/localhost/default_spec.rb | 128 ------------------ .../serverspec/localhost/mod_cgi_spec.rb | 37 ----- .../serverspec/localhost/mod_include_spec.rb | 44 ------ .../serverspec/localhost/mod_php_spec.rb | 44 ------ .../serverspec/localhost/mod_python_spec.rb | 40 ------ .../serverspec/localhost/mod_ssl_spec.rb | 56 -------- .../localhost/standard_modules_spec.rb | 39 ------ 9 files changed, 6 insertions(+), 388 deletions(-) delete mode 100644 test/integration/prefork/serverspec/localhost/default_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/mod_cgi_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/mod_include_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/mod_php_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/mod_python_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/mod_ssl_spec.rb delete mode 100644 test/integration/prefork/serverspec/localhost/standard_modules_spec.rb diff --git a/.kitchen.docker.yml b/.kitchen.docker.yml index 1d4005f91..6389f7454 100644 --- a/.kitchen.docker.yml +++ b/.kitchen.docker.yml @@ -85,6 +85,9 @@ suites: # - recipe[apache2_test::mod_proxy_ajp] - recipe[apache2_test::mod_python] - recipe[apache2_test::mod_ssl] + verifier: + inspec_tests: + - test/integration/default/inspec/localhost - name: worker includes: [ 'centos-7.2' diff --git a/.kitchen.yml b/.kitchen.yml index cd0ce9e9b..beef65f59 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -83,6 +83,9 @@ suites: # - recipe[apache2_test::mod_proxy_ajp] - recipe[apache2_test::mod_python] - recipe[apache2_test::mod_ssl] + verifier: + inspec_tests: + - test/integration/default/inspec/localhost - name: worker includes: [ 'centos-7.2', diff --git a/test/integration/prefork/serverspec/localhost/default_spec.rb b/test/integration/prefork/serverspec/localhost/default_spec.rb deleted file mode 100644 index e5f9b3523..000000000 --- a/test/integration/prefork/serverspec/localhost/default_spec.rb +++ /dev/null @@ -1,128 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -describe 'apache2::default' do - - it "package #{property[:apache][:package]} is installed" do - expect(package(property[:apache][:package])).to be_installed - end - - it "service #{property[:apache][:service_name]} is enabled and running" do - expect(service(property[:apache][:service_name])).to be_enabled - expect(service(property[:apache][:service_name])).to be_running - end - - it "directory #{property[:apache][:dir]} exists and is mode 755" do - expect(file(property[:apache][:dir])).to be_directory - expect(file(property[:apache][:dir])).to be_mode 755 - end - - %w(sites-enabled sites-available mods-enabled mods-available conf-available conf-enabled).each do |dir| - it "directory #{property[:apache][:dir]}/#{dir} exists and is mode 755" do - expect(file("#{property[:apache][:dir]}/#{dir}")).to be_directory - expect(file("#{property[:apache][:dir]}/#{dir}")).to be_mode 755 - end - end - - it "log dir #{property[:apache][:log_dir]} exists and is mode 755" do - expect(file(property[:apache][:log_dir])).to be_directory - expect(file(property[:apache][:log_dir])).to be_mode 755 - end - - it "lib dir #{property[:apache][:lib_dir]} exists and is mode 755" do - expect(file(property[:apache][:lib_dir])).to be_directory - expect(file(property[:apache][:lib_dir])).to be_mode 755 - end - - it "docroot dir #{property[:apache][:docroot_dir]} exists and is mode 755" do - expect(file(property[:apache][:docroot_dir])).to be_directory - expect(file(property[:apache][:docroot_dir])).to be_mode 755 - end - - it "cgi-bin dir #{property[:apache][:cgibin_dir]} exists and is mode 755" do - expect(file(property[:apache][:cgibin_dir])).to be_directory - expect(file(property[:apache][:cgibin_dir])).to be_mode 755 - end - - it "default site #{property[:apache][:dir]}/sites-available/default is a file" do - if property[:apache][:default_site_enabled] - expect(file("#{property[:apache][:dir]}/sites-available/default.conf")).to be_file - else - skip('default_site_enabled is false') - end - end - - it file("#{property[:apache][:dir]}/sites-enabled/000-default.conf") do - if property[:apache][:default_site_enabled] - expect(file("#{property[:apache][:dir]}/sites-enabled/000-default.conf")).to be_linked_to "#{property[:apache][:dir]}/sites-available/default.conf" - else - skip('default_site_enabled is false') - end - end - - %w(a2ensite a2dissite a2enmod a2dismod a2enconf a2disconf).each do |mod_script| - it "cookbook script /usr/sbin/#{mod_script} exists and is executable" do - expect(file("/usr/sbin/#{mod_script}")).to be_file - expect(file("/usr/sbin/#{mod_script}")).to be_executable - end - end - - it 'apache is listening on port 80' do - expect(port(80)).to be_listening - end - - it "listening on port 80 is defined in #{property[:apache][:dir]}/ports.conf" do - expect(file("#{property[:apache][:dir]}/ports.conf")).to contain(/^Listen .*[: ]80$/) - end - - # it 'only listens on port 443 when SSL is enabled' do - # unless ran_recipe?('apache2::mod_ssl') - # apache_configured_ports.wont_include(443) - # end - # end - - # describe file("#{property[:apache][:dir]}/conf.d/security.conf") do - # its(:content) { should match /^ServerTokens #{Regexp.escape(property['apache']['servertokens'])} *$/ } - # end - - # TODO: Verify this directory does NOT exist - # Dir["#{property[:apache][:dir]}/conf.d/*.conf"].each do |f| - # it "#{f} does not contain a LoadModule directive" do - # expect(file(f)).to_not contain 'LoadModule' - # end - # end - - subject(:config) { file(property[:apache][:conf]) } - it "#{property[:apache][:conf]} is the config file dropped by the cookbook" do - expect(config).to be_file - expect(config).to contain '# Generated by Chef' - expect(config).to contain %Q(ServerRoot "#{property[:apache][:dir]}") - if property[:apache][:version] == '2.4' - expect(config).to contain "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" - expect(config).to_not contain "Include #{property[:apache][:dir]}/conf.d/*.conf" - else - expect(config).to contain "Include #{property[:apache][:dir]}/conf-enabled/*.conf" - expect(config).to_not contain "Include #{property[:apache][:dir]}/conf.d/*.conf" - expect(config).to_not contain "IncludeOptional #{property[:apache][:dir]}/conf-enabled/*.conf" - end - end - - # let(:pre_command) { "source #{property[:apache][:dir]}/envvars" } - it 'the apache configuration has no syntax errors' do - expect(command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -t").exit_status).to eq 0 - end -end diff --git a/test/integration/prefork/serverspec/localhost/mod_cgi_spec.rb b/test/integration/prefork/serverspec/localhost/mod_cgi_spec.rb deleted file mode 100644 index ff9bda570..000000000 --- a/test/integration/prefork/serverspec/localhost/mod_cgi_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -describe 'apache2::mod_cgi' do - expected_module = 'cgi' - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end -end diff --git a/test/integration/prefork/serverspec/localhost/mod_include_spec.rb b/test/integration/prefork/serverspec/localhost/mod_include_spec.rb deleted file mode 100644 index 9dbef25e4..000000000 --- a/test/integration/prefork/serverspec/localhost/mod_include_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -describe 'apache2::mod_include' do - expected_module = 'include' - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end - - subject(:configfile) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.conf") } - it "mods-enabled/#{expected_module}.conf adds .shtml handlers" do - expect(configfile).to be_file - expect(configfile).to contain(/AddType text\/html .shtml/) - expect(configfile).to contain(/AddOutputFilter INCLUDES .shtml/) - end -end diff --git a/test/integration/prefork/serverspec/localhost/mod_php_spec.rb b/test/integration/prefork/serverspec/localhost/mod_php_spec.rb deleted file mode 100644 index 7c8d78518..000000000 --- a/test/integration/prefork/serverspec/localhost/mod_php_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -describe 'apache2::mod_php' do - expected_module = property[:apache][:mod_php][:module_name] - so_filename = property[:apache][:mod_php][:so_filename] - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/#{so_filename}\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end - - subject(:config) { file("#{property[:apache][:dir]}/conf.d/php5.conf") } - it 'no old conf.d/php5.conf exists' do - expect(config).to_not be_file - expect(config).to_not be_directory - end -end diff --git a/test/integration/prefork/serverspec/localhost/mod_python_spec.rb b/test/integration/prefork/serverspec/localhost/mod_python_spec.rb deleted file mode 100644 index e149cc21e..000000000 --- a/test/integration/prefork/serverspec/localhost/mod_python_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" -if property[:apache][:version] == '2.4' && %w(redhat redhat7 fedora).include?(os[:family]) - -else - describe 'apache2::mod_python' do - expected_module = 'python' - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end - end -end diff --git a/test/integration/prefork/serverspec/localhost/mod_ssl_spec.rb b/test/integration/prefork/serverspec/localhost/mod_ssl_spec.rb deleted file mode 100644 index 836ed0bbe..000000000 --- a/test/integration/prefork/serverspec/localhost/mod_ssl_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -describe 'apache2::mod_ssl' do - - # it 'installs the mod_ssl package on RHEL distributions' do - # skip unless %w(rhel fedora).include?(node['platform_family']) - # describe package('mod_ssl') do - # it { should be_installed } - # end - # end - - expected_module = 'ssl' - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end - - subject(:portsconf) { file("#{property[:apache][:dir]}/ports.conf") } - it 'ports.conf specifies listening on port 443' do - expect(portsconf).to contain(/^Listen .*[: ]443$/) - end - - subject(:configfile) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.conf") } - it "mods-enabled/#{expected_module}.conf adds SSL directives" do - expect(configfile).to be_file - # expect(configfile).to contain(/SSLCipherSuite #{Regexp.escape(property[:apache][:mod_ssl][:cipher_suite])}$/) - end -end diff --git a/test/integration/prefork/serverspec/localhost/standard_modules_spec.rb b/test/integration/prefork/serverspec/localhost/standard_modules_spec.rb deleted file mode 100644 index 28318cc31..000000000 --- a/test/integration/prefork/serverspec/localhost/standard_modules_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2014 OneHealth Solutions, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -require "#{ENV['BUSSER_ROOT']}/../kitchen/data/serverspec_helper" - -property[:apache][:default_modules].each do |expected_module| - expected_module = 'authz_default' if expected_module == 'authz_core' && property[:apache][:version] != '2.4' - describe "apache2::mod_#{expected_module}" do - subject(:available) { file("#{property[:apache][:dir]}/mods-available/#{expected_module}.load") } - it "mods-available/#{expected_module}.load is accurate" do - expect(available).to be_file - expect(available).to be_mode 644 - expect(available.content).to match "LoadModule #{expected_module}_module #{property[:apache][:libexec_dir]}/mod_#{expected_module}.so\n" - end - - subject(:enabled) { file("#{property[:apache][:dir]}/mods-enabled/#{expected_module}.load") } - it "mods-enabled/#{expected_module}.load is a symlink to mods-available/#{expected_module}.load" do - expect(enabled).to be_linked_to("../mods-available/#{expected_module}.load") - end - - subject(:loaded_modules) { command("APACHE_LOG_DIR=#{property[:apache][:log_dir]} #{property[:apache][:binary]} -M") } - it "#{expected_module} is loaded" do - expect(loaded_modules.exit_status).to eq 0 - expect(loaded_modules.stdout).to match(/#{expected_module}_module/) - end - end -end From d6cecadc69a6b8fbef3f63a5ce8209d3dc92d8ec Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 4 Jan 2017 14:28:32 +0100 Subject: [PATCH 7/8] lint rubocop errors Signed-off-by: Christoph Hartmann --- Rakefile | 2 +- attributes/mod_auth_openid.rb | 2 +- spec/support/supported_platforms.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index a755315ea..3162eaac7 100644 --- a/Rakefile +++ b/Rakefile @@ -19,7 +19,7 @@ namespace :style do FoodCritic::Rake::LintTask.new(:chef) do |t| t.options = { fail_tags: ['any'], - progress: true + progress: true, } end rescue LoadError => e diff --git a/attributes/mod_auth_openid.rb b/attributes/mod_auth_openid.rb index 20814c2d3..81e4e11e0 100644 --- a/attributes/mod_auth_openid.rb +++ b/attributes/mod_auth_openid.rb @@ -31,7 +31,7 @@ when 'freebsd' [ 'CPPFLAGS=-I/usr/local/include', - 'LDFLAGS=-I/usr/local/lib -lsqlite3' + 'LDFLAGS=-I/usr/local/lib -lsqlite3', ] else [] diff --git a/spec/support/supported_platforms.rb b/spec/support/supported_platforms.rb index 39b3ba5ac..edf124429 100644 --- a/spec/support/supported_platforms.rb +++ b/spec/support/supported_platforms.rb @@ -8,6 +8,6 @@ def supported_platforms 'redhat' => ['7.2'], 'centos' => ['7.2.1511'], 'freebsd' => ['10.3'], - 'opensuse' => ['13.2'] + 'opensuse' => ['13.2'], } end From 33022af55b35200523dc9f91803347ffb9dfa290 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Wed, 4 Jan 2017 15:57:41 +0100 Subject: [PATCH 8/8] remove fixtures directory --- .kitchen.docker.yml | 3 --- .kitchen.yml | 1 - Berksfile | 2 +- spec/support/platform_properties.rb | 2 +- test/{fixtures => }/cookbooks/apache2_test/.gitignore | 0 test/{fixtures => }/cookbooks/apache2_test/README.md | 0 .../cookbooks/apache2_test/attributes/default.rb | 0 .../apache2_test/files/default/ssl/ldap.example.com.pem | 0 test/{fixtures => }/cookbooks/apache2_test/metadata.rb | 0 .../cookbooks/apache2_test/recipes/basic_web_app.rb | 0 .../cookbooks/apache2_test/recipes/broken_conf.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/default.rb | 0 .../cookbooks/apache2_test/recipes/god_monitor.rb | 0 .../cookbooks/apache2_test/recipes/mod_auth_basic.rb | 0 .../cookbooks/apache2_test/recipes/mod_auth_digest.rb | 0 .../cookbooks/apache2_test/recipes/mod_auth_openid.rb | 0 .../cookbooks/apache2_test/recipes/mod_authnz_ldap.rb | 0 .../cookbooks/apache2_test/recipes/mod_authz_groupfile.rb | 0 .../cookbooks/apache2_test/recipes/mod_authz_listed_host.rb | 0 .../cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb | 0 .../cookbooks/apache2_test/recipes/mod_authz_user.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/mod_cgi.rb | 0 .../cookbooks/apache2_test/recipes/mod_dav_svn.rb | 0 .../cookbooks/apache2_test/recipes/mod_expires.rb | 0 .../cookbooks/apache2_test/recipes/mod_fastcgi.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/mod_perl.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/mod_php.rb | 0 .../cookbooks/apache2_test/recipes/mod_proxy_ajp.rb | 0 .../cookbooks/apache2_test/recipes/mod_python.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/mod_ssl.rb | 0 .../cookbooks/apache2_test/recipes/mod_status_remote.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/modules.rb | 0 test/{fixtures => }/cookbooks/apache2_test/recipes/setup.rb | 0 .../apache2_test/templates/default/auth_basic.conf.erb | 0 .../apache2_test/templates/default/auth_digest.conf.erb | 0 .../apache2_test/templates/default/auth_openid.conf.erb | 0 .../apache2_test/templates/default/authnz_ldap.conf.erb | 0 .../apache2_test/templates/default/authz_groupfile.conf.erb | 0 .../apache2_test/templates/default/authz_host.conf.erb | 0 .../apache2_test/templates/default/authz_user.conf.erb | 0 .../cookbooks/apache2_test/templates/default/broken.conf.erb | 0 .../apache2_test/templates/default/cache_test.conf.erb | 0 .../cookbooks/apache2_test/templates/default/entries.ldif.erb | 0 .../cookbooks/apache2_test/templates/default/java_env.conf.erb | 0 .../cookbooks/apache2_test/templates/default/perl_env.conf.erb | 0 .../cookbooks/apache2_test/templates/default/php_env.conf.erb | 0 .../apache2_test/templates/default/python_env.conf.erb | 0 .../cookbooks/apache2_test/templates/default/ssl.conf.erb | 0 .../cookbooks/apache2_test/templates/default/status.conf.erb | 0 .../cookbooks/apache2_test/templates/default/svn_repo.conf.erb | 0 .../cookbooks/apache2_test/templates/default/working.conf.erb | 0 51 files changed, 2 insertions(+), 6 deletions(-) rename test/{fixtures => }/cookbooks/apache2_test/.gitignore (100%) rename test/{fixtures => }/cookbooks/apache2_test/README.md (100%) rename test/{fixtures => }/cookbooks/apache2_test/attributes/default.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/files/default/ssl/ldap.example.com.pem (100%) rename test/{fixtures => }/cookbooks/apache2_test/metadata.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/basic_web_app.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/broken_conf.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/default.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/god_monitor.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_auth_basic.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_auth_digest.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_auth_openid.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_authz_user.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_cgi.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_dav_svn.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_expires.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_fastcgi.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_perl.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_php.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_python.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_ssl.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/mod_status_remote.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/modules.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/recipes/setup.rb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/auth_basic.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/auth_digest.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/auth_openid.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/authz_host.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/authz_user.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/broken.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/cache_test.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/entries.ldif.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/java_env.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/perl_env.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/php_env.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/python_env.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/ssl.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/status.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/svn_repo.conf.erb (100%) rename test/{fixtures => }/cookbooks/apache2_test/templates/default/working.conf.erb (100%) diff --git a/.kitchen.docker.yml b/.kitchen.docker.yml index 6389f7454..2761c84d6 100644 --- a/.kitchen.docker.yml +++ b/.kitchen.docker.yml @@ -8,9 +8,6 @@ driver: privileged: true use_sudo: false -provisioner: - data_path: test/fixtures - verifier: name: inspec diff --git a/.kitchen.yml b/.kitchen.yml index beef65f59..a61d4a8bb 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -4,7 +4,6 @@ driver: provisioner: name: chef_zero - data_path: test/fixtures verifier: name: inspec diff --git a/Berksfile b/Berksfile index 2afeb3b2c..700f97fa6 100644 --- a/Berksfile +++ b/Berksfile @@ -10,4 +10,4 @@ group :integration do cookbook 'zypper', '~> 0.3.0' end -cookbook 'apache2_test', :path => 'test/fixtures/cookbooks/apache2_test' +cookbook 'apache2_test', :path => 'test/cookbooks/apache2_test' diff --git a/spec/support/platform_properties.rb b/spec/support/platform_properties.rb index 255df8768..6450c37ee 100644 --- a/spec/support/platform_properties.rb +++ b/spec/support/platform_properties.rb @@ -1,5 +1,5 @@ require 'json' def load_platform_properties(args) - JSON.parse(IO.read(File.join(File.dirname(__FILE__), "/../../test/fixtures/platforms/#{args[:platform]}/#{args[:platform_version]}.json")), :symbolize_names => true) + JSON.parse(IO.read(File.join(File.dirname(__FILE__), "/../../test/integration/default/inspec/localhost/files/platforms/#{args[:platform]}/#{args[:platform_version]}.json")), :symbolize_names => true) end diff --git a/test/fixtures/cookbooks/apache2_test/.gitignore b/test/cookbooks/apache2_test/.gitignore similarity index 100% rename from test/fixtures/cookbooks/apache2_test/.gitignore rename to test/cookbooks/apache2_test/.gitignore diff --git a/test/fixtures/cookbooks/apache2_test/README.md b/test/cookbooks/apache2_test/README.md similarity index 100% rename from test/fixtures/cookbooks/apache2_test/README.md rename to test/cookbooks/apache2_test/README.md diff --git a/test/fixtures/cookbooks/apache2_test/attributes/default.rb b/test/cookbooks/apache2_test/attributes/default.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/attributes/default.rb rename to test/cookbooks/apache2_test/attributes/default.rb diff --git a/test/fixtures/cookbooks/apache2_test/files/default/ssl/ldap.example.com.pem b/test/cookbooks/apache2_test/files/default/ssl/ldap.example.com.pem similarity index 100% rename from test/fixtures/cookbooks/apache2_test/files/default/ssl/ldap.example.com.pem rename to test/cookbooks/apache2_test/files/default/ssl/ldap.example.com.pem diff --git a/test/fixtures/cookbooks/apache2_test/metadata.rb b/test/cookbooks/apache2_test/metadata.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/metadata.rb rename to test/cookbooks/apache2_test/metadata.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/basic_web_app.rb b/test/cookbooks/apache2_test/recipes/basic_web_app.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/basic_web_app.rb rename to test/cookbooks/apache2_test/recipes/basic_web_app.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/broken_conf.rb b/test/cookbooks/apache2_test/recipes/broken_conf.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/broken_conf.rb rename to test/cookbooks/apache2_test/recipes/broken_conf.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/default.rb b/test/cookbooks/apache2_test/recipes/default.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/default.rb rename to test/cookbooks/apache2_test/recipes/default.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/god_monitor.rb b/test/cookbooks/apache2_test/recipes/god_monitor.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/god_monitor.rb rename to test/cookbooks/apache2_test/recipes/god_monitor.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_auth_basic.rb b/test/cookbooks/apache2_test/recipes/mod_auth_basic.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_auth_basic.rb rename to test/cookbooks/apache2_test/recipes/mod_auth_basic.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_auth_digest.rb b/test/cookbooks/apache2_test/recipes/mod_auth_digest.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_auth_digest.rb rename to test/cookbooks/apache2_test/recipes/mod_auth_digest.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_auth_openid.rb b/test/cookbooks/apache2_test/recipes/mod_auth_openid.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_auth_openid.rb rename to test/cookbooks/apache2_test/recipes/mod_auth_openid.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb b/test/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb rename to test/cookbooks/apache2_test/recipes/mod_authnz_ldap.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb b/test/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb rename to test/cookbooks/apache2_test/recipes/mod_authz_groupfile.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb b/test/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb rename to test/cookbooks/apache2_test/recipes/mod_authz_listed_host.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb b/test/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb rename to test/cookbooks/apache2_test/recipes/mod_authz_unlisted_host.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_authz_user.rb b/test/cookbooks/apache2_test/recipes/mod_authz_user.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_authz_user.rb rename to test/cookbooks/apache2_test/recipes/mod_authz_user.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_cgi.rb b/test/cookbooks/apache2_test/recipes/mod_cgi.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_cgi.rb rename to test/cookbooks/apache2_test/recipes/mod_cgi.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_dav_svn.rb b/test/cookbooks/apache2_test/recipes/mod_dav_svn.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_dav_svn.rb rename to test/cookbooks/apache2_test/recipes/mod_dav_svn.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_expires.rb b/test/cookbooks/apache2_test/recipes/mod_expires.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_expires.rb rename to test/cookbooks/apache2_test/recipes/mod_expires.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_fastcgi.rb b/test/cookbooks/apache2_test/recipes/mod_fastcgi.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_fastcgi.rb rename to test/cookbooks/apache2_test/recipes/mod_fastcgi.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_perl.rb b/test/cookbooks/apache2_test/recipes/mod_perl.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_perl.rb rename to test/cookbooks/apache2_test/recipes/mod_perl.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_php.rb b/test/cookbooks/apache2_test/recipes/mod_php.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_php.rb rename to test/cookbooks/apache2_test/recipes/mod_php.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb b/test/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb rename to test/cookbooks/apache2_test/recipes/mod_proxy_ajp.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_python.rb b/test/cookbooks/apache2_test/recipes/mod_python.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_python.rb rename to test/cookbooks/apache2_test/recipes/mod_python.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_ssl.rb b/test/cookbooks/apache2_test/recipes/mod_ssl.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_ssl.rb rename to test/cookbooks/apache2_test/recipes/mod_ssl.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/mod_status_remote.rb b/test/cookbooks/apache2_test/recipes/mod_status_remote.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/mod_status_remote.rb rename to test/cookbooks/apache2_test/recipes/mod_status_remote.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/modules.rb b/test/cookbooks/apache2_test/recipes/modules.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/modules.rb rename to test/cookbooks/apache2_test/recipes/modules.rb diff --git a/test/fixtures/cookbooks/apache2_test/recipes/setup.rb b/test/cookbooks/apache2_test/recipes/setup.rb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/recipes/setup.rb rename to test/cookbooks/apache2_test/recipes/setup.rb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/auth_basic.conf.erb b/test/cookbooks/apache2_test/templates/default/auth_basic.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/auth_basic.conf.erb rename to test/cookbooks/apache2_test/templates/default/auth_basic.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/auth_digest.conf.erb b/test/cookbooks/apache2_test/templates/default/auth_digest.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/auth_digest.conf.erb rename to test/cookbooks/apache2_test/templates/default/auth_digest.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/auth_openid.conf.erb b/test/cookbooks/apache2_test/templates/default/auth_openid.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/auth_openid.conf.erb rename to test/cookbooks/apache2_test/templates/default/auth_openid.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb b/test/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb rename to test/cookbooks/apache2_test/templates/default/authnz_ldap.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb b/test/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb rename to test/cookbooks/apache2_test/templates/default/authz_groupfile.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/authz_host.conf.erb b/test/cookbooks/apache2_test/templates/default/authz_host.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/authz_host.conf.erb rename to test/cookbooks/apache2_test/templates/default/authz_host.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/authz_user.conf.erb b/test/cookbooks/apache2_test/templates/default/authz_user.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/authz_user.conf.erb rename to test/cookbooks/apache2_test/templates/default/authz_user.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/broken.conf.erb b/test/cookbooks/apache2_test/templates/default/broken.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/broken.conf.erb rename to test/cookbooks/apache2_test/templates/default/broken.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/cache_test.conf.erb b/test/cookbooks/apache2_test/templates/default/cache_test.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/cache_test.conf.erb rename to test/cookbooks/apache2_test/templates/default/cache_test.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/entries.ldif.erb b/test/cookbooks/apache2_test/templates/default/entries.ldif.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/entries.ldif.erb rename to test/cookbooks/apache2_test/templates/default/entries.ldif.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/java_env.conf.erb b/test/cookbooks/apache2_test/templates/default/java_env.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/java_env.conf.erb rename to test/cookbooks/apache2_test/templates/default/java_env.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/perl_env.conf.erb b/test/cookbooks/apache2_test/templates/default/perl_env.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/perl_env.conf.erb rename to test/cookbooks/apache2_test/templates/default/perl_env.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/php_env.conf.erb b/test/cookbooks/apache2_test/templates/default/php_env.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/php_env.conf.erb rename to test/cookbooks/apache2_test/templates/default/php_env.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/python_env.conf.erb b/test/cookbooks/apache2_test/templates/default/python_env.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/python_env.conf.erb rename to test/cookbooks/apache2_test/templates/default/python_env.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/ssl.conf.erb b/test/cookbooks/apache2_test/templates/default/ssl.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/ssl.conf.erb rename to test/cookbooks/apache2_test/templates/default/ssl.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/status.conf.erb b/test/cookbooks/apache2_test/templates/default/status.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/status.conf.erb rename to test/cookbooks/apache2_test/templates/default/status.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/svn_repo.conf.erb b/test/cookbooks/apache2_test/templates/default/svn_repo.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/svn_repo.conf.erb rename to test/cookbooks/apache2_test/templates/default/svn_repo.conf.erb diff --git a/test/fixtures/cookbooks/apache2_test/templates/default/working.conf.erb b/test/cookbooks/apache2_test/templates/default/working.conf.erb similarity index 100% rename from test/fixtures/cookbooks/apache2_test/templates/default/working.conf.erb rename to test/cookbooks/apache2_test/templates/default/working.conf.erb