From: Tom Hughes Date: Tue, 18 Feb 2020 22:42:39 +0000 (+0000) Subject: Add test for civicrm cookbook X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/ade44d5bd9baa4381024780db602de3d9e75fa28 Add test for civicrm cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index d3f71ccfa..e383bd272 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -45,6 +45,9 @@ suites: - name: blogs run_list: - recipe[blogs::default] + - name: civicrm + run_list: + - recipe[civicrm::default] - name: clamav run_list: - recipe[clamav::default] diff --git a/.travis.yml b/.travis.yml index 4696f3700..25cf63dbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,9 @@ jobs: - name: "Test Kitchen (blogs)" script: - bundle exec kitchen test blogs-ubuntu-1804 + - name: "Test Kitchen (civicrm)" + script: + - bundle exec kitchen test civicrm-ubuntu-1804 - name: "Test Kitchen (clamav)" script: - bundle exec kitchen test clamav-ubuntu-1804 diff --git a/cookbooks/civicrm/recipes/default.rb b/cookbooks/civicrm/recipes/default.rb index 4486ea352..75e92f016 100644 --- a/cookbooks/civicrm/recipes/default.rb +++ b/cookbooks/civicrm/recipes/default.rb @@ -20,7 +20,11 @@ include_recipe "wordpress" include_recipe "mysql" -package "wkhtmltopdf" +package %w[ + rsync + unzip + wkhtmltopdf +] cache_dir = Chef::Config[:file_cache_path] diff --git a/test/data_bags/civicrm/passwords.json b/test/data_bags/civicrm/passwords.json new file mode 100644 index 000000000..fda558dd5 --- /dev/null +++ b/test/data_bags/civicrm/passwords.json @@ -0,0 +1,7 @@ +{ + "id": "passwords", + "database": "database-password", + "admin": "admin-password", + "key": "key", + "batch": "batch" +} diff --git a/test/integration/civicrm/serverspec/apache_spec.rb b/test/integration/civicrm/serverspec/apache_spec.rb new file mode 100644 index 000000000..446d3b915 --- /dev/null +++ b/test/integration/civicrm/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