Sha256: 7c4ae29acd614573b381b480c9f0df67d5416010d386eff1d59fccf81a07ba9b

Contents?: true

Size: 1.17 KB

Versions: 18

Compression:

Stored size: 1.17 KB

Contents

# This test verifies that setting external-dir and no-external-facts in the config file
# results in an error
test_name "C99993: config option no-external-facts conflicts with external-dir" do
  tag 'risk:low'

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

  agents.each do |agent|
    step "Agent #{agent}: create the exernal-dir and a config file" do
      external_dir = agent.tmpdir('external_dir')

      config_dir = agent.tmpdir("config_dir")
      config_file = File.join(config_dir, "facter.conf")
      config_content = <<EOM
global : {
    external-dir : "#{external_dir}"
    no-external-facts : true,
}
EOM
      create_remote_file(agent, config_file, config_content)

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

      step "Agent #{agent}: config option no-external-facts : true and external-dir should result in an options conflict error" do
        on(agent, facter("--config '#{config_file}'"), :acceptable_exit_codes => 1) do |facter_output|
          assert_match(/options conflict/, facter_output.stderr, "Output does not contain error string")
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

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