Sha256: 4f3e4617d991531a42c8b81e63c949cee0ee087f2225ddfec534acb11a93ab4f
Contents?: true
Size: 1.13 KB
Versions: 16
Compression:
Stored size: 1.13 KB
Contents
# Verify that -p loads external and custom facts from puppet locations test_name "C14783: facter -p loads facts from puppet" do tag 'risk:high' agents.each do |agent| external_dir = agent.puppet['pluginfactdest'] external_file = File.join(external_dir, "external.txt") custom_dir = File.join(agent.puppet['plugindest'], "facter") custom_file = "#{custom_dir}/custom.rb" teardown do on agent, "rm -f '#{external_file}' '#{custom_file}'" end step "Agent #{agent}: create external fact" do on agent, "mkdir -p '#{external_dir}'" create_remote_file(agent, external_file, "external=external") end step "Agent #{agent}: create custom fact" do on agent, "mkdir -p '#{custom_dir}'" create_remote_file(agent, custom_file, "Facter.add(:custom) { setcode { 'custom' } }") end step "Agent #{agent}: verify facts" do on(agent, facter("-p external")) do |facter_output| assert_equal("external", facter_output.stdout.chomp) end on(agent, facter("-p custom")) do |facter_output| assert_equal("custom", facter_output.stdout.chomp) end end end end
Version data entries
16 entries across 16 versions & 2 rubygems