puppet 6.20.0-x64-mingw32 → 7.0.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CODEOWNERS +16 -2
- data/Gemfile +0 -2
- data/Gemfile.lock +18 -24
- data/README.md +1 -1
- data/conf/fileserver.conf +5 -10
- data/ext/build_defaults.yaml +1 -1
- data/ext/osx/file_mapping.yaml +0 -5
- data/ext/project_data.yaml +1 -14
- data/ext/redhat/puppet.spec.erb +0 -1
- data/ext/windows/service/daemon.rb +6 -5
- data/install.rb +21 -17
- data/lib/puppet.rb +11 -20
- data/lib/puppet/application.rb +178 -108
- data/lib/puppet/application/agent.rb +0 -1
- data/lib/puppet/application/apply.rb +2 -3
- data/lib/puppet/application/device.rb +100 -105
- data/lib/puppet/application/filebucket.rb +13 -9
- data/lib/puppet/application/script.rb +0 -1
- data/lib/puppet/application/ssl.rb +1 -1
- data/lib/puppet/application_support.rb +0 -7
- data/lib/puppet/configurer.rb +30 -45
- data/lib/puppet/configurer/plugin_handler.rb +21 -19
- data/lib/puppet/defaults.rb +97 -167
- data/lib/puppet/environments.rb +59 -58
- data/lib/puppet/face/facts.rb +51 -51
- data/lib/puppet/face/help.rb +1 -1
- data/lib/puppet/face/plugin.rb +5 -8
- data/lib/puppet/ffi/windows.rb +12 -0
- data/lib/puppet/ffi/windows/api_types.rb +311 -0
- data/lib/puppet/ffi/windows/constants.rb +404 -0
- data/lib/puppet/ffi/windows/functions.rb +628 -0
- data/lib/puppet/ffi/windows/structs.rb +338 -0
- data/lib/puppet/file_serving/configuration.rb +0 -5
- data/lib/puppet/file_serving/configuration/parser.rb +3 -32
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_serving/mount.rb +1 -2
- data/lib/puppet/forge/repository.rb +0 -1
- data/lib/puppet/generate/models/type/type.rb +4 -1
- data/lib/puppet/http.rb +22 -13
- data/lib/puppet/http/client.rb +164 -114
- data/lib/puppet/{network/resolver.rb → http/dns.rb} +2 -2
- data/lib/puppet/http/errors.rb +16 -0
- data/lib/puppet/http/external_client.rb +5 -7
- data/lib/puppet/{network/http → http}/factory.rb +8 -11
- data/lib/puppet/{network/http → http}/pool.rb +61 -26
- data/lib/puppet/{network/http/session.rb → http/pool_entry.rb} +2 -3
- data/lib/puppet/http/proxy.rb +137 -0
- data/lib/puppet/http/redirector.rb +4 -12
- data/lib/puppet/http/resolver.rb +5 -15
- data/lib/puppet/http/resolver/server_list.rb +6 -10
- data/lib/puppet/http/resolver/settings.rb +4 -7
- data/lib/puppet/http/resolver/srv.rb +7 -11
- data/lib/puppet/http/response.rb +36 -54
- data/lib/puppet/http/response_converter.rb +24 -0
- data/lib/puppet/http/response_net_http.rb +42 -0
- data/lib/puppet/http/retry_after_handler.rb +4 -13
- data/lib/puppet/http/service.rb +12 -26
- data/lib/puppet/http/service/ca.rb +11 -22
- data/lib/puppet/http/service/compiler.rb +22 -69
- data/lib/puppet/http/service/file_server.rb +18 -27
- data/lib/puppet/http/service/puppetserver.rb +26 -12
- data/lib/puppet/http/service/report.rb +8 -10
- data/lib/puppet/http/session.rb +11 -20
- data/lib/puppet/{network/http → http}/site.rb +1 -2
- data/lib/puppet/indirector/catalog/rest.rb +2 -4
- data/lib/puppet/indirector/facts/facter.rb +24 -3
- data/lib/puppet/indirector/facts/rest.rb +3 -22
- data/lib/puppet/indirector/file_bucket_file/rest.rb +3 -9
- data/lib/puppet/indirector/file_content/rest.rb +2 -6
- data/lib/puppet/indirector/file_metadata/rest.rb +3 -9
- data/lib/puppet/indirector/file_server.rb +1 -8
- data/lib/puppet/indirector/generic_http.rb +0 -11
- data/lib/puppet/indirector/node/rest.rb +2 -4
- data/lib/puppet/indirector/report/rest.rb +3 -8
- data/lib/puppet/indirector/request.rb +0 -101
- data/lib/puppet/indirector/rest.rb +12 -263
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/installer.rb +2 -48
- data/lib/puppet/module_tool/errors/shared.rb +2 -17
- data/lib/puppet/network/authconfig.rb +2 -96
- data/lib/puppet/network/authorization.rb +13 -35
- data/lib/puppet/network/http.rb +3 -3
- data/lib/puppet/network/http/api/indirected_routes.rb +2 -20
- data/lib/puppet/network/http/api/master/v3.rb +11 -13
- data/lib/puppet/network/http/connection.rb +247 -316
- data/lib/puppet/network/http/handler.rb +0 -1
- data/lib/puppet/network/http_pool.rb +16 -34
- data/lib/puppet/node.rb +1 -30
- data/lib/puppet/pal/json_catalog_encoder.rb +4 -0
- data/lib/puppet/pal/pal_impl.rb +3 -1
- data/lib/puppet/parser/ast/leaf.rb +2 -3
- data/lib/puppet/parser/ast/pops_bridge.rb +0 -38
- data/lib/puppet/parser/compiler.rb +0 -198
- data/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +14 -39
- data/lib/puppet/parser/resource.rb +0 -69
- data/lib/puppet/parser/templatewrapper.rb +1 -1
- data/lib/puppet/pops/evaluator/deferred_resolver.rb +3 -5
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +0 -5
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +3 -3
- data/lib/puppet/pops/evaluator/runtime3_support.rb +1 -1
- data/lib/puppet/pops/issues.rb +0 -5
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +6 -8
- data/lib/puppet/pops/model/ast.pp +0 -42
- data/lib/puppet/pops/model/ast.rb +0 -290
- data/lib/puppet/pops/model/ast_transformer.rb +1 -1
- data/lib/puppet/pops/model/factory.rb +0 -45
- data/lib/puppet/pops/model/model_label_provider.rb +0 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +0 -22
- data/lib/puppet/pops/model/pn_transformer.rb +0 -16
- data/lib/puppet/pops/parser/egrammar.ra +0 -56
- data/lib/puppet/pops/parser/eparser.rb +1520 -1712
- data/lib/puppet/pops/parser/lexer2.rb +4 -4
- data/lib/puppet/pops/parser/parser_support.rb +0 -5
- data/lib/puppet/pops/resource/resource_type_impl.rb +2 -24
- data/lib/puppet/pops/types/type_calculator.rb +0 -7
- data/lib/puppet/pops/types/type_parser.rb +0 -4
- data/lib/puppet/pops/types/types.rb +0 -1
- data/lib/puppet/pops/validation/checker4_0.rb +9 -37
- data/lib/puppet/pops/validation/tasks_checker.rb +0 -12
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -2
- data/lib/puppet/provider.rb +0 -13
- data/lib/puppet/provider/nameservice.rb +0 -18
- data/lib/puppet/provider/package/apt.rb +0 -4
- data/lib/puppet/provider/package/dpkg.rb +0 -10
- data/lib/puppet/provider/package/gem.rb +23 -3
- data/lib/puppet/provider/package/pip.rb +0 -1
- data/lib/puppet/provider/package/pkg.rb +0 -4
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/puppet_gem.rb +1 -4
- data/lib/puppet/provider/service/smf.rb +191 -73
- data/lib/puppet/provider/user/aix.rb +2 -2
- data/lib/puppet/provider/user/directoryservice.rb +0 -10
- data/lib/puppet/reference/configuration.rb +7 -6
- data/lib/puppet/reference/indirection.rb +1 -1
- data/lib/puppet/resource.rb +1 -89
- data/lib/puppet/resource/catalog.rb +1 -14
- data/lib/puppet/resource/type.rb +3 -119
- data/lib/puppet/resource/type_collection.rb +3 -48
- data/lib/puppet/runtime.rb +1 -2
- data/lib/puppet/settings.rb +73 -66
- data/lib/puppet/settings/integer_setting.rb +17 -0
- data/lib/puppet/settings/port_setting.rb +15 -0
- data/lib/puppet/settings/priority_setting.rb +5 -4
- data/lib/puppet/ssl.rb +10 -6
- data/lib/puppet/ssl/base.rb +3 -5
- data/lib/puppet/ssl/certificate.rb +0 -6
- data/lib/puppet/ssl/certificate_request.rb +1 -12
- data/lib/puppet/ssl/certificate_signer.rb +6 -0
- data/lib/puppet/ssl/oids.rb +3 -1
- data/lib/puppet/ssl/ssl_provider.rb +17 -0
- data/lib/puppet/ssl/state_machine.rb +3 -1
- data/lib/puppet/ssl/verifier.rb +2 -0
- data/lib/puppet/test/test_helper.rb +1 -3
- data/lib/puppet/transaction.rb +1 -7
- data/lib/puppet/transaction/report.rb +2 -4
- data/lib/puppet/type.rb +0 -76
- data/lib/puppet/type/file.rb +5 -7
- data/lib/puppet/type/file/checksum.rb +1 -1
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/filebucket.rb +3 -3
- data/lib/puppet/type/package.rb +5 -13
- data/lib/puppet/util/autoload.rb +8 -1
- data/lib/puppet/util/execution.rb +0 -11
- data/lib/puppet/util/http_proxy.rb +2 -215
- data/lib/puppet/util/monkey_patches.rb +0 -46
- data/lib/puppet/util/posix.rb +5 -54
- data/lib/puppet/util/rdoc.rb +0 -7
- data/lib/puppet/util/retry_action.rb +1 -1
- data/lib/puppet/util/run_mode.rb +9 -1
- data/lib/puppet/util/windows.rb +3 -8
- data/lib/puppet/util/windows/daemon.rb +360 -0
- data/lib/puppet/util/windows/error.rb +1 -0
- data/lib/puppet/util/windows/eventlog.rb +4 -9
- data/lib/puppet/util/windows/file.rb +8 -242
- data/lib/puppet/util/windows/monkey_patches/process.rb +414 -0
- data/lib/puppet/util/windows/process.rb +4 -226
- data/lib/puppet/util/windows/service.rb +9 -460
- data/lib/puppet/util/windows/string.rb +12 -13
- data/lib/puppet/util/yaml.rb +0 -22
- data/lib/puppet/vendor/require_vendored.rb +0 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509.rb +5 -1
- data/lib/puppet/x509/cert_provider.rb +29 -1
- data/locales/puppet.pot +587 -1312
- data/man/man5/puppet.conf.5 +39 -99
- data/man/man8/puppet-agent.8 +2 -2
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +2 -2
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +51 -36
- data/man/man8/puppet-filebucket.8 +4 -4
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-module.8 +1 -58
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +2 -2
- data/man/man8/puppet-ssl.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/service/smf/{svcs.out → svcs_instances.out} +0 -0
- data/spec/fixtures/unit/provider/user/aix/aix_passwd_file.out +0 -4
- data/spec/integration/application/agent_spec.rb +27 -138
- data/spec/integration/application/apply_spec.rb +1 -20
- data/spec/integration/application/filebucket_spec.rb +16 -16
- data/spec/integration/application/help_spec.rb +2 -0
- data/spec/integration/application/plugin_spec.rb +23 -1
- data/spec/integration/defaults_spec.rb +14 -3
- data/spec/integration/network/http_pool_spec.rb +3 -21
- data/spec/integration/parser/catalog_spec.rb +0 -38
- data/spec/integration/parser/node_spec.rb +0 -9
- data/spec/integration/parser/pcore_resource_spec.rb +0 -37
- data/spec/integration/resource/type_collection_spec.rb +6 -2
- data/spec/integration/transaction_spec.rb +9 -4
- data/spec/integration/type/file_spec.rb +5 -4
- data/spec/integration/util/windows/adsi_spec.rb +1 -3
- data/spec/integration/util/windows/monkey_patches/process_spec.rb +231 -0
- data/spec/integration/util/windows/registry_spec.rb +10 -0
- data/spec/integration/util/windows/security_spec.rb +1 -1
- data/spec/lib/puppet_spec/puppetserver.rb +1 -1
- data/spec/lib/puppet_spec/settings.rb +1 -0
- data/spec/spec_helper.rb +6 -1
- data/spec/unit/agent_spec.rb +6 -10
- data/spec/unit/application/agent_spec.rb +1 -0
- data/spec/unit/application/facts_spec.rb +35 -0
- data/spec/unit/application/filebucket_spec.rb +43 -39
- data/spec/unit/application/ssl_spec.rb +2 -2
- data/spec/unit/application_spec.rb +9 -51
- data/spec/unit/certificate_factory_spec.rb +1 -1
- data/spec/unit/configurer/downloader_spec.rb +6 -2
- data/spec/unit/configurer/plugin_handler_spec.rb +56 -18
- data/spec/unit/configurer_spec.rb +12 -9
- data/spec/unit/confine/feature_spec.rb +1 -1
- data/spec/unit/confine_spec.rb +2 -8
- data/spec/unit/context/trusted_information_spec.rb +2 -6
- data/spec/unit/defaults_spec.rb +72 -42
- data/spec/unit/environments_spec.rb +19 -99
- data/spec/unit/face/facts_spec.rb +4 -0
- data/spec/unit/face/node_spec.rb +11 -0
- data/spec/unit/face/plugin_spec.rb +73 -33
- data/spec/unit/file_bucket/file_spec.rb +1 -1
- data/spec/unit/file_serving/configuration/parser_spec.rb +15 -18
- data/spec/unit/file_serving/configuration_spec.rb +6 -12
- data/spec/unit/file_serving/metadata_spec.rb +3 -3
- data/spec/unit/file_serving/terminus_helper_spec.rb +4 -11
- data/spec/unit/forge/module_release_spec.rb +7 -2
- data/spec/unit/functions/camelcase_spec.rb +1 -1
- data/spec/unit/functions/capitalize_spec.rb +1 -1
- data/spec/unit/functions/downcase_spec.rb +1 -1
- data/spec/unit/functions/upcase_spec.rb +1 -1
- data/spec/unit/http/client_spec.rb +7 -8
- data/spec/unit/{network/resolver_spec.rb → http/dns_spec.rb} +3 -3
- data/spec/unit/http/external_client_spec.rb +4 -4
- data/spec/unit/{network/http → http}/factory_spec.rb +5 -11
- data/spec/unit/{network/http/session_spec.rb → http/pool_entry_spec.rb} +3 -3
- data/spec/unit/{network/http → http}/pool_spec.rb +12 -17
- data/spec/unit/{util/http_proxy_spec.rb → http/proxy_spec.rb} +2 -69
- data/spec/unit/http/resolver_spec.rb +13 -13
- data/spec/unit/http/service/compiler_spec.rb +0 -62
- data/spec/unit/http/service/file_server_spec.rb +3 -3
- data/spec/unit/http/service/puppetserver_spec.rb +34 -4
- data/spec/unit/http/service_spec.rb +0 -1
- data/spec/unit/http/session_spec.rb +16 -14
- data/spec/unit/{network/http → http}/site_spec.rb +3 -3
- data/spec/unit/indirector/face_spec.rb +1 -0
- data/spec/unit/indirector/facts/facter_spec.rb +98 -0
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +5 -3
- data/spec/unit/indirector/file_bucket_file/selector_spec.rb +8 -26
- data/spec/unit/indirector/file_content/rest_spec.rb +0 -4
- data/spec/unit/indirector/file_metadata/rest_spec.rb +0 -4
- data/spec/unit/indirector/file_server_spec.rb +1 -15
- data/spec/unit/indirector/indirection_spec.rb +12 -8
- data/spec/unit/indirector/report/rest_spec.rb +2 -17
- data/spec/unit/indirector/request_spec.rb +0 -264
- data/spec/unit/indirector/rest_spec.rb +98 -752
- data/spec/unit/indirector_spec.rb +2 -2
- data/spec/unit/module_tool/applications/installer_spec.rb +0 -66
- data/spec/unit/network/authconfig_spec.rb +2 -129
- data/spec/unit/network/authorization_spec.rb +2 -55
- data/spec/unit/network/formats_spec.rb +4 -4
- data/spec/unit/network/http/api/indirected_routes_spec.rb +5 -92
- data/spec/unit/network/http/api/master/v3_spec.rb +28 -7
- data/spec/unit/network/http/api_spec.rb +10 -0
- data/spec/unit/network/http/connection_spec.rb +19 -41
- data/spec/unit/network/http/handler_spec.rb +0 -1
- data/spec/unit/network/http_pool_spec.rb +0 -4
- data/spec/unit/node/environment_spec.rb +33 -21
- data/spec/unit/node_spec.rb +2 -54
- data/spec/unit/parser/compiler_spec.rb +19 -3
- data/spec/unit/parser/functions/create_resources_spec.rb +2 -20
- data/spec/unit/parser/resource_spec.rb +8 -14
- data/spec/unit/parser/templatewrapper_spec.rb +3 -4
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +4 -7
- data/spec/unit/pops/loaders/loaders_spec.rb +6 -21
- data/spec/unit/pops/parser/parse_application_spec.rb +4 -22
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +0 -1
- data/spec/unit/pops/parser/parse_capabilities_spec.rb +8 -21
- data/spec/unit/pops/parser/parse_site_spec.rb +20 -24
- data/spec/unit/pops/resource/resource_type_impl_spec.rb +0 -71
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +1 -1
- data/spec/unit/pops/types/type_calculator_spec.rb +6 -6
- data/spec/unit/pops/types/type_factory_spec.rb +1 -1
- data/spec/unit/pops/validator/validator_spec.rb +61 -46
- data/spec/unit/pops/visitor_spec.rb +1 -1
- data/spec/unit/property_spec.rb +0 -1
- data/spec/unit/provider/nameservice_spec.rb +64 -122
- data/spec/unit/provider/package/apt_spec.rb +8 -4
- data/spec/unit/provider/package/base_spec.rb +5 -6
- data/spec/unit/provider/package/dpkg_spec.rb +0 -48
- data/spec/unit/provider/package/gem_spec.rb +32 -0
- data/spec/unit/provider/package/pacman_spec.rb +12 -18
- data/spec/unit/provider/package/pip_spec.rb +11 -6
- data/spec/unit/provider/package/pkgdmg_spec.rb +4 -0
- data/spec/unit/provider/package/puppet_gem_spec.rb +3 -2
- data/spec/unit/provider/service/smf_spec.rb +401 -165
- data/spec/unit/provider/service/windows_spec.rb +0 -1
- data/spec/unit/provider/user/aix_spec.rb +0 -5
- data/spec/unit/provider/user/hpux_spec.rb +1 -1
- data/spec/unit/provider/user/pw_spec.rb +0 -2
- data/spec/unit/provider/user/useradd_spec.rb +0 -1
- data/spec/unit/provider_spec.rb +8 -18
- data/spec/unit/resource/type_collection_spec.rb +2 -22
- data/spec/unit/resource/type_spec.rb +1 -1
- data/spec/unit/resource_spec.rb +10 -67
- data/spec/unit/settings/http_extra_headers_spec.rb +2 -4
- data/spec/unit/settings/integer_setting_spec.rb +42 -0
- data/spec/unit/settings/port_setting_spec.rb +31 -0
- data/spec/unit/settings/priority_setting_spec.rb +4 -4
- data/spec/unit/settings_spec.rb +23 -13
- data/spec/unit/ssl/base_spec.rb +37 -3
- data/spec/unit/ssl/certificate_request_spec.rb +15 -45
- data/spec/unit/ssl/certificate_spec.rb +2 -11
- data/spec/unit/ssl/ssl_provider_spec.rb +2 -5
- data/spec/unit/ssl/state_machine_spec.rb +0 -1
- data/spec/unit/ssl/verifier_spec.rb +0 -21
- data/spec/unit/transaction/additional_resource_generator_spec.rb +7 -3
- data/spec/unit/transaction/event_manager_spec.rb +11 -14
- data/spec/unit/transaction/report_spec.rb +0 -2
- data/spec/unit/transaction/resource_harness_spec.rb +2 -2
- data/spec/unit/transaction_spec.rb +48 -91
- data/spec/unit/type/file/checksum_spec.rb +6 -6
- data/spec/unit/type/file/content_spec.rb +2 -1
- data/spec/unit/type/file/ensure_spec.rb +1 -1
- data/spec/unit/type/file/mode_spec.rb +1 -1
- data/spec/unit/type/file/selinux_spec.rb +2 -0
- data/spec/unit/type/file/source_spec.rb +0 -1
- data/spec/unit/type/file_spec.rb +18 -6
- data/spec/unit/type/group_spec.rb +6 -13
- data/spec/unit/type/package_spec.rb +1 -1
- data/spec/unit/type/resources_spec.rb +7 -7
- data/spec/unit/type/service_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +1 -0
- data/spec/unit/type_spec.rb +22 -2
- data/spec/unit/util/at_fork_spec.rb +2 -2
- data/spec/unit/util/autoload_spec.rb +1 -5
- data/spec/unit/util/backups_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +11 -44
- data/spec/unit/util/inifile_spec.rb +14 -6
- data/spec/unit/util/log_spec.rb +7 -8
- data/spec/unit/util/logging_spec.rb +3 -3
- data/spec/unit/util/monkey_patches_spec.rb +0 -6
- data/spec/unit/util/posix_spec.rb +15 -363
- data/spec/unit/util/run_mode_spec.rb +21 -121
- data/spec/unit/util/selinux_spec.rb +52 -76
- data/spec/unit/util/storage_spec.rb +1 -3
- data/spec/unit/util/suidmanager_spec.rb +41 -44
- data/spec/unit/util/windows/string_spec.rb +1 -3
- data/spec/unit/util/yaml_spec.rb +0 -54
- data/spec/unit/util_spec.rb +6 -31
- metadata +40 -233
- data/conf/auth.conf +0 -150
- data/lib/puppet/application/cert.rb +0 -76
- data/lib/puppet/application/key.rb +0 -4
- data/lib/puppet/application/man.rb +0 -4
- data/lib/puppet/application/status.rb +0 -4
- data/lib/puppet/face/key.rb +0 -16
- data/lib/puppet/face/man.rb +0 -145
- data/lib/puppet/face/module/build.rb +0 -14
- data/lib/puppet/face/module/generate.rb +0 -14
- data/lib/puppet/face/module/search.rb +0 -103
- data/lib/puppet/face/status.rb +0 -51
- data/lib/puppet/ffi/posix.rb +0 -10
- data/lib/puppet/ffi/posix/constants.rb +0 -14
- data/lib/puppet/ffi/posix/functions.rb +0 -24
- data/lib/puppet/indirector/certificate/file.rb +0 -9
- data/lib/puppet/indirector/certificate/rest.rb +0 -18
- data/lib/puppet/indirector/certificate_request/file.rb +0 -9
- data/lib/puppet/indirector/certificate_request/memory.rb +0 -7
- data/lib/puppet/indirector/certificate_request/rest.rb +0 -11
- data/lib/puppet/indirector/file_content/http.rb +0 -22
- data/lib/puppet/indirector/key/file.rb +0 -46
- data/lib/puppet/indirector/key/memory.rb +0 -7
- data/lib/puppet/indirector/ssl_file.rb +0 -162
- data/lib/puppet/indirector/status.rb +0 -3
- data/lib/puppet/indirector/status/local.rb +0 -12
- data/lib/puppet/indirector/status/rest.rb +0 -27
- data/lib/puppet/module_tool/applications/searcher.rb +0 -29
- data/lib/puppet/network/auth_config_parser.rb +0 -90
- data/lib/puppet/network/authstore.rb +0 -283
- data/lib/puppet/network/http/api/master/v3/authorization.rb +0 -18
- data/lib/puppet/network/http/api/master/v3/environment.rb +0 -88
- data/lib/puppet/network/http/base_pool.rb +0 -36
- data/lib/puppet/network/http/compression.rb +0 -127
- data/lib/puppet/network/http/connection_adapter.rb +0 -184
- data/lib/puppet/network/http/nocache_pool.rb +0 -28
- data/lib/puppet/network/rest_controller.rb +0 -2
- data/lib/puppet/network/rights.rb +0 -210
- data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +0 -66
- data/lib/puppet/parser/compiler/catalog_validator/site_validator.rb +0 -22
- data/lib/puppet/parser/environment_compiler.rb +0 -202
- data/lib/puppet/pops/types/enumeration.rb +0 -16
- data/lib/puppet/resource/capability_finder.rb +0 -154
- data/lib/puppet/rest/errors.rb +0 -15
- data/lib/puppet/rest/response.rb +0 -35
- data/lib/puppet/rest/route.rb +0 -85
- data/lib/puppet/rest/routes.rb +0 -135
- data/lib/puppet/settings/alias_setting.rb +0 -37
- data/lib/puppet/ssl/host.rb +0 -505
- data/lib/puppet/ssl/key.rb +0 -61
- data/lib/puppet/ssl/validator.rb +0 -61
- data/lib/puppet/ssl/validator/default_validator.rb +0 -209
- data/lib/puppet/ssl/validator/no_validator.rb +0 -22
- data/lib/puppet/ssl/verifier_adapter.rb +0 -58
- data/lib/puppet/status.rb +0 -40
- data/lib/puppet/util/connection.rb +0 -88
- data/lib/puppet/util/fact_dif.rb +0 -62
- data/lib/puppet/util/ssl.rb +0 -83
- data/lib/puppet/util/windows/api_types.rb +0 -309
- data/lib/puppet/util/windows/monkey_patches/dir.rb +0 -40
- data/lib/puppet/vendor/load_pathspec.rb +0 -1
- data/lib/puppet/vendor/pathspec/CHANGELOG.md +0 -2
- data/lib/puppet/vendor/pathspec/LICENSE +0 -201
- data/lib/puppet/vendor/pathspec/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/pathspec/README.md +0 -53
- data/lib/puppet/vendor/pathspec/lib/pathspec.rb +0 -122
- data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +0 -275
- data/lib/puppet/vendor/pathspec/lib/pathspec/regexspec.rb +0 -17
- data/lib/puppet/vendor/pathspec/lib/pathspec/spec.rb +0 -14
- data/man/man8/puppet-key.8 +0 -126
- data/man/man8/puppet-man.8 +0 -76
- data/man/man8/puppet-status.8 +0 -108
- data/spec/fixtures/integration/application/agent/cached_deferred_catalog.json +0 -91
- data/spec/integration/network/authconfig_spec.rb +0 -256
- data/spec/integration/util/windows/monkey_patches/dir_spec.rb +0 -11
- data/spec/unit/application/man_spec.rb +0 -52
- data/spec/unit/capability_spec.rb +0 -414
- data/spec/unit/face/key_spec.rb +0 -9
- data/spec/unit/face/module/search_spec.rb +0 -231
- data/spec/unit/face/status_spec.rb +0 -9
- data/spec/unit/indirector/certificate/file_spec.rb +0 -14
- data/spec/unit/indirector/certificate/rest_spec.rb +0 -61
- data/spec/unit/indirector/certificate_request/file_spec.rb +0 -14
- data/spec/unit/indirector/certificate_request/rest_spec.rb +0 -25
- data/spec/unit/indirector/key/file_spec.rb +0 -78
- data/spec/unit/indirector/ssl_file_spec.rb +0 -305
- data/spec/unit/indirector/status/local_spec.rb +0 -10
- data/spec/unit/indirector/status/rest_spec.rb +0 -50
- data/spec/unit/module_tool/applications/searcher_spec.rb +0 -38
- data/spec/unit/network/auth_config_parser_spec.rb +0 -115
- data/spec/unit/network/authstore_spec.rb +0 -422
- data/spec/unit/network/http/api/master/v3/authorization_spec.rb +0 -57
- data/spec/unit/network/http/api/master/v3/environment_spec.rb +0 -185
- data/spec/unit/network/http/compression_spec.rb +0 -240
- data/spec/unit/network/http/nocache_pool_spec.rb +0 -64
- data/spec/unit/network/http_spec.rb +0 -9
- data/spec/unit/network/rights_spec.rb +0 -439
- data/spec/unit/parser/environment_compiler_spec.rb +0 -730
- data/spec/unit/pops/evaluator/deferred_resolver_spec.rb +0 -20
- data/spec/unit/pops/types/enumeration_spec.rb +0 -51
- data/spec/unit/resource/capability_finder_spec.rb +0 -148
- data/spec/unit/rest/route_spec.rb +0 -132
- data/spec/unit/ssl/host_spec.rb +0 -645
- data/spec/unit/ssl/key_spec.rb +0 -173
- data/spec/unit/ssl/validator_spec.rb +0 -278
- data/spec/unit/status_spec.rb +0 -45
- data/spec/unit/util/ssl_spec.rb +0 -91
@@ -143,11 +143,6 @@ describe 'Puppet::Type::User::Provider::Aix' do
|
|
143
143
|
it "returns the user's password" do
|
144
144
|
expect(call_parse_password).to eql('some_password')
|
145
145
|
end
|
146
|
-
|
147
|
-
it "returns the user's password with tabs" do
|
148
|
-
resource[:name] = 'tab_password_user'
|
149
|
-
expect(call_parse_password).to eql('some_password')
|
150
|
-
end
|
151
146
|
end
|
152
147
|
|
153
148
|
# TODO: If we move from using Mocha to rspec's mocks,
|
@@ -33,7 +33,7 @@ describe Puppet::Type.type(:user).provider(:hpuxuseradd),
|
|
33
33
|
before :each do
|
34
34
|
allow(Etc).to receive(:getpwent).and_return(pwent)
|
35
35
|
allow(Etc).to receive(:getpwnam).and_return(pwent)
|
36
|
-
allow(
|
36
|
+
allow(resource).to receive(:command).with(:modify).and_return('/usr/sam/lbin/usermod.sam')
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should have feature manages_passwords" do
|
@@ -53,14 +53,12 @@ describe Puppet::Type.type(:user).provider(:pw) do
|
|
53
53
|
|
54
54
|
it "should use -G with the correct argument when the groups property is set" do
|
55
55
|
resource[:groups] = "group1"
|
56
|
-
allow(Puppet::Util::POSIX).to receive(:groups_of).with('testuser').and_return([])
|
57
56
|
expect(provider).to receive(:execute).with(include("-G").and(include("group1")), kind_of(Hash))
|
58
57
|
provider.create
|
59
58
|
end
|
60
59
|
|
61
60
|
it "should use -G with all the given groups when the groups property is set to an array" do
|
62
61
|
resource[:groups] = ["group1", "group2"]
|
63
|
-
allow(Puppet::Util::POSIX).to receive(:groups_of).with('testuser').and_return([])
|
64
62
|
expect(provider).to receive(:execute).with(include("-G").and(include("group1,group2")), kind_of(Hash))
|
65
63
|
provider.create
|
66
64
|
end
|
@@ -4,7 +4,6 @@ RSpec::Matchers.define_negated_matcher :excluding, :include
|
|
4
4
|
|
5
5
|
describe Puppet::Type.type(:user).provider(:useradd) do
|
6
6
|
before :each do
|
7
|
-
allow(Puppet::Util::POSIX).to receive(:groups_of).and_return([])
|
8
7
|
allow(described_class).to receive(:command).with(:password).and_return('/usr/bin/chage')
|
9
8
|
allow(described_class).to receive(:command).with(:localpassword).and_return('/usr/sbin/lchage')
|
10
9
|
allow(described_class).to receive(:command).with(:add).and_return('/usr/sbin/useradd')
|
data/spec/unit/provider_spec.rb
CHANGED
@@ -648,37 +648,27 @@ describe Puppet::Provider do
|
|
648
648
|
it "delegates instance execute to Puppet::Util::Execution" do
|
649
649
|
expect(Puppet::Util::Execution).to receive(:execute).with("a_command", { :option => "value" })
|
650
650
|
|
651
|
-
provider.new.execute
|
651
|
+
provider.new.send(:execute, "a_command", { :option => "value" })
|
652
652
|
end
|
653
653
|
|
654
654
|
it "delegates class execute to Puppet::Util::Execution" do
|
655
655
|
expect(Puppet::Util::Execution).to receive(:execute).with("a_command", { :option => "value" })
|
656
656
|
|
657
|
-
provider.execute
|
657
|
+
provider.send(:execute, "a_command", { :option => "value" })
|
658
658
|
end
|
659
659
|
|
660
660
|
it "delegates instance execpipe to Puppet::Util::Execution" do
|
661
|
-
|
661
|
+
block = Proc.new { }
|
662
|
+
expect(Puppet::Util::Execution).to receive(:execpipe).with("a_command", true, block)
|
662
663
|
|
663
|
-
|
664
|
+
provider.new.send(:execpipe, "a_command", true, block)
|
664
665
|
end
|
665
666
|
|
666
667
|
it "delegates class execpipe to Puppet::Util::Execution" do
|
667
|
-
|
668
|
+
block = Proc.new { }
|
669
|
+
expect(Puppet::Util::Execution).to receive(:execpipe).with("a_command", true, block)
|
668
670
|
|
669
|
-
|
670
|
-
end
|
671
|
-
|
672
|
-
it "delegates instance execfail to Puppet::Util::Execution" do
|
673
|
-
expect(Puppet::Util::Execution).to receive(:execfail).with("a_command", "an exception to raise")
|
674
|
-
|
675
|
-
provider.new.execfail("a_command", "an exception to raise")
|
676
|
-
end
|
677
|
-
|
678
|
-
it "delegates class execfail to Puppet::Util::Execution" do
|
679
|
-
expect(Puppet::Util::Execution).to receive(:execfail).with("a_command", "an exception to raise")
|
680
|
-
|
681
|
-
provider.execfail("a_command", "an exception to raise")
|
671
|
+
provider.send(:execpipe, "a_command", true, block)
|
682
672
|
end
|
683
673
|
end
|
684
674
|
|
@@ -75,18 +75,16 @@ describe Puppet::Resource::TypeCollection do
|
|
75
75
|
end.to raise_error(Puppet::ParseError, /cannot be redefined/)
|
76
76
|
end
|
77
77
|
|
78
|
-
it "should remove all nodes, classes
|
78
|
+
it "should remove all nodes, classes and definitions when cleared" do
|
79
79
|
loader = Puppet::Resource::TypeCollection.new(environment)
|
80
80
|
loader.add Puppet::Resource::Type.new(:hostclass, "class")
|
81
81
|
loader.add Puppet::Resource::Type.new(:definition, "define")
|
82
82
|
loader.add Puppet::Resource::Type.new(:node, "node")
|
83
|
-
loader.add Puppet::Resource::Type.new(:application, "application")
|
84
83
|
|
85
84
|
loader.clear
|
86
85
|
expect(loader.hostclass("class")).to be_nil
|
87
86
|
expect(loader.definition("define")).to be_nil
|
88
87
|
expect(loader.node("node")).to be_nil
|
89
|
-
expect(loader.node("application")).to be_nil
|
90
88
|
end
|
91
89
|
|
92
90
|
describe "when looking up names" do
|
@@ -155,7 +153,7 @@ describe Puppet::Resource::TypeCollection do
|
|
155
153
|
end
|
156
154
|
end
|
157
155
|
|
158
|
-
KINDS = %w{hostclass node definition
|
156
|
+
KINDS = %w{hostclass node definition}
|
159
157
|
KINDS.each do |data|
|
160
158
|
describe "behavior of add for #{data}" do
|
161
159
|
|
@@ -178,24 +176,6 @@ describe Puppet::Resource::TypeCollection do
|
|
178
176
|
it "should return nil when asked for a #{data} that has not been added" do
|
179
177
|
expect(Puppet::Resource::TypeCollection.new(environment).send(data, "foo")).to be_nil
|
180
178
|
end
|
181
|
-
|
182
|
-
if data != "node"
|
183
|
-
it "should fail if an application with the same name is added" do
|
184
|
-
loader = Puppet::Resource::TypeCollection.new(environment)
|
185
|
-
instance = Puppet::Resource::Type.new(data, "foo")
|
186
|
-
application = Puppet::Resource::Type.new(:application, "foo")
|
187
|
-
loader.add(instance)
|
188
|
-
expect { loader.add(application) }.to raise_error(Puppet::ParseError, /redefine/)
|
189
|
-
end
|
190
|
-
|
191
|
-
it "should fail if there is an application with the same name" do
|
192
|
-
loader = Puppet::Resource::TypeCollection.new(environment)
|
193
|
-
application = Puppet::Resource::Type.new(:application, "foo")
|
194
|
-
instance = Puppet::Resource::Type.new(data, "foo")
|
195
|
-
loader.add(instance)
|
196
|
-
expect { loader.add(application) }.to raise_error(Puppet::ParseError, /redefine/)
|
197
|
-
end
|
198
|
-
end
|
199
179
|
end
|
200
180
|
end
|
201
181
|
|
@@ -554,7 +554,7 @@ describe Puppet::Resource::Type do
|
|
554
554
|
|
555
555
|
it "should not create a subscope for the :main class" do
|
556
556
|
allow(@resource).to receive(:title).and_return(:main)
|
557
|
-
expect(@
|
557
|
+
expect(@type).not_to receive(:subscope)
|
558
558
|
expect(@type).to receive(:set_resource_parameters).with(@resource, @scope)
|
559
559
|
|
560
560
|
@type.evaluate_code(@resource)
|
data/spec/unit/resource_spec.rb
CHANGED
@@ -286,42 +286,9 @@ describe Puppet::Resource do
|
|
286
286
|
Puppet::Parser::AST::Leaf.new(value: value)
|
287
287
|
end
|
288
288
|
|
289
|
-
it "should fail when asked to set default values and it is not a parser resource" do
|
290
|
-
environment.known_resource_types.add(
|
291
|
-
Puppet::Resource::Type.new(:definition, "default_param", :arguments => {"a" => ast_leaf("default")})
|
292
|
-
)
|
293
|
-
resource = Puppet::Resource.new("default_param", "name", :environment => environment)
|
294
|
-
expect { resource.set_default_parameters(scope) }.to raise_error(Puppet::DevError)
|
295
|
-
end
|
296
|
-
|
297
|
-
it "should evaluate and set any default values when no value is provided" do
|
298
|
-
environment.known_resource_types.add(
|
299
|
-
Puppet::Resource::Type.new(:definition, "default_param", :arguments => {"a" => ast_leaf("a_default_value")})
|
300
|
-
)
|
301
|
-
resource = Puppet::Parser::Resource.new("default_param", "name", :scope => scope)
|
302
|
-
resource.set_default_parameters(scope)
|
303
|
-
expect(resource["a"]).to eq("a_default_value")
|
304
|
-
end
|
305
|
-
|
306
|
-
it "should skip attributes with no default value" do
|
307
|
-
environment.known_resource_types.add(
|
308
|
-
Puppet::Resource::Type.new(:definition, "no_default_param", :arguments => {"a" => ast_leaf("a_default_value")})
|
309
|
-
)
|
310
|
-
resource = Puppet::Parser::Resource.new("no_default_param", "name", :scope => scope)
|
311
|
-
expect { resource.set_default_parameters(scope) }.not_to raise_error
|
312
|
-
end
|
313
|
-
|
314
|
-
it "should return the list of default parameters set" do
|
315
|
-
environment.known_resource_types.add(
|
316
|
-
Puppet::Resource::Type.new(:definition, "default_param", :arguments => {"a" => ast_leaf("a_default_value")})
|
317
|
-
)
|
318
|
-
resource = Puppet::Parser::Resource.new("default_param", "name", :scope => scope)
|
319
|
-
expect(resource.set_default_parameters(scope)).to eq(["a"])
|
320
|
-
end
|
321
|
-
|
322
289
|
describe "when the resource type is :hostclass" do
|
323
290
|
let(:environment_name) { "testing env" }
|
324
|
-
let(:fact_values) { {
|
291
|
+
let(:fact_values) { { :a => 1 } }
|
325
292
|
let(:port) { Puppet::Parser::AST::Leaf.new(:value => '80') }
|
326
293
|
|
327
294
|
def inject_and_set_defaults(resource, scope)
|
@@ -330,7 +297,10 @@ describe Puppet::Resource do
|
|
330
297
|
|
331
298
|
before do
|
332
299
|
environment.known_resource_types.add(apache)
|
333
|
-
|
300
|
+
|
301
|
+
allow(scope).to receive(:host).and_return('host')
|
302
|
+
allow(scope).to receive(:environment).and_return(environment)
|
303
|
+
allow(scope).to receive(:facts).and_return(Puppet::Node::Facts.new("facts", fact_values))
|
334
304
|
end
|
335
305
|
|
336
306
|
context 'with a default value expression' do
|
@@ -402,7 +372,6 @@ describe Puppet::Resource do
|
|
402
372
|
|
403
373
|
it "should use the value provided" do
|
404
374
|
expect(Puppet::DataBinding.indirection).not_to receive(:find)
|
405
|
-
expect(resource.set_default_parameters(scope)).to eq([])
|
406
375
|
expect(resource[:port]).to eq('8080')
|
407
376
|
end
|
408
377
|
|
@@ -444,28 +413,6 @@ describe Puppet::Resource do
|
|
444
413
|
end
|
445
414
|
end
|
446
415
|
|
447
|
-
describe "when validating all required parameters are present" do
|
448
|
-
it "should be able to validate that all required parameters are present" do
|
449
|
-
environment.known_resource_types.add(
|
450
|
-
Puppet::Resource::Type.new(:definition, "required_param", :arguments => {"a" => nil})
|
451
|
-
)
|
452
|
-
expect { Puppet::Resource.new("required_param", "name", :environment => environment).validate_complete }.to raise_error(Puppet::ParseError)
|
453
|
-
end
|
454
|
-
|
455
|
-
it "should not fail when all required parameters are present" do
|
456
|
-
environment.known_resource_types.add(
|
457
|
-
Puppet::Resource::Type.new(:definition, "no_required_param")
|
458
|
-
)
|
459
|
-
resource = Puppet::Resource.new("no_required_param", "name", :environment => environment)
|
460
|
-
resource["a"] = "meh"
|
461
|
-
expect { resource.validate_complete }.not_to raise_error
|
462
|
-
end
|
463
|
-
|
464
|
-
it "should not validate against builtin types" do
|
465
|
-
expect { Puppet::Resource.new("file", "/bar").validate_complete }.not_to raise_error
|
466
|
-
end
|
467
|
-
end
|
468
|
-
|
469
416
|
describe "when referring to a resource with name canonicalization" do
|
470
417
|
it "should canonicalize its own name" do
|
471
418
|
res = Puppet::Resource.new("file", "/path/")
|
@@ -624,15 +571,11 @@ describe Puppet::Resource do
|
|
624
571
|
expect(resource.to_hash[:myvar]).to eq("bob")
|
625
572
|
end
|
626
573
|
|
627
|
-
it "should set :name to the title if :name is not present for non-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
it "should set :name to the title if :name is not present for a definition" do
|
633
|
-
type = Puppet::Resource::Type.new(:definition, :foo)
|
634
|
-
environment.known_resource_types.add(type)
|
635
|
-
resource = Puppet::Resource.new :foo, "bar", :environment => environment
|
574
|
+
it "should set :name to the title if :name is not present for non-builtin types" do
|
575
|
+
krt = Puppet::Resource::TypeCollection.new("myenv")
|
576
|
+
krt.add Puppet::Resource::Type.new(:definition, :foo)
|
577
|
+
resource = Puppet::Resource.new :foo, "bar"
|
578
|
+
allow(resource).to receive(:known_resource_types).and_return(krt)
|
636
579
|
expect(resource.to_hash[:name]).to eq("bar")
|
637
580
|
end
|
638
581
|
end
|
@@ -46,18 +46,16 @@ describe Puppet::Settings::HttpExtraHeadersSetting do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
describe 'raises an error when' do
|
49
|
-
|
50
|
-
# Ruby 2.3 reports the class of these objects as Fixnum, whereas later ruby versions report them as Integer
|
51
49
|
it 'is given an unexpected object type' do
|
52
50
|
expect {
|
53
51
|
subject.munge(65)
|
54
|
-
}.to raise_error(ArgumentError, /^Expected an Array, String, or Hash, got a
|
52
|
+
}.to raise_error(ArgumentError, /^Expected an Array, String, or Hash, got a Integer/)
|
55
53
|
end
|
56
54
|
|
57
55
|
it 'is given an array of unexpected object types' do
|
58
56
|
expect {
|
59
57
|
subject.munge([65, 82])
|
60
|
-
}.to raise_error(ArgumentError, /^Expected an Array or String, got a
|
58
|
+
}.to raise_error(ArgumentError, /^Expected an Array or String, got a Integer/)
|
61
59
|
end
|
62
60
|
end
|
63
61
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'puppet/settings'
|
4
|
+
require 'puppet/settings/integer_setting'
|
5
|
+
|
6
|
+
describe Puppet::Settings::IntegerSetting do
|
7
|
+
let(:setting) { described_class.new(:settings => double('settings'), :desc => "test") }
|
8
|
+
|
9
|
+
it "is of type :integer" do
|
10
|
+
expect(setting.type).to eq(:integer)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "when munging the setting" do
|
14
|
+
it "returns the same value if given a positive integer" do
|
15
|
+
expect(setting.munge(5)).to eq(5)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns the same value if given a negative integer" do
|
19
|
+
expect(setting.munge(-25)).to eq(-25)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns an integer if given a valid integer as string" do
|
23
|
+
expect(setting.munge('12')).to eq(12)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "returns an integer if given a valid negative integer as string" do
|
27
|
+
expect(setting.munge('-12')).to eq(-12)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "returns an integer if given a valid positive integer as string" do
|
31
|
+
expect(setting.munge('+12')).to eq(12)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "raises if given an invalid value" do
|
35
|
+
expect { setting.munge('a5') }.to raise_error(Puppet::Settings::ValidationError)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "raises if given nil" do
|
39
|
+
expect { setting.munge(nil) }.to raise_error(Puppet::Settings::ValidationError)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'puppet/settings'
|
4
|
+
require 'puppet/settings/port_setting'
|
5
|
+
|
6
|
+
describe Puppet::Settings::PortSetting do
|
7
|
+
let(:setting) { described_class.new(:settings => double('settings'), :desc => "test") }
|
8
|
+
|
9
|
+
it "is of type :port" do
|
10
|
+
expect(setting.type).to eq(:port)
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "when munging the setting" do
|
14
|
+
it "returns the same value if given a valid port as integer" do
|
15
|
+
expect(setting.munge(5)).to eq(5)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns an integer if given valid port as string" do
|
19
|
+
expect(setting.munge('12')).to eq(12)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "raises if given a negative port number" do
|
23
|
+
expect { setting.munge('-5') }.to raise_error(Puppet::Settings::ValidationError)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "raises if the port number is too high" do
|
27
|
+
expect { setting.munge(65536) }.to raise_error(Puppet::Settings::ValidationError)
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -52,10 +52,10 @@ describe Puppet::Settings::PrioritySetting do
|
|
52
52
|
describe "on a Windows-like platform it", :if => Puppet::Util::Platform.windows? do
|
53
53
|
it "parses high, normal, low, and idle priorities" do
|
54
54
|
{
|
55
|
-
'high' => Puppet::
|
56
|
-
'normal' => Puppet::
|
57
|
-
'low' => Puppet::
|
58
|
-
'idle' => Puppet::
|
55
|
+
'high' => Puppet::FFI::Windows::Constants::HIGH_PRIORITY_CLASS,
|
56
|
+
'normal' => Puppet::FFI::Windows::Constants::NORMAL_PRIORITY_CLASS,
|
57
|
+
'low' => Puppet::FFI::Windows::Constants::BELOW_NORMAL_PRIORITY_CLASS,
|
58
|
+
'idle' => Puppet::FFI::Windows::Constants::IDLE_PRIORITY_CLASS
|
59
59
|
}.each do |value, converted_value|
|
60
60
|
expect(setting.munge(value)).to eq(converted_value)
|
61
61
|
end
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -1088,7 +1088,7 @@ describe Puppet::Settings do
|
|
1088
1088
|
before(:each) do
|
1089
1089
|
@settings.define_settings :main, PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS
|
1090
1090
|
@settings.define_settings :server, :masterport => { :desc => "a", :default => 1000 }
|
1091
|
-
@settings.define_settings :server, :serverport => { :
|
1091
|
+
@settings.define_settings :server, :serverport => { :desc => "a", :default => 1000 }
|
1092
1092
|
@settings.define_settings :server, :ca_port => { :desc => "a", :default => "$serverport" }
|
1093
1093
|
@settings.define_settings :server, :report_port => { :desc => "a", :default => "$serverport" }
|
1094
1094
|
|
@@ -1110,10 +1110,9 @@ describe Puppet::Settings do
|
|
1110
1110
|
"
|
1111
1111
|
end
|
1112
1112
|
|
1113
|
-
it { expect(@settings[:serverport]).to eq(
|
1114
|
-
it { expect(@settings[:ca_port]).to eq("
|
1115
|
-
it { expect(@settings[:report_port]).to eq("
|
1116
|
-
it { expect(@settings[:masterport]).to eq(445) }
|
1113
|
+
it { expect(@settings[:serverport]).to eq(445) }
|
1114
|
+
it { expect(@settings[:ca_port]).to eq("445") }
|
1115
|
+
it { expect(@settings[:report_port]).to eq("445") }
|
1117
1116
|
end
|
1118
1117
|
|
1119
1118
|
context 'with serverport and masterport in main' do
|
@@ -1127,7 +1126,6 @@ describe Puppet::Settings do
|
|
1127
1126
|
it { expect(@settings[:serverport]).to eq(445) }
|
1128
1127
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1129
1128
|
it { expect(@settings[:report_port]).to eq("445") }
|
1130
|
-
it { expect(@settings[:masterport]).to eq(444) }
|
1131
1129
|
end
|
1132
1130
|
|
1133
1131
|
context 'with serverport and masterport in agent' do
|
@@ -1141,7 +1139,6 @@ describe Puppet::Settings do
|
|
1141
1139
|
it { expect(@settings[:serverport]).to eq(445) }
|
1142
1140
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1143
1141
|
it { expect(@settings[:report_port]).to eq("445") }
|
1144
|
-
it { expect(@settings[:masterport]).to eq(444) }
|
1145
1142
|
end
|
1146
1143
|
|
1147
1144
|
context 'with both serverport and masterport in main and agent' do
|
@@ -1158,7 +1155,6 @@ describe Puppet::Settings do
|
|
1158
1155
|
it { expect(@settings[:serverport]).to eq(445) }
|
1159
1156
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1160
1157
|
it { expect(@settings[:report_port]).to eq("445") }
|
1161
|
-
it { expect(@settings[:masterport]).to eq(444) }
|
1162
1158
|
end
|
1163
1159
|
|
1164
1160
|
context 'with serverport in agent and masterport in main' do
|
@@ -1173,7 +1169,6 @@ describe Puppet::Settings do
|
|
1173
1169
|
it { expect(@settings[:serverport]).to eq(444) }
|
1174
1170
|
it { expect(@settings[:ca_port]).to eq("444") }
|
1175
1171
|
it { expect(@settings[:report_port]).to eq("444") }
|
1176
|
-
it { expect(@settings[:masterport]).to eq(445) }
|
1177
1172
|
end
|
1178
1173
|
|
1179
1174
|
context 'with masterport in main' do
|
@@ -1186,7 +1181,6 @@ describe Puppet::Settings do
|
|
1186
1181
|
it { expect(@settings[:serverport]).to eq(445) }
|
1187
1182
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1188
1183
|
it { expect(@settings[:report_port]).to eq("445") }
|
1189
|
-
it { expect(@settings[:masterport]).to eq(445) }
|
1190
1184
|
end
|
1191
1185
|
|
1192
1186
|
context 'with masterport in agent' do
|
@@ -1199,7 +1193,6 @@ describe Puppet::Settings do
|
|
1199
1193
|
it { expect(@settings[:serverport]).to eq(445) }
|
1200
1194
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1201
1195
|
it { expect(@settings[:report_port]).to eq("445") }
|
1202
|
-
it { expect(@settings[:masterport]).to eq(445) }
|
1203
1196
|
end
|
1204
1197
|
|
1205
1198
|
context 'with serverport in agent' do
|
@@ -1210,7 +1203,7 @@ describe Puppet::Settings do
|
|
1210
1203
|
end
|
1211
1204
|
|
1212
1205
|
it { expect(@settings[:serverport]).to eq(445) }
|
1213
|
-
it { expect(@settings[:masterport]).to eq(
|
1206
|
+
it { expect(@settings[:masterport]).to eq(445) }
|
1214
1207
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1215
1208
|
it { expect(@settings[:report_port]).to eq("445") }
|
1216
1209
|
end
|
@@ -1223,7 +1216,7 @@ describe Puppet::Settings do
|
|
1223
1216
|
end
|
1224
1217
|
|
1225
1218
|
it { expect(@settings[:serverport]).to eq(445) }
|
1226
|
-
it { expect(@settings[:masterport]).to eq(
|
1219
|
+
it { expect(@settings[:masterport]).to eq(445) }
|
1227
1220
|
it { expect(@settings[:ca_port]).to eq("445") }
|
1228
1221
|
it { expect(@settings[:report_port]).to eq("445") }
|
1229
1222
|
end
|
@@ -1991,6 +1984,23 @@ describe Puppet::Settings do
|
|
1991
1984
|
end
|
1992
1985
|
end
|
1993
1986
|
|
1987
|
+
describe 'when settings_catalog is disabled' do
|
1988
|
+
let(:settings) { Puppet::Settings.new }
|
1989
|
+
before do
|
1990
|
+
allow(Puppet).to receive(:[]).with(:settings_catalog).and_return(false)
|
1991
|
+
end
|
1992
|
+
|
1993
|
+
it 'does not compile and apply settings catalog' do
|
1994
|
+
expect(settings).not_to receive(:to_catalog)
|
1995
|
+
settings.use(:main)
|
1996
|
+
end
|
1997
|
+
|
1998
|
+
it 'logs a message that settings catalog is skipped' do
|
1999
|
+
expect(Puppet).to receive(:debug).with('Skipping settings catalog for sections main')
|
2000
|
+
settings.use(:main)
|
2001
|
+
end
|
2002
|
+
end
|
2003
|
+
|
1994
2004
|
describe "when dealing with printing configs" do
|
1995
2005
|
before do
|
1996
2006
|
@settings = Puppet::Settings.new
|