From: Tom Hughes Date: Sun, 16 Feb 2020 11:31:49 +0000 (+0000) Subject: Add test for geoipupdate cookbook X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/85bd960b218b23411744b080d3f2df4f55fdee27?ds=sidebyside Add test for geoipupdate cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index 5e058c04b..4cff8942b 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -89,6 +89,9 @@ suites: attributes: apache: mpm: prefork + - name: geoipupdate + run_list: + - recipe[geoipupdate::default] - name: incron run_list: - recipe[incron::default] diff --git a/.travis.yml b/.travis.yml index f6be57d86..5057de2f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/cookbooks/geoipupdate/recipes/default.rb b/cookbooks/geoipupdate/recipes/default.rb index 77c62e5ad..58bf40d8b 100644 --- a/cookbooks/geoipupdate/recipes/default.rb +++ b/cookbooks/geoipupdate/recipes/default.rb @@ -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