]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for memcached cookbook
authorTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:44:32 +0000 (16:44 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 14 Feb 2020 16:44:32 +0000 (16:44 +0000)
.kitchen.yml
.travis.yml
cookbooks/memcached/metadata.rb
test/integration/memcached/serverspec/memcached_spec.rb [new file with mode: 0644]

index 0e994e71c8dd8d3caf2d262a271b07f7ffb963bb..d994aee92d4779851f513dcb89c8ca1bd67dcfd1 100644 (file)
@@ -98,6 +98,10 @@ suites:
       apt:
         sources:
           - openstreetmap
+  - name: memcached
+    run_list:
+      - recipe[munin::default]
+      - recipe[memcached::default]
   - name: munin
     run_list:
       - recipe[munin::default]
index 86655a944760940464d024bbfa76fb3501553a87..f4212920f42619bf76a10fb546e19ae59af39850 100644 (file)
@@ -50,6 +50,9 @@ jobs:
     - name: "Test Kitchen (letsencrypt)"
       script:
         - bundle exec kitchen test letsencrypt-ubuntu-1804
+    - name: "Test Kitchen (memcached)"
+      script:
+        - bundle exec kitchen test memcached-ubuntu-1804
     - name: "Test Kitchen (munin)"
       script:
         - bundle exec kitchen test munin-ubuntu-1804
index e9dd85c82b2dfdfaa69b2076403fe2782a54109e..6ccb01343b8532378e43dee2e5ca44c5045559bb 100644 (file)
@@ -6,3 +6,4 @@ description       "Installs and configures memcached"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "munin"
diff --git a/test/integration/memcached/serverspec/memcached_spec.rb b/test/integration/memcached/serverspec/memcached_spec.rb
new file mode 100644 (file)
index 0000000..26eccec
--- /dev/null
@@ -0,0 +1,17 @@
+require "serverspec"
+
+# Required by serverspec
+set :backend, :exec
+
+describe package("memcached") do
+  it { should be_installed }
+end
+
+describe service("memcached") do
+  it { should be_enabled }
+  it { should be_running }
+end
+
+describe port(11211) do
+  it { should be_listening.with("tcp") }
+end