Sha256: 7007db8e094f70aeb8a46cb90c3a50ea5d96e68458684e1e11d7050c9963ad9e

Contents?: true

Size: 1.12 KB

Versions: 18

Compression:

Stored size: 1.12 KB

Contents

# This test verifies that the global.no-ruby config file field disables
# ruby facts
test_name "C99964: no-ruby config field flag disables requiring Ruby" do
  tag 'risk:high'

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

  config = <<EOM
global : {
    no-ruby : true
}
EOM

  agents.each do |agent|
    step "Agent #{agent}: create config file" do
      config_dir = get_default_fact_dir(agent['platform'], on(agent, facter('kernelmajversion')).stdout.chomp.to_f)
      config_file = File.join(config_dir, "facter.conf")
      on(agent, "mkdir -p '#{config_dir}'")
      create_remote_file(agent, config_file, config)

      teardown do
        on(agent, "rm -rf '#{config_dir}'", :acceptable_exit_codes => [0,1])
      end

      step "no-ruby option should disable Ruby and facts requiring Ruby" do
        on(agent, facter("ruby")) do |facter_output|
          assert_equal("", facter_output.stdout.chomp, "Expected Ruby and Ruby fact to be disabled")
          assert_equal("", facter_output.stderr.chomp, "Expected no warnings about Ruby on stderr")
        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_ruby_disables_ruby_facts.rb
facter-4.0.28 acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.2.cfacter.20181217 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.1.cfacter.20181031 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.6.cfacter.20181031 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.1.cfacter.20181023 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.5.cfacter.20181022 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.0.cfacter.20181004 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.0.cfacter.20181001 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.12.0.cfacter.20180918 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.4.cfacter.20180821 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.3.cfacter.20180716 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.2.cfacter.20180612 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.9.6.cfacter.20180612 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.2.cfacter.20180606 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.9.6.cfacter.20180606 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
facter-3.11.0.cfacter.20180319 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb
cfacter-3.11.0.rc.20180314 ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb