Sha256: 5a0b5b5203e90d229a3e51f4bfd51f3c0d48c3bef98a112cb35bf0718631b192

Contents?: true

Size: 1.06 KB

Versions: 18

Compression:

Stored size: 1.06 KB

Contents

# This test verified that having debug set to false in the config file can be
# overridden by the command line option --debug
test_name "C100044: flags set on the command line override config file settings" do
  tag 'risk:medium'

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

  config = <<EOM
cli : {
    debug : false
}
EOM

  agents.each do |agent|
    config_dir = get_default_fact_dir(agent['platform'], on(agent, facter('kernelmajversion')).stdout.chomp.to_f)
    config_file = File.join(config_dir, "facter.conf")

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

    step "Agent #{agent}: create config file in default location" do
      on(agent, "mkdir -p '#{config_dir}'")
      create_remote_file(agent, config_file, config)
    end

    step "--debug flag should override debug=false in config file" do
      on(agent, facter("--debug")) do |facter_output|
        assert_match(/DEBUG/, facter_output.stderr, "Expected DEBUG information in stderr")
      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/debug_override_config_file.rb
facter-4.0.28 acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.2.cfacter.20181217 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.1.cfacter.20181031 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.6.cfacter.20181031 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.1.cfacter.20181023 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.5.cfacter.20181022 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.0.cfacter.20181004 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.0.cfacter.20181001 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.12.0.cfacter.20180918 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.4.cfacter.20180821 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.3.cfacter.20180716 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.2.cfacter.20180612 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.9.6.cfacter.20180612 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.2.cfacter.20180606 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.9.6.cfacter.20180606 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
facter-3.11.0.cfacter.20180319 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb
cfacter-3.11.0.rc.20180314 ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb