Sha256: 698283a3428f11a8cfa3bb19de0dc2397652b5f152a72fd8a9068ad218a6794a
Contents?: true
Size: 1.02 KB
Versions: 18
Compression:
Stored size: 1.02 KB
Contents
test_name "C100153: custom fact with weight of >= 10001 overrides an external fact" do tag 'risk:high' require 'facter/acceptance/user_fact_utils' extend Facter::Acceptance::UserFactUtils fact_name = 'test' # Use a static external fact ext_fact = "#{fact_name}: 'EXTERNAL'" agents.each do |agent| facts_dir = agent.tmpdir('facts.d') ext_fact_path = "#{facts_dir}/test.yaml" cust_fact_path = "#{facts_dir}/test.rb" create_remote_file(agent, ext_fact_path, ext_fact) create_remote_file(agent, cust_fact_path, custom_fact_content(fact_name, 'CUSTOM', "has_weight 10001")) teardown do on(agent, "rm -rf '#{facts_dir}'") end # Custom fact with weight >= 10001 should override an external fact step "Agent #{agent}: resolve a custom fact with weight of 10001 overriding the external fact" do on(agent, facter("--external-dir=#{facts_dir} --custom-dir=#{facts_dir} test")) do |facter_output| assert_equal("CUSTOM", facter_output.stdout.chomp) end end end end
Version data entries
18 entries across 18 versions & 2 rubygems