From 85bd960b218b23411744b080d3f2df4f55fdee27 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 16 Feb 2020 11:31:49 +0000 Subject: [PATCH] Add test for geoipupdate cookbook --- .kitchen.yml | 3 +++ .travis.yml | 3 +++ cookbooks/geoipupdate/recipes/default.rb | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5