From c61dad4d0afbe41d85716e5231e76d94b6a529af Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 20 Feb 2020 19:04:41 +0000 Subject: [PATCH] Add test for subversion cookbook --- .kitchen.yml | 3 +++ .travis.yml | 3 +++ cookbooks/subversion/recipes/default.rb | 4 ++-- .../subversion/serverspec/apache_spec.rb | 21 +++++++++++++++++++ .../subversion/serverspec/subversion_spec.rb | 8 +++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 test/integration/subversion/serverspec/apache_spec.rb create mode 100644 test/integration/subversion/serverspec/subversion_spec.rb diff --git a/.kitchen.yml b/.kitchen.yml index 15e1dc2e2..2e937d121 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -209,6 +209,9 @@ suites: - name: stateofthemap run_list: - recipe[stateofthemap::default] + - name: subversion + run_list: + - recipe[subversion::default] - name: switch2osm run_list: - recipe[switch2osm::default] diff --git a/.travis.yml b/.travis.yml index 7953740a3..b9f212d85 100644 --- a/.travis.yml +++ b/.travis.yml @@ -157,6 +157,9 @@ jobs: - name: "Test Kitchen (stateofthemap)" script: - bundle exec kitchen test stateofthemap-ubuntu-1804 + - name: "Test Kitchen (subversion)" + script: + - bundle exec kitchen test subversion-ubuntu-1804 - name: "Test Kitchen (switch2osm)" script: - bundle exec kitchen test switch2osm-ubuntu-1804 diff --git a/cookbooks/subversion/recipes/default.rb b/cookbooks/subversion/recipes/default.rb index 7014c2d5f..f5803e5ee 100644 --- a/cookbooks/subversion/recipes/default.rb +++ b/cookbooks/subversion/recipes/default.rb @@ -43,11 +43,11 @@ apache_module "dav_fs" do end apache_module "dav_svn" do - package "libapache2-svn" + package "libapache2-mod-svn" end apache_module "authz_svn" do - package "libapache2-svn" + package "libapache2-mod-svn" end ssl_certificate "svn.openstreetmap.org" do diff --git a/test/integration/subversion/serverspec/apache_spec.rb b/test/integration/subversion/serverspec/apache_spec.rb new file mode 100644 index 000000000..446d3b915 --- /dev/null +++ b/test/integration/subversion/serverspec/apache_spec.rb @@ -0,0 +1,21 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("apache2") do + it { should be_installed } +end + +describe service("apache2") do + it { should be_enabled } + it { should be_running } +end + +describe port(80) do + it { should be_listening.with("tcp") } +end + +describe port(443) do + it { should be_listening.with("tcp") } +end diff --git a/test/integration/subversion/serverspec/subversion_spec.rb b/test/integration/subversion/serverspec/subversion_spec.rb new file mode 100644 index 000000000..8bbecba74 --- /dev/null +++ b/test/integration/subversion/serverspec/subversion_spec.rb @@ -0,0 +1,8 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("subversion") do + it { should be_installed } +end -- 2.39.5