Sha256: d6be7cb13e348ba659e4d743406315cff838f3dfbc2e2a920096ea2519a98b55

Contents?: true

Size: 1.11 KB

Versions: 18

Compression:

Stored size: 1.11 KB

Contents

# This test verifies that --no-external-facts does not load external facts

test_name "C99961: external fact command line option --no-external-facts does not load external facts" do
  tag 'risk:medium'

  require 'facter/acceptance/user_fact_utils'
  extend Facter::Acceptance::UserFactUtils

  agents.each do |agent|
    step "Agent #{agent}: create external fact directory and external fact" do
      external_dir = agent.tmpdir('external_dir')
      ext = get_external_fact_script_extension(agent['platform'])
      external_fact = File.join(external_dir, "external_fact#{ext}")
      create_remote_file(agent, external_fact, external_fact_content(agent['platform'], 'external_fact', 'external_value'))
      on(agent, "chmod +x '#{external_fact}'")

      teardown do
        on(agent, "rm -rf '#{external_dir}'")
      end

      step "Agent #{agent}: --no-external-facts option should not load external facts" do
        on(agent, facter("--no-external-facts external_fact")) do |facter_output|
          assert_equal("", facter_output.stdout.chomp, "External fact should not have resolved")
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
facter-4.0.29 acceptance/tests/options/no_external_facts.rb
facter-4.0.28 acceptance/tests/options/no_external_facts.rb
facter-3.12.2.cfacter.20181217 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.12.1.cfacter.20181031 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.6.cfacter.20181031 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.12.1.cfacter.20181023 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.5.cfacter.20181022 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.12.0.cfacter.20181004 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.12.0.cfacter.20181001 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.12.0.cfacter.20180918 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.4.cfacter.20180821 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.3.cfacter.20180716 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.2.cfacter.20180612 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.9.6.cfacter.20180612 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.2.cfacter.20180606 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.9.6.cfacter.20180606 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
facter-3.11.0.cfacter.20180319 ext/facter/facter/acceptance/tests/options/no_external_facts.rb
cfacter-3.11.0.rc.20180314 ext/facter/facter/acceptance/tests/options/no_external_facts.rb