diff options
author | Hunter Haugen <hunter@puppetlabs.com> | 2014-08-05 10:55:58 -0700 |
---|---|---|
committer | Hunter Haugen <hunter@puppetlabs.com> | 2014-08-05 10:55:58 -0700 |
commit | 2ba0e375e2bb5b4a85eac781f02f6a3e8b96e0f6 (patch) | |
tree | 3e6519a658f623c81667271c8c6f9a8b431f6aa2 /spec/acceptance/fqdn_rotate_spec.rb | |
parent | e310b1fdab7be1478b464167d2be20f0d4e5f63a (diff) | |
parent | 4c62b7a2eeec8d6e49ae8b05f2ed000a2b544cc2 (diff) |
Merge branch '4.3.x'
Diffstat (limited to 'spec/acceptance/fqdn_rotate_spec.rb')
-rwxr-xr-x | spec/acceptance/fqdn_rotate_spec.rb | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index fc8bea2..c37b35a 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -4,18 +4,31 @@ require 'spec_helper_acceptance' describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do describe 'success' do let(:facts_d) do - if fact('is_pe') == "true" - '/etc/puppetlabs/facter/facts.d' + if fact('is_pe', '--puppet') == "true" + if fact('osfamily') =~ /windows/i + if fact('kernelmajversion').to_f < 6.0 + 'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d' + else + 'C:/ProgramData/PuppetLabs/facter/facts.d' + end + else + '/etc/puppetlabs/facter/facts.d' + end else '/etc/facter/facts.d' end end after :each do - shell("if [ -f #{facts_d}/fqdn.txt ] ; then rm #{facts_d}/fqdn.txt ; fi") + shell("if [ -f '#{facts_d}/fqdn.txt' ] ; then rm '#{facts_d}/fqdn.txt' ; fi") + end + before :all do + #No need to create on windows, PE creates by default + if fact('osfamily') !~ /windows/i + shell("mkdir -p '#{facts_d}'") + end end it 'fqdn_rotates floats' do - shell("mkdir -p #{facts_d}") - shell("echo 'fqdn=fakehost.localdomain' > #{facts_d}/fqdn.txt") + shell("echo fqdn=fakehost.localdomain > '#{facts_d}/fqdn.txt'") pp = <<-EOS $a = ['a','b','c','d'] $o = fqdn_rotate($a) |