]> git.openstreetmap.org Git - chef.git/commitdiff
Add basic test for the ntp cookbook
authorTom Hughes <tom@compton.nu>
Thu, 13 Feb 2020 21:53:11 +0000 (21:53 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 13 Feb 2020 21:57:46 +0000 (21:57 +0000)
.kitchen.yml
.travis.yml
cookbooks/ntp/metadata.rb
test/integration/ntp/serverspec/chronyd_spec.rb [new file with mode: 0644]

index faf16e69ab5a888e955124fd2a22f666d3b18b61..d5132931b74e3de8525c76b583fa172768f002ba 100644 (file)
@@ -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]
index deb00f9e1957ebb9d4e6ef798250ed28683da77a..e5568cf8e71b11342bfc8c72c773e9033628b3ed 100644 (file)
@@ -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
index 910386b24b710d30afad603fd364b869a0449f4d..f80c8dbeefa0e0b0e1d840f21d666636fd9c2fb7 100644 (file)
@@ -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 (file)
index 0000000..40894b0
--- /dev/null
@@ -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