From 3e6a35fe7a8f09eda49ee253518121fc76ebf1e0 Mon Sep 17 00:00:00 2001 From: Bram Gillemon Date: Mon, 12 Feb 2024 00:17:33 +0100 Subject: [PATCH] extra tests for debian, remove centos-stream-9 as they dropped support for ntp --- kitchen.dokken.yml | 5 ----- test/integration/default/default_spec.rb | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index adff0148..bafe1956 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -27,11 +27,6 @@ platforms: image: dokken/centos-stream-8 pid_one_command: /usr/lib/systemd/systemd - - name: centos-stream-9 - driver: - image: dokken/centos-stream-9 - pid_one_command: /usr/lib/systemd/systemd - - name: debian-9 driver: image: dokken/debian-9 diff --git a/test/integration/default/default_spec.rb b/test/integration/default/default_spec.rb index 4a90b0a9..633089c3 100644 --- a/test/integration/default/default_spec.rb +++ b/test/integration/default/default_spec.rb @@ -6,7 +6,7 @@ 'ntp' end -if (os.family == 'redhat') || (inspec.os.name == 'fedora') +if (os.family == 'redhat' && os.release.to_i >= 8) || (inspec.os.name == 'fedora' && os.release.to_i >= 34) describe file '/etc/ntp.conf' do it { should_not be_file } end @@ -19,10 +19,28 @@ it { should_not be_enabled } it { should_not be_running } end +elseif (os.family == 'redhat' && os.release.to_i >= 8) + describe file '/usr/share/zoneinfo/leapseconds' do + it { should be_file } + end elsif os.family == 'debian' + describe file '/etc/ntp.conf' do + it { should be_file } + end + + describe ntp_conf do + its('tos') { should eq 'maxdist 1' } + end + describe file '/usr/share/zoneinfo/leap-seconds.list' do it { should be_file } end + + describe service service_name do + it { should be_enabled } + it { should be_running } + end + elsif os.windows? describe file 'C:\NTP\etc\ntp.conf' do it { should be_file }