puppet 5.4.0-universal-darwin → 5.5.0-universal-darwin
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.
- data/Gemfile +3 -3
- data/MAINTAINERS +0 -19
- data/README.md +5 -5
- data/Rakefile +26 -0
- data/conf/auth.conf +5 -0
- data/ext/project_data.yaml +1 -0
- data/ext/regexp_nodes/regexp_nodes.rb +3 -4
- data/lib/puppet/application/apply.rb +1 -1
- data/lib/puppet/application/cert.rb +3 -1
- data/lib/puppet/application/device.rb +100 -13
- data/lib/puppet/application/facts.rb +5 -0
- data/lib/puppet/application/lookup.rb +12 -2
- data/lib/puppet/configurer.rb +37 -17
- data/lib/puppet/confine.rb +4 -1
- data/lib/puppet/datatypes.rb +1 -1
- data/lib/puppet/environments.rb +1 -1
- data/lib/puppet/error.rb +6 -3
- data/lib/puppet/external/dot.rb +0 -7
- data/lib/puppet/external/nagios/parser.rb +1 -1
- data/lib/puppet/face/config.rb +92 -10
- data/lib/puppet/face/epp.rb +31 -6
- data/lib/puppet/face/facts.rb +49 -0
- data/lib/puppet/face/help.rb +33 -35
- data/lib/puppet/face/help/action.erb +1 -1
- data/lib/puppet/face/help/face.erb +1 -1
- data/lib/puppet/face/man.rb +55 -12
- data/lib/puppet/face/parser.rb +30 -3
- data/lib/puppet/file_bucket/file.rb +0 -2
- data/lib/puppet/file_serving/base.rb +10 -10
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/forge/errors.rb +3 -3
- data/lib/puppet/functions.rb +1 -3
- data/lib/puppet/functions/alert.rb +1 -1
- data/lib/puppet/functions/all.rb +6 -6
- data/lib/puppet/functions/annotate.rb +10 -10
- data/lib/puppet/functions/any.rb +6 -6
- data/lib/puppet/functions/assert_type.rb +4 -4
- data/lib/puppet/functions/binary_file.rb +14 -2
- data/lib/puppet/functions/break.rb +31 -2
- data/lib/puppet/functions/call.rb +4 -4
- data/lib/puppet/functions/contain.rb +19 -3
- data/lib/puppet/functions/convert_to.rb +6 -5
- data/lib/puppet/functions/crit.rb +1 -1
- data/lib/puppet/functions/debug.rb +1 -1
- data/lib/puppet/functions/defined.rb +11 -9
- data/lib/puppet/functions/dig.rb +26 -2
- data/lib/puppet/functions/each.rb +8 -8
- data/lib/puppet/functions/emerg.rb +1 -1
- data/lib/puppet/functions/empty.rb +79 -0
- data/lib/puppet/functions/err.rb +1 -1
- data/lib/puppet/functions/eyaml_lookup_key.rb +3 -1
- data/lib/puppet/functions/filter.rb +7 -7
- data/lib/puppet/functions/find_file.rb +15 -1
- data/lib/puppet/functions/flatten.rb +64 -0
- data/lib/puppet/functions/hiera.rb +6 -6
- data/lib/puppet/functions/hiera_array.rb +6 -6
- data/lib/puppet/functions/hiera_hash.rb +6 -6
- data/lib/puppet/functions/hiera_include.rb +8 -8
- data/lib/puppet/functions/include.rb +28 -2
- data/lib/puppet/functions/info.rb +1 -1
- data/lib/puppet/functions/inline_epp.rb +2 -2
- data/lib/puppet/functions/join.rb +56 -0
- data/lib/puppet/functions/json_data.rb +2 -2
- data/lib/puppet/functions/keys.rb +25 -0
- data/lib/puppet/functions/length.rb +44 -0
- data/lib/puppet/functions/lest.rb +39 -1
- data/lib/puppet/functions/lookup.rb +2 -1
- data/lib/puppet/functions/map.rb +10 -9
- data/lib/puppet/functions/match.rb +6 -6
- data/lib/puppet/functions/new.rb +995 -2
- data/lib/puppet/functions/next.rb +1 -1
- data/lib/puppet/functions/notice.rb +1 -1
- data/lib/puppet/functions/reduce.rb +6 -6
- data/lib/puppet/functions/regsubst.rb +9 -3
- data/lib/puppet/functions/require.rb +36 -2
- data/lib/puppet/functions/return.rb +1 -1
- data/lib/puppet/functions/reverse_each.rb +71 -2
- data/lib/puppet/functions/slice.rb +23 -9
- data/lib/puppet/functions/split.rb +12 -10
- data/lib/puppet/functions/step.rb +73 -1
- data/lib/puppet/functions/strftime.rb +176 -2
- data/lib/puppet/functions/then.rb +65 -2
- data/lib/puppet/functions/tree_each.rb +19 -19
- data/lib/puppet/functions/type.rb +42 -1
- data/lib/puppet/functions/unique.rb +13 -13
- data/lib/puppet/functions/unwrap.rb +8 -4
- data/lib/puppet/functions/values.rb +25 -0
- data/lib/puppet/functions/versioncmp.rb +1 -1
- data/lib/puppet/functions/warning.rb +1 -1
- data/lib/puppet/functions/with.rb +6 -4
- data/lib/puppet/functions/yaml_data.rb +3 -1
- data/lib/puppet/indirector/certificate_status/file.rb +1 -1
- data/lib/puppet/indirector/facts/facter.rb +1 -3
- data/lib/puppet/indirector/facts/rest.rb +21 -0
- data/lib/puppet/indirector/facts/yaml.rb +0 -4
- data/lib/puppet/indirector/rest.rb +2 -2
- data/lib/puppet/module.rb +3 -3
- data/lib/puppet/module/task.rb +2 -3
- data/lib/puppet/module_tool/applications/application.rb +4 -4
- data/lib/puppet/module_tool/applications/builder.rb +2 -2
- data/lib/puppet/module_tool/applications/checksummer.rb +3 -3
- data/lib/puppet/module_tool/applications/unpacker.rb +2 -2
- data/lib/puppet/module_tool/metadata.rb +3 -3
- data/lib/puppet/network/authconfig.rb +1 -1
- data/lib/puppet/network/format_support.rb +1 -1
- data/lib/puppet/network/formats.rb +5 -7
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -0
- data/lib/puppet/network/http/api/master/v3/environment.rb +2 -2
- data/lib/puppet/network/http/api/master/v3/environments.rb +2 -2
- data/lib/puppet/network/http/error.rb +3 -3
- data/lib/puppet/network/resolver.rb +1 -2
- data/lib/puppet/parser/compiler.rb +12 -5
- data/lib/puppet/parser/compiler/catalog_validator/env_relationship_validator.rb +1 -1
- data/lib/puppet/parser/functions/fqdn_rand.rb +15 -4
- data/lib/puppet/parser/functions/new.rb +31 -46
- data/lib/puppet/parser/parser_factory.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/parser/type_loader.rb +11 -11
- data/lib/puppet/pops/evaluator/closure.rb +1 -1
- data/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +2 -2
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +2 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +5 -2
- data/lib/puppet/pops/functions/dispatch.rb +1 -1
- data/lib/puppet/pops/issue_reporter.rb +18 -1
- data/lib/puppet/pops/issues.rb +6 -3
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -2
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -2
- data/lib/puppet/pops/loader/task_instantiator.rb +5 -5
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -1
- data/lib/puppet/pops/loaders.rb +18 -7
- data/lib/puppet/pops/lookup/global_data_provider.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +55 -6
- data/lib/puppet/pops/model/factory.rb +6 -3
- data/lib/puppet/pops/model/model_tree_dumper.rb +4 -0
- data/lib/puppet/pops/model/pn_transformer.rb +400 -0
- data/lib/puppet/pops/parser/egrammar.ra +1 -1
- data/lib/puppet/pops/parser/eparser.rb +1 -1
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/lexer_support.rb +3 -2
- data/lib/puppet/pops/parser/locator.rb +0 -2
- data/lib/puppet/pops/parser/pn_parser.rb +316 -0
- data/lib/puppet/pops/pcore.rb +17 -17
- data/lib/puppet/pops/pn.rb +236 -0
- data/lib/puppet/pops/serialization/json.rb +7 -7
- data/lib/puppet/pops/types/class_loader.rb +6 -3
- data/lib/puppet/pops/types/implementation_registry.rb +28 -35
- data/lib/puppet/pops/types/p_object_type.rb +3 -3
- data/lib/puppet/pops/types/p_timespan_type.rb +2 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +24 -1
- data/lib/puppet/pops/types/ruby_generator.rb +3 -4
- data/lib/puppet/pops/types/type_calculator.rb +1 -1
- data/lib/puppet/pops/types/type_factory.rb +0 -4
- data/lib/puppet/pops/types/type_mismatch_describer.rb +1 -1
- data/lib/puppet/pops/types/type_parser.rb +14 -7
- data/lib/puppet/pops/types/types.rb +1 -1
- data/lib/puppet/pops/utils.rb +2 -2
- data/lib/puppet/pops/validation/checker4_0.rb +6 -2
- data/lib/puppet/provider/group/groupadd.rb +3 -1
- data/lib/puppet/provider/group/windows_adsi.rb +4 -7
- data/lib/puppet/provider/nameservice.rb +3 -3
- data/lib/puppet/provider/package/pacman.rb +4 -4
- data/lib/puppet/provider/package/pip.rb +3 -3
- data/lib/puppet/provider/package/pkgdmg.rb +3 -3
- data/lib/puppet/provider/package/pkgutil.rb +2 -2
- data/lib/puppet/provider/package/portage.rb +9 -9
- data/lib/puppet/provider/package/zypper.rb +2 -2
- data/lib/puppet/provider/service/base.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +3 -2
- data/lib/puppet/provider/service/systemd.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +6 -2
- data/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +20 -9
- data/lib/puppet/provider/zfs/zfs.rb +1 -1
- data/lib/puppet/reference/configuration.rb +2 -0
- data/lib/puppet/reference/type.rb +11 -11
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/capability_finder.rb +5 -5
- data/lib/puppet/resource/catalog.rb +6 -3
- data/lib/puppet/resource/status.rb +9 -2
- data/lib/puppet/resource/type.rb +1 -1
- data/lib/puppet/settings.rb +31 -19
- data/lib/puppet/settings/base_setting.rb +5 -0
- data/lib/puppet/settings/config_file.rb +1 -1
- data/lib/puppet/settings/ttl_setting.rb +5 -0
- data/lib/puppet/ssl/certificate_factory.rb +2 -2
- data/lib/puppet/ssl/certificate_request.rb +0 -2
- data/lib/puppet/syntax_checkers/json.rb +1 -1
- data/lib/puppet/transaction/additional_resource_generator.rb +2 -2
- data/lib/puppet/transaction/event.rb +1 -1
- data/lib/puppet/transaction/report.rb +18 -12
- data/lib/puppet/type.rb +9 -13
- data/lib/puppet/type/augeas.rb +2 -2
- data/lib/puppet/type/cron.rb +11 -6
- data/lib/puppet/type/exec.rb +1 -1
- data/lib/puppet/type/file.rb +4 -5
- data/lib/puppet/type/host.rb +1 -1
- data/lib/puppet/type/k5login.rb +30 -54
- data/lib/puppet/type/package.rb +3 -3
- data/lib/puppet/type/schedule.rb +12 -12
- data/lib/puppet/type/scheduled_task.rb +2 -2
- data/lib/puppet/type/ssh_authorized_key.rb +5 -5
- data/lib/puppet/type/sshkey.rb +2 -2
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/user.rb +1 -1
- data/lib/puppet/type/yumrepo.rb +26 -5
- data/lib/puppet/util.rb +0 -4
- data/lib/puppet/util/backups.rb +1 -1
- data/lib/puppet/util/inifile.rb +3 -4
- data/lib/puppet/util/json.rb +68 -0
- data/lib/puppet/util/json_lockfile.rb +3 -3
- data/lib/puppet/util/log.rb +2 -5
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/network_device/cisco/facts.rb +1 -1
- data/lib/puppet/util/plist.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -8
- data/lib/puppet/util/tagging.rb +1 -1
- data/lib/puppet/util/warnings.rb +0 -2
- data/lib/puppet/util/windows/adsi.rb +15 -18
- data/lib/puppet/util/windows/com.rb +2 -1
- data/lib/puppet/util/windows/file.rb +2 -2
- data/lib/puppet/util/windows/principal.rb +7 -6
- data/lib/puppet/util/windows/sid.rb +60 -7
- data/lib/puppet/util/windows/taskscheduler.rb +0 -9
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +53 -48
- data/locales/ja/puppet.po +1357 -912
- data/locales/puppet.pot +549 -466
- data/man/man5/puppet.conf.5 +103 -20
- data/man/man8/puppet-agent.8 +6 -2
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +35 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +33 -11
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +34 -12
- data/man/man8/puppet-facts.8 +50 -1
- data/man/man8/puppet-filebucket.8 +38 -11
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +10 -4
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +15 -6
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +31 -8
- 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 +67 -0
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +3 -3
- data/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/puppet_x/awesome2/echo_scheme_handler.rb +1 -1
- data/spec/integration/application/apply_spec.rb +15 -15
- data/spec/integration/application/lookup_spec.rb +21 -0
- data/spec/integration/faces/config_spec.rb +16 -4
- data/spec/integration/network/http/api/indirected_routes_spec.rb +5 -5
- data/spec/integration/parser/catalog_spec.rb +1 -1
- data/spec/integration/parser/collection_spec.rb +2 -2
- data/spec/integration/parser/compiler_spec.rb +17 -18
- data/spec/integration/parser/pcore_resource_spec.rb +2 -2
- data/spec/integration/parser/scope_spec.rb +2 -2
- data/spec/integration/ssl/certificate_authority_spec.rb +7 -7
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/integration/ssl/key_spec.rb +1 -1
- data/spec/integration/transaction/report_spec.rb +3 -3
- data/spec/integration/transaction_spec.rb +0 -1
- data/spec/integration/type/file_spec.rb +10 -11
- data/spec/integration/type_spec.rb +1 -2
- data/spec/integration/util/windows/adsi_spec.rb +86 -1
- data/spec/integration/util/windows/principal_spec.rb +11 -2
- data/spec/integration/util/windows/security_spec.rb +2 -2
- data/spec/lib/matchers/json.rb +4 -4
- data/spec/lib/puppet_spec/language.rb +34 -35
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +2 -2
- data/spec/shared_behaviours/file_server_terminus.rb +0 -2
- data/spec/shared_behaviours/things_that_declare_options.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/application/cert_spec.rb +21 -9
- data/spec/unit/application/device_spec.rb +96 -2
- data/spec/unit/application/face_base_spec.rb +2 -2
- data/spec/unit/application/lookup_spec.rb +0 -1
- data/spec/unit/configurer_spec.rb +14 -0
- data/spec/unit/confine_spec.rb +16 -0
- data/spec/unit/data_providers/hiera_data_provider_spec.rb +4 -4
- data/spec/unit/datatypes_spec.rb +49 -0
- data/spec/unit/environments_spec.rb +7 -0
- data/spec/unit/face/config_spec.rb +116 -12
- data/spec/unit/face/epp_face_spec.rb +53 -2
- data/spec/unit/face/facts_spec.rb +53 -0
- data/spec/unit/face/help_spec.rb +62 -69
- data/spec/unit/face/man_spec.rb +26 -0
- data/spec/unit/face/module/list_spec.rb +0 -1
- data/spec/unit/face/parser_spec.rb +78 -0
- data/spec/unit/file_bucket/dipper_spec.rb +0 -4
- data/spec/unit/file_serving/content_spec.rb +0 -1
- data/spec/unit/file_serving/fileset_spec.rb +0 -1
- data/spec/unit/file_serving/metadata_spec.rb +0 -1
- data/spec/unit/file_serving/terminus_selector_spec.rb +0 -2
- data/spec/unit/forge_spec.rb +1 -2
- data/spec/unit/functions/assert_type_spec.rb +1 -1
- data/spec/unit/functions/empty_spec.rb +77 -0
- data/spec/unit/functions/epp_spec.rb +1 -1
- data/spec/unit/functions/flatten_spec.rb +31 -0
- data/spec/unit/functions/include_spec.rb +2 -2
- data/spec/unit/functions/inline_epp_spec.rb +1 -1
- data/spec/unit/functions/join_spec.rb +33 -0
- data/spec/unit/functions/keys_spec.rb +31 -0
- data/spec/unit/functions/length_spec.rb +50 -0
- data/spec/unit/functions/lookup_fixture_spec.rb +1 -1
- data/spec/unit/functions/lookup_spec.rb +52 -0
- data/spec/unit/functions/shared.rb +1 -1
- data/spec/unit/functions/values_spec.rb +30 -0
- data/spec/unit/functions/versioncmp_spec.rb +1 -1
- data/spec/unit/functions4_spec.rb +30 -32
- data/spec/unit/graph/title_hash_prioritizer_spec.rb +2 -1
- data/spec/unit/indirector/catalog/compiler_spec.rb +0 -15
- data/spec/unit/indirector/facts/rest_spec.rb +45 -0
- data/spec/unit/indirector/facts/yaml_spec.rb +6 -0
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +2 -2
- data/spec/unit/indirector/indirection_spec.rb +1 -1
- data/spec/unit/indirector/node/ldap_spec.rb +2 -2
- data/spec/unit/indirector/request_spec.rb +0 -2
- data/spec/unit/indirector/rest_spec.rb +2 -2
- data/spec/unit/indirector_spec.rb +0 -1
- data/spec/unit/info_service_spec.rb +1 -1
- data/spec/unit/interface/action_manager_spec.rb +1 -1
- data/spec/unit/interface/action_spec.rb +1 -1
- data/spec/unit/module_spec.rb +0 -5
- data/spec/unit/module_tool/applications/builder_spec.rb +1 -1
- data/spec/unit/module_tool/applications/unpacker_spec.rb +4 -4
- data/spec/unit/network/formats_spec.rb +5 -13
- data/spec/unit/network/http/api/indirected_routes_spec.rb +6 -2
- data/spec/unit/network/http/connection_spec.rb +1 -1
- data/spec/unit/network/http/handler_spec.rb +3 -2
- data/spec/unit/node/environment_spec.rb +1 -1
- data/spec/unit/node_spec.rb +3 -3
- data/spec/unit/parser/compiler_spec.rb +9 -2
- data/spec/unit/parser/environment_compiler_spec.rb +8 -8
- data/spec/unit/parser/functions/create_resources_spec.rb +1 -1
- data/spec/unit/parser/functions/fail_spec.rb +1 -1
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +24 -0
- data/spec/unit/parser/functions/realize_spec.rb +1 -1
- data/spec/unit/parser/resource_spec.rb +0 -1
- data/spec/unit/parser/scope_spec.rb +3 -3
- data/spec/unit/parser/type_loader_spec.rb +1 -1
- data/spec/unit/pops/adaptable_spec.rb +0 -1
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +0 -3
- data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +0 -4
- data/spec/unit/pops/factory_rspec_helper.rb +1 -1
- data/spec/unit/pops/factory_spec.rb +5 -5
- data/spec/unit/pops/issues_spec.rb +23 -8
- data/spec/unit/pops/loaders/loaders_spec.rb +24 -2
- data/spec/unit/pops/loaders/static_loader_spec.rb +1 -1
- data/spec/unit/pops/lookup/interpolation_spec.rb +5 -0
- data/spec/unit/pops/lookup/lookup_spec.rb +56 -0
- data/spec/unit/pops/model/pn_transformer_spec.rb +53 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +14 -5
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +9 -9
- data/spec/unit/pops/parser/parse_calls_spec.rb +1 -1
- data/spec/unit/pops/parser/parse_functions_spec.rb +1 -1
- data/spec/unit/pops/parser/parse_heredoc_spec.rb +3 -3
- data/spec/unit/pops/parser/parse_lambda_spec.rb +1 -1
- data/spec/unit/pops/parser/parse_resource_spec.rb +35 -35
- data/spec/unit/pops/parser/pn_parser_spec.rb +101 -0
- data/spec/unit/pops/pn_spec.rb +148 -0
- data/spec/unit/pops/types/iterable_spec.rb +1 -1
- data/spec/unit/pops/types/p_object_type_spec.rb +5 -5
- data/spec/unit/pops/types/p_timespan_type_spec.rb +11 -4
- data/spec/unit/pops/types/p_timestamp_type_spec.rb +9 -2
- data/spec/unit/pops/types/p_type_set_type_spec.rb +106 -2
- data/spec/unit/pops/types/ruby_generator_spec.rb +3 -8
- data/spec/unit/pops/types/string_converter_spec.rb +3 -3
- data/spec/unit/pops/types/type_calculator_spec.rb +1 -1
- data/spec/unit/pops/validator/validator_spec.rb +3 -1
- data/spec/unit/property_spec.rb +2 -2
- data/spec/unit/provider/aixobject_spec.rb +1 -1
- data/spec/unit/provider/cron/crontab_spec.rb +3 -3
- data/spec/unit/provider/exec/posix_spec.rb +6 -6
- data/spec/unit/provider/group/groupadd_spec.rb +4 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +79 -22
- data/spec/unit/provider/ldap_spec.rb +0 -1
- data/spec/unit/provider/nameservice_spec.rb +5 -5
- data/spec/unit/provider/package/rpm_spec.rb +3 -4
- data/spec/unit/provider/package/yum_spec.rb +6 -2
- data/spec/unit/provider/parsedfile_spec.rb +1 -1
- data/spec/unit/provider/service/base_spec.rb +2 -4
- data/spec/unit/provider/service/init_spec.rb +2 -2
- data/spec/unit/provider/service/openrc_spec.rb +2 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/service/smf_spec.rb +2 -0
- data/spec/unit/provider/service/systemd_spec.rb +3 -3
- data/spec/unit/provider/service/upstart_spec.rb +7 -7
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +0 -4
- data/spec/unit/provider/sshkey/parsed_spec.rb +0 -2
- data/spec/unit/provider/user/useradd_spec.rb +15 -9
- data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
- data/spec/unit/provider/yumrepo/inifile_spec.rb +76 -0
- data/spec/unit/puppet_pal_2pec.rb +4 -5
- data/spec/unit/resource/catalog_spec.rb +8 -3
- data/spec/unit/resource/status_spec.rb +15 -4
- data/spec/unit/resource/type_spec.rb +2 -3
- data/spec/unit/settings_spec.rb +9 -4
- data/spec/unit/ssl/certificate_authority_spec.rb +1 -9
- data/spec/unit/ssl/certificate_request_spec.rb +1 -2
- data/spec/unit/transaction/report_spec.rb +41 -0
- data/spec/unit/transaction_spec.rb +1 -1
- data/spec/unit/type/exec_spec.rb +7 -9
- data/spec/unit/type/file/selinux_spec.rb +0 -1
- data/spec/unit/type/file_spec.rb +4 -3
- data/spec/unit/type/k5login_spec.rb +79 -10
- data/spec/unit/type/mount_spec.rb +1 -1
- data/spec/unit/type/nagios_spec.rb +6 -6
- data/spec/unit/type/user_spec.rb +1 -1
- data/spec/unit/type/yumrepo_spec.rb +18 -0
- data/spec/unit/type/zfs_spec.rb +1 -1
- data/spec/unit/type_spec.rb +14 -15
- data/spec/unit/util/docs_spec.rb +1 -1
- data/spec/unit/util/execution_spec.rb +0 -1
- data/spec/unit/util/inifile_spec.rb +35 -4
- data/spec/unit/util/log/destinations_spec.rb +2 -2
- data/spec/unit/util/log_spec.rb +6 -5
- data/spec/unit/util/network_device/cisco/device_spec.rb +2 -2
- data/spec/unit/util/plist_spec.rb +3 -3
- data/spec/unit/util/selinux_spec.rb +2 -2
- data/spec/unit/util/tagging_spec.rb +1 -7
- data/spec/unit/util/windows/adsi_spec.rb +31 -27
- data/spec/unit/util/windows/sid_spec.rb +86 -15
- data/spec/unit/util_spec.rb +2 -2
- data/spec/watchr.rb +0 -1
- data/tasks/benchmark.rake +37 -0
- data/tasks/manpages.rake +1 -1
- metadata +73 -11
- checksums.yaml +0 -7
@@ -99,7 +99,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
|
|
99
99
|
resource[:password_max_age] = 10
|
100
100
|
resource[:password_warn_days] = 15
|
101
101
|
provider.expects(:execute).with(includes('/usr/sbin/useradd'), kind_of(Hash))
|
102
|
-
provider.expects(:execute).with(['/usr/bin/chage', '-m', 5, '-M', 10, '-W', 15, 'myuser'],
|
102
|
+
provider.expects(:execute).with(['/usr/bin/chage', '-m', 5, '-M', 10, '-W', 15, 'myuser'], has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
103
103
|
provider.create
|
104
104
|
end
|
105
105
|
|
@@ -125,10 +125,10 @@ describe Puppet::Type.type(:user).provider(:useradd) do
|
|
125
125
|
expect { provider.create }.to raise_error(Puppet::Error, "UID 505 already exists, use allowdupe to force user creation")
|
126
126
|
end
|
127
127
|
|
128
|
-
it "should not use -G for luseradd and should call
|
128
|
+
it "should not use -G for luseradd and should call usermod with -G after luseradd when groups property is set" do
|
129
129
|
resource[:groups] = ['group1', 'group2']
|
130
|
-
provider.expects(:execute).with(Not(includes(
|
131
|
-
provider.expects(:execute).with(includes('/usr/sbin/
|
130
|
+
provider.expects(:execute).with(all_of(includes('/usr/sbin/luseradd'), Not(includes('-G'))), has_entry(:custom_environment, has_key('LIBUSER_CONF')))
|
131
|
+
provider.expects(:execute).with(all_of(includes('/usr/sbin/usermod'), includes('-G')), has_entry(:custom_environment, has_key('LIBUSER_CONF')))
|
132
132
|
provider.create
|
133
133
|
end
|
134
134
|
|
@@ -175,30 +175,36 @@ describe Puppet::Type.type(:user).provider(:useradd) do
|
|
175
175
|
end
|
176
176
|
|
177
177
|
it "should use usermod" do
|
178
|
-
provider.expects(:execute).with(['/usr/sbin/usermod', '-u', 150, 'myuser'],
|
178
|
+
provider.expects(:execute).with(['/usr/sbin/usermod', '-u', 150, 'myuser'], has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
179
179
|
provider.uid = 150
|
180
180
|
end
|
181
181
|
|
182
182
|
it "should use -o when allowdupe=true" do
|
183
183
|
resource[:allowdupe] = :true
|
184
|
-
provider.expects(:execute).with(includes('-o'),
|
184
|
+
provider.expects(:execute).with(includes('-o'), has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
185
185
|
provider.uid = 505
|
186
186
|
end
|
187
187
|
|
188
188
|
it 'should use chage for password_min_age' do
|
189
|
-
provider.expects(:execute).with(['/usr/bin/chage', '-m', 100, 'myuser'],
|
189
|
+
provider.expects(:execute).with(['/usr/bin/chage', '-m', 100, 'myuser'], has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
190
190
|
provider.password_min_age = 100
|
191
191
|
end
|
192
192
|
|
193
193
|
it 'should use chage for password_max_age' do
|
194
|
-
provider.expects(:execute).with(['/usr/bin/chage', '-M', 101, 'myuser'],
|
194
|
+
provider.expects(:execute).with(['/usr/bin/chage', '-M', 101, 'myuser'], has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
195
195
|
provider.password_max_age = 101
|
196
196
|
end
|
197
197
|
|
198
198
|
it 'should use chage for password_warn_days' do
|
199
|
-
provider.expects(:execute).with(['/usr/bin/chage', '-W', 99, 'myuser'],
|
199
|
+
provider.expects(:execute).with(['/usr/bin/chage', '-W', 99, 'myuser'], has_entries({:failonfail => true, :combine => true, :custom_environment => {}}))
|
200
200
|
provider.password_warn_days = 99
|
201
201
|
end
|
202
|
+
|
203
|
+
it 'should not call check_allow_dup if not modifying the uid' do
|
204
|
+
provider.expects(:check_allow_dup).never
|
205
|
+
provider.expects(:execute)
|
206
|
+
provider.home = 'foo/bar'
|
207
|
+
end
|
202
208
|
end
|
203
209
|
|
204
210
|
describe "on systems with the libuser and forcelocal=true" do
|
@@ -81,9 +81,9 @@ describe Puppet::Type.type(:user).provider(:windows_adsi), :if => Puppet.feature
|
|
81
81
|
let(:group3) { stub(:account => 'group3', :domain => '.', :sid => 'group3sid') }
|
82
82
|
|
83
83
|
before :each do
|
84
|
-
Puppet::Util::Windows::SID.stubs(:
|
85
|
-
Puppet::Util::Windows::SID.stubs(:
|
86
|
-
Puppet::Util::Windows::SID.stubs(:
|
84
|
+
Puppet::Util::Windows::SID.stubs(:name_to_principal).with('group1').returns(group1)
|
85
|
+
Puppet::Util::Windows::SID.stubs(:name_to_principal).with('group2').returns(group2)
|
86
|
+
Puppet::Util::Windows::SID.stubs(:name_to_principal).with('group3').returns(group3)
|
87
87
|
end
|
88
88
|
|
89
89
|
it "should return true for same lists of members" do
|
@@ -267,7 +267,7 @@ describe Puppet::Type.type(:user).provider(:windows_adsi), :if => Puppet.feature
|
|
267
267
|
end
|
268
268
|
|
269
269
|
it 'should be able to test whether a user exists' do
|
270
|
-
Puppet::Util::Windows::SID.stubs(:
|
270
|
+
Puppet::Util::Windows::SID.stubs(:name_to_principal).returns(nil)
|
271
271
|
Puppet::Util::Windows::ADSI.stubs(:connect).returns stub('connection', :Class => 'User')
|
272
272
|
expect(provider).to be_exists
|
273
273
|
|
@@ -1,7 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'puppet_spec/files'
|
2
3
|
|
3
4
|
describe Puppet::Type.type(:yumrepo).provider(:inifile) do
|
4
5
|
|
6
|
+
include PuppetSpec::Files
|
7
|
+
|
5
8
|
after(:each) do
|
6
9
|
described_class.clear
|
7
10
|
end
|
@@ -323,4 +326,77 @@ describe Puppet::Type.type(:yumrepo).provider(:inifile) do
|
|
323
326
|
end
|
324
327
|
end
|
325
328
|
end
|
329
|
+
|
330
|
+
describe "resource application after prefetch" do
|
331
|
+
let(:type_instance) do
|
332
|
+
Puppet::Type.type(:yumrepo).new(
|
333
|
+
:name => 'puppetlabs-products',
|
334
|
+
:ensure => :present,
|
335
|
+
:baseurl => 'http://yum.puppetlabs.com/el/6/products/$basearch',
|
336
|
+
:descr => 'Puppet Labs Products El 6 - $basearch',
|
337
|
+
:enabled => '1',
|
338
|
+
:gpgcheck => '1',
|
339
|
+
:gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs'
|
340
|
+
)
|
341
|
+
end
|
342
|
+
|
343
|
+
let(:provider) do
|
344
|
+
described_class.new(type_instance)
|
345
|
+
end
|
346
|
+
|
347
|
+
before :each do
|
348
|
+
@yumrepo_dir = tmpdir('yumrepo_integration_specs')
|
349
|
+
@yumrepo_conf_file = tmpfile('yumrepo_conf_file', @yumrepo_dir)
|
350
|
+
described_class.stubs(:reposdir).returns [@yumrepo_dir]
|
351
|
+
described_class.stubs(:repofiles).returns [@yumrepo_conf_file]
|
352
|
+
type_instance.provider = provider
|
353
|
+
end
|
354
|
+
|
355
|
+
it "preserves repo file contents that were created after prefetch" do
|
356
|
+
provider.class.prefetch({})
|
357
|
+
# we specifically want to create a file after prefetch has happened so that
|
358
|
+
# none of the sections in the file exist in the prefetch cache
|
359
|
+
repo_file = File.join(@yumrepo_dir, 'puppetlabs-products.repo')
|
360
|
+
contents = <<-HEREDOC
|
361
|
+
[puppetlabs-products]
|
362
|
+
name=created_by_package_after_prefetch
|
363
|
+
enabled=1
|
364
|
+
failovermethod=priority
|
365
|
+
gpgcheck=0
|
366
|
+
|
367
|
+
[additional_section]
|
368
|
+
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
|
369
|
+
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
|
370
|
+
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
|
371
|
+
failovermethod=priority
|
372
|
+
enabled=0
|
373
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
|
374
|
+
gpgcheck=1
|
375
|
+
HEREDOC
|
376
|
+
File.open(repo_file, 'wb') { |f| f.write(contents)}
|
377
|
+
|
378
|
+
provider.create
|
379
|
+
provider.flush
|
380
|
+
|
381
|
+
expected_contents = <<-HEREDOC
|
382
|
+
[puppetlabs-products]
|
383
|
+
name=Puppet Labs Products El 6 - $basearch
|
384
|
+
enabled=1
|
385
|
+
failovermethod=priority
|
386
|
+
gpgcheck=1
|
387
|
+
|
388
|
+
baseurl=http://yum.puppetlabs.com/el/6/products/$basearch
|
389
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs
|
390
|
+
[additional_section]
|
391
|
+
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
|
392
|
+
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
|
393
|
+
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
|
394
|
+
failovermethod=priority
|
395
|
+
enabled=0
|
396
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
|
397
|
+
gpgcheck=1
|
398
|
+
HEREDOC
|
399
|
+
expect(File.read(repo_file)).to eq(expected_contents)
|
400
|
+
end
|
401
|
+
end
|
326
402
|
end
|
@@ -691,7 +691,7 @@ describe 'Puppet Pal' do
|
|
691
691
|
end.to raise_error(/A block must be given to 'in_tmp_environment/)
|
692
692
|
end
|
693
693
|
|
694
|
-
it 'errors if an env_name is given and is not a String[1]' do
|
694
|
+
it 'errors if an env_name is given and is not a String[1]' do
|
695
695
|
expect do
|
696
696
|
Puppet::Pal.in_tmp_environment('', modulepath: modulepath, facts: node_facts) { |ctx| }
|
697
697
|
end.to raise_error(/temporary environment name has wrong type/)
|
@@ -839,7 +839,7 @@ describe 'Puppet Pal' do
|
|
839
839
|
|
840
840
|
it 'a given "modulepath" overrides the default' do
|
841
841
|
expect do
|
842
|
-
|
842
|
+
Puppet::Pal.in_environment('pal_env', env_dir: testing_env_dir, modulepath: [], facts: node_facts) do |ctx|
|
843
843
|
ctx.with_script_compiler {|c| c.evaluate_string('a::afunc()') }
|
844
844
|
end
|
845
845
|
end.to raise_error(/Unknown function: 'a::afunc'/)
|
@@ -874,7 +874,7 @@ describe 'Puppet Pal' do
|
|
874
874
|
end.to raise_error(/The environment directory '.*' does not exist/)
|
875
875
|
end
|
876
876
|
|
877
|
-
it 'errors if an env_name is given and is not a String[1]' do
|
877
|
+
it 'errors if an env_name is given and is not a String[1]' do
|
878
878
|
expect do
|
879
879
|
Puppet::Pal.in_environment('', env_dir: testing_env_dir, facts: node_facts) { |ctx| }
|
880
880
|
end.to raise_error(/env_name has wrong type/)
|
@@ -917,7 +917,7 @@ describe 'Puppet Pal' do
|
|
917
917
|
it 'a given "modulepath" overrides the default' do
|
918
918
|
testing_env_dir # creates the structure
|
919
919
|
expect do
|
920
|
-
|
920
|
+
Puppet::Pal.in_environment('pal_env', envpath: environments_dir, modulepath: [], facts: node_facts) do |ctx|
|
921
921
|
ctx.with_script_compiler { |c| c.evaluate_string('a::afunc()') }
|
922
922
|
end
|
923
923
|
end.to raise_error(/Unknown function: 'a::afunc'/)
|
@@ -940,7 +940,6 @@ describe 'Puppet Pal' do
|
|
940
940
|
|
941
941
|
it 'the envpath can have multiple entries - that are searched for the given env' do
|
942
942
|
testing_env_dir # creates the structure
|
943
|
-
several_dirs = "/tmp/nowhere/to/be/found:#{environments_dir}"
|
944
943
|
result = Puppet::Pal.in_environment('pal_env', envpath: environments_dir, facts: node_facts) do |ctx|
|
945
944
|
ctx.with_script_compiler {|c| c.evaluate_string('a::afunc()') }
|
946
945
|
end
|
@@ -160,7 +160,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
|
|
160
160
|
before do
|
161
161
|
@original = Puppet::Resource::Catalog.new("mynode")
|
162
162
|
@original.tag(*%w{one two three})
|
163
|
-
@original.add_class
|
163
|
+
@original.add_class(*%w{four five six})
|
164
164
|
|
165
165
|
@top = Puppet::Resource.new :class, 'top'
|
166
166
|
@topobject = Puppet::Resource.new :file, @basepath+'/topobject'
|
@@ -233,7 +233,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
|
|
233
233
|
before :each do
|
234
234
|
@original = Puppet::Resource::Catalog.new("mynode")
|
235
235
|
@original.tag(*%w{one two three})
|
236
|
-
@original.add_class
|
236
|
+
@original.add_class(*%w{four five six})
|
237
237
|
|
238
238
|
@r1 = stub_everything 'r1', :ref => "File[/a]"
|
239
239
|
@r1.stubs(:respond_to?).with(:ref).returns(true)
|
@@ -438,7 +438,7 @@ describe Puppet::Resource::Catalog, "when compiling" do
|
|
438
438
|
it "should optionally support an initialization block and should finalize after such blocks" do
|
439
439
|
@one.expects :finish
|
440
440
|
@two.expects :finish
|
441
|
-
|
441
|
+
Puppet::Resource::Catalog.new("host") do |conf|
|
442
442
|
conf.add_resource @one
|
443
443
|
conf.add_resource @two
|
444
444
|
end
|
@@ -629,6 +629,11 @@ describe Puppet::Resource::Catalog, "when compiling" do
|
|
629
629
|
@catalog.apply
|
630
630
|
end
|
631
631
|
|
632
|
+
it "should add a transaction evalution time to the report" do
|
633
|
+
@transaction.report.expects(:add_times).with(:transaction_evaluation, kind_of(Numeric))
|
634
|
+
@catalog.apply
|
635
|
+
end
|
636
|
+
|
632
637
|
it "should return the transaction" do
|
633
638
|
expect(@catalog.apply).to equal(@transaction)
|
634
639
|
end
|
@@ -32,7 +32,7 @@ describe Puppet::Resource::Status do
|
|
32
32
|
expect(status.send(attr)).to eq("foo")
|
33
33
|
end
|
34
34
|
|
35
|
-
it "should have a boolean method for determining
|
35
|
+
it "should have a boolean method for determining whether it was #{attr}" do
|
36
36
|
status.send(attr.to_s + "=", "foo")
|
37
37
|
expect(status).to send("be_#{attr}")
|
38
38
|
end
|
@@ -59,7 +59,7 @@ describe Puppet::Resource::Status do
|
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should copy the resource's tags" do
|
62
|
-
resource.
|
62
|
+
resource.tag('foo', 'bar')
|
63
63
|
status = Puppet::Resource::Status.new(resource)
|
64
64
|
expect(status).to be_tagged("foo")
|
65
65
|
expect(status).to be_tagged("bar")
|
@@ -70,6 +70,15 @@ describe Puppet::Resource::Status do
|
|
70
70
|
expect(Puppet::Resource::Status.new(resource).resource).to eq("foo")
|
71
71
|
end
|
72
72
|
|
73
|
+
it 'should set the provider_used correctly' do
|
74
|
+
expected_name = if Puppet::Util::Platform.windows?
|
75
|
+
'windows'
|
76
|
+
else
|
77
|
+
'posix'
|
78
|
+
end
|
79
|
+
expect(status.provider_used).to eq(expected_name)
|
80
|
+
end
|
81
|
+
|
73
82
|
it "should support tags" do
|
74
83
|
expect(Puppet::Resource::Status.ancestors).to include(Puppet::Util::Tagging)
|
75
84
|
end
|
@@ -146,7 +155,7 @@ describe Puppet::Resource::Status do
|
|
146
155
|
context 'when serializing' do
|
147
156
|
let(:status) do
|
148
157
|
s = Puppet::Resource::Status.new(resource)
|
149
|
-
s.file =
|
158
|
+
s.file = '/foo.rb'
|
150
159
|
s.line = 27
|
151
160
|
s.evaluation_time = 2.7
|
152
161
|
s.tags = %w{one two}
|
@@ -155,10 +164,11 @@ describe Puppet::Resource::Status do
|
|
155
164
|
s.changed = true
|
156
165
|
s.out_of_sync = true
|
157
166
|
s.skipped = false
|
167
|
+
s.provider_used = 'provider_used_class_name'
|
158
168
|
s
|
159
169
|
end
|
160
170
|
|
161
|
-
it
|
171
|
+
it 'should round trip through json' do
|
162
172
|
expect(status.containment_path).to eq(containment_path)
|
163
173
|
|
164
174
|
tripped = Puppet::Resource::Status.from_data_hash(JSON.parse(status.to_json))
|
@@ -169,6 +179,7 @@ describe Puppet::Resource::Status do
|
|
169
179
|
expect(tripped.line).to eq(status.line)
|
170
180
|
expect(tripped.resource).to eq(status.resource)
|
171
181
|
expect(tripped.resource_type).to eq(status.resource_type)
|
182
|
+
expect(tripped.provider_used).to eq(status.provider_used)
|
172
183
|
expect(tripped.evaluation_time).to eq(status.evaluation_time)
|
173
184
|
expect(tripped.tags).to eq(status.tags)
|
174
185
|
expect(tripped.time).to eq(status.time)
|
@@ -524,7 +524,6 @@ describe Puppet::Resource::Type do
|
|
524
524
|
subscope = stub 'subscope', :compiler => @compiler
|
525
525
|
@scope.expects(:newscope).with(:source => @type, :resource => @resource).returns subscope
|
526
526
|
|
527
|
-
elevel = 876
|
528
527
|
subscope.expects(:with_guarded_scope).yields
|
529
528
|
subscope.expects(:ephemeral_from).with(match, nil, nil).returns subscope
|
530
529
|
code.expects(:safeevaluate).with(subscope)
|
@@ -778,7 +777,7 @@ describe Puppet::Resource::Type do
|
|
778
777
|
|
779
778
|
describe "when merging code from another instance" do
|
780
779
|
def code(str)
|
781
|
-
|
780
|
+
Puppet::Pops::Model::Factory.literal(str)
|
782
781
|
end
|
783
782
|
|
784
783
|
it "should fail unless it is a class" do
|
@@ -811,7 +810,7 @@ describe Puppet::Resource::Type do
|
|
811
810
|
it "should copy the other class's parent if it has not parent" do
|
812
811
|
dest = Puppet::Resource::Type.new(:hostclass, "bar")
|
813
812
|
|
814
|
-
|
813
|
+
Puppet::Resource::Type.new(:hostclass, "parent")
|
815
814
|
source = Puppet::Resource::Type.new(:hostclass, "foo", :parent => "parent")
|
816
815
|
dest.merge(source)
|
817
816
|
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -104,7 +104,6 @@ describe Puppet::Settings do
|
|
104
104
|
end
|
105
105
|
|
106
106
|
it "should fail if the app defaults hash is missing any required values" do
|
107
|
-
incomplete_default_values = default_values.reject { |key, _| key == :confdir }
|
108
107
|
expect {
|
109
108
|
@settings.initialize_app_defaults(default_values.reject { |key, _| key == :confdir })
|
110
109
|
}.to raise_error(Puppet::Settings::SettingsError)
|
@@ -556,7 +555,8 @@ describe Puppet::Settings do
|
|
556
555
|
:two => { :default => "$one TWO", :desc => "b"},
|
557
556
|
:three => { :default => "$one $two THREE", :desc => "c"},
|
558
557
|
:four => { :default => "$two $three FOUR", :desc => "d"},
|
559
|
-
:five => { :default => nil, :desc => "e" }
|
558
|
+
:five => { :default => nil, :desc => "e" },
|
559
|
+
:code => { :default => "", :desc => "my code"}
|
560
560
|
Puppet::FileSystem.stubs(:exist?).returns true
|
561
561
|
end
|
562
562
|
|
@@ -612,6 +612,13 @@ describe Puppet::Settings do
|
|
612
612
|
expect(@settings[:two]).to eq("one TWO")
|
613
613
|
end
|
614
614
|
|
615
|
+
it "should not interpolate the value of the :code setting" do
|
616
|
+
@code = @settings.setting(:code)
|
617
|
+
@code.expects(:munge).never
|
618
|
+
|
619
|
+
expect(@settings[:code]).to eq("")
|
620
|
+
end
|
621
|
+
|
615
622
|
it "should have a run_mode that defaults to user" do
|
616
623
|
expect(@settings.preferred_run_mode).to eq(:user)
|
617
624
|
end
|
@@ -658,7 +665,6 @@ describe Puppet::Settings do
|
|
658
665
|
|
659
666
|
it "should not return values outside of its search path" do
|
660
667
|
text = "[other]\none = oval\n"
|
661
|
-
file = "/some/file"
|
662
668
|
@settings.stubs(:read_file).returns(text)
|
663
669
|
@settings.send(:parse_config_files)
|
664
670
|
expect(@settings[:one]).to eq("ONE")
|
@@ -938,7 +944,6 @@ describe Puppet::Settings do
|
|
938
944
|
end
|
939
945
|
|
940
946
|
it "does not require the value for a setting without a hook to resolve during global setup" do
|
941
|
-
hook_invoked = false
|
942
947
|
@settings.define_settings :section, :can_cause_problems => {:desc => '' }
|
943
948
|
|
944
949
|
@settings.define_settings(:main,
|
@@ -46,7 +46,6 @@ describe Puppet::SSL::CertificateAuthority do
|
|
46
46
|
Puppet[:ca] = false
|
47
47
|
Puppet.run_mode.stubs(:master?).returns true
|
48
48
|
|
49
|
-
ca = mock('ca')
|
50
49
|
Puppet::SSL::CertificateAuthority.expects(:new).never
|
51
50
|
expect(Puppet::SSL::CertificateAuthority.instance).to be_nil
|
52
51
|
end
|
@@ -57,7 +56,6 @@ describe Puppet::SSL::CertificateAuthority do
|
|
57
56
|
Puppet[:ca] = true
|
58
57
|
Puppet.run_mode.stubs(:master?).returns false
|
59
58
|
|
60
|
-
ca = mock('ca')
|
61
59
|
Puppet::SSL::CertificateAuthority.expects(:new).never
|
62
60
|
expect(Puppet::SSL::CertificateAuthority.instance).to be_nil
|
63
61
|
end
|
@@ -392,7 +390,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
392
390
|
Puppet::SSL::CertificateFactory.expects(:build).with do |*args|
|
393
391
|
args[2] == @cacert.content
|
394
392
|
end.returns @cert.content
|
395
|
-
|
393
|
+
@ca.sign(@name)
|
396
394
|
end
|
397
395
|
|
398
396
|
it "should pass the next serial as the serial number" do
|
@@ -986,8 +984,6 @@ describe Puppet::SSL::CertificateAuthority do
|
|
986
984
|
end
|
987
985
|
|
988
986
|
it "should get the serial number from inventory if no local certificate exists" do
|
989
|
-
real_cert = stub 'real_cert', :serial => 15
|
990
|
-
cert = stub 'cert', :content => real_cert
|
991
987
|
Puppet::SSL::Certificate.indirection.expects(:find).with("host").returns nil
|
992
988
|
|
993
989
|
@ca.inventory.expects(:serials).with("host").returns [16]
|
@@ -997,8 +993,6 @@ describe Puppet::SSL::CertificateAuthority do
|
|
997
993
|
end
|
998
994
|
|
999
995
|
it "should revoke all serials matching a name" do
|
1000
|
-
real_cert = stub 'real_cert', :serial => 15
|
1001
|
-
cert = stub 'cert', :content => real_cert
|
1002
996
|
Puppet::SSL::Certificate.indirection.expects(:find).with("host").returns nil
|
1003
997
|
|
1004
998
|
@ca.inventory.expects(:serials).with("host").returns [16, 20, 25]
|
@@ -1010,8 +1004,6 @@ describe Puppet::SSL::CertificateAuthority do
|
|
1010
1004
|
end
|
1011
1005
|
|
1012
1006
|
it "should raise an error if no certificate match" do
|
1013
|
-
real_cert = stub 'real_cert', :serial => 15
|
1014
|
-
cert = stub 'cert', :content => real_cert
|
1015
1007
|
Puppet::SSL::Certificate.indirection.expects(:find).with("host").returns nil
|
1016
1008
|
|
1017
1009
|
@ca.inventory.expects(:serials).with("host").returns []
|