Sha256: 4d97e0a66a3bb7ac94d96a98ecffafa638d7a3dceeee967968ebfffb131c875b
Contents?: true
Size: 810 Bytes
Versions: 2
Compression:
Stored size: 810 Bytes
Contents
test_name 'FACT-2054: Custom facts that execute a shell command should expand it' do tag 'risk:high' confine :to, :platform => /el-7/ content = <<-EOM Facter.add(:foo) do setcode do Facter::Core::Execution.execute("cd /opt/puppetlabs && pwd") end end EOM agents.each do |agent| fact_dir = agent.tmpdir('facter') fact_file = File.join(fact_dir, 'test_facts.rb') create_remote_file(agent, fact_file, content) env = {'FACTERLIB' => fact_dir} teardown do on(agent, "rm -rf '#{fact_dir}'") end step "Agent: Verify that command is expanded" do on(agent, facter('foo', :environment => env)) do |facter_result| refute_equal('/opt/puppetlabs', facter_result.stdout.chomp, 'command was not expanded') end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
facter-4.0.29 | acceptance/tests/custom_facts/expand_command.rb |
facter-4.0.28 | acceptance/tests/custom_facts/expand_command.rb |