File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 describe 'success' do
66 let ( :facts_d ) do
77 if fact ( 'is_pe' ) == "true"
8- '/etc/puppetlabs/facter/facts.d'
8+ if fact ( 'osfamily' ) =~ /windows/i
9+ if fact ( 'kernelmajversion' ) . to_f < 6.0
10+ 'C:\Documents and Settings\All Users\Application Data\PuppetLabs\facter\facts.d'
11+ else
12+ 'C:\ProgramData\PuppetLabs\facter\facts.d'
13+ end
14+ else
15+ '/etc/puppetlabs/facter/facts.d'
16+ end
917 else
1018 '/etc/facter/facts.d'
1119 end
1220 end
1321 after :each do
1422 shell ( "if [ -f #{ facts_d } /fqdn.txt ] ; then rm #{ facts_d } /fqdn.txt ; fi" )
1523 end
24+ before :all do
25+ #No need to create on windows, PE creates by default
26+ if fact ( 'osfamily' ) !~ /windows/i
27+ shell ( "mkdir -p #{ facts_d } " )
28+ end
29+ end
1630 it 'fqdn_rotates floats' do
17- shell ( "mkdir -p #{ facts_d } " )
18- shell ( "echo 'fqdn=fakehost.localdomain' > #{ facts_d } /fqdn.txt" )
31+ shell ( "echo fqdn=fakehost.localdomain > #{ facts_d } /fqdn.txt" )
1932 pp = <<-EOS
2033 $a = ['a','b','c','d']
2134 $o = fqdn_rotate($a)
Original file line number Diff line number Diff line change 66 it 'getparam a notify' do
77 pp = <<-EOS
88 notify { 'rspec':
9- ensure => present,
109 message => 'custom rspec message',
1110 }
1211 $o = getparam(Notify['rspec'], 'message')
Original file line number Diff line number Diff line change 55 describe 'success' do
66 it 'has_interface_with existing ipaddress' do
77 pp = <<-EOS
8- $a = '127.0.0.1'
8+ $a = $::ipaddress
99 $o = has_interface_with('ipaddress', $a)
1010 notice(inline_template('has_interface_with is <%= @o.inspect %>'))
1111 EOS
2929 pp = <<-EOS
3030 if $osfamily == 'Solaris' or $osfamily == 'Darwin' {
3131 $a = 'lo0'
32- } else {
32+ }elsif $osfamily == 'windows' {
33+ $a = $::kernelmajversion ? {
34+ /6\. (2|3|4)/ => 'Ethernet0',
35+ /6\. (0|1)/ => 'Local_Area_Connection',
36+ /5\. (1|2)/ => undef, #Broken current in facter
37+ }
38+ }else {
3339 $a = 'lo'
3440 }
3541 $o = has_interface_with($a)
You can’t perform that action at this time.
0 commit comments