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

index 38b9c7f890ba176e62696fc82e046dda9ea19ed6..77ef19f964b9736a2d29c78fe70adbf36113f333 100644 (file)
@@ -182,6 +182,9 @@ suites:
   - name: squid
     run_list:
       - recipe[squid::default]
+  - name: stateofthemap
+    run_list:
+      - recipe[stateofthemap::default]
   - name: tilecache
     run_list:
       - recipe[tilecache::default]
index 82657630770a968e8cfe0f28cfe30f4f48b6a192..3f16680ba67bef0cec463a7e0f95922708bd7a88 100644 (file)
@@ -123,6 +123,9 @@ jobs:
     - name: "Test Kitchen (squid)"
       script:
         - bundle exec kitchen test squid-ubuntu-1804
+    - name: "Test Kitchen (stateofthemap)"
+      script:
+        - bundle exec kitchen test stateofthemap-ubuntu-1804
     - name: "Test Kitchen (tilecache)"
       script:
         - bundle exec kitchen test tilecache-ubuntu-1804
index 01c4bc91000d84b27ef6d4eb4d9b6e702522df00..1bb8176f177f05141a31d051821c282a68a93b29 100644 (file)
@@ -284,7 +284,9 @@ end
 package %w[
   ruby
   ruby-dev
+  libssl-dev
   zlib1g-dev
+  pkg-config
 ]
 
 apache_module "expires"
diff --git a/test/data_bags/stateofthemap/passwords.json b/test/data_bags/stateofthemap/passwords.json
new file mode 100644 (file)
index 0000000..3ffc384
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "id": "passwords",
+  "sotm2007": "sotm2007",
+  "sotm2008": "sotm2008",
+  "sotm2009": "sotm2009",
+  "sotm2010": "sotm2010",
+  "sotm2011": "sotm2011",
+  "sotm2012": "sotm2012",
+  "sotm2016": "sotm2016"
+}
diff --git a/test/integration/stateofhemap/serverspec/apache_spec.rb b/test/integration/stateofhemap/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