Sha256: afb96fb18631f2c9bd4a0d762c223054a48459181eb9351eb666cbe68963af96

Contents?: true

Size: 674 Bytes

Versions: 2

Compression:

Stored size: 674 Bytes

Contents

test_name 'Querying the fqdn with a numeric hostname should not fail' do

  # calling getaddrinfo with a numeric value on OS X does not fill the
  # ai_canonname field of the addrinfo structure
  confine :to, :platform => /^osx-/

  agents.each do |agent|
    original_hostname = agent.hostname.split('.').first
    numeric_hostname = 42

    teardown do
      on(agent, "scutil --set HostName #{original_hostname}")
    end

    step "Change hostname from '#{original_hostname}' to '#{numeric_hostname}'" do
      on(agent, "scutil --set HostName #{numeric_hostname}")
    end

    step 'Verify fqdn fact does not fail' do
      on(agent, facter('fqdn'))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
facter-4.0.29 acceptance/tests/facts/osx_numeric_hostname.rb
facter-4.0.28 acceptance/tests/facts/osx_numeric_hostname.rb