From: Tom Hughes Date: Thu, 13 Feb 2020 21:53:11 +0000 (+0000) Subject: Add basic test for the ntp cookbook X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/a204af49937bc521d89f3d6bb6f892b4ed2deb3d Add basic test for the ntp cookbook --- diff --git a/.kitchen.yml b/.kitchen.yml index faf16e69a..d5132931b 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -67,6 +67,9 @@ suites: - name: networking run_list: - recipe[networking::default] + - name: ntp + run_list: + - recipe[ntp::default] - name: otrs run_list: - recipe[accounts::default] diff --git a/.travis.yml b/.travis.yml index deb00f9e1..e5568cf8e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,9 @@ jobs: - name: "Test Kitchen (networking)" script: - bundle exec kitchen test networking-ubuntu-1804 + - name: "Test Kitchen (ntp)" + script: + - bundle exec kitchen test ntp-ubuntu-1804 - name: "Test Kitchen (otrs)" script: - bundle exec kitchen test otrs-ubuntu-1804 diff --git a/cookbooks/ntp/metadata.rb b/cookbooks/ntp/metadata.rb index 910386b24..f80c8dbee 100644 --- a/cookbooks/ntp/metadata.rb +++ b/cookbooks/ntp/metadata.rb @@ -6,3 +6,5 @@ description "Installs and configures ntp as a client or server" version "0.8.2" supports "ubuntu" +depends "munin" +depends "systemd" diff --git a/test/integration/ntp/serverspec/chronyd_spec.rb b/test/integration/ntp/serverspec/chronyd_spec.rb new file mode 100644 index 000000000..40894b040 --- /dev/null +++ b/test/integration/ntp/serverspec/chronyd_spec.rb @@ -0,0 +1,13 @@ +require "serverspec" + +# Required by serverspec +set :backend, :exec + +describe package("chrony") do + it { should be_installed } +end + +describe service("chronyd") do + it { should be_enabled } + it { should be_running } +end