diff options
author | Ryan Coleman <ryan@puppetlabs.com> | 2013-04-04 13:27:49 -0700 |
---|---|---|
committer | Ryan Coleman <ryan@puppetlabs.com> | 2013-04-04 13:27:49 -0700 |
commit | 73db1005de51670d60bc72dadb2de361c4a293b0 (patch) | |
tree | 2b1cbe120e272d7b32cb856030b5643ef7d581fd /spec/classes/ntp_spec.rb | |
parent | 554692be65611d5cd0e7f0de3897319188941990 (diff) |
Add test for virtual machines and local clocks
This commit provides a spec test for pull request #49 and commit
01273c53f1cf2015c3ff5a9f704828225d900e03 which specifies that virtual
machines should not use the local clock. This test attempts to protect
against a regression on that statement.
Diffstat (limited to 'spec/classes/ntp_spec.rb')
-rw-r--r-- | spec/classes/ntp_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/classes/ntp_spec.rb b/spec/classes/ntp_spec.rb index 9ce690b..a29c4e4 100644 --- a/spec/classes/ntp_spec.rb +++ b/spec/classes/ntp_spec.rb @@ -88,6 +88,22 @@ describe 'ntp' do end + describe "for virtual machines" do + + let(:params) {{}} + let(:facts) { { :operatingsystem => 'Archlinux', + :osfamily => 'Linux', + :isvirtual => 'false' } } + + it 'should not use local clock as a time source' do + content = param_value(subject, 'file', '/etc/ntp.conf', 'content') + expected_lines = [ + 'server 127.127.1.0 # local clock', + 'fudge 127.127.1.0 stratum 10' ] + (content.split("\n") & expected_lines).should_not == expected_lines + end + end + describe "for operating system Archlinux" do let(:params) {{}} |