cfacter 3.11.0.rc.20180314
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ext/facter/Makefile.erb +31 -0
- data/ext/facter/cpp-hocon/CMakeLists.txt +67 -0
- data/ext/facter/cpp-hocon/CONTRIBUTING.md +9 -0
- data/ext/facter/cpp-hocon/LICENSE +17 -0
- data/ext/facter/cpp-hocon/MAINTAINERS +33 -0
- data/ext/facter/cpp-hocon/README.md +74 -0
- data/ext/facter/cpp-hocon/acceptance/Gemfile +18 -0
- data/ext/facter/cpp-hocon/acceptance/Rakefile +7 -0
- data/ext/facter/cpp-hocon/acceptance/tests/fake.rb +0 -0
- data/ext/facter/cpp-hocon/appveyor.yml +41 -0
- data/ext/facter/cpp-hocon/lib/CMakeLists.txt +94 -0
- data/ext/facter/cpp-hocon/lib/Doxyfile.in +2312 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config.hpp +734 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_exception.hpp +184 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_include_context.hpp +51 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_includer.hpp +53 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_includer_file.hpp +30 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_list.hpp +51 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_mergeable.hpp +72 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_object.hpp +81 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_origin.hpp +98 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_parse_options.hpp +139 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_parseable.hpp +47 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_render_options.hpp +128 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_resolve_options.hpp +83 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_syntax.hpp +24 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_value.hpp +267 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/config_value_factory.hpp +48 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/functional_list.hpp +318 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_document.hpp +95 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_document_factory.hpp +39 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/parser/config_node.hpp +32 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/path.hpp +60 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/program_options.hpp +84 -0
- data/ext/facter/cpp-hocon/lib/inc/hocon/types.hpp +57 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/config_document_parser.hpp +83 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/config_parser.hpp +55 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/config_util.hpp +17 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/container.hpp +28 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/default_transformer.hpp +12 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/full_includer.hpp +13 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/abstract_config_node.hpp +16 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/abstract_config_node_value.hpp +12 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_array.hpp +17 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_comment.hpp +14 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_complex_value.hpp +25 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_concatenation.hpp +16 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_field.hpp +29 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_include.hpp +26 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_object.hpp +45 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_path.hpp +25 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_root.hpp +24 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_simple_value.hpp +21 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/nodes/config_node_single_token.hpp +20 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/parseable.hpp +128 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/path_builder.hpp +20 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/path_parser.hpp +55 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/replaceable_merge_stack.hpp +14 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_context.hpp +53 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_result.hpp +21 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/resolve_source.hpp +55 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_config_document.hpp +28 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_config_origin.hpp +67 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_include_context.hpp +22 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/simple_includer.hpp +79 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/substitution_expression.hpp +28 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/token.hpp +45 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/tokenizer.hpp +143 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/tokens.hpp +135 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/unmergeable.hpp +20 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_boolean.hpp +26 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_concatenation.hpp +59 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_delayed_merge.hpp +53 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_delayed_merge_object.hpp +57 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_double.hpp +28 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_int.hpp +25 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_long.hpp +28 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_null.hpp +33 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_number.hpp +38 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_reference.hpp +38 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/config_string.hpp +32 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/simple_config_list.hpp +75 -0
- data/ext/facter/cpp-hocon/lib/inc/internal/values/simple_config_object.hpp +107 -0
- data/ext/facter/cpp-hocon/lib/namespaces.dox.in +6 -0
- data/ext/facter/cpp-hocon/lib/src/config.cc +573 -0
- data/ext/facter/cpp-hocon/lib/src/config_document_factory.cc +24 -0
- data/ext/facter/cpp-hocon/lib/src/config_document_parser.cc +620 -0
- data/ext/facter/cpp-hocon/lib/src/config_parse_options.cc +101 -0
- data/ext/facter/cpp-hocon/lib/src/config_parser.cc +399 -0
- data/ext/facter/cpp-hocon/lib/src/config_render_options.cc +44 -0
- data/ext/facter/cpp-hocon/lib/src/config_resolve_options.cc +24 -0
- data/ext/facter/cpp-hocon/lib/src/config_util.cc +95 -0
- data/ext/facter/cpp-hocon/lib/src/config_value_factory.cc +68 -0
- data/ext/facter/cpp-hocon/lib/src/default_transformer.cc +94 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/abstract_config_node.cc +19 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_array.cc +13 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_comment.cc +15 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_complex_value.cc +50 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_concatenation.cc +14 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_field.cc +80 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_include.cc +38 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_object.cc +318 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_path.cc +47 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_root.cc +70 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_simple_value.cc +50 -0
- data/ext/facter/cpp-hocon/lib/src/nodes/config_node_single_token.cc +18 -0
- data/ext/facter/cpp-hocon/lib/src/parseable.cc +325 -0
- data/ext/facter/cpp-hocon/lib/src/path.cc +219 -0
- data/ext/facter/cpp-hocon/lib/src/path_builder.cc +38 -0
- data/ext/facter/cpp-hocon/lib/src/path_parser.cc +253 -0
- data/ext/facter/cpp-hocon/lib/src/resolve_context.cc +139 -0
- data/ext/facter/cpp-hocon/lib/src/resolve_source.cc +216 -0
- data/ext/facter/cpp-hocon/lib/src/simple_config_document.cc +69 -0
- data/ext/facter/cpp-hocon/lib/src/simple_config_origin.cc +246 -0
- data/ext/facter/cpp-hocon/lib/src/simple_include_context.cc +18 -0
- data/ext/facter/cpp-hocon/lib/src/simple_includer.cc +186 -0
- data/ext/facter/cpp-hocon/lib/src/substitution_expression.cc +35 -0
- data/ext/facter/cpp-hocon/lib/src/token.cc +52 -0
- data/ext/facter/cpp-hocon/lib/src/tokenizer.cc +568 -0
- data/ext/facter/cpp-hocon/lib/src/tokens.cc +257 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_boolean.cc +34 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_concatenation.cc +260 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_delayed_merge.cc +223 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_delayed_merge_object.cc +180 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_double.cc +35 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_int.cc +35 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_long.cc +35 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_null.cc +35 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_number.cc +78 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_object.cc +97 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_reference.cc +85 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_string.cc +47 -0
- data/ext/facter/cpp-hocon/lib/src/values/config_value.cc +289 -0
- data/ext/facter/cpp-hocon/lib/src/values/simple_config_list.cc +219 -0
- data/ext/facter/cpp-hocon/lib/src/values/simple_config_object.cc +515 -0
- data/ext/facter/cpp-hocon/lib/tests/CMakeLists.txt +42 -0
- data/ext/facter/cpp-hocon/lib/tests/concatenation_test.cc +401 -0
- data/ext/facter/cpp-hocon/lib/tests/conf_parser_test.cc +715 -0
- data/ext/facter/cpp-hocon/lib/tests/config_document_parser_test.cc +208 -0
- data/ext/facter/cpp-hocon/lib/tests/config_document_tests.cc +110 -0
- data/ext/facter/cpp-hocon/lib/tests/config_node_test.cc +338 -0
- data/ext/facter/cpp-hocon/lib/tests/config_substitution_test.cc +897 -0
- data/ext/facter/cpp-hocon/lib/tests/config_test.cc +151 -0
- data/ext/facter/cpp-hocon/lib/tests/config_value_factory_test.cc +60 -0
- data/ext/facter/cpp-hocon/lib/tests/config_value_test.cc +111 -0
- data/ext/facter/cpp-hocon/lib/tests/fixtures.hpp.in +3 -0
- data/ext/facter/cpp-hocon/lib/tests/fixtures/test01.conf +91 -0
- data/ext/facter/cpp-hocon/lib/tests/fixtures/test01.json +4 -0
- data/ext/facter/cpp-hocon/lib/tests/main.cc +8 -0
- data/ext/facter/cpp-hocon/lib/tests/path_test.cc +129 -0
- data/ext/facter/cpp-hocon/lib/tests/program_options.cc +63 -0
- data/ext/facter/cpp-hocon/lib/tests/test.conf +1 -0
- data/ext/facter/cpp-hocon/lib/tests/test_utils.cc +452 -0
- data/ext/facter/cpp-hocon/lib/tests/test_utils.hpp +139 -0
- data/ext/facter/cpp-hocon/lib/tests/token_test.cc +108 -0
- data/ext/facter/cpp-hocon/lib/tests/tokenizer_test.cc +694 -0
- data/ext/facter/cpp-hocon/lib/version.h.in +28 -0
- data/ext/facter/cpp-hocon/locales/CMakeLists.txt +4 -0
- data/ext/facter/cpp-hocon/locales/cpp-hocon.pot +767 -0
- data/ext/facter/extconf.rb +22 -0
- data/ext/facter/facter/CMakeLists.txt +183 -0
- data/ext/facter/facter/CONTRIBUTING.md +99 -0
- data/ext/facter/facter/Extensibility.md +133 -0
- data/ext/facter/facter/LICENSE +17 -0
- data/ext/facter/facter/MAINTAINERS +28 -0
- data/ext/facter/facter/README.md +295 -0
- data/ext/facter/facter/Rakefile +42 -0
- data/ext/facter/facter/acceptance/Gemfile +21 -0
- data/ext/facter/facter/acceptance/Rakefile +342 -0
- data/ext/facter/facter/acceptance/bin/ci-bootstrap-from-artifacts.sh +55 -0
- data/ext/facter/facter/acceptance/config/aio/options.rb +9 -0
- data/ext/facter/facter/acceptance/config/git/options.rb +7 -0
- data/ext/facter/facter/acceptance/config/nodes/aix-53-power.yaml +7 -0
- data/ext/facter/facter/acceptance/config/nodes/aix-61-power.yaml +7 -0
- data/ext/facter/facter/acceptance/config/nodes/aix-71-power.yaml +7 -0
- data/ext/facter/facter/acceptance/config/nodes/huaweios-6-powerpc.yaml +7 -0
- data/ext/facter/facter/acceptance/config/nodes/solaris-10-sparc.yaml +9 -0
- data/ext/facter/facter/acceptance/config/nodes/solaris-11-sparc.yaml +9 -0
- data/ext/facter/facter/acceptance/lib/facter/acceptance/base_fact_utils.rb +563 -0
- data/ext/facter/facter/acceptance/lib/facter/acceptance/user_fact_utils.rb +132 -0
- data/ext/facter/facter/acceptance/lib/helper.rb +1 -0
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/common_utils.rb +10 -0
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/git_utils.rb +19 -0
- data/ext/facter/facter/acceptance/lib/puppet/acceptance/install_utils.rb +58 -0
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/010_Install.rb +22 -0
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/021_InstallAristaModule.rb +12 -0
- data/ext/facter/facter/acceptance/setup/aio/pre-suite/022_Remove_LD_PRELOAD.rb +11 -0
- data/ext/facter/facter/acceptance/setup/common/00_EnvSetup.rb +64 -0
- data/ext/facter/facter/acceptance/setup/common/pre-suite/000-delete-puppet-when-none.rb +11 -0
- data/ext/facter/facter/acceptance/setup/git/pre-suite/01_TestSetup.rb +31 -0
- data/ext/facter/facter/acceptance/tests/custom_facts/custom_fact_with_10001_weight_overrides_external_fact.rb +30 -0
- data/ext/facter/facter/acceptance/tests/custom_facts/having_multiple_facts_in_one_file.rb +40 -0
- data/ext/facter/facter/acceptance/tests/custom_facts/using_win32ole_should_not_hang.rb +33 -0
- data/ext/facter/facter/acceptance/tests/external_facts/env_var_overrides_external_fact.rb +46 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_dir_overrides_default_external_fact.rb +34 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact.rb +29 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_10000_weight_or_less.rb +30 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_overrides_custom_fact_with_confine.rb +35 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_fact_stderr_messages_output_to_stderr.rb +49 -0
- data/ext/facter/facter/acceptance/tests/external_facts/external_facts_only_run_once.rb +43 -0
- data/ext/facter/facter/acceptance/tests/external_facts/fact_directory_precedence.rb +109 -0
- data/ext/facter/facter/acceptance/tests/external_facts/non_root_users_default_external_fact_directory.rb +142 -0
- data/ext/facter/facter/acceptance/tests/external_facts/root_uses_default_external_fact_dir.rb +34 -0
- data/ext/facter/facter/acceptance/tests/external_facts/structured_executable_facts.rb +139 -0
- data/ext/facter/facter/acceptance/tests/facter_returns_success_on_non_existent_fact.rb +9 -0
- data/ext/facter/facter/acceptance/tests/facts/dmi.rb +51 -0
- data/ext/facter/facter/acceptance/tests/facts/facterversion.rb +11 -0
- data/ext/facter/facter/acceptance/tests/facts/identity.rb +52 -0
- data/ext/facter/facter/acceptance/tests/facts/networking_facts.rb +76 -0
- data/ext/facter/facter/acceptance/tests/facts/non_root_users_without_errors.rb +32 -0
- data/ext/facter/facter/acceptance/tests/facts/operatingsystem_detection_after_clear_on_ubuntu.rb +26 -0
- data/ext/facter/facter/acceptance/tests/facts/os_processors_and_kernel.rb +20 -0
- data/ext/facter/facter/acceptance/tests/facts/partitions.rb +37 -0
- data/ext/facter/facter/acceptance/tests/facts/productname.rb +15 -0
- data/ext/facter/facter/acceptance/tests/facts/ruby.rb +59 -0
- data/ext/facter/facter/acceptance/tests/facts/validate_file_system_size_bytes.rb +37 -0
- data/ext/facter/facter/acceptance/tests/facts/verify_tmpfs_file_system.rb +54 -0
- data/ext/facter/facter/acceptance/tests/load_libfacter.rb +66 -0
- data/ext/facter/facter/acceptance/tests/no_errors_on_stderr.rb +10 -0
- data/ext/facter/facter/acceptance/tests/options/color.rb +16 -0
- data/ext/facter/facter/acceptance/tests/options/config.rb +27 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/blocklist.rb +35 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/blocklist_from_puppet_facts.rb +40 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_dir_overridden_by_cli_custom_dir.rb +56 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_facts.rb +42 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/custom_facts_list.rb +56 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/debug.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/debug_override_config_file.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/default_file_location.rb +37 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/external_dir_conflicts_with_cli_no_external_facts.rb +37 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/external_dir_overridden_by_cli_external_dir.rb +40 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/external_facts.rb +37 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/external_facts_list.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/load_from_ruby.rb +73 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/log_level.rb +35 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_custom_dir.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_facterlib.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_custom_facts_and_load_path.rb +49 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_external_facts.rb +38 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_external_facts_and_external_dir.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_custom_facts.rb +52 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/no_ruby_disables_ruby_facts.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/trace.rb +48 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_clear_by_empty_ttls_cache_list.rb +71 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_creates_json_cache_file.rb +48 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_do_not_read_the_old_cached_value.rb +58 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_expire_facts_refresh_the_cached_value.rb +61 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_read_from_the_cached_value.rb +57 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_that_are_corrupt_are_refreshed.rb +53 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_cached_facts_that_are_empty_return_an_empty_value.rb +53 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_puppet_facts_creates_json_for_cached_facts.rb +45 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/ttls_puppet_facts_honors_cached_facts.rb +54 -0
- data/ext/facter/facter/acceptance/tests/options/config_file/verbose.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/custom_facts.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/custom_facts_facterlib.rb +33 -0
- data/ext/facter/facter/acceptance/tests/options/custom_facts_list.rb +48 -0
- data/ext/facter/facter/acceptance/tests/options/custom_facts_load_path.rb +42 -0
- data/ext/facter/facter/acceptance/tests/options/debug.rb +12 -0
- data/ext/facter/facter/acceptance/tests/options/external_facts.rb +28 -0
- data/ext/facter/facter/acceptance/tests/options/external_facts_list.rb +35 -0
- data/ext/facter/facter/acceptance/tests/options/help.rb +13 -0
- data/ext/facter/facter/acceptance/tests/options/json.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/list_block_groups.rb +16 -0
- data/ext/facter/facter/acceptance/tests/options/list_cache_groups.rb +16 -0
- data/ext/facter/facter/acceptance/tests/options/log_level.rb +13 -0
- data/ext/facter/facter/acceptance/tests/options/no_block.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_cache_facts.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_load_cached_facts.rb +58 -0
- data/ext/facter/facter/acceptance/tests/options/no_cache_should_not_refresh_cached_facts.rb +63 -0
- data/ext/facter/facter/acceptance/tests/options/no_color.rb +16 -0
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_custom_dir.rb +19 -0
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_facterlib.rb +34 -0
- data/ext/facter/facter/acceptance/tests/options/no_custom_facts_and_load_path.rb +43 -0
- data/ext/facter/facter/acceptance/tests/options/no_external_facts.rb +28 -0
- data/ext/facter/facter/acceptance/tests/options/no_external_facts_and_external_dir.rb +19 -0
- data/ext/facter/facter/acceptance/tests/options/no_ruby.rb +44 -0
- data/ext/facter/facter/acceptance/tests/options/puppet_facts.rb +35 -0
- data/ext/facter/facter/acceptance/tests/options/show_legacy.rb +18 -0
- data/ext/facter/facter/acceptance/tests/options/strict.rb +11 -0
- data/ext/facter/facter/acceptance/tests/options/trace.rb +36 -0
- data/ext/facter/facter/acceptance/tests/options/verbose.rb +12 -0
- data/ext/facter/facter/acceptance/tests/options/version.rb +12 -0
- data/ext/facter/facter/acceptance/tests/options/yaml.rb +43 -0
- data/ext/facter/facter/acceptance/tests/ticket_1123_facter_with_invalid_locale.rb +22 -0
- data/ext/facter/facter/acceptance/tests/ticket_1238_hostname_fqdn.rb +57 -0
- data/ext/facter/facter/appveyor.yml +43 -0
- data/ext/facter/facter/cmake/FindBLKID.cmake +6 -0
- data/ext/facter/facter/cmake/FindCPPHOCON.cmake +6 -0
- data/ext/facter/facter/cmake/FindDependency.cmake +54 -0
- data/ext/facter/facter/cmake/FindOPENSSL.cmake +10 -0
- data/ext/facter/facter/cmake/FindRuby.cmake +286 -0
- data/ext/facter/facter/cmake/FindWHEREAMI.cmake +6 -0
- data/ext/facter/facter/cmake/FindYAMLCPP.cmake +17 -0
- data/ext/facter/facter/contrib/dockerfiles/travis-cpp-builder/Dockerfile +56 -0
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-builder/Dockerfile +23 -0
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/Dockerfile +40 -0
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/_coverity-submit.erb +12 -0
- data/ext/facter/facter/contrib/dockerfiles/travis-facter-coverity/fix_curl_command.patch +32 -0
- data/ext/facter/facter/exe/CMakeLists.txt +39 -0
- data/ext/facter/facter/exe/facter.cc +377 -0
- data/ext/facter/facter/ext/build_defaults.yaml +16 -0
- data/ext/facter/facter/ext/debian/changelog.erb +11 -0
- data/ext/facter/facter/ext/debian/compat +1 -0
- data/ext/facter/facter/ext/debian/control +14 -0
- data/ext/facter/facter/ext/debian/copyright +19 -0
- data/ext/facter/facter/ext/debian/docs +2 -0
- data/ext/facter/facter/ext/debian/facter.install +4 -0
- data/ext/facter/facter/ext/debian/lintian-overrides +0 -0
- data/ext/facter/facter/ext/debian/rules +39 -0
- data/ext/facter/facter/ext/debian/source/format +1 -0
- data/ext/facter/facter/ext/project_data.yaml +30 -0
- data/ext/facter/facter/ext/redhat/facter.spec.erb +113 -0
- data/ext/facter/facter/ext/windows/facter.bat +8 -0
- data/ext/facter/facter/ext/windows/facter_interactive.bat +6 -0
- data/ext/facter/facter/ext/windows/run_facter_interactive.bat +9 -0
- data/ext/facter/facter/factergo/example/main.go +17 -0
- data/ext/facter/facter/factergo/facter.go +42 -0
- data/ext/facter/facter/factergo/facter_test.go +25 -0
- data/ext/facter/facter/lib/CMakeLists.txt +409 -0
- data/ext/facter/facter/lib/Doxyfile +2313 -0
- data/ext/facter/facter/lib/Facter.java.in +110 -0
- data/ext/facter/facter/lib/Gemfile +11 -0
- data/ext/facter/facter/lib/Rakefile +8 -0
- data/ext/facter/facter/lib/docs/generate.rb +25 -0
- data/ext/facter/facter/lib/docs/namespaces.dox +129 -0
- data/ext/facter/facter/lib/docs/template.erb +43 -0
- data/ext/facter/facter/lib/facter.rb.in +45 -0
- data/ext/facter/facter/lib/gemspec.in +21 -0
- data/ext/facter/facter/lib/inc/facter/cwrapper.hpp +18 -0
- data/ext/facter/facter/lib/inc/facter/facts/array_value.hpp +125 -0
- data/ext/facter/facter/lib/inc/facter/facts/collection.hpp +339 -0
- data/ext/facter/facter/lib/inc/facter/facts/external/resolver.hpp +49 -0
- data/ext/facter/facter/lib/inc/facter/facts/fact.hpp +669 -0
- data/ext/facter/facter/lib/inc/facter/facts/map_value.hpp +127 -0
- data/ext/facter/facter/lib/inc/facter/facts/os.hpp +202 -0
- data/ext/facter/facter/lib/inc/facter/facts/os_family.hpp +58 -0
- data/ext/facter/facter/lib/inc/facter/facts/resolver.hpp +126 -0
- data/ext/facter/facter/lib/inc/facter/facts/scalar_value.hpp +152 -0
- data/ext/facter/facter/lib/inc/facter/facts/value.hpp +164 -0
- data/ext/facter/facter/lib/inc/facter/facts/vm.hpp +157 -0
- data/ext/facter/facter/lib/inc/facter/logging/logging.hpp +192 -0
- data/ext/facter/facter/lib/inc/facter/ruby/ruby.hpp +62 -0
- data/ext/facter/facter/lib/inc/facter/util/config.hpp +84 -0
- data/ext/facter/facter/lib/inc/facter/util/string.hpp +72 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/disk_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/filesystem_resolver.hpp +41 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/kernel_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/networking_resolver.hpp +49 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/operating_system_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/aix/serial_number_resolver.hpp +27 -0
- data/ext/facter/facter/lib/inc/internal/facts/bsd/filesystem_resolver.hpp +30 -0
- data/ext/facter/facter/lib/inc/internal/facts/bsd/networking_resolver.hpp +59 -0
- data/ext/facter/facter/lib/inc/internal/facts/bsd/uptime_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/cache.hpp +71 -0
- data/ext/facter/facter/lib/inc/internal/facts/external/execution_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/external/json_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/external/text_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/external/windows/powershell_resolver.hpp +34 -0
- data/ext/facter/facter/lib/inc/internal/facts/external/yaml_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/dmi_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/networking_resolver.hpp +42 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/operating_system_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/virtualization_resolver.hpp +27 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/zfs_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/freebsd/zpool_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/glib/load_average_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/disk_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/dmi_resolver.hpp +37 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/filesystem_resolver.hpp +40 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/fips_resolver.hpp +31 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/kernel_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/networking_resolver.hpp +78 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/operating_system_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_cisco.hpp +114 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_coreos.hpp +56 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_cumulus.hpp +56 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/os_linux.hpp +72 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/processor_resolver.hpp +60 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/release_file.hpp +124 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/uptime_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/linux/virtualization_resolver.hpp +50 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/dmi_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/networking_resolver.hpp +42 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/openbsd/virtualization_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/dmi_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/networking_resolver.hpp +60 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/operating_system_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/system_profiler_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/osx/virtualization_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/identity_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/kernel_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/networking_resolver.hpp +48 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/operating_system_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/ssh_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/timezone_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/uptime_resolver.hpp +32 -0
- data/ext/facter/facter/lib/inc/internal/facts/posix/xen_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/augeas_resolver.hpp +35 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/disk_resolver.hpp +81 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/dmi_resolver.hpp +115 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ec2_resolver.hpp +30 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/filesystem_resolver.hpp +166 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/fips_resolver.hpp +46 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/gce_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/hypervisors_resolver.hpp +69 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/identity_resolver.hpp +73 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/kernel_resolver.hpp +66 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ldom_resolver.hpp +64 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/load_average_resolver.hpp +37 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/memory_resolver.hpp +99 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/networking_resolver.hpp +155 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/operating_system_resolver.hpp +235 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/path_resolver.hpp +28 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/processor_resolver.hpp +80 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ruby_resolver.hpp +56 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/ssh_resolver.hpp +105 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/system_profiler_resolver.hpp +127 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/timezone_resolver.hpp +36 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/uptime_resolver.hpp +36 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/virtualization_resolver.hpp +95 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/xen_resolver.hpp +55 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zfs_resolver.hpp +59 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zone_resolver.hpp +95 -0
- data/ext/facter/facter/lib/inc/internal/facts/resolvers/zpool_resolver.hpp +63 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/disk_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/dmi_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/filesystem_resolver.hpp +29 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/kernel_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/ldom_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/networking_resolver.hpp +48 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/operating_system_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/processor_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/virtualization_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zfs_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zone_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/solaris/zpool_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/dmi_resolver.hpp +38 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/identity_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/kernel_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/memory_resolver.hpp +25 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/networking_resolver.hpp +74 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/operating_system_resolver.hpp +36 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/processor_resolver.hpp +36 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/timezone_resolver.hpp +24 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/uptime_resolver.hpp +32 -0
- data/ext/facter/facter/lib/inc/internal/facts/windows/virtualization_resolver.hpp +37 -0
- data/ext/facter/facter/lib/inc/internal/ruby/aggregate_resolution.hpp +77 -0
- data/ext/facter/facter/lib/inc/internal/ruby/chunk.hpp +83 -0
- data/ext/facter/facter/lib/inc/internal/ruby/confine.hpp +60 -0
- data/ext/facter/facter/lib/inc/internal/ruby/fact.hpp +108 -0
- data/ext/facter/facter/lib/inc/internal/ruby/module.hpp +165 -0
- data/ext/facter/facter/lib/inc/internal/ruby/resolution.hpp +126 -0
- data/ext/facter/facter/lib/inc/internal/ruby/ruby_value.hpp +119 -0
- data/ext/facter/facter/lib/inc/internal/ruby/simple_resolution.hpp +56 -0
- data/ext/facter/facter/lib/inc/internal/util/agent.hpp +29 -0
- data/ext/facter/facter/lib/inc/internal/util/aix/odm.hpp +373 -0
- data/ext/facter/facter/lib/inc/internal/util/aix/vmount.hpp +139 -0
- data/ext/facter/facter/lib/inc/internal/util/bsd/scoped_ifaddrs.hpp +33 -0
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_addrinfo.hpp +45 -0
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_bio.hpp +34 -0
- data/ext/facter/facter/lib/inc/internal/util/posix/scoped_descriptor.hpp +27 -0
- data/ext/facter/facter/lib/inc/internal/util/scoped_file.hpp +36 -0
- data/ext/facter/facter/lib/inc/internal/util/solaris/k_stat.hpp +176 -0
- data/ext/facter/facter/lib/inc/internal/util/solaris/scoped_kstat.hpp +45 -0
- data/ext/facter/facter/lib/inc/internal/util/versions.hpp +34 -0
- data/ext/facter/facter/lib/inc/internal/util/windows/wsa.hpp +92 -0
- data/ext/facter/facter/lib/inc/internal/util/yaml.hpp +25 -0
- data/ext/facter/facter/lib/schema/core_facts.pot +2017 -0
- data/ext/facter/facter/lib/schema/facter.yaml +1947 -0
- data/ext/facter/facter/lib/schema/translation_tooling.rb +67 -0
- data/ext/facter/facter/lib/spec/unit/facter_spec.rb +136 -0
- data/ext/facter/facter/lib/spec_helper.rb.in +27 -0
- data/ext/facter/facter/lib/src/cwrapper.cc +45 -0
- data/ext/facter/facter/lib/src/facts/aix/collection.cc +32 -0
- data/ext/facter/facter/lib/src/facts/aix/disk_resolver.cc +66 -0
- data/ext/facter/facter/lib/src/facts/aix/filesystem_resolver.cc +132 -0
- data/ext/facter/facter/lib/src/facts/aix/kernel_resolver.cc +27 -0
- data/ext/facter/facter/lib/src/facts/aix/memory_resolver.cc +48 -0
- data/ext/facter/facter/lib/src/facts/aix/networking_resolver.cc +245 -0
- data/ext/facter/facter/lib/src/facts/aix/operating_system_resolver.cc +61 -0
- data/ext/facter/facter/lib/src/facts/aix/processor_resolver.cc +106 -0
- data/ext/facter/facter/lib/src/facts/aix/serial_number_resolver.cc +43 -0
- data/ext/facter/facter/lib/src/facts/array_value.cc +111 -0
- data/ext/facter/facter/lib/src/facts/bsd/collection.cc +27 -0
- data/ext/facter/facter/lib/src/facts/bsd/filesystem_resolver.cc +92 -0
- data/ext/facter/facter/lib/src/facts/bsd/networking_resolver.cc +175 -0
- data/ext/facter/facter/lib/src/facts/bsd/uptime_resolver.cc +23 -0
- data/ext/facter/facter/lib/src/facts/cache.cc +117 -0
- data/ext/facter/facter/lib/src/facts/collection.cc +661 -0
- data/ext/facter/facter/lib/src/facts/external/execution_resolver.cc +89 -0
- data/ext/facter/facter/lib/src/facts/external/json_resolver.cc +219 -0
- data/ext/facter/facter/lib/src/facts/external/resolver.cc +12 -0
- data/ext/facter/facter/lib/src/facts/external/text_resolver.cc +45 -0
- data/ext/facter/facter/lib/src/facts/external/windows/powershell_resolver.cc +117 -0
- data/ext/facter/facter/lib/src/facts/external/yaml_resolver.cc +45 -0
- data/ext/facter/facter/lib/src/facts/freebsd/collection.cc +41 -0
- data/ext/facter/facter/lib/src/facts/freebsd/dmi_resolver.cc +43 -0
- data/ext/facter/facter/lib/src/facts/freebsd/memory_resolver.cc +76 -0
- data/ext/facter/facter/lib/src/facts/freebsd/networking_resolver.cc +55 -0
- data/ext/facter/facter/lib/src/facts/freebsd/operating_system_resolver.cc +17 -0
- data/ext/facter/facter/lib/src/facts/freebsd/processor_resolver.cc +63 -0
- data/ext/facter/facter/lib/src/facts/freebsd/virtualization_resolver.cc +41 -0
- data/ext/facter/facter/lib/src/facts/freebsd/zfs_resolver.cc +12 -0
- data/ext/facter/facter/lib/src/facts/freebsd/zpool_resolver.cc +12 -0
- data/ext/facter/facter/lib/src/facts/glib/load_average_resolver.cc +22 -0
- data/ext/facter/facter/lib/src/facts/linux/collection.cc +44 -0
- data/ext/facter/facter/lib/src/facts/linux/disk_resolver.cc +80 -0
- data/ext/facter/facter/lib/src/facts/linux/dmi_resolver.cc +208 -0
- data/ext/facter/facter/lib/src/facts/linux/filesystem_resolver.cc +282 -0
- data/ext/facter/facter/lib/src/facts/linux/fips_resolver.cc +31 -0
- data/ext/facter/facter/lib/src/facts/linux/kernel_resolver.cc +20 -0
- data/ext/facter/facter/lib/src/facts/linux/memory_resolver.cc +50 -0
- data/ext/facter/facter/lib/src/facts/linux/networking_resolver.cc +275 -0
- data/ext/facter/facter/lib/src/facts/linux/operating_system_resolver.cc +175 -0
- data/ext/facter/facter/lib/src/facts/linux/os_linux.cc +393 -0
- data/ext/facter/facter/lib/src/facts/linux/processor_resolver.cc +200 -0
- data/ext/facter/facter/lib/src/facts/linux/uptime_resolver.cc +15 -0
- data/ext/facter/facter/lib/src/facts/linux/virtualization_resolver.cc +282 -0
- data/ext/facter/facter/lib/src/facts/map_value.cc +119 -0
- data/ext/facter/facter/lib/src/facts/openbsd/collection.cc +37 -0
- data/ext/facter/facter/lib/src/facts/openbsd/dmi_resolver.cc +47 -0
- data/ext/facter/facter/lib/src/facts/openbsd/memory_resolver.cc +76 -0
- data/ext/facter/facter/lib/src/facts/openbsd/networking_resolver.cc +55 -0
- data/ext/facter/facter/lib/src/facts/openbsd/processor_resolver.cc +59 -0
- data/ext/facter/facter/lib/src/facts/openbsd/virtualization_resolver.cc +20 -0
- data/ext/facter/facter/lib/src/facts/osx/collection.cc +39 -0
- data/ext/facter/facter/lib/src/facts/osx/dmi_resolver.cc +32 -0
- data/ext/facter/facter/lib/src/facts/osx/memory_resolver.cc +60 -0
- data/ext/facter/facter/lib/src/facts/osx/networking_resolver.cc +71 -0
- data/ext/facter/facter/lib/src/facts/osx/operating_system_resolver.cc +49 -0
- data/ext/facter/facter/lib/src/facts/osx/processor_resolver.cc +55 -0
- data/ext/facter/facter/lib/src/facts/osx/system_profiler_resolver.cc +66 -0
- data/ext/facter/facter/lib/src/facts/osx/virtualization_resolver.cc +46 -0
- data/ext/facter/facter/lib/src/facts/posix/cache.cc +9 -0
- data/ext/facter/facter/lib/src/facts/posix/collection.cc +48 -0
- data/ext/facter/facter/lib/src/facts/posix/identity_resolver.cc +79 -0
- data/ext/facter/facter/lib/src/facts/posix/kernel_resolver.cc +25 -0
- data/ext/facter/facter/lib/src/facts/posix/networking_resolver.cc +136 -0
- data/ext/facter/facter/lib/src/facts/posix/operatingsystem_resolver.cc +29 -0
- data/ext/facter/facter/lib/src/facts/posix/processor_resolver.cc +22 -0
- data/ext/facter/facter/lib/src/facts/posix/ssh_resolver.cc +116 -0
- data/ext/facter/facter/lib/src/facts/posix/timezone_resolver.cc +26 -0
- data/ext/facter/facter/lib/src/facts/posix/uptime_resolver.cc +53 -0
- data/ext/facter/facter/lib/src/facts/posix/xen_resolver.cc +43 -0
- data/ext/facter/facter/lib/src/facts/resolver.cc +105 -0
- data/ext/facter/facter/lib/src/facts/resolvers/augeas_resolver.cc +56 -0
- data/ext/facter/facter/lib/src/facts/resolvers/disk_resolver.cc +69 -0
- data/ext/facter/facter/lib/src/facts/resolvers/dmi_resolver.cc +160 -0
- data/ext/facter/facter/lib/src/facts/resolvers/ec2_resolver.cc +174 -0
- data/ext/facter/facter/lib/src/facts/resolvers/filesystem_resolver.cc +118 -0
- data/ext/facter/facter/lib/src/facts/resolvers/fips_resolver.cc +23 -0
- data/ext/facter/facter/lib/src/facts/resolvers/gce_resolver.cc +276 -0
- data/ext/facter/facter/lib/src/facts/resolvers/hypervisors_resolver.cc +76 -0
- data/ext/facter/facter/lib/src/facts/resolvers/identity_resolver.cc +50 -0
- data/ext/facter/facter/lib/src/facts/resolvers/kernel_resolver.cc +62 -0
- data/ext/facter/facter/lib/src/facts/resolvers/ldom_resolver.cc +60 -0
- data/ext/facter/facter/lib/src/facts/resolvers/load_average_resolver.cc +36 -0
- data/ext/facter/facter/lib/src/facts/resolvers/memory_resolver.cc +88 -0
- data/ext/facter/facter/lib/src/facts/resolvers/networking_resolver.cc +280 -0
- data/ext/facter/facter/lib/src/facts/resolvers/operating_system_resolver.cc +276 -0
- data/ext/facter/facter/lib/src/facts/resolvers/path_resolver.cc +25 -0
- data/ext/facter/facter/lib/src/facts/resolvers/processor_resolver.cc +70 -0
- data/ext/facter/facter/lib/src/facts/resolvers/ruby_resolver.cc +109 -0
- data/ext/facter/facter/lib/src/facts/resolvers/ssh_resolver.cc +77 -0
- data/ext/facter/facter/lib/src/facts/resolvers/system_profiler_resolver.cc +137 -0
- data/ext/facter/facter/lib/src/facts/resolvers/timezone_resolver.cc +27 -0
- data/ext/facter/facter/lib/src/facts/resolvers/uptime_resolver.cc +63 -0
- data/ext/facter/facter/lib/src/facts/resolvers/virtualization_resolver.cc +119 -0
- data/ext/facter/facter/lib/src/facts/resolvers/xen_resolver.cc +80 -0
- data/ext/facter/facter/lib/src/facts/resolvers/zfs_resolver.cc +63 -0
- data/ext/facter/facter/lib/src/facts/resolvers/zone_resolver.cc +91 -0
- data/ext/facter/facter/lib/src/facts/resolvers/zpool_resolver.cc +93 -0
- data/ext/facter/facter/lib/src/facts/scalar_value.cc +73 -0
- data/ext/facter/facter/lib/src/facts/solaris/collection.cc +51 -0
- data/ext/facter/facter/lib/src/facts/solaris/disk_resolver.cc +35 -0
- data/ext/facter/facter/lib/src/facts/solaris/dmi_resolver.cc +86 -0
- data/ext/facter/facter/lib/src/facts/solaris/filesystem_resolver.cc +92 -0
- data/ext/facter/facter/lib/src/facts/solaris/kernel_resolver.cc +24 -0
- data/ext/facter/facter/lib/src/facts/solaris/ldom_resolver.cc +87 -0
- data/ext/facter/facter/lib/src/facts/solaris/memory_resolver.cc +91 -0
- data/ext/facter/facter/lib/src/facts/solaris/networking_resolver.cc +183 -0
- data/ext/facter/facter/lib/src/facts/solaris/operating_system_resolver.cc +83 -0
- data/ext/facter/facter/lib/src/facts/solaris/processor_resolver.cc +105 -0
- data/ext/facter/facter/lib/src/facts/solaris/virtualization_resolver.cc +38 -0
- data/ext/facter/facter/lib/src/facts/solaris/zfs_resolver.cc +12 -0
- data/ext/facter/facter/lib/src/facts/solaris/zone_resolver.cc +33 -0
- data/ext/facter/facter/lib/src/facts/solaris/zpool_resolver.cc +12 -0
- data/ext/facter/facter/lib/src/facts/windows/cache.cc +11 -0
- data/ext/facter/facter/lib/src/facts/windows/collection.cc +91 -0
- data/ext/facter/facter/lib/src/facts/windows/dmi_resolver.cc +38 -0
- data/ext/facter/facter/lib/src/facts/windows/identity_resolver.cc +46 -0
- data/ext/facter/facter/lib/src/facts/windows/kernel_resolver.cc +78 -0
- data/ext/facter/facter/lib/src/facts/windows/memory_resolver.cc +25 -0
- data/ext/facter/facter/lib/src/facts/windows/networking_resolver.cc +227 -0
- data/ext/facter/facter/lib/src/facts/windows/operating_system_resolver.cc +125 -0
- data/ext/facter/facter/lib/src/facts/windows/processor_resolver.cc +99 -0
- data/ext/facter/facter/lib/src/facts/windows/timezone_resolver.cc +28 -0
- data/ext/facter/facter/lib/src/facts/windows/uptime_resolver.cc +26 -0
- data/ext/facter/facter/lib/src/facts/windows/virtualization_resolver.cc +63 -0
- data/ext/facter/facter/lib/src/java/facter.cc +185 -0
- data/ext/facter/facter/lib/src/logging/logging.cc +151 -0
- data/ext/facter/facter/lib/src/ruby/aggregate_resolution.cc +249 -0
- data/ext/facter/facter/lib/src/ruby/chunk.cc +136 -0
- data/ext/facter/facter/lib/src/ruby/confine.cc +84 -0
- data/ext/facter/facter/lib/src/ruby/fact.cc +382 -0
- data/ext/facter/facter/lib/src/ruby/module.cc +1130 -0
- data/ext/facter/facter/lib/src/ruby/resolution.cc +230 -0
- data/ext/facter/facter/lib/src/ruby/ruby.cc +150 -0
- data/ext/facter/facter/lib/src/ruby/ruby_value.cc +288 -0
- data/ext/facter/facter/lib/src/ruby/simple_resolution.cc +156 -0
- data/ext/facter/facter/lib/src/util/bsd/scoped_ifaddrs.cc +29 -0
- data/ext/facter/facter/lib/src/util/config/config.cc +83 -0
- data/ext/facter/facter/lib/src/util/config/posix/config.cc +12 -0
- data/ext/facter/facter/lib/src/util/config/windows/config.cc +14 -0
- data/ext/facter/facter/lib/src/util/posix/scoped_addrinfo.cc +41 -0
- data/ext/facter/facter/lib/src/util/posix/scoped_bio.cc +29 -0
- data/ext/facter/facter/lib/src/util/posix/scoped_descriptor.cc +20 -0
- data/ext/facter/facter/lib/src/util/scoped_file.cc +26 -0
- data/ext/facter/facter/lib/src/util/solaris/k_stat.cc +165 -0
- data/ext/facter/facter/lib/src/util/solaris/scoped_kstat.cc +31 -0
- data/ext/facter/facter/lib/src/util/string.cc +170 -0
- data/ext/facter/facter/lib/src/util/windows/wsa.cc +69 -0
- data/ext/facter/facter/lib/src/util/yaml.cc +72 -0
- data/ext/facter/facter/lib/tasks/spec.rake +26 -0
- data/ext/facter/facter/lib/tests/CMakeLists.txt +172 -0
- data/ext/facter/facter/lib/tests/collection_fixture.cc +15 -0
- data/ext/facter/facter/lib/tests/collection_fixture.hpp +19 -0
- data/ext/facter/facter/lib/tests/cwrapper.cc +22 -0
- data/ext/facter/facter/lib/tests/facts/array_value.cc +140 -0
- data/ext/facter/facter/lib/tests/facts/boolean_value.cc +67 -0
- data/ext/facter/facter/lib/tests/facts/cache.cc +100 -0
- data/ext/facter/facter/lib/tests/facts/collection.cc +576 -0
- data/ext/facter/facter/lib/tests/facts/double_value.cc +40 -0
- data/ext/facter/facter/lib/tests/facts/external/json_resolver.cc +62 -0
- data/ext/facter/facter/lib/tests/facts/external/posix/execution_resolver.cc +69 -0
- data/ext/facter/facter/lib/tests/facts/external/text_resolver.cc +46 -0
- data/ext/facter/facter/lib/tests/facts/external/windows/execution_resolver.cc +69 -0
- data/ext/facter/facter/lib/tests/facts/external/windows/powershell_resolver.cc +122 -0
- data/ext/facter/facter/lib/tests/facts/external/yaml_resolver.cc +70 -0
- data/ext/facter/facter/lib/tests/facts/integer_value.cc +69 -0
- data/ext/facter/facter/lib/tests/facts/linux/dmi_resolver.cc +116 -0
- data/ext/facter/facter/lib/tests/facts/linux/filesystem_resolver.cc +13 -0
- data/ext/facter/facter/lib/tests/facts/linux/processor_fixture.cc +259 -0
- data/ext/facter/facter/lib/tests/facts/linux/processor_fixture.hpp +77 -0
- data/ext/facter/facter/lib/tests/facts/linux/processor_resolver.cc +312 -0
- data/ext/facter/facter/lib/tests/facts/linux/virtualization_resolver.cc +48 -0
- data/ext/facter/facter/lib/tests/facts/map_value.cc +116 -0
- data/ext/facter/facter/lib/tests/facts/posix/collection.cc +39 -0
- data/ext/facter/facter/lib/tests/facts/posix/uptime_resolver.cc +52 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/augeas_resolver.cc +58 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/disk_resolver.cc +114 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/dmi_resolver.cc +152 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/filesystem_resolver.cc +206 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/identity_resolver.cc +83 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/kernel_resolver.cc +61 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/ldom_resolver.cc +86 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/memory_resolver.cc +135 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/networking_resolver.cc +507 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/operating_system_resolver.cc +247 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/processor_resolver.cc +157 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/ruby_resolver.cc +74 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/ssh_resolver.cc +103 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/system_profiler_resolver.cc +135 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/timezone_resolver.cc +49 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/uptime_resolver.cc +151 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/virtualization_resolver.cc +175 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/xen_resolver.cc +100 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/zfs_resolver.cc +65 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/zone_resolver.cc +122 -0
- data/ext/facter/facter/lib/tests/facts/resolvers/zpool_resolver.cc +69 -0
- data/ext/facter/facter/lib/tests/facts/schema.cc +796 -0
- data/ext/facter/facter/lib/tests/facts/string_value.cc +270 -0
- data/ext/facter/facter/lib/tests/facts/windows/collection.cc +60 -0
- data/ext/facter/facter/lib/tests/facts/windows/networking_resolver.cc +217 -0
- data/ext/facter/facter/lib/tests/fixtures.cc +62 -0
- data/ext/facter/facter/lib/tests/fixtures.hpp.in +27 -0
- data/ext/facter/facter/lib/tests/fixtures/execution/with space/command_with_space.bat +2 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/json/facts.json +12 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/json/invalid.json +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/ordering/bar/foo.yaml +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/ordering/foo/foo.yaml +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/error_message +4 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/facts +5 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/failed +3 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/posix/execution/not_executable +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/text/facts.txt +4 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/error_message.bat +4 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/facts.bat +4 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/failed.cmd +2 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/not_executable +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/execution/ruby_script.rb +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/error_message.ps1 +3 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/facts.ps1 +4 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/failed.ps1 +2 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/json.ps1 +21 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/not_executable +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/windows/powershell/yaml.ps1 +18 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/yaml/facts.yaml +15 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/yaml/invalid.yaml +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/z/303/266/facts.rb +3 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/external/z/303/266/facts.txt +1 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/azure +3 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/azure-unknown +3 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/cloud/not-azure +0 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/full.txt +83 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/full_alternative.txt +83 -0
- data/ext/facter/facter/lib/tests/fixtures/facts/linux/dmidecode/none.txt +2 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/100_resolutions.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/101_resolutions.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_invalid_require.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_block.rb +30 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_cycle.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_invalid_merge.rb +13 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_merge.rb +23 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/aggregate_with_require.rb +16 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/array_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/array_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/bad_command.rb +19 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/bad_syntax.rb +2 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/bignum_fact_value.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_confine.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_false_confine.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_nil_confine.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/block_true_confine.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_false_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_false_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_true_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/boolean_true_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/command_with_space.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/confine_missing_fact.rb +22 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/confine_weight.rb +20 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/custom_dir/expect_network_init.rb +15 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/cycle.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/debug.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/debugging.rb +14 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/debugonce.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/define_aggregate_fact.rb +13 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/define_fact.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/double_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_command.rb +3 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_fact.rb +1 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_fact_with_value.rb +1 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/empty_setcode_command.rb +3 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/exec.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_on_fail_raise.rb +17 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_on_fail_value.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/execute_timeout.rb +1 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/execution_failure.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/existing_aggregate_resolution.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/existing_simple_resolution.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/fact.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/facter.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/facterversion.rb +17 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/hash_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/hash_with_non_string_key.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/integer_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/log_exception.rb +21 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/lookup.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/multi_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/named_resolution.rb +13 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/negative_number.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/nil_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/nonexistent_command.rb +21 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/on_message.rb +16 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/range_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/regexp_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/ruby.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple.rb +11 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_command.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_confine.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/simple_resolution.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/single_allocation.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/stderr_output.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/string_fact.rb +5 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/timeout.rb +10 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/trace.rb +22 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/uni/341/220/201dir/customfacts/342/204/242.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/uses_exit_code.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/value.rb +6 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/version.rb +2 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/warn.rb +7 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/warnonce.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/weight.rb +20 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/weight_option.rb +17 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/which.rb +9 -0
- data/ext/facter/facter/lib/tests/fixtures/ruby/windows/ole.rb +7 -0
- data/ext/facter/facter/lib/tests/java/facter.cc +69 -0
- data/ext/facter/facter/lib/tests/log_capture.cc +29 -0
- data/ext/facter/facter/lib/tests/log_capture.hpp +35 -0
- data/ext/facter/facter/lib/tests/logging/logging.cc +69 -0
- data/ext/facter/facter/lib/tests/main.cc +20 -0
- data/ext/facter/facter/lib/tests/mock_server.cc +44 -0
- data/ext/facter/facter/lib/tests/mock_server.hpp +25 -0
- data/ext/facter/facter/lib/tests/ruby/ruby.cc +634 -0
- data/ext/facter/facter/lib/tests/ruby/ruby_dirfacts.cc +35 -0
- data/ext/facter/facter/lib/tests/ruby/ruby_helper.cc +41 -0
- data/ext/facter/facter/lib/tests/ruby/ruby_helper.hpp +8 -0
- data/ext/facter/facter/lib/tests/ruby/windows/ruby.cc +53 -0
- data/ext/facter/facter/lib/tests/util/bsd/scoped_ifaddrs.cc +10 -0
- data/ext/facter/facter/lib/tests/util/posix/scoped_addrinfo.cc +11 -0
- data/ext/facter/facter/lib/tests/util/posix/scoped_bio.cc +12 -0
- data/ext/facter/facter/lib/tests/util/posix/scoped_descriptor.cc +22 -0
- data/ext/facter/facter/lib/tests/util/string.cc +291 -0
- data/ext/facter/facter/lib/version.h.in +28 -0
- data/ext/facter/facter/locales/CMakeLists.txt +7 -0
- data/ext/facter/facter/locales/FACTER.pot +1508 -0
- data/ext/facter/facter/man/man8/facter.8 +205 -0
- data/ext/facter/facter/scripts/cpplint.py +4754 -0
- data/ext/facter/facter/scripts/travis_target.sh +83 -0
- data/ext/facter/facter/tasks/ci.rake +22 -0
- data/ext/facter/leatherman/CHANGELOG.md +430 -0
- data/ext/facter/leatherman/CMakeLists.txt +143 -0
- data/ext/facter/leatherman/CONTRIBUTING.md +98 -0
- data/ext/facter/leatherman/LICENSE +17 -0
- data/ext/facter/leatherman/LeathermanConfig.cmake.in +57 -0
- data/ext/facter/leatherman/LeathermanConfigVersion.cmake.in +11 -0
- data/ext/facter/leatherman/MAINTAINERS +28 -0
- data/ext/facter/leatherman/README.md +416 -0
- data/ext/facter/leatherman/appveyor.yml +47 -0
- data/ext/facter/leatherman/catch/CMakeLists.txt +1 -0
- data/ext/facter/leatherman/cmake/FindICU.cmake +690 -0
- data/ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake +130 -0
- data/ext/facter/leatherman/cmake/GetGitRevisionDescription.cmake.in +38 -0
- data/ext/facter/leatherman/cmake/cflags.cmake +110 -0
- data/ext/facter/leatherman/cmake/generate_translations.cmake +17 -0
- data/ext/facter/leatherman/cmake/internal.cmake +241 -0
- data/ext/facter/leatherman/cmake/leatherman.cmake.in +369 -0
- data/ext/facter/leatherman/cmake/leatherman_config.cmake +80 -0
- data/ext/facter/leatherman/cmake/normalize_pot.cmake +17 -0
- data/ext/facter/leatherman/cmake/options.cmake +21 -0
- data/ext/facter/leatherman/cmake/pod2man.cmake +36 -0
- data/ext/facter/leatherman/curl/CMakeLists.txt +42 -0
- data/ext/facter/leatherman/curl/inc/leatherman/curl/client.hpp +441 -0
- data/ext/facter/leatherman/curl/inc/leatherman/curl/request.hpp +130 -0
- data/ext/facter/leatherman/curl/inc/leatherman/curl/response.hpp +80 -0
- data/ext/facter/leatherman/curl/src/client.cc +575 -0
- data/ext/facter/leatherman/curl/src/request.cc +112 -0
- data/ext/facter/leatherman/curl/src/response.cc +62 -0
- data/ext/facter/leatherman/curl/tests/CMakeLists.txt +22 -0
- data/ext/facter/leatherman/curl/tests/client_test.cc +613 -0
- data/ext/facter/leatherman/curl/tests/fixtures.cc +27 -0
- data/ext/facter/leatherman/curl/tests/fixtures.hpp +31 -0
- data/ext/facter/leatherman/curl/tests/mock_curl.cc +423 -0
- data/ext/facter/leatherman/curl/tests/mock_curl.hpp +85 -0
- data/ext/facter/leatherman/curl/tests/request_test.cc +85 -0
- data/ext/facter/leatherman/curl/tests/response_test.cc +58 -0
- data/ext/facter/leatherman/dynamic_library/CMakeLists.txt +43 -0
- data/ext/facter/leatherman/dynamic_library/inc/leatherman/dynamic_library/dynamic_library.hpp +122 -0
- data/ext/facter/leatherman/dynamic_library/src/dynamic_library.cc +57 -0
- data/ext/facter/leatherman/dynamic_library/src/posix/dynamic_library.cc +91 -0
- data/ext/facter/leatherman/dynamic_library/src/windows/dynamic_library.cc +128 -0
- data/ext/facter/leatherman/dynamic_library/tests/dynamic_library_tests.cc +94 -0
- data/ext/facter/leatherman/dynamic_library/tests/fixtures.hpp.in +3 -0
- data/ext/facter/leatherman/dynamic_library/tests/test-lib/goodbye.cc +5 -0
- data/ext/facter/leatherman/dynamic_library/tests/test-lib/hello.cc +7 -0
- data/ext/facter/leatherman/execution/CMakeLists.txt +65 -0
- data/ext/facter/leatherman/execution/inc/leatherman/execution/execution.hpp +488 -0
- data/ext/facter/leatherman/execution/src/execution.cc +510 -0
- data/ext/facter/leatherman/execution/src/posix/execution.cc +574 -0
- data/ext/facter/leatherman/execution/src/posix/generic/platform.cc +30 -0
- data/ext/facter/leatherman/execution/src/posix/platform.hpp +15 -0
- data/ext/facter/leatherman/execution/src/posix/solaris/platform.cc +197 -0
- data/ext/facter/leatherman/execution/src/windows/execution.cc +698 -0
- data/ext/facter/leatherman/execution/tests/fixtures.hpp.in +2 -0
- data/ext/facter/leatherman/execution/tests/fixtures/echo_pid +2 -0
- data/ext/facter/leatherman/execution/tests/fixtures/error_message +5 -0
- data/ext/facter/leatherman/execution/tests/fixtures/execution/selfkill.sh +3 -0
- data/ext/facter/leatherman/execution/tests/fixtures/execution/sleep.sh +3 -0
- data/ext/facter/leatherman/execution/tests/fixtures/facts +5 -0
- data/ext/facter/leatherman/execution/tests/fixtures/failed +3 -0
- data/ext/facter/leatherman/execution/tests/fixtures/ls/crlf.txt +3 -0
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file1.txt +1 -0
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file2.txt +1 -0
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file3.txt +1 -0
- data/ext/facter/leatherman/execution/tests/fixtures/ls/file4.txt +7 -0
- data/ext/facter/leatherman/execution/tests/fixtures/not_executable +1 -0
- data/ext/facter/leatherman/execution/tests/fixtures/windows/error_message.bat +6 -0
- data/ext/facter/leatherman/execution/tests/fixtures/windows/facts.bat +4 -0
- data/ext/facter/leatherman/execution/tests/fixtures/windows/failed.cmd +2 -0
- data/ext/facter/leatherman/execution/tests/fixtures/windows/not_executable +1 -0
- data/ext/facter/leatherman/execution/tests/fixtures/windows/ruby_script.rb +1 -0
- data/ext/facter/leatherman/execution/tests/log_capture.cc +29 -0
- data/ext/facter/leatherman/execution/tests/log_capture.hpp +35 -0
- data/ext/facter/leatherman/execution/tests/lth_cat.cc +38 -0
- data/ext/facter/leatherman/execution/tests/lth_cat.hpp +9 -0
- data/ext/facter/leatherman/execution/tests/posix/execution.cc +728 -0
- data/ext/facter/leatherman/execution/tests/posix/solaris/execution.cc +54 -0
- data/ext/facter/leatherman/execution/tests/windows/execution.cc +789 -0
- data/ext/facter/leatherman/file_util/CMakeLists.txt +18 -0
- data/ext/facter/leatherman/file_util/inc/leatherman/file_util/directory.hpp +28 -0
- data/ext/facter/leatherman/file_util/inc/leatherman/file_util/file.hpp +95 -0
- data/ext/facter/leatherman/file_util/src/directory.cc +51 -0
- data/ext/facter/leatherman/file_util/src/file.cc +131 -0
- data/ext/facter/leatherman/file_util/tests/directory_utils_test.cc +87 -0
- data/ext/facter/leatherman/file_util/tests/file_utils_test.cc +195 -0
- data/ext/facter/leatherman/file_util/tests/fixtures.cc +37 -0
- data/ext/facter/leatherman/file_util/tests/fixtures.hpp +39 -0
- data/ext/facter/leatherman/json_container/CMakeLists.txt +11 -0
- data/ext/facter/leatherman/json_container/README.md +108 -0
- data/ext/facter/leatherman/json_container/inc/leatherman/json_container/json_container.hpp +443 -0
- data/ext/facter/leatherman/json_container/src/json_container.cc +655 -0
- data/ext/facter/leatherman/json_container/tests/json_container_test.cc +1129 -0
- data/ext/facter/leatherman/locale/CMakeLists.txt +46 -0
- data/ext/facter/leatherman/locale/disabled/locale.cc +38 -0
- data/ext/facter/leatherman/locale/inc/leatherman/locale/locale.hpp +263 -0
- data/ext/facter/leatherman/locale/locales/CMakeLists.txt +6 -0
- data/ext/facter/leatherman/locale/locales/fr.po +40 -0
- data/ext/facter/leatherman/locale/locales/leatherman_locale.pot +41 -0
- data/ext/facter/leatherman/locale/src/locale.cc +95 -0
- data/ext/facter/leatherman/locale/tests/format.cc +117 -0
- data/ext/facter/leatherman/locale/tests/locale.cc +190 -0
- data/ext/facter/leatherman/locales/CMakeLists.txt +7 -0
- data/ext/facter/leatherman/locales/leatherman.pot +717 -0
- data/ext/facter/leatherman/logging/CMakeLists.txt +43 -0
- data/ext/facter/leatherman/logging/inc/leatherman/logging/logging.hpp +264 -0
- data/ext/facter/leatherman/logging/locales/CMakeLists.txt +6 -0
- data/ext/facter/leatherman/logging/locales/fr.po +72 -0
- data/ext/facter/leatherman/logging/locales/leatherman_logging.pot +72 -0
- data/ext/facter/leatherman/logging/src/logging.cc +229 -0
- data/ext/facter/leatherman/logging/src/posix/logging.cc +39 -0
- data/ext/facter/leatherman/logging/src/windows/logging.cc +52 -0
- data/ext/facter/leatherman/logging/tests/logging.cc +118 -0
- data/ext/facter/leatherman/logging/tests/logging.hpp +88 -0
- data/ext/facter/leatherman/logging/tests/logging_i18n.cc +103 -0
- data/ext/facter/leatherman/logging/tests/logging_on_message.cc +61 -0
- data/ext/facter/leatherman/logging/tests/logging_stream.cc +159 -0
- data/ext/facter/leatherman/logging/tests/logging_stream_lines.cc +172 -0
- data/ext/facter/leatherman/logging/tests/posix/logging.cc +23 -0
- data/ext/facter/leatherman/logging/tests/windows/logging.cc +13 -0
- data/ext/facter/leatherman/nowide/CMakeLists.txt +7 -0
- data/ext/facter/leatherman/rapidjson/CMakeLists.txt +1 -0
- data/ext/facter/leatherman/ruby/CMakeLists.txt +26 -0
- data/ext/facter/leatherman/ruby/inc/leatherman/ruby/api.hpp +744 -0
- data/ext/facter/leatherman/ruby/src/api.cc +527 -0
- data/ext/facter/leatherman/ruby/src/posix/api.cc +14 -0
- data/ext/facter/leatherman/ruby/src/windows/api.cc +20 -0
- data/ext/facter/leatherman/ruby/tests/api-test.cc +206 -0
- data/ext/facter/leatherman/scripts/cpplint.py +6323 -0
- data/ext/facter/leatherman/tests/CMakeLists.txt +22 -0
- data/ext/facter/leatherman/tests/main.cc +17 -0
- data/ext/facter/leatherman/util/CMakeLists.txt +36 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/environment.hpp +69 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/option_set.hpp +228 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/posix/scoped_descriptor.hpp +32 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/regex.hpp +80 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/scope_exit.hpp +62 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/scoped_env.hpp +35 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/scoped_resource.hpp +130 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/strings.hpp +54 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/time.hpp +36 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/timer.hpp +43 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/uri.hpp +23 -0
- data/ext/facter/leatherman/util/inc/leatherman/util/windows/scoped_handle.hpp +32 -0
- data/ext/facter/leatherman/util/src/environment.cc +29 -0
- data/ext/facter/leatherman/util/src/posix/environment.cc +75 -0
- data/ext/facter/leatherman/util/src/posix/scoped_descriptor.cc +23 -0
- data/ext/facter/leatherman/util/src/posix/time.cc +9 -0
- data/ext/facter/leatherman/util/src/scope_exit.cc +43 -0
- data/ext/facter/leatherman/util/src/scoped_env.cc +37 -0
- data/ext/facter/leatherman/util/src/strings.cc +41 -0
- data/ext/facter/leatherman/util/src/time.cc +49 -0
- data/ext/facter/leatherman/util/src/uri.cc +75 -0
- data/ext/facter/leatherman/util/src/windows/environment.cc +75 -0
- data/ext/facter/leatherman/util/src/windows/scoped_handle.cc +24 -0
- data/ext/facter/leatherman/util/src/windows/time.cc +10 -0
- data/ext/facter/leatherman/util/tests/environment.cc +90 -0
- data/ext/facter/leatherman/util/tests/option_set.cc +234 -0
- data/ext/facter/leatherman/util/tests/posix/environment.cc +36 -0
- data/ext/facter/leatherman/util/tests/scoped_env.cc +52 -0
- data/ext/facter/leatherman/util/tests/strings_test.cc +71 -0
- data/ext/facter/leatherman/util/tests/timer.cc +39 -0
- data/ext/facter/leatherman/util/tests/uri.cc +104 -0
- data/ext/facter/leatherman/util/tests/windows/environment.cc +30 -0
- data/ext/facter/leatherman/vendor/Catch-1.10.0.zip +0 -0
- data/ext/facter/leatherman/vendor/nowide/build/Jamfile.v2 +26 -0
- data/ext/facter/leatherman/vendor/nowide/doc/Doxyfile +1632 -0
- data/ext/facter/leatherman/vendor/nowide/doc/LICENSE_1_0.txt +23 -0
- data/ext/facter/leatherman/vendor/nowide/doc/gendoc.sh +11 -0
- data/ext/facter/leatherman/vendor/nowide/doc/main.txt +354 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/args.hpp +167 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cenv.hpp +126 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/config.hpp +54 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/convert.hpp +154 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdio.hpp +101 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/cstdlib.hpp +16 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/filebuf.hpp +415 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/fstream.hpp +283 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/integration/filesystem.hpp +28 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/iostream.hpp +99 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/stackstring.hpp +154 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/system.hpp +46 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/utf8_codecvt.hpp +499 -0
- data/ext/facter/leatherman/vendor/nowide/include/boost/nowide/windows.hpp +39 -0
- data/ext/facter/leatherman/vendor/nowide/index.html +16 -0
- data/ext/facter/leatherman/vendor/nowide/src/iostream.cpp +263 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/CMakeLists.txt +104 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/MinGW.cmake +9 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/config.hpp +37 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/convert +34 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/encoding_errors.hpp +58 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/encoding_utf.hpp +84 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/run_convert_and_build.sh +17 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/scoped_ptr.hpp +93 -0
- data/ext/facter/leatherman/vendor/nowide/standalone/utf.hpp +469 -0
- data/ext/facter/leatherman/vendor/nowide/template.hpp +19 -0
- data/ext/facter/leatherman/vendor/nowide/test/Jamfile.v2 +43 -0
- data/ext/facter/leatherman/vendor/nowide/test/test.hpp +25 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_codecvt.cpp +254 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_convert.cpp +101 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_env.cpp +49 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_fs.cpp +48 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_fstream.cpp +184 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_iostream.cpp +52 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_stdio.cpp +60 -0
- data/ext/facter/leatherman/vendor/nowide/test/test_system.cpp +91 -0
- data/ext/facter/leatherman/vendor/rapidjson-1.0.2.zip +0 -0
- data/ext/facter/leatherman/windows/CMakeLists.txt +27 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/file_util.hpp +23 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/process.hpp +22 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/registry.hpp +56 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/system_error.hpp +23 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/user.hpp +30 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/windows.hpp +10 -0
- data/ext/facter/leatherman/windows/inc/leatherman/windows/wmi.hpp +188 -0
- data/ext/facter/leatherman/windows/src/file_util.cc +28 -0
- data/ext/facter/leatherman/windows/src/process.cc +42 -0
- data/ext/facter/leatherman/windows/src/registry.cc +96 -0
- data/ext/facter/leatherman/windows/src/system_error.cc +33 -0
- data/ext/facter/leatherman/windows/src/user.cc +76 -0
- data/ext/facter/leatherman/windows/src/wmi.cc +208 -0
- data/ext/facter/leatherman/windows/tests/file_utils_test.cc +13 -0
- metadata +1089 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
#include <catch.hpp>
|
2
|
+
#include <internal/facts/resolvers/identity_resolver.hpp>
|
3
|
+
#include <facter/facts/collection.hpp>
|
4
|
+
#include <facter/facts/fact.hpp>
|
5
|
+
#include <facter/facts/scalar_value.hpp>
|
6
|
+
#include <facter/facts/map_value.hpp>
|
7
|
+
#include "../../collection_fixture.hpp"
|
8
|
+
|
9
|
+
using namespace std;
|
10
|
+
using namespace facter::facts;
|
11
|
+
using namespace facter::facts::resolvers;
|
12
|
+
using namespace facter::testing;
|
13
|
+
|
14
|
+
struct empty_identity_resolver : identity_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
virtual data collect_data(collection& facts) override
|
18
|
+
{
|
19
|
+
return {};
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
struct test_identity_resolver : identity_resolver
|
24
|
+
{
|
25
|
+
protected:
|
26
|
+
virtual data collect_data(collection& facts) override
|
27
|
+
{
|
28
|
+
data result;
|
29
|
+
result.group_id = 123;
|
30
|
+
result.group_name = "foo";
|
31
|
+
result.user_id = 456;
|
32
|
+
result.user_name = "bar";
|
33
|
+
result.privileged = false;
|
34
|
+
return result;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
SCENARIO("using the identity resolver") {
|
39
|
+
collection_fixture facts;
|
40
|
+
WHEN("data is not present") {
|
41
|
+
facts.add(make_shared<empty_identity_resolver>());
|
42
|
+
THEN("facts should not be added") {
|
43
|
+
REQUIRE(facts.size() == 0u);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
WHEN("data is present") {
|
47
|
+
facts.add(make_shared<test_identity_resolver>());
|
48
|
+
THEN("a structured fact is added") {
|
49
|
+
auto identity = facts.get<map_value>(fact::identity);
|
50
|
+
REQUIRE(identity);
|
51
|
+
REQUIRE(identity->size() == 5u);
|
52
|
+
|
53
|
+
auto name = identity->get<string_value>("group");
|
54
|
+
REQUIRE(name);
|
55
|
+
REQUIRE(name->value() == "foo");
|
56
|
+
|
57
|
+
auto id = identity->get<integer_value>("gid");
|
58
|
+
REQUIRE(id);
|
59
|
+
REQUIRE(id->value() == 123);
|
60
|
+
|
61
|
+
name = identity->get<string_value>("user");
|
62
|
+
REQUIRE(name);
|
63
|
+
REQUIRE(name->value() == "bar");
|
64
|
+
|
65
|
+
id = identity->get<integer_value>("uid");
|
66
|
+
REQUIRE(id);
|
67
|
+
REQUIRE(id->value() == 456);
|
68
|
+
|
69
|
+
auto privileged = identity->get<boolean_value>("privileged");
|
70
|
+
REQUIRE(privileged);
|
71
|
+
REQUIRE(privileged->value() == false);
|
72
|
+
}
|
73
|
+
THEN("flat facts are added") {
|
74
|
+
auto name = facts.get<string_value>(fact::gid);
|
75
|
+
REQUIRE(name);
|
76
|
+
REQUIRE(name->value() == "foo");
|
77
|
+
|
78
|
+
name = facts.get<string_value>(fact::id);
|
79
|
+
REQUIRE(name);
|
80
|
+
REQUIRE(name->value() == "bar");
|
81
|
+
}
|
82
|
+
}
|
83
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
#include <catch.hpp>
|
2
|
+
#include <internal/facts/resolvers/kernel_resolver.hpp>
|
3
|
+
#include <facter/facts/collection.hpp>
|
4
|
+
#include <facter/facts/fact.hpp>
|
5
|
+
#include <facter/facts/scalar_value.hpp>
|
6
|
+
#include "../../collection_fixture.hpp"
|
7
|
+
|
8
|
+
using namespace std;
|
9
|
+
using namespace facter::facts;
|
10
|
+
using namespace facter::facts::resolvers;
|
11
|
+
using namespace facter::testing;
|
12
|
+
|
13
|
+
struct empty_kernel_resolver : kernel_resolver
|
14
|
+
{
|
15
|
+
protected:
|
16
|
+
virtual data collect_data(collection& facts) override
|
17
|
+
{
|
18
|
+
return {};
|
19
|
+
}
|
20
|
+
};
|
21
|
+
|
22
|
+
struct test_kernel_resolver : kernel_resolver
|
23
|
+
{
|
24
|
+
protected:
|
25
|
+
virtual data collect_data(collection& facts) override
|
26
|
+
{
|
27
|
+
data result;
|
28
|
+
result.name = "foo";
|
29
|
+
result.release = "1.2.3-foo";
|
30
|
+
result.version = "1.2.3";
|
31
|
+
return result;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
SCENARIO("using the kernel resolver") {
|
36
|
+
collection_fixture facts;
|
37
|
+
WHEN("data is not present") {
|
38
|
+
facts.add(make_shared<empty_kernel_resolver>());
|
39
|
+
THEN("facts should not be added") {
|
40
|
+
REQUIRE(facts.size() == 0u);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
WHEN("data is present") {
|
44
|
+
facts.add(make_shared<test_kernel_resolver>());
|
45
|
+
THEN("flat facts are added") {
|
46
|
+
REQUIRE(facts.size() == 4u);
|
47
|
+
auto kernel = facts.get<string_value>(fact::kernel);
|
48
|
+
REQUIRE(kernel);
|
49
|
+
REQUIRE(kernel->value() == "foo");
|
50
|
+
auto release = facts.get<string_value>(fact::kernel_release);
|
51
|
+
REQUIRE(release);
|
52
|
+
REQUIRE(release->value() == "1.2.3-foo");
|
53
|
+
auto version = facts.get<string_value>(fact::kernel_version);
|
54
|
+
REQUIRE(version);
|
55
|
+
REQUIRE(version->value() == "1.2.3");
|
56
|
+
auto major = facts.get<string_value>(fact::kernel_major_version);
|
57
|
+
REQUIRE(major);
|
58
|
+
REQUIRE(major->value() == "1.2");
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#include <catch.hpp>
|
2
|
+
#include <internal/facts/resolvers/ldom_resolver.hpp>
|
3
|
+
#include <facter/facts/collection.hpp>
|
4
|
+
#include <facter/facts/fact.hpp>
|
5
|
+
#include <facter/facts/scalar_value.hpp>
|
6
|
+
#include <facter/facts/map_value.hpp>
|
7
|
+
#include "../../collection_fixture.hpp"
|
8
|
+
|
9
|
+
using namespace std;
|
10
|
+
using namespace facter::facts;
|
11
|
+
using namespace facter::facts::resolvers;
|
12
|
+
using namespace facter::testing;
|
13
|
+
|
14
|
+
struct empty_ldom_resolver : ldom_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
virtual data collect_data(collection& facts) override
|
18
|
+
{
|
19
|
+
data result;
|
20
|
+
return result;
|
21
|
+
}
|
22
|
+
};
|
23
|
+
|
24
|
+
struct test_ldom_resolver : ldom_resolver
|
25
|
+
{
|
26
|
+
protected:
|
27
|
+
virtual data collect_data(collection& facts) override
|
28
|
+
{
|
29
|
+
ldom_info single_value;
|
30
|
+
single_value.key = "domainname";
|
31
|
+
single_value.values.insert({ "domainname", "somedomain"});
|
32
|
+
|
33
|
+
ldom_info multi_value;
|
34
|
+
multi_value.key = "domainrole";
|
35
|
+
multi_value.values.insert({ "impl", "true"});
|
36
|
+
multi_value.values.insert({ "io", "false"});
|
37
|
+
|
38
|
+
data result;
|
39
|
+
result.ldom.emplace_back(single_value);
|
40
|
+
result.ldom.emplace_back(multi_value);
|
41
|
+
|
42
|
+
return result;
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
SCENARIO("Using the Solaris LDom resolver") {
|
47
|
+
collection_fixture facts;
|
48
|
+
WHEN("data is not present") {
|
49
|
+
facts.add(make_shared<empty_ldom_resolver>());
|
50
|
+
THEN("no LDom facts should be added") {
|
51
|
+
REQUIRE(facts.size() == 0u);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
WHEN("data is present") {
|
55
|
+
facts.add(make_shared<test_ldom_resolver>());
|
56
|
+
THEN("a structured fact is added") {
|
57
|
+
REQUIRE(facts.size() == 4u);
|
58
|
+
auto ldom = facts.get<map_value>(fact::ldom);
|
59
|
+
REQUIRE(ldom);
|
60
|
+
REQUIRE(ldom->size() == 2u);
|
61
|
+
|
62
|
+
auto sval = ldom->get<string_value>("domainname");
|
63
|
+
REQUIRE(sval);
|
64
|
+
REQUIRE(sval->value() == "somedomain");
|
65
|
+
|
66
|
+
auto mval = ldom->get<map_value>("domainrole");
|
67
|
+
REQUIRE(mval);
|
68
|
+
REQUIRE(mval->size() == 2u);
|
69
|
+
}
|
70
|
+
THEN("flat facts are added") {
|
71
|
+
REQUIRE(facts.size() == 4u);
|
72
|
+
auto sval_2 = facts.get<string_value>("ldom_domainname");
|
73
|
+
REQUIRE(sval_2);
|
74
|
+
REQUIRE(sval_2->value() == "somedomain");
|
75
|
+
|
76
|
+
auto sval_3 = facts.get<string_value>("ldom_domainrole_impl");
|
77
|
+
REQUIRE(sval_3);
|
78
|
+
REQUIRE(sval_3->value() == "true");
|
79
|
+
|
80
|
+
auto sval_4 = facts.get<string_value>("ldom_domainrole_io");
|
81
|
+
REQUIRE(sval_4);
|
82
|
+
REQUIRE(sval_4->value() == "false");
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
#include <catch.hpp>
|
2
|
+
#include <internal/facts/resolvers/memory_resolver.hpp>
|
3
|
+
#include <facter/facts/collection.hpp>
|
4
|
+
#include <facter/facts/fact.hpp>
|
5
|
+
#include <facter/facts/scalar_value.hpp>
|
6
|
+
#include <facter/facts/map_value.hpp>
|
7
|
+
#include "../../collection_fixture.hpp"
|
8
|
+
|
9
|
+
using namespace std;
|
10
|
+
using namespace facter::facts;
|
11
|
+
using namespace facter::facts::resolvers;
|
12
|
+
using namespace facter::testing;
|
13
|
+
|
14
|
+
struct empty_memory_resolver : memory_resolver
|
15
|
+
{
|
16
|
+
protected:
|
17
|
+
virtual data collect_data(collection& facts) override
|
18
|
+
{
|
19
|
+
return {};
|
20
|
+
}
|
21
|
+
};
|
22
|
+
|
23
|
+
struct test_memory_resolver : memory_resolver
|
24
|
+
{
|
25
|
+
protected:
|
26
|
+
virtual data collect_data(collection& facts) override
|
27
|
+
{
|
28
|
+
data result;
|
29
|
+
result.swap_encryption = encryption_status::encrypted;
|
30
|
+
result.mem_total = 10 * 1024 * 1024;
|
31
|
+
result.mem_free = 5 * 1024 * 1024;
|
32
|
+
result.swap_total = 20 * 1024 * 1024;
|
33
|
+
result.swap_free = 4 * 1024 * 1024;
|
34
|
+
return result;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
|
38
|
+
SCENARIO("using the memory resolver") {
|
39
|
+
collection_fixture facts;
|
40
|
+
WHEN("data is not present") {
|
41
|
+
facts.add(make_shared<empty_memory_resolver>());
|
42
|
+
THEN("facts should not be added") {
|
43
|
+
REQUIRE(facts.size() == 0u);
|
44
|
+
}
|
45
|
+
}
|
46
|
+
WHEN("data is present") {
|
47
|
+
facts.add(make_shared<test_memory_resolver>());
|
48
|
+
THEN("a structured fact is added") {
|
49
|
+
REQUIRE(facts.size() == 10u);
|
50
|
+
auto memory = facts.get<map_value>(fact::memory);
|
51
|
+
REQUIRE(memory);
|
52
|
+
auto info = memory->get<map_value>("swap");
|
53
|
+
REQUIRE(info);
|
54
|
+
REQUIRE(info->size() == 8u);
|
55
|
+
auto available = info->get<string_value>("available");
|
56
|
+
REQUIRE(available);
|
57
|
+
REQUIRE(available->value() == "4.00 MiB");
|
58
|
+
auto available_bytes = info->get<integer_value>("available_bytes");
|
59
|
+
REQUIRE(available_bytes);
|
60
|
+
REQUIRE(available_bytes->value() == 4194304);
|
61
|
+
auto capacity = info->get<string_value>("capacity");
|
62
|
+
REQUIRE(capacity);
|
63
|
+
REQUIRE(capacity->value() == "80.00%");
|
64
|
+
auto encrypted = info->get<boolean_value>("encrypted");
|
65
|
+
REQUIRE(encrypted);
|
66
|
+
REQUIRE(encrypted->value());
|
67
|
+
auto total = info->get<string_value>("total");
|
68
|
+
REQUIRE(total);
|
69
|
+
REQUIRE(total->value() == "20.00 MiB");
|
70
|
+
auto total_bytes = info->get<integer_value>("total_bytes");
|
71
|
+
REQUIRE(total_bytes);
|
72
|
+
REQUIRE(total_bytes->value() == 20971520);
|
73
|
+
auto used = info->get<string_value>("used");
|
74
|
+
REQUIRE(used);
|
75
|
+
REQUIRE(used->value() == "16.00 MiB");
|
76
|
+
auto used_bytes = info->get<integer_value>("used_bytes");
|
77
|
+
REQUIRE(used_bytes);
|
78
|
+
REQUIRE(used_bytes->value() == 16777216);
|
79
|
+
info = memory->get<map_value>("system");
|
80
|
+
REQUIRE(info);
|
81
|
+
REQUIRE(info->size() == 7u);
|
82
|
+
available = info->get<string_value>("available");
|
83
|
+
REQUIRE(available);
|
84
|
+
REQUIRE(available->value() == "5.00 MiB");
|
85
|
+
available_bytes = info->get<integer_value>("available_bytes");
|
86
|
+
REQUIRE(available_bytes);
|
87
|
+
REQUIRE(available_bytes->value() == 5242880);
|
88
|
+
capacity = info->get<string_value>("capacity");
|
89
|
+
REQUIRE(capacity);
|
90
|
+
REQUIRE(capacity->value() == "50.00%");
|
91
|
+
total = info->get<string_value>("total");
|
92
|
+
REQUIRE(total);
|
93
|
+
REQUIRE(total->value() == "10.00 MiB");
|
94
|
+
total_bytes = info->get<integer_value>("total_bytes");
|
95
|
+
REQUIRE(total_bytes);
|
96
|
+
REQUIRE(total_bytes->value() == 10485760);
|
97
|
+
used = info->get<string_value>("used");
|
98
|
+
REQUIRE(used);
|
99
|
+
REQUIRE(used->value() == "5.00 MiB");
|
100
|
+
used_bytes = info->get<integer_value>("used_bytes");
|
101
|
+
REQUIRE(used_bytes);
|
102
|
+
REQUIRE(used_bytes->value() == 5242880);
|
103
|
+
}
|
104
|
+
THEN("flat facts are added") {
|
105
|
+
REQUIRE(facts.size() == 10u);
|
106
|
+
auto memoryfree = facts.get<string_value>(fact::memoryfree);
|
107
|
+
REQUIRE(memoryfree);
|
108
|
+
REQUIRE(memoryfree->value() == "5.00 MiB");
|
109
|
+
auto memoryfree_mb = facts.get<double_value>(fact::memoryfree_mb);
|
110
|
+
REQUIRE(memoryfree_mb);
|
111
|
+
REQUIRE(memoryfree_mb->value() == Approx(5.0));
|
112
|
+
auto memorysize = facts.get<string_value>(fact::memorysize);
|
113
|
+
REQUIRE(memorysize);
|
114
|
+
REQUIRE(memorysize->value() == "10.00 MiB");
|
115
|
+
auto memorysize_mb = facts.get<double_value>(fact::memorysize_mb);
|
116
|
+
REQUIRE(memorysize_mb);
|
117
|
+
REQUIRE(memorysize_mb->value() == Approx(10.0));
|
118
|
+
auto swapencrypted = facts.get<boolean_value>(fact::swapencrypted);
|
119
|
+
REQUIRE(swapencrypted);
|
120
|
+
REQUIRE(swapencrypted->value());
|
121
|
+
auto swapfree = facts.get<string_value>(fact::swapfree);
|
122
|
+
REQUIRE(swapfree);
|
123
|
+
REQUIRE(swapfree->value() == "4.00 MiB");
|
124
|
+
auto swapfree_mb = facts.get<double_value>(fact::swapfree_mb);
|
125
|
+
REQUIRE(swapfree_mb);
|
126
|
+
REQUIRE(swapfree_mb->value() == Approx(4.0));
|
127
|
+
auto swapsize = facts.get<string_value>(fact::swapsize);
|
128
|
+
REQUIRE(swapsize);
|
129
|
+
REQUIRE(swapsize->value() == "20.00 MiB");
|
130
|
+
auto swapsize_mb = facts.get<double_value>(fact::swapsize_mb);
|
131
|
+
REQUIRE(swapsize_mb);
|
132
|
+
REQUIRE(swapsize_mb->value() == Approx(20.0));
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
@@ -0,0 +1,507 @@
|
|
1
|
+
#include <catch.hpp>
|
2
|
+
#include <internal/facts/resolvers/networking_resolver.hpp>
|
3
|
+
#include <facter/facts/collection.hpp>
|
4
|
+
#include <facter/facts/fact.hpp>
|
5
|
+
#include <facter/facts/scalar_value.hpp>
|
6
|
+
#include <facter/facts/array_value.hpp>
|
7
|
+
#include <facter/facts/map_value.hpp>
|
8
|
+
#include "../../collection_fixture.hpp"
|
9
|
+
|
10
|
+
using namespace std;
|
11
|
+
using namespace facter::facts;
|
12
|
+
using namespace facter::facts::resolvers;
|
13
|
+
using namespace facter::testing;
|
14
|
+
|
15
|
+
struct empty_networking_resolver : networking_resolver
|
16
|
+
{
|
17
|
+
protected:
|
18
|
+
virtual data collect_data(collection& facts) override
|
19
|
+
{
|
20
|
+
return {};
|
21
|
+
}
|
22
|
+
};
|
23
|
+
|
24
|
+
struct test_hostname_resolver : networking_resolver
|
25
|
+
{
|
26
|
+
protected:
|
27
|
+
virtual data collect_data(collection& facts) override
|
28
|
+
{
|
29
|
+
data result;
|
30
|
+
result.hostname = "hostname";
|
31
|
+
return result;
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
struct test_domain_resolver : networking_resolver
|
36
|
+
{
|
37
|
+
protected:
|
38
|
+
virtual data collect_data(collection& facts) override
|
39
|
+
{
|
40
|
+
data result;
|
41
|
+
result.domain = "domain";
|
42
|
+
return result;
|
43
|
+
}
|
44
|
+
};
|
45
|
+
|
46
|
+
struct test_fqdn_resolver : networking_resolver
|
47
|
+
{
|
48
|
+
protected:
|
49
|
+
virtual data collect_data(collection& facts) override
|
50
|
+
{
|
51
|
+
data result;
|
52
|
+
result.fqdn = "fqdn";
|
53
|
+
return result;
|
54
|
+
}
|
55
|
+
};
|
56
|
+
|
57
|
+
struct test_missing_fqdn_resolver : networking_resolver
|
58
|
+
{
|
59
|
+
protected:
|
60
|
+
virtual data collect_data(collection& facts) override
|
61
|
+
{
|
62
|
+
data result;
|
63
|
+
result.hostname = "hostname";
|
64
|
+
result.domain = "domain.com";
|
65
|
+
return result;
|
66
|
+
}
|
67
|
+
};
|
68
|
+
|
69
|
+
struct test_domain_with_trailing_dot : networking_resolver
|
70
|
+
{
|
71
|
+
protected:
|
72
|
+
virtual data collect_data(collection& facts) override
|
73
|
+
{
|
74
|
+
data result;
|
75
|
+
result.domain = "domain.com.";
|
76
|
+
return result;
|
77
|
+
}
|
78
|
+
};
|
79
|
+
|
80
|
+
struct test_interface_resolver : networking_resolver
|
81
|
+
{
|
82
|
+
protected:
|
83
|
+
virtual data collect_data(collection& facts) override
|
84
|
+
{
|
85
|
+
data result;
|
86
|
+
for (int i = 0; i < 5; ++i) {
|
87
|
+
string num = to_string(i);
|
88
|
+
|
89
|
+
interface iface;
|
90
|
+
iface.name = "iface_" + num;
|
91
|
+
iface.dhcp_server = "dhcp_" + num;
|
92
|
+
for (int binding_index = 0; binding_index < 2; ++binding_index) {
|
93
|
+
string binding_num = to_string(binding_index);
|
94
|
+
iface.ipv4_bindings.emplace_back(binding { "ip_" + num + "_" + binding_num, "netmask_" + num + "_" + binding_num, "network_" + num + "_" + binding_num });
|
95
|
+
iface.ipv6_bindings.emplace_back(binding { "ip6_" + num + "_" + binding_num, "netmask6_" + num + "_" + binding_num, "network6_" + num + "_" + binding_num });
|
96
|
+
}
|
97
|
+
iface.macaddress = "macaddress_" + num;
|
98
|
+
iface.mtu = i;
|
99
|
+
result.interfaces.emplace_back(move(iface));
|
100
|
+
}
|
101
|
+
result.primary_interface = "iface_2";
|
102
|
+
return result;
|
103
|
+
}
|
104
|
+
};
|
105
|
+
|
106
|
+
struct primary_interface_resolver : networking_resolver
|
107
|
+
{
|
108
|
+
protected:
|
109
|
+
virtual data collect_data(collection& facts) override
|
110
|
+
{
|
111
|
+
data result;
|
112
|
+
|
113
|
+
interface lo0;
|
114
|
+
lo0.name = "lo0";
|
115
|
+
lo0.ipv4_bindings.emplace_back(binding { "127.0.0.1", "255.255.255.0", "127.0.0.0" });
|
116
|
+
lo0.ipv6_bindings.emplace_back(binding { "::1", "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", "::1" });
|
117
|
+
result.interfaces.emplace_back(move(lo0));
|
118
|
+
|
119
|
+
interface en0;
|
120
|
+
en0.name = "en0";
|
121
|
+
en0.ipv4_bindings.emplace_back(binding { "123.123.123.123", "255.255.255.0", "123.123.123.0" });
|
122
|
+
en0.ipv6_bindings.emplace_back(binding { "fe80::6203:8ff:fe95:2d16", "ffff:ffff:ffff:ffff::", "fe80::" });
|
123
|
+
result.interfaces.emplace_back(move(en0));
|
124
|
+
|
125
|
+
interface en1;
|
126
|
+
en1.name = "en1";
|
127
|
+
en1.ipv4_bindings.emplace_back(binding { "123.123.123.124", "255.255.255.0", "123.123.123.0" });
|
128
|
+
en1.ipv6_bindings.emplace_back(binding { "fe80::6203:8ff:fe95:2d17", "ffff:ffff:ffff:ffff::", "fe80::" });
|
129
|
+
result.interfaces.emplace_back(move(en1));
|
130
|
+
|
131
|
+
return result;
|
132
|
+
}
|
133
|
+
};
|
134
|
+
|
135
|
+
SCENARIO("using the networking resolver") {
|
136
|
+
collection_fixture facts;
|
137
|
+
WHEN("data is not present") {
|
138
|
+
facts.add(make_shared<empty_networking_resolver>());
|
139
|
+
THEN("facts should not be added") {
|
140
|
+
REQUIRE(facts.size() == 0u);
|
141
|
+
}
|
142
|
+
}
|
143
|
+
WHEN("only hostname is present") {
|
144
|
+
facts.add(make_shared<test_hostname_resolver>());
|
145
|
+
REQUIRE(facts.size() == 3u);
|
146
|
+
THEN("a flat fact is added") {
|
147
|
+
auto hostname = facts.get<string_value>(fact::hostname);
|
148
|
+
REQUIRE(hostname);
|
149
|
+
REQUIRE(hostname->value() == "hostname");
|
150
|
+
}
|
151
|
+
THEN("a structured fact is added") {
|
152
|
+
auto networking = facts.get<map_value>(fact::networking);
|
153
|
+
REQUIRE(networking);
|
154
|
+
REQUIRE(networking->size() == 2u);
|
155
|
+
|
156
|
+
auto hostname = networking->get<string_value>("hostname");
|
157
|
+
REQUIRE(hostname);
|
158
|
+
REQUIRE(hostname->value() == "hostname");
|
159
|
+
|
160
|
+
auto fqdn = networking->get<string_value>("fqdn");
|
161
|
+
REQUIRE(fqdn);
|
162
|
+
REQUIRE(fqdn->value() == "hostname");
|
163
|
+
}
|
164
|
+
THEN("the FQDN fact is the hostname") {
|
165
|
+
auto fqdn = facts.get<string_value>(fact::fqdn);
|
166
|
+
REQUIRE(fqdn);
|
167
|
+
REQUIRE(fqdn->value() == "hostname");
|
168
|
+
}
|
169
|
+
}
|
170
|
+
WHEN("only domain is present") {
|
171
|
+
facts.add(make_shared<test_domain_resolver>());
|
172
|
+
REQUIRE(facts.size() == 2u);
|
173
|
+
THEN("a flat fact is added") {
|
174
|
+
auto domain = facts.get<string_value>(fact::domain);
|
175
|
+
REQUIRE(domain);
|
176
|
+
REQUIRE(domain->value() == "domain");
|
177
|
+
}
|
178
|
+
THEN("a structured fact is added") {
|
179
|
+
auto networking = facts.get<map_value>(fact::networking);
|
180
|
+
REQUIRE(networking);
|
181
|
+
REQUIRE(networking->size() == 1u);
|
182
|
+
|
183
|
+
auto domain = networking->get<string_value>("domain");
|
184
|
+
REQUIRE(domain);
|
185
|
+
REQUIRE(domain->value() == "domain");
|
186
|
+
}
|
187
|
+
THEN("the FQDN fact is not present") {
|
188
|
+
auto fqdn = facts.get<string_value>(fact::fqdn);
|
189
|
+
REQUIRE_FALSE(fqdn);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
WHEN("domain contains a trailing dot, the dot is removed") {
|
193
|
+
facts.add(make_shared<test_domain_with_trailing_dot>());
|
194
|
+
REQUIRE(facts.size() == 2u);
|
195
|
+
THEN("a flat fact is added") {
|
196
|
+
auto domain = facts.get<string_value>(fact::domain);
|
197
|
+
REQUIRE(domain);
|
198
|
+
REQUIRE(domain->value() == "domain.com");
|
199
|
+
}
|
200
|
+
THEN("a structured fact is added") {
|
201
|
+
auto networking = facts.get<map_value>(fact::networking);
|
202
|
+
REQUIRE(networking);
|
203
|
+
REQUIRE(networking->size() == 1u);
|
204
|
+
|
205
|
+
auto domain = networking->get<string_value>("domain");
|
206
|
+
REQUIRE(domain);
|
207
|
+
REQUIRE(domain->value() == "domain.com");
|
208
|
+
}
|
209
|
+
THEN("the FQDN fact is not present") {
|
210
|
+
auto fqdn = facts.get<string_value>(fact::fqdn);
|
211
|
+
REQUIRE_FALSE(fqdn);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
WHEN("FQDN is present") {
|
215
|
+
facts.add(make_shared<test_fqdn_resolver>());
|
216
|
+
REQUIRE(facts.size() == 2u);
|
217
|
+
THEN("a flat fact is added") {
|
218
|
+
auto fqdn = facts.get<string_value>(fact::fqdn);
|
219
|
+
REQUIRE(fqdn);
|
220
|
+
REQUIRE(fqdn->value() == "fqdn");
|
221
|
+
}
|
222
|
+
THEN("a structured fact is added") {
|
223
|
+
auto networking = facts.get<map_value>(fact::networking);
|
224
|
+
REQUIRE(networking);
|
225
|
+
REQUIRE(networking->size() == 1u);
|
226
|
+
auto fqdn = networking->get<string_value>("fqdn");
|
227
|
+
REQUIRE(fqdn);
|
228
|
+
REQUIRE(fqdn->value() == "fqdn");
|
229
|
+
}
|
230
|
+
THEN("the FQDN fact is present") {
|
231
|
+
auto fqdn = facts.get<string_value>(fact::fqdn);
|
232
|
+
REQUIRE(fqdn);
|
233
|
+
REQUIRE(fqdn->value() == "fqdn");
|
234
|
+
}
|
235
|
+
}
|
236
|
+
WHEN("FQDN is not present") {
|
237
|
+
facts.add(make_shared<test_missing_fqdn_resolver>());
|
238
|
+
REQUIRE(facts.size() == 4u);
|
239
|
+
THEN("the FQDN fact is the combination of hostname and domain") {
|
240
|
+
auto svalue = facts.get<string_value>(fact::hostname);
|
241
|
+
REQUIRE(svalue);
|
242
|
+
REQUIRE(svalue->value() == "hostname");
|
243
|
+
svalue = facts.get<string_value>(fact::domain);
|
244
|
+
REQUIRE(svalue);
|
245
|
+
REQUIRE(svalue->value() == "domain.com");
|
246
|
+
svalue = facts.get<string_value>(fact::fqdn);
|
247
|
+
REQUIRE(svalue);
|
248
|
+
REQUIRE(svalue->value() == "hostname.domain.com");
|
249
|
+
}
|
250
|
+
THEN("the FQDN in the structured fact is the combination of hostname and domain") {
|
251
|
+
auto networking = facts.get<map_value>(fact::networking);
|
252
|
+
REQUIRE(networking);
|
253
|
+
REQUIRE(networking->size() == 3u);
|
254
|
+
auto svalue = networking->get<string_value>("hostname");
|
255
|
+
REQUIRE(svalue);
|
256
|
+
REQUIRE(svalue->value() == "hostname");
|
257
|
+
svalue = networking->get<string_value>("domain");
|
258
|
+
REQUIRE(svalue);
|
259
|
+
REQUIRE(svalue->value() == "domain.com");
|
260
|
+
svalue = networking->get<string_value>("fqdn");
|
261
|
+
REQUIRE(svalue);
|
262
|
+
REQUIRE(svalue->value() == "hostname.domain.com");
|
263
|
+
}
|
264
|
+
}
|
265
|
+
WHEN("network interfaces are present") {
|
266
|
+
facts.add(make_shared<test_interface_resolver>());
|
267
|
+
REQUIRE(facts.size() == 50u);
|
268
|
+
THEN("the DHCP servers fact is present") {
|
269
|
+
auto dhcp_servers = facts.get<map_value>(fact::dhcp_servers);
|
270
|
+
REQUIRE(dhcp_servers);
|
271
|
+
REQUIRE(dhcp_servers->size() == 6u);
|
272
|
+
for (unsigned int i = 0; i < 5; ++i) {
|
273
|
+
string num = to_string(i);
|
274
|
+
auto server = dhcp_servers->get<string_value>("iface_" + num);
|
275
|
+
REQUIRE(server);
|
276
|
+
REQUIRE(server->value() == "dhcp_" + num);
|
277
|
+
}
|
278
|
+
auto dhcp = dhcp_servers->get<string_value>("system");
|
279
|
+
REQUIRE(dhcp);
|
280
|
+
REQUIRE(dhcp->value() == "dhcp_2");
|
281
|
+
}
|
282
|
+
THEN("the interface names fact is present") {
|
283
|
+
auto interfaces_list = facts.get<string_value>(fact::interfaces);
|
284
|
+
REQUIRE(interfaces_list);
|
285
|
+
REQUIRE(interfaces_list->value() == "iface_0,iface_1,iface_2,iface_3,iface_4");
|
286
|
+
}
|
287
|
+
THEN("the interface flat facts are present") {
|
288
|
+
for (unsigned int i = 0; i < 5; ++i) {
|
289
|
+
string num = to_string(i);
|
290
|
+
auto ip = facts.get<string_value>(fact::ipaddress + string("_iface_") + num);
|
291
|
+
REQUIRE(ip);
|
292
|
+
REQUIRE(ip->value() == "ip_" + num + "_0");
|
293
|
+
auto ip6 = facts.get<string_value>(fact::ipaddress6 + string("_iface_") + num);
|
294
|
+
REQUIRE(ip6);
|
295
|
+
REQUIRE(ip6->value() == "ip6_" + num + "_0");
|
296
|
+
auto macaddress = facts.get<string_value>(fact::macaddress + string("_iface_") + num);
|
297
|
+
REQUIRE(macaddress);
|
298
|
+
REQUIRE(macaddress->value() == "macaddress_" + num);
|
299
|
+
auto mtu = facts.get<integer_value>(fact::mtu + string("_iface_") + num);
|
300
|
+
REQUIRE(mtu);
|
301
|
+
REQUIRE(mtu->value() == i);
|
302
|
+
auto netmask = facts.get<string_value>(fact::netmask + string("_iface_") + num);
|
303
|
+
REQUIRE(netmask);
|
304
|
+
REQUIRE(netmask->value() == "netmask_" + num + "_0");
|
305
|
+
auto netmask6 = facts.get<string_value>(fact::netmask6 + string("_iface_") + num);
|
306
|
+
REQUIRE(netmask6);
|
307
|
+
REQUIRE(netmask6->value() == "netmask6_" + num + "_0");
|
308
|
+
auto network = facts.get<string_value>(fact::network + string("_iface_") + num);
|
309
|
+
REQUIRE(network);
|
310
|
+
REQUIRE(network->value() == "network_" + num + "_0");
|
311
|
+
auto network6 = facts.get<string_value>(fact::network6 + string("_iface_") + num);
|
312
|
+
REQUIRE(network6);
|
313
|
+
REQUIRE(network6->value() == "network6_" + num + "_0");
|
314
|
+
}
|
315
|
+
}
|
316
|
+
THEN("the system fact facts are present") {
|
317
|
+
auto ip = facts.get<string_value>(fact::ipaddress);
|
318
|
+
REQUIRE(ip);
|
319
|
+
REQUIRE(ip->value() == "ip_2_0");
|
320
|
+
auto ip6 = facts.get<string_value>(fact::ipaddress6);
|
321
|
+
REQUIRE(ip6);
|
322
|
+
REQUIRE(ip6->value() == "ip6_2_0");
|
323
|
+
auto macaddress = facts.get<string_value>(fact::macaddress);
|
324
|
+
REQUIRE(macaddress);
|
325
|
+
REQUIRE(macaddress->value() == "macaddress_2");
|
326
|
+
auto netmask = facts.get<string_value>(fact::netmask);
|
327
|
+
REQUIRE(netmask);
|
328
|
+
REQUIRE(netmask->value() == "netmask_2_0");
|
329
|
+
auto netmask6 = facts.get<string_value>(fact::netmask6);
|
330
|
+
REQUIRE(netmask6);
|
331
|
+
REQUIRE(netmask6->value() == "netmask6_2_0");
|
332
|
+
auto network = facts.get<string_value>(fact::network);
|
333
|
+
REQUIRE(network);
|
334
|
+
REQUIRE(network->value() == "network_2_0");
|
335
|
+
auto network6 = facts.get<string_value>(fact::network6);
|
336
|
+
REQUIRE(network6);
|
337
|
+
REQUIRE(network6->value() == "network6_2_0");
|
338
|
+
}
|
339
|
+
THEN("the networking structured fact is present") {
|
340
|
+
auto networking = facts.get<map_value>(fact::networking);
|
341
|
+
REQUIRE(networking);
|
342
|
+
REQUIRE(networking->size() == 11u);
|
343
|
+
auto primary = networking->get<string_value>("primary");
|
344
|
+
REQUIRE(primary);
|
345
|
+
REQUIRE(primary->value() == "iface_2");
|
346
|
+
auto dhcp = networking->get<string_value>("dhcp");
|
347
|
+
REQUIRE(dhcp);
|
348
|
+
REQUIRE(dhcp->value() == "dhcp_2");
|
349
|
+
auto ip = networking->get<string_value>("ip");
|
350
|
+
REQUIRE(ip);
|
351
|
+
REQUIRE(ip->value() == "ip_2_0");
|
352
|
+
auto ip6 = networking->get<string_value>("ip6");
|
353
|
+
REQUIRE(ip6);
|
354
|
+
REQUIRE(ip6->value() == "ip6_2_0");
|
355
|
+
auto macaddress = networking->get<string_value>("mac");
|
356
|
+
REQUIRE(macaddress);
|
357
|
+
REQUIRE(macaddress->value() == "macaddress_2");
|
358
|
+
auto netmask = networking->get<string_value>("netmask");
|
359
|
+
REQUIRE(netmask);
|
360
|
+
REQUIRE(netmask->value() == "netmask_2_0");
|
361
|
+
auto netmask6 = networking->get<string_value>("netmask6");
|
362
|
+
REQUIRE(netmask6);
|
363
|
+
REQUIRE(netmask6->value() == "netmask6_2_0");
|
364
|
+
auto network = networking->get<string_value>("network");
|
365
|
+
REQUIRE(network);
|
366
|
+
REQUIRE(network->value() == "network_2_0");
|
367
|
+
auto network6 = networking->get<string_value>("network6");
|
368
|
+
REQUIRE(network6);
|
369
|
+
REQUIRE(network6->value() == "network6_2_0");
|
370
|
+
auto mtu = networking->get<integer_value>("mtu");
|
371
|
+
REQUIRE(mtu);
|
372
|
+
REQUIRE(mtu->value() == 2);
|
373
|
+
auto interfaces = networking->get<map_value>("interfaces");
|
374
|
+
REQUIRE(interfaces);
|
375
|
+
for (unsigned int i = 0; i < 5; ++i) {
|
376
|
+
string num = to_string(i);
|
377
|
+
auto interface = interfaces->get<map_value>("iface_" + num);
|
378
|
+
REQUIRE(interface);
|
379
|
+
dhcp = interface->get<string_value>("dhcp");
|
380
|
+
REQUIRE(dhcp);
|
381
|
+
REQUIRE(dhcp->value() == "dhcp_" + num);
|
382
|
+
ip = interface->get<string_value>("ip");
|
383
|
+
REQUIRE(ip);
|
384
|
+
REQUIRE(ip->value() == "ip_" + num + "_0");
|
385
|
+
ip6 = interface->get<string_value>("ip6");
|
386
|
+
REQUIRE(ip6);
|
387
|
+
REQUIRE(ip6->value() == "ip6_" + num + "_0");
|
388
|
+
macaddress = interface->get<string_value>("mac");
|
389
|
+
REQUIRE(macaddress);
|
390
|
+
REQUIRE(macaddress->value() == "macaddress_" + num);
|
391
|
+
netmask = interface->get<string_value>("netmask");
|
392
|
+
REQUIRE(netmask);
|
393
|
+
REQUIRE(netmask->value() == "netmask_" + num + "_0");
|
394
|
+
netmask6 = interface->get<string_value>("netmask6");
|
395
|
+
REQUIRE(netmask6);
|
396
|
+
REQUIRE(netmask6->value() == "netmask6_" + num + "_0");
|
397
|
+
network = interface->get<string_value>("network");
|
398
|
+
REQUIRE(network);
|
399
|
+
REQUIRE(network->value() == "network_" + num + "_0");
|
400
|
+
network6 = interface->get<string_value>("network6");
|
401
|
+
REQUIRE(network6);
|
402
|
+
REQUIRE(network6->value() == "network6_" + num + "_0");
|
403
|
+
mtu = interface->get<integer_value>("mtu");
|
404
|
+
REQUIRE(mtu);
|
405
|
+
REQUIRE(mtu->value() == i);
|
406
|
+
auto bindings = interface->get<array_value>("bindings");
|
407
|
+
REQUIRE(bindings);
|
408
|
+
REQUIRE(bindings->size() == 2u);
|
409
|
+
for (size_t binding_index = 0; binding_index < bindings->size(); ++binding_index) {
|
410
|
+
auto interface_num = to_string(binding_index);
|
411
|
+
auto binding = bindings->get<map_value>(binding_index);
|
412
|
+
REQUIRE(binding);
|
413
|
+
auto address = binding->get<string_value>("address");
|
414
|
+
REQUIRE(address);
|
415
|
+
REQUIRE(address->value() == "ip_" + num + "_" + interface_num);
|
416
|
+
auto netmask = binding->get<string_value>("netmask");
|
417
|
+
REQUIRE(netmask);
|
418
|
+
REQUIRE(netmask->value() == "netmask_" + num + "_" + interface_num);
|
419
|
+
auto network = binding->get<string_value>("network");
|
420
|
+
REQUIRE(network);
|
421
|
+
REQUIRE(network->value() == "network_" + num + "_" + interface_num);
|
422
|
+
}
|
423
|
+
bindings = interface->get<array_value>("bindings6");
|
424
|
+
REQUIRE(bindings);
|
425
|
+
REQUIRE(bindings->size() == 2u);
|
426
|
+
for (size_t binding_index = 0; binding_index < bindings->size(); ++binding_index) {
|
427
|
+
auto interface_num = to_string(binding_index);
|
428
|
+
auto binding = bindings->get<map_value>(binding_index);
|
429
|
+
REQUIRE(binding);
|
430
|
+
auto address = binding->get<string_value>("address");
|
431
|
+
REQUIRE(address);
|
432
|
+
REQUIRE(address->value() == "ip6_" + num + "_" + interface_num);
|
433
|
+
auto netmask = binding->get<string_value>("netmask");
|
434
|
+
REQUIRE(netmask);
|
435
|
+
REQUIRE(netmask->value() == "netmask6_" + num + "_" + interface_num);
|
436
|
+
auto network = binding->get<string_value>("network");
|
437
|
+
REQUIRE(network);
|
438
|
+
REQUIRE(network->value() == "network6_" + num + "_" + interface_num);
|
439
|
+
}
|
440
|
+
}
|
441
|
+
}
|
442
|
+
}
|
443
|
+
WHEN("the primary interface is not resolved") {
|
444
|
+
facts.add(make_shared<primary_interface_resolver>());
|
445
|
+
THEN("the first interface with a valid address should be treated as primary") {
|
446
|
+
REQUIRE(facts.query<string_value>("networking.primary"));
|
447
|
+
REQUIRE(facts.query<string_value>("networking.primary")->value() == "en0");
|
448
|
+
}
|
449
|
+
}
|
450
|
+
}
|
451
|
+
|
452
|
+
SCENARIO("ignored IPv4 addresses") {
|
453
|
+
char const* ignored_addresses[] = {
|
454
|
+
"",
|
455
|
+
"127.0.0.1",
|
456
|
+
"127.0.0.2",
|
457
|
+
"127.1.0.0",
|
458
|
+
"127.0.1.0",
|
459
|
+
"169.254.7.14",
|
460
|
+
"169.254.0.0",
|
461
|
+
"169.254.255.255"
|
462
|
+
};
|
463
|
+
for (auto s : ignored_addresses) {
|
464
|
+
CAPTURE(s);
|
465
|
+
REQUIRE(networking_resolver::ignored_ipv4_address(s));
|
466
|
+
}
|
467
|
+
char const* accepted_addresses[] = {
|
468
|
+
"169.253.0.0",
|
469
|
+
"169.255.0.0",
|
470
|
+
"100.100.100.100",
|
471
|
+
"0.0.0.0",
|
472
|
+
"1.1.1.1",
|
473
|
+
"10.0.18.142",
|
474
|
+
"192.168.0.1",
|
475
|
+
"255.255.255.255",
|
476
|
+
"128.0.0.1",
|
477
|
+
};
|
478
|
+
for (auto s : accepted_addresses) {
|
479
|
+
CAPTURE(s);
|
480
|
+
REQUIRE_FALSE(networking_resolver::ignored_ipv4_address(s));
|
481
|
+
}
|
482
|
+
}
|
483
|
+
|
484
|
+
|
485
|
+
SCENARIO("ignore IPv6 adddresses") {
|
486
|
+
char const* ignored_addresses[] = {
|
487
|
+
"",
|
488
|
+
"::1",
|
489
|
+
"fe80::9c84:7ca1:794b:12ed",
|
490
|
+
"fe80::75f2:2f55:823b:a513%10"
|
491
|
+
};
|
492
|
+
for (auto s : ignored_addresses) {
|
493
|
+
CAPTURE(s);
|
494
|
+
REQUIRE(networking_resolver::ignored_ipv6_address(s));
|
495
|
+
}
|
496
|
+
char const* accepted_addresses[] = {
|
497
|
+
"::fe80:75f2:2f55:823b:a513",
|
498
|
+
"fe7f::75f2:2f55:823b:a513%10",
|
499
|
+
"::2",
|
500
|
+
"::fe01",
|
501
|
+
"::fe80"
|
502
|
+
};
|
503
|
+
for (auto s : accepted_addresses) {
|
504
|
+
CAPTURE(s);
|
505
|
+
REQUIRE_FALSE(networking_resolver::ignored_ipv6_address(s));
|
506
|
+
}
|
507
|
+
}
|