summaryrefslogtreecommitdiff
path: root/spec/classes/ntp_config_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/classes/ntp_config_spec.rb')
-rw-r--r--spec/classes/ntp_config_spec.rb44
1 files changed, 20 insertions, 24 deletions
diff --git a/spec/classes/ntp_config_spec.rb b/spec/classes/ntp_config_spec.rb
index 80bee42..eec939f 100644
--- a/spec/classes/ntp_config_spec.rb
+++ b/spec/classes/ntp_config_spec.rb
@@ -78,6 +78,21 @@ describe 'ntp::config' do
(content.split("\n") & expected_lines).should == expected_lines
end
+ describe "for operating system family Archlinux" do
+
+ let(:params) {{}}
+ let(:facts) {{ :osfamily => 'Archlinux' }}
+
+ it 'should use the NTP pool servers by default' do
+ content = param_value(subject, 'file', '/etc/ntp.conf', 'content')
+ expected_lines = [
+ "server 0.pool.ntp.org",
+ "server 1.pool.ntp.org",
+ "server 2.pool.ntp.org"]
+ (content.split("\n") & expected_lines).should == expected_lines
+ end
+ end
+
describe "for operating system family unsupported" do
let(:facts) {{
:osfamily => 'unsupported',
@@ -93,9 +108,8 @@ describe 'ntp::config' do
describe 'for virtual machines' do
let(:params) {{}}
- let(:facts) {{ :operatingsystem => 'Archlinux',
- :osfamily => 'Linux',
- :is_virtual => true }}
+ let(:facts) {{ :osfamily => 'Archlinux',
+ :is_virtual => true }}
it 'should not use local clock as a time source' do
content = param_value(subject, 'file', '/etc/ntp.conf', 'content')
@@ -116,9 +130,8 @@ describe 'ntp::config' do
describe 'for physical machines' do
let(:params) {{}}
- let(:facts) {{ :operatingsystem => 'Archlinux',
- :osfamily => 'Linux',
- :is_virtual => false }}
+ let(:facts) {{ :osfamily => 'Archlinux',
+ :is_virtual => false }}
it 'disallows large clock skews' do
content = param_value(subject, 'file', '/etc/ntp.conf', 'content')
@@ -128,23 +141,6 @@ describe 'ntp::config' do
end
- describe "for operating system Archlinux" do
-
- let(:params) {{}}
- let(:facts) {{ :operatingsystem => 'Archlinux',
- :osfamily => 'Linux' }}
-
-
- it 'should use the NTP pool servers by default' do
- content = param_value(subject, 'file', '/etc/ntp.conf', 'content')
- expected_lines = [
- "server 0.pool.ntp.org",
- "server 1.pool.ntp.org",
- "server 2.pool.ntp.org"]
- (content.split("\n") & expected_lines).should == expected_lines
- end
- end
-
describe "for operating system Gentoo" do
let(:params) {{}}
@@ -163,7 +159,7 @@ describe 'ntp::config' do
end
end
- ['Debian', 'RedHat','SuSE', 'FreeBSD'].each do |osfamily|
+ ['Debian', 'RedHat','SuSE', 'FreeBSD', 'Archlinux'].each do |osfamily|
describe "for operating system family #{osfamily}" do
let(:facts) {{ :osfamily => osfamily }}