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

index b21df580b12e075289a7be063db75768aab84e97..1fcc3f7d68019442c60f6c48a35bfeda6b8ed529 100644 (file)
@@ -148,6 +148,12 @@ suites:
   - name: passenger
     run_list:
       - recipe[passenger::default]
   - name: passenger
     run_list:
       - recipe[passenger::default]
+  - name: piwik
+    run_list:
+      - recipe[piwik::default]
+    attributes:
+      apache:
+        mpm: prefork
   - name: planet
     run_list:
       - recipe[planet::default]
   - name: planet
     run_list:
       - recipe[planet::default]
index 9b55eaa342ca30b921079408777c9b9f94a46b7b..8f02cbd483fde0066614823e23bfcf33e10142ad 100644 (file)
@@ -99,6 +99,9 @@ jobs:
     - name: "Test Kitchen (passenger)"
       script:
         - bundle exec kitchen test passenger-ubuntu-1804
     - name: "Test Kitchen (passenger)"
       script:
         - bundle exec kitchen test passenger-ubuntu-1804
+    - name: "Test Kitchen (piwik)"
+      script:
+        - bundle exec kitchen test piwik-ubuntu-1804
     - name: "Test Kitchen (planet)"
       script:
         - bundle exec kitchen test planet-ubuntu-1804
     - name: "Test Kitchen (planet)"
       script:
         - bundle exec kitchen test planet-ubuntu-1804
index a6b2bf3a7aa283572478fb49398dabcfed52f886..5317c359610fd314cf8feb72d1f1fa99e850c767 100644 (file)
@@ -23,14 +23,17 @@ include_recipe "mysql"
 
 passwords = data_bag_item("piwik", "passwords")
 
 
 passwords = data_bag_item("piwik", "passwords")
 
-package "php"
-package "php-cli"
-package "php-curl"
-package "php-mbstring"
-package "php-mysql"
-package "php-gd"
-package "php-xml"
-package "php-apcu"
+package %w[
+  php
+  php-cli
+  php-curl
+  php-mbstring
+  php-mysql
+  php-gd
+  php-xml
+  php-apcu
+  unzip
+]
 
 apache_module "expires"
 apache_module "php7.2"
 
 apache_module "expires"
 apache_module "php7.2"
diff --git a/test/data_bags/piwik/passwords.json b/test/data_bags/piwik/passwords.json
new file mode 100644 (file)
index 0000000..396b281
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "id": "passwords",
+  "database": "database-password",
+  "salt": "salt"
+}
diff --git a/test/integration/piwik/serverspec/apache_spec.rb b/test/integration/piwik/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