]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for civicrm cookbook
authorTom Hughes <tom@compton.nu>
Tue, 18 Feb 2020 22:42:39 +0000 (22:42 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 18 Feb 2020 22:42:39 +0000 (22:42 +0000)
.kitchen.yml
.travis.yml
cookbooks/civicrm/recipes/default.rb
test/data_bags/civicrm/passwords.json [new file with mode: 0644]
test/integration/civicrm/serverspec/apache_spec.rb [new file with mode: 0644]

index d3f71ccfa1bd8a4feddfdb8eec5b47568f590565..e383bd272444bb06391d8dadcb03b5ffc7d6b0c2 100644 (file)
@@ -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]
index 4696f3700271b2d01483ace78bdaba1304f21946..25cf63dbf9b6a370e5de49a32c41ff11142bc94b 100644 (file)
@@ -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
index 4486ea3520eb718c34c0aee434fc808182bcf32f..75e92f016615e5d78b1821c1b0e705b4c7c5c1c5 100644 (file)
 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 (file)
index 0000000..fda558d
--- /dev/null
@@ -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 (file)
index 0000000..446d3b9
--- /dev/null
@@ -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