From: Tom Hughes Date: Thu, 20 Feb 2020 18:50:50 +0000 (+0000) Subject: Add test for hardware cookbook X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/1dfb3a0bf24b6c261191fff05c632f8f6331e038?ds=inline Add test for hardware cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index 9f87919ba..15e1dc2e2 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -105,6 +105,9 @@ suites: - name: gps-tile run_list: - recipe[gps-tile::default] + - name: hardware + run_list: + - recipe[hardware::default] - name: incron run_list: - recipe[incron::default] diff --git a/.travis.yml b/.travis.yml index 99ddba7fe..7953740a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,6 +63,9 @@ jobs: - name: "Test Kitchen (gps-tile)" script: - bundle exec kitchen test gps-tile-ubuntu-1804 + - name: "Test Kitchen (hardare)" + script: + - bundle exec kitchen test hardware-ubuntu-1804 - name: "Test Kitchen (incron)" script: - bundle exec kitchen test incron-ubuntu-1804 diff --git a/cookbooks/hardware/metadata.rb b/cookbooks/hardware/metadata.rb index b632a23d9..c7891e909 100644 --- a/cookbooks/hardware/metadata.rb +++ b/cookbooks/hardware/metadata.rb @@ -7,6 +7,7 @@ description "Configures hardware" version "1.0.0" supports "ubuntu" depends "apt" +depends "chef" depends "git" depends "munin" depends "ohai" diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 7c7790d47..fa5f43c64 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -17,7 +17,10 @@ # limitations under the License. # +include_recipe "apt" +include_recipe "git" include_recipe "munin" +include_recipe "sysfs" include_recipe "tools" ohai_plugin "hardware" do @@ -259,6 +262,7 @@ if tools_packages.include?("areca") repository "https://git.openstreetmap.org/private/areca.git" user "root" group "root" + not_if { ENV["TEST_KITCHEN"] } end else directory "/opt/areca" do