summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorWill Hopper <whopper@cat.pdx.edu>2012-05-13 16:26:48 -0700
committerWill Hopper <whopper@cat.pdx.edu>2012-05-13 21:06:58 -0700
commit2e0d20761709818a964e8ca1ff23d84d51206d8a (patch)
tree21dc946cb0951b1064852b90fa5672a76d9b36f9 /spec
parent0b39d32f9b2fbfab83081db78600a27d3fa4a274 (diff)
(#14457) Add FreeBSD support for the NTP class
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/ntp_spec.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb
index cae253d..ac68b89 100644
--- a/spec/classes/ntp_spec.rb
+++ b/spec/classes/ntp_spec.rb
@@ -13,6 +13,7 @@ describe 'ntp' do
debianish = ['debian', 'ubuntu']
redhatish = ['centos', 'redhat', 'oel', 'linux']
+ bsdish = ['freebsd']
debianish.each do |os|
describe "for operating system #{os}" do
@@ -50,7 +51,26 @@ describe 'ntp' do
end
end
- (redhatish + debianish).each do |os|
+ bsdish.each do |os|
+ describe "for operating system #{os}" do
+
+ let(:params) {{}}
+ let(:facts) { { :operatingsystem => os } }
+
+ 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 = [
+ "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",
+ "server 3.freebsd.pool.ntp.org iburst maxpoll 9"]
+ (content.split("\n") & expected_lines).should == expected_lines
+ end
+ end
+ end
+
+ (redhatish + debianish + bsdish).each do |os|
describe "for operating system #{os}" do
let(:facts) { { :operatingsystem => os } }