forked from olevole/puppetlabs-ntp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathntp_install_spec.rb
44 lines (41 loc) · 981 Bytes
/
ntp_install_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'spec_helper_acceptance'
case fact('osfamily')
when 'FreeBSD'
packagename = 'net/ntp'
when 'Gentoo'
packagename = 'net-misc/ntp'
when 'Linux'
case fact('operatingsystem')
when 'ArchLinux'
packagename = 'ntp'
when 'Gentoo'
packagename = 'net-misc/ntp'
end
when 'AIX'
packagename = 'bos.net.tcp.client'
when 'Solaris'
case fact('kernelrelease')
when '5.10'
packagename = ['SUNWntpr','SUNWntpu']
when '5.11'
packagename = 'service/network/ntp'
end
else
if fact('operatingsystem') == 'SLES' and fact('operatingsystemmajrelease') == '12'
servicename = 'ntpd'
else
servicename = 'ntp'
end
end
describe 'ntp::install class', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
it 'installs the package' do
apply_manifest(%{
class { 'ntp': }
}, :catch_failures => true)
end
Array(packagename).each do |package|
describe package(package) do
it { should be_installed }
end
end
end