From 12ff9af2ca65af9954212a11536873ef21229991 Mon Sep 17 00:00:00 2001 From: Michael Moll Date: Fri, 19 Oct 2012 20:26:01 +0200 Subject: add SuSE support --- spec/classes/ntp_spec.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'spec/classes') diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb index 239f641..6ff453f 100644 --- a/spec/classes/ntp_spec.rb +++ b/spec/classes/ntp_spec.rb @@ -43,6 +43,23 @@ describe 'ntp' do end end + describe "for operating system family SuSE" do + + let(:params) {{}} + let(:facts) { { :osfamily => 'suse' } } + + it { should contain_service('ntp').with_name('ntp') } + it 'should use the redhat ntp servers by default' do + content = param_value(subject, 'file', '/etc/ntp.conf', 'content') + expected_lines = [ + 'server 0.opensuse.pool.ntp.org', + 'server 1.opensuse.pool.ntp.org', + 'server 2.opensuse.pool.ntp.org', + 'server 3.opensuse.pool.ntp.org'] + (content.split("\n") & expected_lines).should == expected_lines + end + end + describe "for operating system family FreeBSD" do let(:params) {{}} @@ -51,7 +68,7 @@ describe 'ntp' do it { should contain_service('ntp').with_name('ntpd') } it 'should use the freebsd ntp servers by default' do content = param_value(subject, 'file', '/etc/ntp.conf', 'content') - expected_lines = [ + expected_lines = [ "server 0.freebsd.pool.ntp.org iburst maxpoll 9", "server 1.freebsd.pool.ntp.org iburst maxpoll 9", "server 2.freebsd.pool.ntp.org iburst maxpoll 9", @@ -71,7 +88,7 @@ describe 'ntp' do end - ['Debian', 'RedHat', 'FreeBSD'].each do |osfamily| + ['Debian', 'RedHat','SuSE', 'FreeBSD'].each do |osfamily| describe "for operating system family #{osfamily}" do let(:facts) { { :osfamily => osfamily } } -- cgit v1.2.3