1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
7 if fact('is_pe', '--puppet') == "true"
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'
12 'C:/ProgramData/PuppetLabs/facter/facts.d'
15 '/etc/puppetlabs/facter/facts.d'
22 shell("if [ -f '#{facts_d}/fqdn.txt' ] ; then rm '#{facts_d}/fqdn.txt' ; fi")
25 #No need to create on windows, PE creates by default
26 if fact('osfamily') !~ /windows/i
27 shell("mkdir -p '#{facts_d}'")
30 it 'fqdn_rotates floats' do
31 shell("echo fqdn=fakehost.localdomain > '#{facts_d}/fqdn.txt'")
33 $a = ['a','b','c','d']
35 notice(inline_template('fqdn_rotate is <%= @o.inspect %>'))
38 apply_manifest(pp, :catch_failures => true) do |r|
39 expect(r.stdout).to match(/fqdn_rotate is \["c", "d", "a", "b"\]/)
44 it 'handles improper argument counts'
45 it 'handles non-numbers'