diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-09 16:59:43 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-09 17:01:04 -0400 |
commit | 5fd66d38ed79bb42c64ff68f26a43e71207476ef (patch) | |
tree | d313c8dba66ca14de0928340b8ab652e42f39b7a /spec | |
parent | 43b484c7ab6f92c9eae165982ba127e3d3a87a2e (diff) |
Add panic as a new parameter in case people want to allow clock skews.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/classes/ntp_config_spec.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/spec/classes/ntp_config_spec.rb b/spec/classes/ntp_config_spec.rb index ddb9be9..80bee42 100644 --- a/spec/classes/ntp_config_spec.rb +++ b/spec/classes/ntp_config_spec.rb @@ -90,12 +90,12 @@ describe 'ntp::config' do end - describe "for virtual machines" do + describe 'for virtual machines' do let(:params) {{}} let(:facts) {{ :operatingsystem => 'Archlinux', :osfamily => 'Linux', - :isvirtual => 'false' }} + :is_virtual => true }} it 'should not use local clock as a time source' do content = param_value(subject, 'file', '/etc/ntp.conf', 'content') @@ -104,6 +104,28 @@ describe 'ntp::config' do 'fudge 127.127.1.0 stratum 10' ] (content.split("\n") & expected_lines).should_not == expected_lines end + + it 'allows large clock skews' do + content = param_value(subject, 'file', '/etc/ntp.conf', 'content') + expected_lines = [ 'tinker panic 0' ] + (content.split("\n") & expected_lines).should == expected_lines + end + + end + + describe 'for physical machines' do + + let(:params) {{}} + let(:facts) {{ :operatingsystem => 'Archlinux', + :osfamily => 'Linux', + :is_virtual => false }} + + it 'disallows large clock skews' do + content = param_value(subject, 'file', '/etc/ntp.conf', 'content') + expected_lines = [ 'tinker panic 0' ] + (content.split("\n") & expected_lines).should_not == expected_lines + end + end describe "for operating system Archlinux" do |