From a364605f3b71b8a0857bbc2c47388f7bb9e11f82 Mon Sep 17 00:00:00 2001 From: Morgan Haskel Date: Tue, 3 Jun 2014 11:13:35 -0400 Subject: Merge pull request #264 from apenney/fixes-for-tests Fixes for PE3.3. --- spec/acceptance/fqdn_rotate_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index b7f8bf8..fc8bea2 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -14,6 +14,7 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( shell("if [ -f #{facts_d}/fqdn.txt ] ; then rm #{facts_d}/fqdn.txt ; fi") end it 'fqdn_rotates floats' do + shell("mkdir -p #{facts_d}") shell("echo 'fqdn=fakehost.localdomain' > #{facts_d}/fqdn.txt") pp = <<-EOS $a = ['a','b','c','d'] -- cgit v1.2.3 From eb507c9a5486d269ec6a36f169eb68695910bfbf Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Mon, 23 Jun 2014 23:27:59 -0700 Subject: Fixed fqdn,getparam and has_interface_with spec tests --- spec/acceptance/fqdn_rotate_spec.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index fc8bea2..2527c28 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -5,7 +5,15 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( describe 'success' do let(:facts_d) do if fact('is_pe') == "true" - '/etc/puppetlabs/facter/facts.d' + 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 @@ -13,9 +21,14 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( after :each do 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) -- cgit v1.2.3 From ca35be6480a5935a4b0e0721bdb726934269e433 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 24 Jun 2014 11:37:34 -0700 Subject: Fix pe facts and slashes --- spec/acceptance/fqdn_rotate_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index 2527c28..bc02eb6 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -4,12 +4,12 @@ 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" + 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' + 'C:\\Documents and Settings\\All Users\\Application Data\\PuppetLabs\\facter\\facts.d' else - 'C:\ProgramData\PuppetLabs\facter\facts.d' + 'C:\\ProgramData\\PuppetLabs\\facter\\facts.d' end else '/etc/puppetlabs/facter/facts.d' -- cgit v1.2.3 From 0cac9fd0489180d7b6ae59ce67334dc34ddcc961 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 24 Jun 2014 15:03:58 -0700 Subject: Not enough escape velocity --- spec/acceptance/fqdn_rotate_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index bc02eb6..d56c2b1 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -7,9 +7,9 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( 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' + 'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d' else - 'C:\\ProgramData\\PuppetLabs\\facter\\facts.d' + 'C:/ProgramData/PuppetLabs/facter/facts.d' end else '/etc/puppetlabs/facter/facts.d' -- cgit v1.2.3 From 05b79dcabbdb67aab322fa6e12e77532ab044749 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Wed, 25 Jun 2014 10:16:06 -0700 Subject: Disable windows network stuff and quote path --- spec/acceptance/fqdn_rotate_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index d56c2b1..ee2afb5 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -28,7 +28,7 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( end end it 'fqdn_rotates floats' do - 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) -- cgit v1.2.3 From 1b893ff653d64ca8a923ab37a0c222fc35c0eb5f Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Thu, 26 Jun 2014 13:17:07 -0700 Subject: Need quotes for spaces in path --- spec/acceptance/fqdn_rotate_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/acceptance/fqdn_rotate_spec.rb') diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index ee2afb5..c37b35a 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -19,12 +19,12 @@ describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact( 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}") + shell("mkdir -p '#{facts_d}'") end end it 'fqdn_rotates floats' do -- cgit v1.2.3