Add test for geoipupdate cookbook
authorTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 11:31:49 +0000 (11:31 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 16 Feb 2020 11:32:05 +0000 (11:32 +0000)
.kitchen.yml
.travis.yml
cookbooks/geoipupdate/recipes/default.rb

index 5e058c04b13fde14c1c098b2990d2def8645322b..4cff8942bb378e9c52857f32e46b579e7c3bec15 100644 (file)
@@ -89,6 +89,9 @@ suites:
     attributes:
       apache:
         mpm: prefork
+  - name: geoipupdate
+    run_list:
+      - recipe[geoipupdate::default]
   - name: incron
     run_list:
       - recipe[incron::default]
index f6be57d86d21b612464ff18c643b2778ea888ba5..5057de2f086a044bc11331dfcea44e6ad31d6f9c 100644 (file)
@@ -48,6 +48,9 @@ jobs:
     - name: "Test Kitchen (forum)"
       script:
         - bundle exec kitchen test forum-ubuntu-1804
+    - name: "Test Kitchen (geoipupdate)"
+      script:
+        - bundle exec kitchen test geoipupdate-ubuntu-1804
     - name: "Test Kitchen (incron)"
       script:
         - bundle exec kitchen test incron-ubuntu-1804
index 77c62e5ad93b5150be8b6dac3630360d7b0b7eb5..58bf40d8b032a9c4c982d7d2d2d5d987cbeb4d66 100644 (file)
@@ -35,7 +35,7 @@ execute "geoipdate" do
   command "geoipupdate"
   user "root"
   group "root"
-  not_if { node[:geoipupdate][:editions].all? { |edition| ::File.exist?("/usr/share/GeoIP/#{edition}.mmdb") } }
+  not_if { ENV.key?("TEST_KITCHEN") || node[:geoipupdate][:editions].all? { |edition| ::File.exist?("/usr/share/GeoIP/#{edition}.mmdb") } }
 end
 
 directory "/var/lib/GeoIP" do