]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for tilecache cookbook
authorTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 17:55:33 +0000 (17:55 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 17:55:33 +0000 (17:55 +0000)
.kitchen.yml
.travis.yml
test/integration/tilecache/serverspec/nginx_spec.rb [new file with mode: 0644]
test/integration/tilecache/serverspec/squid_spec.rb [new file with mode: 0644]

index 03549801fead7e57876ae64c6e0571cf2054e0f4..e9350cc01b0f22c686a0abcbf2947a663af8b7b2 100644 (file)
@@ -172,6 +172,13 @@ suites:
   - name: squid
     run_list:
       - recipe[squid::default]
+  - name: tilecache
+    run_list:
+      - recipe[tilecache::default]
+    attributes:
+      networking:
+        nameservers:
+          - 127.0.0.1
   - name: tools
     run_list:
       - recipe[tools::default]
index c822da4f03a0d192782b97721c0a466a1e0231af..78f216557d1f2bffc270401203bd8b3736be88eb 100644 (file)
@@ -117,6 +117,9 @@ jobs:
     - name: "Test Kitchen (squid)"
       script:
         - bundle exec kitchen test squid-ubuntu-1804
+    - name: "Test Kitchen (tilecache)"
+      script:
+        - bundle exec kitchen test tilecache-ubuntu-1804
     - name: "Test Kitchen (tools)"
       script:
         - bundle exec kitchen test tools-ubuntu-1804
diff --git a/test/integration/tilecache/serverspec/nginx_spec.rb b/test/integration/tilecache/serverspec/nginx_spec.rb
new file mode 100644 (file)
index 0000000..4122e19
--- /dev/null
@@ -0,0 +1,25 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("nginx") do
+  it { should be_installed }
+end
+
+describe service("nginx") 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
+
+describe port(8050) do
+  it { should be_listening.with("tcp") }
+end
diff --git a/test/integration/tilecache/serverspec/squid_spec.rb b/test/integration/tilecache/serverspec/squid_spec.rb
new file mode 100644 (file)
index 0000000..a72a8b3
--- /dev/null
@@ -0,0 +1,21 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("squid") do
+  it { should be_installed }
+end
+
+describe service("squid") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(3128) do
+  it { should be_listening.with("tcp") }
+end
+
+describe port(8080) do
+  it { should be_listening.with("tcp") }
+end