puppet 3.8.7-x86-mingw32 → 4.0.0.rc1-x86-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.
- data/CONTRIBUTING.md +26 -11
- data/Gemfile +13 -25
- data/LICENSE +1 -1
- data/Rakefile +9 -0
- data/bin/puppet +7 -6
- data/conf/auth.conf +30 -26
- data/conf/environment.conf +16 -0
- data/conf/fileserver.conf +2 -2
- data/conf/puppet.conf +6 -0
- data/ext/README.environment +1 -1
- data/ext/build_defaults.yaml +16 -7
- data/ext/debian/control +5 -5
- data/ext/debian/puppet-common.manpages +0 -5
- data/ext/debian/puppet-common.postinst +3 -3
- data/ext/debian/puppet.init +23 -12
- data/ext/debian/puppet.logrotate +1 -2
- data/ext/debian/puppetmaster-common.postinst +6 -0
- data/ext/debian/puppetmaster.init +5 -5
- data/ext/debian/rules +4 -1
- data/ext/debian/vim-puppet.dirs +2 -0
- data/ext/debian/vim-puppet.yaml +2 -0
- data/ext/emacs/puppet-mode.el +0 -1
- data/ext/gentoo/conf.d/puppet +1 -1
- data/ext/gentoo/conf.d/puppetmaster +1 -1
- data/ext/nagios/check_puppet.rb +1 -1
- data/ext/project_data.yaml +6 -7
- data/ext/puppet-nm-dispatcher +13 -0
- data/ext/puppet-test +0 -66
- data/ext/puppetlisten/puppetlisten.rb +7 -5
- data/ext/rack/config.ru +12 -5
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/logrotate +1 -2
- data/ext/redhat/puppet.spec.erb +12 -8
- data/ext/redhat/server.init +1 -1
- data/ext/regexp_nodes/regexp_nodes.rb +1 -1
- data/ext/solaris/smf/svc-puppetd +1 -1
- data/ext/solaris/smf/svc-puppetmasterd +1 -1
- data/ext/suse/client.init +1 -1
- data/ext/suse/server.init +1 -1
- data/ext/systemd/puppet.service +1 -3
- data/ext/vim/syntax/puppet.vim +1 -1
- data/ext/windows/service/daemon.rb +19 -2
- data/install.rb +63 -7
- data/lib/hiera/puppet_function.rb +7 -18
- data/lib/hiera/scope.rb +4 -1
- data/lib/puppet.rb +19 -51
- data/lib/puppet/agent.rb +2 -6
- data/lib/puppet/application.rb +14 -65
- data/lib/puppet/application/agent.rb +7 -56
- data/lib/puppet/application/apply.rb +1 -6
- data/lib/puppet/application/ca.rb +5 -0
- data/lib/puppet/application/cert.rb +7 -3
- data/lib/puppet/application/certificate.rb +2 -0
- data/lib/puppet/application/device.rb +10 -36
- data/lib/puppet/application/doc.rb +16 -63
- data/lib/puppet/application/epp.rb +5 -0
- data/lib/puppet/application/face_base.rb +24 -5
- data/lib/puppet/application/master.rb +2 -5
- data/lib/puppet/application/resource.rb +17 -17
- data/lib/puppet/application_support.rb +57 -0
- data/lib/puppet/configurer.rb +3 -7
- data/lib/puppet/configurer/downloader.rb +1 -0
- data/lib/puppet/configurer/fact_handler.rb +1 -1
- data/lib/puppet/daemon.rb +6 -15
- data/lib/puppet/data_providers.rb +28 -0
- data/lib/puppet/data_providers/data_adapter.rb +86 -0
- data/lib/puppet/data_providers/data_function_support.rb +32 -0
- data/lib/puppet/data_providers/function_env_data_provider.rb +28 -0
- data/lib/puppet/data_providers/function_module_data_provider.rb +44 -0
- data/lib/puppet/defaults.rb +135 -530
- data/lib/puppet/environments.rb +10 -156
- data/lib/puppet/error.rb +4 -30
- data/lib/puppet/external/nagios/base.rb +2 -2
- data/lib/puppet/external/pson/common.rb +2 -17
- data/lib/puppet/external/pson/pure/generator.rb +1 -0
- data/lib/puppet/external/pson/pure/parser.rb +0 -11
- data/lib/puppet/face/catalog.rb +4 -4
- data/lib/puppet/face/certificate.rb +2 -3
- data/lib/puppet/face/certificate_request.rb +4 -3
- data/lib/puppet/face/certificate_revocation_list.rb +5 -9
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/epp.rb +479 -0
- data/lib/puppet/face/facts.rb +6 -49
- data/lib/puppet/face/file.rb +2 -2
- data/lib/puppet/face/file/download.rb +1 -2
- data/lib/puppet/face/help.rb +2 -3
- data/lib/puppet/face/module/build.rb +5 -5
- data/lib/puppet/face/module/changes.rb +1 -1
- data/lib/puppet/face/module/generate.rb +6 -6
- data/lib/puppet/face/module/install.rb +16 -16
- data/lib/puppet/face/module/list.rb +9 -9
- data/lib/puppet/face/module/uninstall.rb +5 -5
- data/lib/puppet/face/module/upgrade.rb +3 -3
- data/lib/puppet/face/node.rb +3 -4
- data/lib/puppet/face/node/clean.rb +5 -68
- data/lib/puppet/face/parser.rb +6 -8
- data/lib/puppet/face/report.rb +4 -4
- data/lib/puppet/face/resource.rb +1 -1
- data/lib/puppet/face/resource_type.rb +7 -4
- data/lib/puppet/face/status.rb +6 -12
- data/lib/puppet/feature/base.rb +0 -7
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_bucket/file.rb +12 -25
- data/lib/puppet/file_serving/base.rb +1 -11
- data/lib/puppet/file_serving/content.rb +5 -7
- data/lib/puppet/file_serving/metadata.rb +4 -61
- data/lib/puppet/file_serving/mount/pluginfacts.rb +1 -1
- data/lib/puppet/file_serving/mount/plugins.rb +1 -1
- data/lib/puppet/file_serving/terminus_helper.rb +16 -5
- data/lib/puppet/file_system.rb +6 -22
- data/lib/puppet/file_system/file_impl.rb +0 -4
- data/lib/puppet/file_system/memory_file.rb +0 -5
- data/lib/puppet/file_system/memory_impl.rb +0 -4
- data/lib/puppet/file_system/{file19.rb → posix.rb} +1 -1
- data/lib/puppet/file_system/{file19windows.rb → windows.rb} +2 -10
- data/lib/puppet/forge/repository.rb +12 -8
- data/lib/puppet/functions.rb +17 -51
- data/lib/puppet/functions/assert_type.rb +7 -7
- data/lib/puppet/functions/each.rb +1 -3
- data/lib/puppet/functions/epp.rb +3 -3
- data/lib/puppet/functions/filter.rb +3 -5
- data/lib/puppet/functions/hiera.rb +2 -23
- data/lib/puppet/functions/hiera_array.rb +3 -25
- data/lib/puppet/functions/hiera_hash.rb +2 -26
- data/lib/puppet/functions/hiera_include.rb +4 -37
- data/lib/puppet/functions/inline_epp.rb +1 -2
- data/lib/puppet/functions/lookup.rb +234 -0
- data/lib/puppet/functions/map.rb +1 -3
- data/lib/puppet/functions/match.rb +5 -5
- data/lib/puppet/functions/reduce.rb +1 -3
- data/lib/puppet/functions/regsubst.rb +79 -0
- data/lib/puppet/functions/scanf.rb +4 -3
- data/lib/puppet/functions/slice.rb +1 -3
- data/lib/puppet/functions/split.rb +47 -0
- data/lib/puppet/functions/with.rb +1 -1
- data/lib/puppet/graph/relationship_graph.rb +41 -13
- data/lib/puppet/graph/simple_graph.rb +6 -10
- data/lib/puppet/indirector/catalog/compiler.rb +0 -2
- data/lib/puppet/indirector/catalog/static_compiler.rb +4 -5
- data/lib/puppet/indirector/direct_file_server.rb +1 -3
- data/lib/puppet/indirector/face.rb +11 -2
- data/lib/puppet/indirector/facts/facter.rb +5 -1
- data/lib/puppet/indirector/facts/network_device.rb +5 -2
- data/lib/puppet/indirector/facts/store_configs.rb +3 -0
- data/lib/puppet/indirector/facts/yaml.rb +4 -0
- data/lib/puppet/indirector/file_metadata/file.rb +0 -15
- data/lib/puppet/indirector/file_server.rb +2 -16
- data/lib/puppet/indirector/hiera.rb +39 -1
- data/lib/puppet/indirector/indirection.rb +2 -9
- data/lib/puppet/indirector/node/ldap.rb +1 -1
- data/lib/puppet/indirector/request.rb +21 -81
- data/lib/puppet/indirector/resource/ral.rb +1 -2
- data/lib/puppet/indirector/resource/store_configs.rb +1 -2
- data/lib/puppet/indirector/resource_type/parser.rb +1 -1
- data/lib/puppet/indirector/rest.rb +21 -33
- data/lib/puppet/interface.rb +0 -7
- data/lib/puppet/interface/action_builder.rb +1 -1
- data/lib/puppet/interface/action_manager.rb +9 -13
- data/lib/puppet/interface/face_collection.rb +2 -2
- data/lib/puppet/interface/option_builder.rb +1 -3
- data/lib/puppet/metatype/manager.rb +1 -7
- data/lib/puppet/module.rb +42 -35
- data/lib/puppet/module_tool.rb +5 -7
- data/lib/puppet/module_tool/applications/application.rb +3 -10
- data/lib/puppet/module_tool/applications/installer.rb +13 -15
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +9 -11
- data/lib/puppet/module_tool/contents_description.rb +17 -13
- data/lib/puppet/module_tool/installed_modules.rb +4 -6
- data/lib/puppet/module_tool/metadata.rb +3 -14
- data/lib/puppet/module_tool/skeleton/templates/generator/Gemfile +3 -3
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +0 -1
- data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +1 -1
- data/lib/puppet/module_tool/tar/gnu.rb +1 -1
- data/lib/puppet/module_tool/tar/mini.rb +2 -2
- data/lib/puppet/network/auth_config_parser.rb +2 -2
- data/lib/puppet/network/authconfig.rb +32 -16
- data/lib/puppet/network/format_handler.rb +7 -7
- data/lib/puppet/network/format_support.rb +4 -0
- data/lib/puppet/network/formats.rb +6 -62
- data/lib/puppet/network/http.rb +12 -2
- data/lib/puppet/network/http/api.rb +42 -0
- data/lib/puppet/network/http/api/ca.rb +2 -0
- data/lib/puppet/network/http/api/ca/v1.rb +11 -0
- data/lib/puppet/network/http/api/{v1.rb → indirected_routes.rb} +57 -29
- data/lib/puppet/network/http/api/indirection_type.rb +32 -0
- data/lib/puppet/network/http/api/master.rb +2 -0
- data/lib/puppet/network/http/api/master/v3.rb +22 -0
- data/lib/puppet/network/http/api/master/v3/authorization.rb +18 -0
- data/lib/puppet/network/http/api/{v2 → master/v3}/environments.rb +2 -2
- data/lib/puppet/network/http/compression.rb +3 -5
- data/lib/puppet/network/http/connection.rb +1 -8
- data/lib/puppet/network/http/factory.rb +2 -3
- data/lib/puppet/network/http/handler.rb +3 -11
- data/lib/puppet/network/http/rack/rest.rb +4 -4
- data/lib/puppet/network/http/request.rb +4 -4
- data/lib/puppet/network/http/webrick.rb +1 -6
- data/lib/puppet/network/http/webrick/rest.rb +15 -8
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/network/rights.rb +2 -2
- data/lib/puppet/node.rb +2 -29
- data/lib/puppet/node/environment.rb +92 -184
- data/lib/puppet/node/facts.rb +22 -44
- data/lib/puppet/parameter.rb +3 -16
- data/lib/puppet/parameter/value.rb +1 -3
- data/lib/puppet/parameter/value_collection.rb +12 -11
- data/lib/puppet/parser.rb +12 -2
- data/lib/puppet/parser/ast.rb +9 -78
- data/lib/puppet/parser/ast/block_expression.rb +11 -36
- data/lib/puppet/parser/ast/branch.rb +15 -18
- data/lib/puppet/parser/ast/hostclass.rb +1 -3
- data/lib/puppet/parser/ast/leaf.rb +55 -212
- data/lib/puppet/parser/ast/node.rb +3 -11
- data/lib/puppet/parser/ast/pops_bridge.rb +2 -7
- data/lib/puppet/parser/ast/resource.rb +14 -20
- data/lib/puppet/parser/ast/resource_instance.rb +4 -7
- data/lib/puppet/parser/ast/resourceparam.rb +21 -22
- data/lib/puppet/parser/compiler.rb +41 -70
- data/lib/puppet/parser/e4_parser_adapter.rb +2 -23
- data/lib/puppet/parser/files.rb +22 -67
- data/lib/puppet/parser/functions.rb +1 -3
- data/lib/puppet/parser/functions/assert_type.rb +1 -2
- data/lib/puppet/parser/functions/contain.rb +5 -3
- data/lib/puppet/parser/functions/create_resources.rb +9 -1
- data/lib/puppet/parser/functions/defined.rb +33 -61
- data/lib/puppet/parser/functions/each.rb +1 -3
- data/lib/puppet/parser/functions/epp.rb +1 -2
- data/lib/puppet/parser/functions/file.rb +1 -3
- data/lib/puppet/parser/functions/filter.rb +1 -3
- data/lib/puppet/parser/functions/hiera.rb +4 -6
- data/lib/puppet/parser/functions/hiera_array.rb +4 -6
- data/lib/puppet/parser/functions/hiera_hash.rb +6 -8
- data/lib/puppet/parser/functions/hiera_include.rb +2 -10
- data/lib/puppet/parser/functions/include.rb +4 -2
- data/lib/puppet/parser/functions/lookup.rb +115 -105
- data/lib/puppet/parser/functions/map.rb +1 -3
- data/lib/puppet/parser/functions/match.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -6
- data/lib/puppet/parser/functions/reduce.rb +1 -3
- data/lib/puppet/parser/functions/regsubst.rb +1 -57
- data/lib/puppet/parser/functions/require.rb +6 -4
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/slice.rb +1 -3
- data/lib/puppet/parser/functions/split.rb +1 -1
- data/lib/puppet/parser/functions/with.rb +1 -2
- data/lib/puppet/parser/parser_factory.rb +5 -21
- data/lib/puppet/parser/relationship.rb +14 -37
- data/lib/puppet/parser/resource.rb +11 -22
- data/lib/puppet/parser/scope.rb +45 -135
- data/lib/puppet/parser/templatewrapper.rb +1 -29
- data/lib/puppet/parser/type_loader.rb +12 -15
- data/lib/puppet/plugins.rb +9 -0
- data/lib/{puppetx/puppet/bindings_scheme_handler.rb → puppet/plugins/binding_schemes.rb} +14 -4
- data/lib/puppet/plugins/configuration.rb +68 -0
- data/lib/puppet/plugins/data_providers.rb +90 -0
- data/lib/{puppetx/puppet/syntax_checker.rb → puppet/plugins/syntax_checkers.rb} +14 -2
- data/lib/puppet/pops.rb +6 -7
- data/lib/puppet/pops/adaptable.rb +16 -5
- data/lib/puppet/pops/binder/binder.rb +5 -4
- data/lib/puppet/pops/binder/bindings_composer.rb +6 -4
- data/lib/puppet/pops/binder/bindings_factory.rb +4 -0
- data/lib/puppet/pops/binder/bindings_label_provider.rb +1 -1
- data/lib/puppet/pops/binder/bindings_loader.rb +3 -8
- data/lib/puppet/pops/binder/bindings_model_dumper.rb +36 -8
- data/lib/puppet/pops/binder/config/binder_config.rb +2 -2
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/config/issues.rb +4 -0
- data/lib/puppet/pops/binder/injector.rb +0 -1
- data/lib/puppet/pops/binder/scheme_handler/symbolic_scheme.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +18 -50
- data/lib/puppet/pops/evaluator/callable_mismatch_describer.rb +5 -5
- data/lib/puppet/pops/evaluator/callable_signature.rb +2 -2
- data/lib/puppet/pops/evaluator/closure.rb +16 -21
- data/lib/puppet/pops/evaluator/collector_transformer.rb +11 -1
- data/lib/puppet/pops/evaluator/compare_operator.rb +0 -43
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +36 -152
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +6 -3
- data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +9 -57
- data/lib/puppet/pops/functions/dispatch.rb +1 -6
- data/lib/puppet/pops/issue_reporter.rb +16 -42
- data/lib/puppet/pops/issues.rb +13 -128
- data/lib/puppet/pops/loader/dependency_loader.rb +3 -3
- data/lib/puppet/pops/loader/loader.rb +21 -20
- data/lib/puppet/pops/loaders.rb +13 -8
- data/lib/puppet/pops/lookup.rb +96 -0
- data/lib/puppet/pops/merge_strategy.rb +283 -0
- data/lib/puppet/pops/model/ast_transformer.rb +4 -522
- data/lib/puppet/pops/model/factory.rb +20 -21
- data/lib/puppet/pops/model/model.rb +1 -1
- data/lib/puppet/pops/model/model_label_provider.rb +1 -1
- data/lib/puppet/pops/model/model_meta.rb +10 -7
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/egrammar.ra +1 -13
- data/lib/puppet/pops/parser/eparser.rb +1132 -1272
- data/lib/puppet/pops/parser/epp_support.rb +11 -22
- data/lib/puppet/pops/parser/evaluating_parser.rb +11 -10
- data/lib/puppet/pops/parser/heredoc_support.rb +12 -13
- data/lib/puppet/pops/parser/interpolation_support.rb +1 -7
- data/lib/puppet/pops/parser/lexer2.rb +33 -36
- data/lib/puppet/pops/parser/lexer_support.rb +20 -46
- data/lib/puppet/pops/parser/locator.rb +6 -30
- data/lib/puppet/pops/parser/parser_support.rb +14 -11
- data/lib/puppet/pops/parser/slurp_support.rb +6 -22
- data/lib/puppet/pops/patterns.rb +0 -3
- data/lib/puppet/pops/types/class_loader.rb +8 -8
- data/lib/puppet/pops/types/enumeration.rb +1 -1
- data/lib/puppet/pops/types/type_asserter.rb +45 -0
- data/lib/puppet/pops/types/type_assertion_error.rb +26 -0
- data/lib/puppet/pops/types/type_calculator.rb +110 -212
- data/lib/puppet/pops/types/type_factory.rb +15 -74
- data/lib/puppet/pops/types/type_parser.rb +15 -24
- data/lib/puppet/pops/types/types.rb +25 -35
- data/lib/puppet/pops/types/types_meta.rb +2 -13
- data/lib/puppet/pops/utils.rb +1 -1
- data/lib/puppet/pops/validation.rb +3 -26
- data/lib/puppet/pops/validation/checker4_0.rb +6 -56
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -3
- data/lib/puppet/pops/visitor.rb +10 -7
- data/lib/puppet/property.rb +44 -124
- data/lib/puppet/provider.rb +0 -52
- data/lib/puppet/provider/aixobject.rb +2 -2
- data/lib/puppet/provider/augeas/augeas.rb +9 -6
- data/lib/puppet/provider/command.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +37 -0
- data/lib/puppet/provider/exec.rb +2 -16
- data/lib/puppet/provider/file/posix.rb +1 -1
- data/lib/puppet/provider/file/windows.rb +1 -1
- data/lib/puppet/provider/group/aix.rb +1 -1
- data/lib/puppet/provider/group/pw.rb +0 -1
- data/lib/puppet/provider/group/windows_adsi.rb +4 -18
- data/lib/puppet/provider/host/parsed.rb +4 -2
- data/lib/puppet/provider/macauthorization/macauthorization.rb +0 -12
- data/lib/puppet/provider/mailalias/aliases.rb +23 -12
- data/lib/puppet/provider/mount/parsed.rb +2 -145
- data/lib/puppet/provider/nameservice/directoryservice.rb +57 -131
- data/lib/puppet/provider/network_device.rb +3 -0
- data/lib/puppet/provider/package/appdmg.rb +5 -2
- data/lib/puppet/provider/package/apt.rb +1 -1
- data/lib/puppet/provider/package/fink.rb +1 -1
- data/lib/puppet/provider/package/openbsd.rb +26 -12
- data/lib/puppet/provider/package/opkg.rb +6 -1
- data/lib/puppet/provider/package/pacman.rb +159 -127
- data/lib/puppet/provider/package/pip.rb +1 -11
- data/lib/puppet/provider/package/pkg.rb +73 -29
- data/lib/puppet/provider/package/pkgdmg.rb +2 -2
- data/lib/puppet/provider/package/pkgin.rb +1 -1
- data/lib/puppet/provider/package/portage.rb +5 -1
- data/lib/puppet/provider/package/portupgrade.rb +0 -2
- data/lib/puppet/provider/package/rpm.rb +109 -0
- data/lib/puppet/provider/package/rug.rb +0 -1
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +121 -30
- data/lib/puppet/provider/package/zypper.rb +8 -17
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +7 -32
- data/lib/puppet/provider/service/base.rb +17 -3
- data/lib/puppet/provider/service/bsd.rb +1 -1
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -7
- data/lib/puppet/provider/service/launchd.rb +11 -89
- data/lib/puppet/provider/service/openbsd.rb +56 -298
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/service/systemd.rb +1 -0
- data/lib/puppet/provider/service/upstart.rb +4 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +1 -1
- data/lib/puppet/provider/user/directoryservice.rb +40 -70
- data/lib/puppet/provider/user/hpux.rb +31 -2
- data/lib/puppet/provider/user/openbsd.rb +74 -0
- data/lib/puppet/provider/user/pw.rb +0 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -3
- data/lib/puppet/provider/user/windows_adsi.rb +2 -9
- data/lib/puppet/provider/yumrepo/inifile.rb +1 -3
- data/lib/puppet/provider/zfs/zfs.rb +3 -2
- data/lib/puppet/provider/zone/solaris.rb +3 -3
- data/lib/puppet/reference/configuration.rb +4 -3
- data/lib/puppet/reference/metaparameter.rb +0 -9
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +8 -10
- data/lib/puppet/relationship.rb +4 -17
- data/lib/puppet/resource.rb +132 -114
- data/lib/puppet/resource/catalog.rb +23 -30
- data/lib/puppet/resource/status.rb +74 -22
- data/lib/puppet/resource/type.rb +12 -52
- data/lib/puppet/resource/type_collection.rb +26 -73
- data/lib/puppet/settings.rb +94 -153
- data/lib/puppet/settings/base_setting.rb +6 -30
- data/lib/puppet/settings/config_file.rb +14 -11
- data/lib/puppet/settings/duration_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +14 -12
- data/lib/puppet/settings/file_setting.rb +9 -10
- data/lib/puppet/settings/ttl_setting.rb +1 -3
- data/lib/puppet/ssl/certificate.rb +38 -8
- data/lib/puppet/ssl/certificate_authority/interface.rb +7 -1
- data/lib/puppet/ssl/certificate_factory.rb +3 -3
- data/lib/puppet/ssl/certificate_request.rb +36 -8
- data/lib/puppet/ssl/configuration.rb +2 -8
- data/lib/puppet/ssl/host.rb +1 -8
- data/lib/puppet/ssl/inventory.rb +0 -7
- data/lib/puppet/ssl/oids.rb +72 -3
- data/lib/puppet/ssl/validator/default_validator.rb +0 -1
- data/lib/puppet/status.rb +0 -5
- data/lib/puppet/syntax_checkers.rb +3 -0
- data/lib/{puppetx/puppetlabs → puppet}/syntax_checkers/json.rb +2 -2
- data/lib/puppet/test/test_helper.rb +11 -12
- data/lib/puppet/transaction.rb +12 -9
- data/lib/puppet/transaction/event.rb +4 -5
- data/lib/puppet/transaction/event_manager.rb +50 -5
- data/lib/puppet/transaction/report.rb +5 -10
- data/lib/puppet/transaction/resource_harness.rb +7 -2
- data/lib/puppet/type.rb +113 -29
- data/lib/puppet/type/augeas.rb +1 -0
- data/lib/puppet/type/exec.rb +2 -2
- data/lib/puppet/type/file.rb +8 -9
- data/lib/puppet/type/file/content.rb +19 -15
- data/lib/puppet/type/file/mode.rb +16 -11
- data/lib/puppet/type/file/selcontext.rb +1 -1
- data/lib/puppet/type/file/source.rb +15 -15
- data/lib/puppet/type/filebucket.rb +2 -2
- data/lib/puppet/type/group.rb +5 -17
- data/lib/puppet/type/host.rb +12 -3
- data/lib/puppet/type/k5login.rb +1 -1
- data/lib/puppet/type/mailalias.rb +20 -6
- data/lib/puppet/type/maillist.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -16
- data/lib/puppet/type/notify.rb +1 -1
- data/lib/puppet/type/package.rb +91 -16
- data/lib/puppet/type/resources.rb +0 -7
- data/lib/puppet/type/router.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +0 -13
- data/lib/puppet/type/selboolean.rb +2 -2
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/ssh_authorized_key.rb +1 -1
- data/lib/puppet/type/sshkey.rb +1 -1
- data/lib/puppet/type/tidy.rb +4 -1
- data/lib/puppet/type/user.rb +16 -3
- data/lib/puppet/type/yumrepo.rb +26 -0
- data/lib/puppet/type/zfs.rb +1 -1
- data/lib/puppet/type/zpool.rb +1 -1
- data/lib/puppet/util.rb +2 -85
- data/lib/puppet/util/autoload.rb +3 -13
- data/lib/puppet/util/checksums.rb +59 -22
- data/lib/puppet/util/classgen.rb +1 -9
- data/lib/puppet/util/colors.rb +0 -117
- data/lib/puppet/util/command_line.rb +1 -23
- data/lib/puppet/util/errors.rb +2 -4
- data/lib/puppet/util/execution.rb +19 -22
- data/lib/puppet/util/feature.rb +2 -4
- data/lib/puppet/util/fileparsing.rb +3 -2
- data/lib/puppet/util/log.rb +13 -56
- data/lib/puppet/util/log/destinations.rb +17 -36
- data/lib/puppet/util/logging.rb +52 -37
- data/lib/puppet/util/metric.rb +0 -149
- data/lib/puppet/util/monkey_patches.rb +1 -94
- data/lib/puppet/util/network_device/base.rb +1 -5
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/config.rb +0 -5
- data/lib/puppet/util/network_device/transport/ssh.rb +2 -2
- data/lib/puppet/util/profiler.rb +1 -1
- data/lib/puppet/util/profiler/aggregate.rb +1 -1
- data/lib/puppet/util/profiler/around_profiler.rb +1 -1
- data/lib/puppet/util/psych_support.rb +38 -0
- data/lib/puppet/util/rdoc.rb +6 -42
- data/lib/puppet/util/rdoc/code_objects.rb +5 -45
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
- data/lib/puppet/util/rdoc/parser.rb +5 -15
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +8 -227
- data/lib/puppet/util/retry_action.rb +46 -0
- data/lib/puppet/util/run_mode.rb +31 -7
- data/lib/puppet/util/selinux.rb +2 -2
- data/lib/puppet/util/ssl.rb +11 -11
- data/lib/puppet/util/suidmanager.rb +4 -31
- data/lib/puppet/util/tag_set.rb +0 -11
- data/lib/puppet/util/tagging.rb +50 -19
- data/lib/puppet/util/warnings.rb +1 -0
- data/lib/puppet/util/windows/adsi.rb +13 -60
- data/lib/puppet/util/windows/api_types.rb +16 -2
- data/lib/puppet/util/windows/file.rb +2 -8
- data/lib/puppet/util/windows/process.rb +58 -0
- data/lib/puppet/util/windows/registry.rb +319 -31
- data/lib/puppet/util/windows/security.rb +1 -68
- data/lib/puppet/util/windows/taskscheduler.rb +0 -21
- data/lib/puppet/util/windows/user.rb +2 -3
- data/lib/puppet/vendor/deep_merge/CHANGELOG +45 -0
- data/lib/puppet/vendor/deep_merge/Gemfile +3 -0
- data/lib/puppet/vendor/deep_merge/LICENSE +21 -0
- data/lib/puppet/vendor/deep_merge/README.md +113 -0
- data/lib/puppet/vendor/deep_merge/Rakefile +19 -0
- data/lib/puppet/vendor/deep_merge/deep_merge.gemspec +35 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge.rb +2 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/core.rb +210 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb +28 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/rails_compat.rb +27 -0
- data/lib/puppet/vendor/deep_merge/test/test_deep_merge.rb +608 -0
- data/lib/puppet/vendor/load_deep_merge.rb +1 -0
- data/lib/puppet/vendor/load_rgen.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +1 -3
- data/lib/puppet/vendor/rgen_patch.rb +132 -0
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_x.rb +8 -0
- data/lib/semver.rb +0 -1
- data/man/man5/puppet.conf.5 +432 -287
- data/man/man8/extlookup2hiera.8 +2 -15
- data/man/man8/puppet-agent.8 +14 -14
- data/man/man8/puppet-apply.8 +29 -30
- data/man/man8/puppet-ca.8 +29 -17
- data/man/man8/puppet-catalog.8 +5 -34
- data/man/man8/puppet-cert.8 +8 -4
- data/man/man8/puppet-certificate.8 +15 -29
- data/man/man8/puppet-certificate_request.8 +9 -16
- data/man/man8/puppet-certificate_revocation_list.8 +5 -31
- data/man/man8/puppet-config.8 +52 -11
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +5 -16
- data/man/man8/puppet-doc.8 +7 -80
- data/man/man8/puppet-epp.8 +349 -0
- data/man/man8/puppet-facts.8 +5 -95
- data/man/man8/puppet-file.8 +2 -28
- data/man/man8/puppet-filebucket.8 +2 -2
- data/man/man8/puppet-help.8 +2 -2
- data/man/man8/puppet-inspect.8 +1 -1
- data/man/man8/puppet-key.8 +6 -3
- data/man/man8/puppet-man.8 +2 -2
- data/man/man8/puppet-master.8 +11 -7
- data/man/man8/puppet-module.8 +75 -49
- data/man/man8/puppet-node.8 +8 -56
- data/man/man8/puppet-parser.8 +38 -4
- data/man/man8/puppet-plugin.8 +2 -2
- data/man/man8/puppet-report.8 +8 -70
- data/man/man8/puppet-resource.8 +7 -3
- data/man/man8/puppet-resource_type.8 +2 -28
- data/man/man8/puppet-status.8 +5 -47
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/integration/provider/mailalias/aliases/test1 +3 -0
- data/spec/fixtures/integration/provider/sshkey/sample +21 -0
- data/spec/fixtures/unit/data_providers/environments/production/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/production/lib/puppet/functions/environment/data.rb +7 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +9 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +8 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp +9 -0
- data/spec/fixtures/unit/data_providers/environments/sample/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp +6 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb +54 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb +31 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_module_data.rb +32 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/manifests/init.pp +5 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/environment.conf +2 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/lib/puppet/functions/environment/data.rb +11 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/manifests/init.pp +8 -0
- data/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/pops/binder/bindings_composer/ok/binder_config.yaml +1 -1
- data/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/{puppetx → puppet_x}/awesome2/echo_scheme_handler.rb +3 -3
- data/spec/fixtures/unit/pops/binder/config/binder_config/nolayer/binder_config.yaml +6 -0
- data/spec/fixtures/unit/pops/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/provider/mount/parsed/aix.filesystems +85 -93
- data/spec/fixtures/unit/provider/mount/parsed/aix.mount +7 -11
- data/spec/fixtures/unit/provider/package/pkg/dummy_implicit_version +3 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris10 +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.certificate_warning +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.installed +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.known +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.installed +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.known +1 -1
- data/spec/fixtures/unit/provider/package/pkg/incomplete +1 -1
- data/spec/fixtures/unit/provider/package/pkg/solaris11 +2 -2
- data/spec/fixtures/unit/provider/package/pkg/unknown_status +12 -12
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt +201 -0
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt +12 -0
- data/spec/fixtures/unit/provider/parsedfile/simple.txt +3 -0
- data/spec/fixtures/unit/provider/service/openbsd/rcctl_getall +6 -0
- data/spec/fixtures/unit/ssl/certificate/old-style-cert-exts.pem +33 -0
- data/spec/fixtures/unit/ssl/certificate_request/old-style-cert-request.pem +28 -0
- data/spec/integration/agent/logging_spec.rb +1 -5
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/application/doc_spec.rb +1 -43
- data/spec/integration/configurer_spec.rb +5 -5
- data/spec/integration/data_binding.rb +4 -0
- data/spec/integration/defaults_spec.rb +42 -143
- data/spec/integration/directory_environments_spec.rb +3 -3
- data/spec/integration/environments/default_manifest_spec.rb +3 -51
- data/spec/integration/environments/setting_hooks_spec.rb +1 -1
- data/spec/integration/environments/settings_interpolation_spec.rb +50 -105
- data/spec/integration/environments/settings_spec.rb +100 -0
- data/spec/integration/faces/ca_spec.rb +51 -51
- data/spec/integration/faces/documentation_spec.rb +6 -6
- data/spec/integration/file_bucket/file_spec.rb +5 -16
- data/spec/integration/file_serving/fileset_spec.rb +1 -1
- data/spec/integration/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/integration/indirector/catalog/compiler_spec.rb +6 -6
- data/spec/integration/indirector/direct_file_server_spec.rb +40 -12
- data/spec/integration/indirector/facts/facter_spec.rb +1 -1
- data/spec/integration/indirector/file_content/file_server_spec.rb +23 -21
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +53 -0
- data/spec/integration/indirector/node/ldap_spec.rb +0 -0
- data/spec/integration/network/authconfig_spec.rb +26 -26
- data/spec/integration/network/formats_spec.rb +12 -12
- data/spec/integration/network/http/api/indirected_routes_spec.rb +56 -0
- data/spec/integration/node/environment_spec.rb +12 -15
- data/spec/integration/node/facts_spec.rb +3 -3
- data/spec/integration/node_spec.rb +8 -8
- data/spec/integration/parser/catalog_spec.rb +1 -32
- data/spec/integration/parser/class_spec.rb +0 -4
- data/spec/integration/parser/{collector_spec.rb → collection_spec.rb} +3 -27
- data/spec/integration/parser/compiler_spec.rb +769 -385
- data/spec/integration/parser/conditionals_spec.rb +2 -27
- data/spec/integration/parser/functions/require_spec.rb +8 -8
- data/spec/integration/parser/node_spec.rb +29 -42
- data/spec/integration/parser/resource_expressions_spec.rb +125 -210
- data/spec/integration/parser/scope_spec.rb +168 -319
- data/spec/integration/parser/undef_param_spec.rb +5 -5
- data/spec/integration/provider/cron/crontab_spec.rb +3 -3
- data/spec/integration/provider/mailalias/aliases_spec.rb +0 -0
- data/spec/integration/provider/mount_spec.rb +33 -28
- data/spec/integration/provider/package_spec.rb +3 -14
- data/spec/integration/provider/service/init_spec.rb +4 -4
- data/spec/integration/provider/service/systemd_spec.rb +3 -3
- data/spec/integration/provider/ssh_authorized_key_spec.rb +12 -12
- data/spec/integration/provider/sshkey_spec.rb +159 -0
- data/spec/integration/reference/providers_spec.rb +1 -1
- data/spec/integration/reports_spec.rb +1 -1
- data/spec/integration/resource/catalog_spec.rb +3 -3
- data/spec/integration/resource/type_collection_spec.rb +10 -25
- data/spec/integration/ssl/autosign_spec.rb +1 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +8 -8
- data/spec/integration/ssl/certificate_request_spec.rb +2 -2
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +0 -0
- data/spec/integration/ssl/host_spec.rb +7 -7
- data/spec/integration/transaction/report_spec.rb +0 -0
- data/spec/integration/transaction_spec.rb +86 -50
- data/spec/integration/type/exec_spec.rb +5 -5
- data/spec/integration/type/file_spec.rb +277 -280
- data/spec/integration/type/package_spec.rb +105 -6
- data/spec/integration/type/tidy_spec.rb +1 -1
- data/spec/integration/type/user_spec.rb +4 -4
- data/spec/integration/type_spec.rb +2 -2
- data/spec/integration/util/autoload_spec.rb +7 -12
- data/spec/integration/util/rdoc/parser_spec.rb +13 -99
- data/spec/integration/util/settings_spec.rb +1 -1
- data/spec/integration/util/windows/process_spec.rb +6 -6
- data/spec/integration/util/windows/security_spec.rb +79 -105
- data/spec/integration/util/windows/user_spec.rb +12 -12
- data/spec/integration/util_spec.rb +8 -8
- data/spec/lib/matchers/containment_matchers.rb +1 -1
- data/spec/lib/matchers/include.rb +3 -3
- data/spec/lib/matchers/include_in_order.rb +2 -2
- data/spec/lib/matchers/json.rb +5 -35
- data/spec/lib/matchers/match_tokens2.rb +1 -1
- data/spec/lib/matchers/relationship_graph_matchers.rb +1 -1
- data/spec/lib/matchers/resource.rb +8 -23
- data/spec/lib/puppet/face/1.0.0/huzzah.rb +2 -2
- data/spec/lib/puppet/face/basetest.rb +0 -0
- data/spec/lib/puppet/face/huzzah.rb +2 -2
- data/spec/lib/puppet/face/version_matching.rb +1 -1
- data/spec/lib/puppet/indirector_proxy.rb +34 -0
- data/spec/lib/puppet/indirector_testing.rb +1 -11
- data/spec/lib/puppet_spec/files.rb +1 -1
- data/spec/lib/puppet_spec/fixtures.rb +0 -0
- data/spec/lib/puppet_spec/handler.rb +53 -0
- data/spec/lib/puppet_spec/matchers.rb +12 -5
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +3 -3
- data/spec/lib/puppet_spec/modules.rb +11 -0
- data/spec/lib/puppet_spec/network.rb +101 -0
- data/spec/lib/puppet_spec/pops.rb +2 -2
- data/spec/lib/puppet_spec/settings.rb +17 -0
- data/spec/lib/puppet_spec/verbose.rb +0 -0
- data/spec/shared_behaviours/all_parsedfile_providers.rb +1 -1
- data/spec/shared_behaviours/an_indirector_face.rb +2 -2
- data/spec/shared_behaviours/documentation_on_faces.rb +46 -46
- data/spec/shared_behaviours/file_server_terminus.rb +1 -1
- data/spec/shared_behaviours/file_serving.rb +0 -0
- data/spec/shared_behaviours/hiera_indirections.rb +10 -10
- data/spec/shared_behaviours/iterative_functions.rb +1 -1
- data/spec/shared_behaviours/memory_terminus.rb +5 -5
- data/spec/shared_behaviours/path_parameters.rb +8 -8
- data/spec/shared_behaviours/store_configs_terminus.rb +3 -3
- data/spec/shared_behaviours/things_that_declare_options.rb +25 -25
- data/spec/shared_contexts/checksum.rb +62 -0
- data/spec/shared_contexts/{checksums.rb → digests.rb} +2 -2
- data/spec/spec_helper.rb +14 -5
- data/spec/unit/agent/disabler_spec.rb +3 -3
- data/spec/unit/agent/locker_spec.rb +9 -9
- data/spec/unit/agent_spec.rb +18 -18
- data/spec/unit/application/agent_spec.rb +25 -92
- data/spec/unit/application/apply_spec.rb +16 -16
- data/spec/unit/application/cert_spec.rb +15 -15
- data/spec/unit/application/certificate_spec.rb +2 -2
- data/spec/unit/application/config_spec.rb +1 -1
- data/spec/unit/application/describe_spec.rb +6 -6
- data/spec/unit/application/device_spec.rb +25 -63
- data/spec/unit/application/doc_spec.rb +22 -31
- data/spec/unit/application/face_base_spec.rb +88 -59
- data/spec/unit/application/facts_spec.rb +2 -11
- data/spec/unit/application/filebucket_spec.rb +7 -7
- data/spec/unit/application/indirection_base_spec.rb +0 -4
- data/spec/unit/application/inspect_spec.rb +21 -21
- data/spec/unit/application/master_spec.rb +8 -9
- data/spec/unit/application/resource_spec.rb +27 -79
- data/spec/unit/application_spec.rb +54 -58
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -0
- data/spec/unit/configurer/downloader_spec.rb +26 -20
- data/spec/unit/configurer/fact_handler_spec.rb +19 -12
- data/spec/unit/configurer/plugin_handler_spec.rb +0 -0
- data/spec/unit/configurer_spec.rb +44 -44
- data/spec/unit/confine/exists_spec.rb +10 -10
- data/spec/unit/confine/false_spec.rb +7 -7
- data/spec/unit/confine/feature_spec.rb +7 -7
- data/spec/unit/confine/true_spec.rb +7 -7
- data/spec/unit/confine/variable_spec.rb +13 -13
- data/spec/unit/confine_collection_spec.rb +12 -12
- data/spec/unit/confine_spec.rb +10 -10
- data/spec/unit/confiner_spec.rb +8 -8
- data/spec/unit/context/trusted_information_spec.rb +9 -2
- data/spec/unit/daemon_spec.rb +10 -21
- data/spec/unit/data_binding_spec.rb +1 -1
- data/spec/unit/data_providers/function_data_provider_spec.rb +96 -0
- data/spec/unit/data_providers/sample_data_provider_spec.rb +52 -0
- data/spec/unit/defaults_spec.rb +6 -6
- data/spec/unit/environments_spec.rb +4 -6
- data/spec/unit/{util → external}/pson_spec.rb +15 -25
- data/spec/unit/face/catalog_spec.rb +0 -0
- data/spec/unit/face/certificate_spec.rb +19 -19
- data/spec/unit/face/config_spec.rb +2 -7
- data/spec/unit/face/epp_face_spec.rb +303 -0
- data/spec/unit/face/facts_spec.rb +1 -15
- data/spec/unit/face/file_spec.rb +3 -5
- data/spec/unit/face/help_spec.rb +17 -16
- data/spec/unit/face/module/build_spec.rb +2 -2
- data/spec/unit/face/module/list_spec.rb +11 -11
- data/spec/unit/face/module/search_spec.rb +17 -17
- data/spec/unit/face/node_spec.rb +4 -122
- data/spec/unit/face/parser_spec.rb +1 -1
- data/spec/unit/face/plugin_spec.rb +2 -2
- data/spec/unit/face_spec.rb +0 -0
- data/spec/unit/file_bucket/dipper_spec.rb +23 -23
- data/spec/unit/file_bucket/file_spec.rb +12 -28
- data/spec/unit/file_serving/base_spec.rb +26 -26
- data/spec/unit/file_serving/configuration/parser_spec.rb +10 -10
- data/spec/unit/file_serving/configuration_spec.rb +17 -17
- data/spec/unit/file_serving/content_spec.rb +19 -31
- data/spec/unit/file_serving/fileset_spec.rb +32 -33
- data/spec/unit/file_serving/metadata_spec.rb +115 -71
- data/spec/unit/file_serving/mount/file_spec.rb +15 -15
- data/spec/unit/file_serving/mount/modules_spec.rb +2 -2
- data/spec/unit/file_serving/mount/pluginfacts_spec.rb +5 -5
- data/spec/unit/file_serving/mount/plugins_spec.rb +5 -5
- data/spec/unit/file_serving/mount_spec.rb +5 -5
- data/spec/unit/file_serving/terminus_helper_spec.rb +19 -0
- data/spec/unit/file_serving/terminus_selector_spec.rb +6 -6
- data/spec/unit/file_system/uniquefile_spec.rb +2 -2
- data/spec/unit/file_system_spec.rb +79 -117
- data/spec/unit/forge/errors_spec.rb +8 -8
- data/spec/unit/forge/module_release_spec.rb +2 -4
- data/spec/unit/forge/repository_spec.rb +38 -44
- data/spec/unit/forge_spec.rb +1 -1
- data/spec/unit/functions/assert_type_spec.rb +1 -1
- data/spec/unit/functions/each_spec.rb +19 -23
- data/spec/unit/functions/epp_spec.rb +9 -17
- data/spec/unit/functions/filter_spec.rb +0 -22
- data/spec/unit/functions/hiera_spec.rb +18 -24
- data/spec/unit/functions/inline_epp_spec.rb +8 -16
- data/spec/unit/functions/lookup_spec.rb +324 -0
- data/spec/unit/functions/map_spec.rb +1 -7
- data/spec/unit/functions/reduce_spec.rb +0 -11
- data/spec/unit/functions/regsubst_spec.rb +94 -0
- data/spec/unit/functions/scanf_spec.rb +0 -4
- data/spec/unit/functions/slice_spec.rb +0 -12
- data/spec/unit/functions/split_spec.rb +46 -0
- data/spec/unit/functions/with_spec.rb +4 -13
- data/spec/unit/functions4_spec.rb +57 -162
- data/spec/unit/graph/rb_tree_map_spec.rb +78 -78
- data/spec/unit/graph/relationship_graph_spec.rb +17 -17
- data/spec/unit/graph/{simple_graph.rb → simple_graph_spec.rb} +122 -126
- data/spec/unit/hiera/scope_spec.rb +13 -12
- data/spec/unit/hiera_puppet_spec.rb +12 -12
- data/spec/unit/indirector/catalog/compiler_spec.rb +10 -15
- data/spec/unit/indirector/catalog/json_spec.rb +2 -2
- data/spec/unit/indirector/catalog/msgpack_spec.rb +2 -2
- data/spec/unit/indirector/catalog/rest_spec.rb +1 -1
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +14 -14
- data/spec/unit/indirector/catalog/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/catalog/yaml_spec.rb +4 -4
- data/spec/unit/indirector/certificate/ca_spec.rb +3 -3
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate/file_spec.rb +3 -3
- data/spec/unit/indirector/certificate/rest_spec.rb +6 -6
- data/spec/unit/indirector/certificate_request/ca_spec.rb +8 -8
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_request/rest_spec.rb +4 -4
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +4 -4
- data/spec/unit/indirector/certificate_status/file_spec.rb +18 -18
- data/spec/unit/indirector/certificate_status/rest_spec.rb +2 -2
- data/spec/unit/indirector/code_spec.rb +3 -3
- data/spec/unit/indirector/data_binding/hiera_spec.rb +3 -3
- data/spec/unit/indirector/data_binding/none_spec.rb +5 -5
- data/spec/unit/indirector/direct_file_server_spec.rb +14 -4
- data/spec/unit/indirector/envelope_spec.rb +4 -4
- data/spec/unit/indirector/exec_spec.rb +4 -4
- data/spec/unit/indirector/face_spec.rb +13 -8
- data/spec/unit/indirector/facts/facter_spec.rb +10 -20
- data/spec/unit/indirector/facts/network_device_spec.rb +10 -20
- data/spec/unit/indirector/facts/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/facts/yaml_spec.rb +6 -6
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +34 -34
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_content/file_spec.rb +2 -2
- data/spec/unit/indirector/file_content/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_metadata/file_spec.rb +13 -5
- data/spec/unit/indirector/file_metadata/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_server_spec.rb +35 -17
- data/spec/unit/indirector/indirection_spec.rb +56 -56
- data/spec/unit/indirector/json_spec.rb +15 -16
- data/spec/unit/indirector/key/ca_spec.rb +3 -3
- data/spec/unit/indirector/key/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/key/file_spec.rb +5 -5
- data/spec/unit/indirector/ldap_spec.rb +13 -13
- data/spec/unit/indirector/memory_spec.rb +0 -0
- data/spec/unit/indirector/msgpack_spec.rb +15 -15
- data/spec/unit/indirector/node/exec_spec.rb +20 -9
- data/spec/unit/indirector/node/ldap_spec.rb +48 -48
- data/spec/unit/indirector/node/memory_spec.rb +0 -0
- data/spec/unit/indirector/node/msgpack_spec.rb +4 -4
- data/spec/unit/indirector/node/plain_spec.rb +2 -2
- data/spec/unit/indirector/node/rest_spec.rb +0 -0
- data/spec/unit/indirector/node/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/node/yaml_spec.rb +4 -4
- data/spec/unit/indirector/none_spec.rb +2 -2
- data/spec/unit/indirector/plain_spec.rb +1 -1
- data/spec/unit/indirector/report/msgpack_spec.rb +5 -5
- data/spec/unit/indirector/report/processor_spec.rb +4 -4
- data/spec/unit/indirector/report/rest_spec.rb +8 -8
- data/spec/unit/indirector/report/yaml_spec.rb +5 -5
- data/spec/unit/indirector/request_spec.rb +103 -206
- data/spec/unit/indirector/resource/ral_spec.rb +8 -10
- data/spec/unit/indirector/resource/store_configs_spec.rb +2 -4
- data/spec/unit/indirector/resource_type/parser_spec.rb +37 -37
- data/spec/unit/indirector/resource_type/rest_spec.rb +2 -2
- data/spec/unit/indirector/rest_spec.rb +70 -55
- data/spec/unit/indirector/ssl_file_spec.rb +13 -13
- data/spec/unit/indirector/status/rest_spec.rb +1 -1
- data/spec/unit/indirector/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/terminus_spec.rb +17 -17
- data/spec/unit/indirector/yaml_spec.rb +12 -12
- data/spec/unit/indirector_spec.rb +7 -7
- data/spec/unit/interface/action_builder_spec.rb +15 -15
- data/spec/unit/interface/action_manager_spec.rb +31 -56
- data/spec/unit/interface/action_spec.rb +62 -65
- data/spec/unit/interface/documentation_spec.rb +2 -2
- data/spec/unit/interface/face_collection_spec.rb +33 -33
- data/spec/unit/interface/option_builder_spec.rb +8 -8
- data/spec/unit/interface/option_spec.rb +23 -23
- data/spec/unit/interface_spec.rb +19 -24
- data/spec/unit/man_spec.rb +0 -0
- data/spec/unit/module_spec.rb +163 -115
- data/spec/unit/module_tool/applications/builder_spec.rb +0 -19
- data/spec/unit/module_tool/applications/installer_spec.rb +29 -29
- data/spec/unit/module_tool/applications/searcher_spec.rb +4 -4
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +15 -15
- data/spec/unit/module_tool/applications/unpacker_spec.rb +3 -3
- data/spec/unit/module_tool/applications/upgrader_spec.rb +28 -28
- data/spec/unit/module_tool/install_directory_spec.rb +3 -3
- data/spec/unit/module_tool/metadata_spec.rb +26 -26
- data/spec/unit/module_tool/tar/gnu_spec.rb +1 -1
- data/spec/unit/module_tool/tar/mini_spec.rb +2 -2
- data/spec/unit/module_tool/tar_spec.rb +2 -2
- data/spec/unit/module_tool_spec.rb +13 -34
- data/spec/unit/network/auth_config_parser_spec.rb +7 -7
- data/spec/unit/network/authconfig_spec.rb +9 -9
- data/spec/unit/network/authstore_spec.rb +38 -39
- data/spec/unit/network/format_handler_spec.rb +14 -14
- data/spec/unit/network/format_spec.rb +34 -34
- data/spec/unit/network/format_support_spec.rb +10 -10
- data/spec/unit/network/formats_spec.rb +50 -136
- data/spec/unit/network/http/api/ca/v1_spec.rb +26 -0
- data/spec/unit/network/http/api/{v1_spec.rb → indirected_routes_spec.rb} +128 -184
- data/spec/unit/network/http/api/{v2 → master/v3}/authorization_spec.rb +23 -21
- data/spec/unit/network/http/api/{v2 → master/v3}/environments_spec.rb +5 -5
- data/spec/unit/network/http/api/master/v3_spec.rb +39 -0
- data/spec/unit/network/http/api_spec.rb +127 -0
- data/spec/unit/network/http/compression_spec.rb +20 -26
- data/spec/unit/network/http/connection_spec.rb +2 -5
- data/spec/unit/network/http/factory_spec.rb +6 -8
- data/spec/unit/network/http/handler_spec.rb +31 -84
- data/spec/unit/network/http/nocache_pool_spec.rb +0 -0
- data/spec/unit/network/http/pool_spec.rb +0 -0
- data/spec/unit/network/http/rack/rest_spec.rb +38 -39
- data/spec/unit/network/http/rack_spec.rb +1 -1
- data/spec/unit/network/http/route_spec.rb +3 -3
- data/spec/unit/network/http/session_spec.rb +4 -4
- data/spec/unit/network/http/site_spec.rb +1 -1
- data/spec/unit/network/http/webrick/rest_spec.rb +36 -55
- data/spec/unit/network/http/webrick_spec.rb +16 -27
- data/spec/unit/network/http_pool_spec.rb +11 -11
- data/spec/unit/network/http_spec.rb +0 -0
- data/spec/unit/network/resolver_spec.rb +10 -10
- data/spec/unit/network/rights_spec.rb +67 -67
- data/spec/unit/network/server_spec.rb +3 -3
- data/spec/unit/node/environment_spec.rb +177 -273
- data/spec/unit/node/facts_spec.rb +71 -33
- data/spec/unit/node_spec.rb +150 -158
- data/spec/unit/other/selinux_spec.rb +6 -6
- data/spec/unit/parameter/boolean_spec.rb +4 -3
- data/spec/unit/parameter/package_options_spec.rb +5 -5
- data/spec/unit/parameter/path_spec.rb +1 -1
- data/spec/unit/parameter/value_collection_spec.rb +23 -28
- data/spec/unit/parameter/value_spec.rb +20 -24
- data/spec/unit/parameter_spec.rb +26 -26
- data/spec/unit/parser/ast/block_expression_spec.rb +3 -2
- data/spec/unit/parser/ast/leaf_spec.rb +5 -378
- data/spec/unit/parser/compiler_spec.rb +84 -74
- data/spec/unit/parser/files_spec.rb +55 -121
- data/spec/unit/parser/functions/contain_spec.rb +8 -11
- data/spec/unit/parser/functions/create_resources_spec.rb +29 -29
- data/spec/unit/parser/functions/defined_spec.rb +52 -51
- data/spec/unit/parser/functions/digest_spec.rb +2 -2
- data/spec/unit/parser/functions/fail_spec.rb +1 -1
- data/spec/unit/parser/functions/file_spec.rb +7 -13
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +5 -5
- data/spec/unit/parser/functions/generate_spec.rb +20 -20
- data/spec/unit/parser/functions/hiera_array_spec.rb +2 -16
- data/spec/unit/parser/functions/hiera_hash_spec.rb +2 -12
- data/spec/unit/parser/functions/hiera_include_spec.rb +2 -29
- data/spec/unit/parser/functions/hiera_spec.rb +2 -12
- data/spec/unit/parser/functions/include_spec.rb +9 -19
- data/spec/unit/parser/functions/inline_template_spec.rb +3 -3
- data/spec/unit/parser/functions/lookup_spec.rb +3 -140
- data/spec/unit/parser/functions/realize_spec.rb +0 -0
- data/spec/unit/parser/functions/regsubst_spec.rb +7 -179
- data/spec/unit/parser/functions/require_spec.rb +14 -21
- data/spec/unit/parser/functions/scanf_spec.rb +0 -0
- data/spec/unit/parser/functions/shellquote_spec.rb +20 -20
- data/spec/unit/parser/functions/split_spec.rb +2 -37
- data/spec/unit/parser/functions/sprintf_spec.rb +7 -11
- data/spec/unit/parser/functions/tag_spec.rb +3 -3
- data/spec/unit/parser/functions/template_spec.rb +10 -10
- data/spec/unit/parser/functions/versioncmp_spec.rb +3 -3
- data/spec/unit/parser/functions_spec.rb +8 -8
- data/spec/unit/parser/relationship_spec.rb +14 -32
- data/spec/unit/parser/resource/param_spec.rb +0 -0
- data/spec/unit/parser/resource_spec.rb +57 -57
- data/spec/unit/parser/scope_spec.rb +89 -101
- data/spec/unit/parser/templatewrapper_spec.rb +15 -32
- data/spec/unit/parser/type_loader_spec.rb +53 -73
- data/spec/unit/pops/adaptable_spec.rb +22 -22
- data/spec/unit/pops/binder/bindings_checker_spec.rb +14 -14
- data/spec/unit/pops/binder/bindings_composer_spec.rb +4 -6
- data/spec/unit/pops/binder/bindings_validator_factory_spec.rb +3 -3
- data/spec/unit/pops/binder/config/binder_config_spec.rb +8 -1
- data/spec/unit/pops/binder/injector_spec.rb +92 -92
- data/spec/unit/pops/containment_spec.rb +4 -4
- data/spec/unit/pops/evaluator/access_ops_spec.rb +5 -24
- data/spec/unit/pops/evaluator/arithmetic_ops_spec.rb +23 -23
- data/spec/unit/pops/evaluator/basic_expressions_spec.rb +22 -22
- data/spec/unit/pops/evaluator/collections_ops_spec.rb +1 -3
- data/spec/unit/pops/evaluator/comparison_ops_spec.rb +104 -107
- data/spec/unit/pops/evaluator/conditionals_spec.rb +39 -39
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +75 -143
- data/spec/unit/pops/evaluator/evaluator_rspec_helper.rb +1 -5
- data/spec/unit/pops/evaluator/logical_ops_spec.rb +15 -15
- data/spec/unit/pops/evaluator/string_interpolation_spec.rb +5 -5
- data/spec/unit/pops/evaluator/variables_spec.rb +18 -18
- data/spec/unit/pops/factory_rspec_helper.rb +0 -8
- data/spec/unit/pops/factory_spec.rb +104 -104
- data/spec/unit/pops/issues_spec.rb +21 -21
- data/spec/unit/pops/label_provider_spec.rb +6 -6
- data/spec/unit/pops/loaders/loaders_spec.rb +3 -3
- data/spec/unit/pops/model/model_spec.rb +10 -10
- data/spec/unit/pops/parser/epp_parser_spec.rb +20 -20
- data/spec/unit/pops/parser/evaluating_parser_spec.rb +2 -2
- data/spec/unit/pops/parser/lexer2_spec.rb +65 -276
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +91 -91
- data/spec/unit/pops/parser/parse_calls_spec.rb +19 -19
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +38 -22
- data/spec/unit/pops/parser/parse_containers_spec.rb +47 -47
- data/spec/unit/pops/parser/parse_heredoc_spec.rb +15 -62
- data/spec/unit/pops/parser/parse_resource_spec.rb +75 -70
- data/spec/unit/pops/parser/parser_rspec_helper.rb +0 -5
- data/spec/unit/pops/parser/parser_spec.rb +7 -7
- data/spec/unit/pops/parser/parsing_typed_parameters_spec.rb +0 -7
- data/spec/unit/pops/parser/rgen_sanitycheck_spec.rb +2 -2
- data/spec/unit/pops/types/class_loader_spec.rb +10 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +456 -651
- data/spec/unit/pops/types/type_factory_spec.rb +59 -59
- data/spec/unit/pops/types/type_parser_spec.rb +2 -10
- data/spec/unit/pops/validator/validator_spec.rb +3 -57
- data/spec/unit/pops/visitor_spec.rb +4 -4
- data/spec/unit/property/boolean_spec.rb +2 -2
- data/spec/unit/property/ensure_spec.rb +1 -1
- data/spec/unit/property/keyvalue_spec.rb +16 -16
- data/spec/unit/property/list_spec.rb +18 -18
- data/spec/unit/property/ordered_list_spec.rb +7 -7
- data/spec/unit/property_spec.rb +72 -96
- data/spec/unit/provider/aixobject_spec.rb +12 -12
- data/spec/unit/provider/augeas/augeas_spec.rb +171 -149
- data/spec/unit/provider/cisco_spec.rb +2 -2
- data/spec/unit/provider/command_spec.rb +1 -1
- data/spec/unit/provider/cron/crontab_spec.rb +9 -9
- data/spec/unit/provider/cron/parsed_spec.rb +59 -38
- data/spec/unit/provider/exec/posix_spec.rb +9 -19
- data/spec/unit/provider/exec/shell_spec.rb +13 -13
- data/spec/unit/provider/exec/windows_spec.rb +10 -10
- data/spec/unit/provider/exec_spec.rb +2 -2
- data/spec/unit/provider/file/posix_spec.rb +27 -27
- data/spec/unit/provider/file/windows_spec.rb +15 -15
- data/spec/unit/provider/group/groupadd_spec.rb +1 -1
- data/spec/unit/provider/group/ldap_spec.rb +11 -11
- data/spec/unit/provider/group/pw_spec.rb +3 -3
- data/spec/unit/provider/group/windows_adsi_spec.rb +48 -62
- data/spec/unit/provider/host/parsed_spec.rb +58 -22
- data/spec/unit/provider/interface/cisco_spec.rb +3 -3
- data/spec/unit/provider/ldap_spec.rb +23 -23
- data/spec/unit/provider/macauthorization_spec.rb +6 -6
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +6 -6
- data/spec/unit/provider/mount/parsed_spec.rb +101 -119
- data/spec/unit/provider/mount_spec.rb +0 -0
- data/spec/unit/provider/naginator_spec.rb +8 -8
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +5 -27
- data/spec/unit/provider/nameservice_spec.rb +26 -26
- data/spec/unit/provider/network_device_spec.rb +11 -11
- data/spec/unit/provider/package/aix_spec.rb +3 -3
- data/spec/unit/provider/package/appdmg_spec.rb +1 -1
- data/spec/unit/provider/package/apt_spec.rb +4 -4
- data/spec/unit/provider/package/aptitude_spec.rb +1 -1
- data/spec/unit/provider/package/aptrpm_spec.rb +3 -3
- data/spec/unit/provider/package/dpkg_spec.rb +0 -0
- data/spec/unit/provider/package/freebsd_spec.rb +1 -1
- data/spec/unit/provider/package/gem_spec.rb +12 -12
- data/spec/unit/provider/package/hpux_spec.rb +3 -3
- data/spec/unit/provider/package/macports_spec.rb +15 -15
- data/spec/unit/provider/package/nim_spec.rb +11 -11
- data/spec/unit/provider/package/openbsd_spec.rb +72 -37
- data/spec/unit/provider/package/opkg_spec.rb +14 -11
- data/spec/unit/provider/package/pacman_spec.rb +185 -86
- data/spec/unit/provider/package/pip_spec.rb +25 -54
- data/spec/unit/provider/package/pkg_spec.rb +145 -71
- data/spec/unit/provider/package/pkgdmg_spec.rb +9 -9
- data/spec/unit/provider/package/pkgin_spec.rb +18 -18
- data/spec/unit/provider/package/pkgutil_spec.rb +19 -19
- data/spec/unit/provider/package/portage_spec.rb +8 -4
- data/spec/unit/provider/package/rpm_spec.rb +103 -9
- data/spec/unit/provider/package/sun_spec.rb +14 -14
- data/spec/unit/provider/package/up2date_spec.rb +1 -1
- data/spec/unit/provider/package/{urpmi.rb → urpmi_spec.rb} +3 -3
- data/spec/unit/provider/package/windows/exe_package_spec.rb +15 -13
- data/spec/unit/provider/package/windows/msi_package_spec.rb +16 -16
- data/spec/unit/provider/package/windows/package_spec.rb +14 -14
- data/spec/unit/provider/package/windows_spec.rb +26 -26
- data/spec/unit/provider/package/yum_spec.rb +292 -98
- data/spec/unit/provider/package/zypper_spec.rb +20 -31
- data/spec/unit/provider/parsedfile_spec.rb +9 -9
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +192 -434
- data/spec/unit/provider/selboolean_spec.rb +2 -2
- data/spec/unit/provider/selmodule_spec.rb +8 -8
- data/spec/unit/provider/service/base_spec.rb +27 -38
- data/spec/unit/provider/service/daemontools_spec.rb +11 -11
- data/spec/unit/provider/service/debian_spec.rb +8 -8
- data/spec/unit/provider/service/freebsd_spec.rb +7 -8
- data/spec/unit/provider/service/gentoo_spec.rb +12 -13
- data/spec/unit/provider/service/init_spec.rb +25 -38
- data/spec/unit/provider/service/launchd_spec.rb +19 -125
- data/spec/unit/provider/service/openbsd_spec.rb +90 -144
- data/spec/unit/provider/service/openrc_spec.rb +14 -14
- data/spec/unit/provider/service/openwrt_spec.rb +9 -9
- data/spec/unit/provider/service/redhat_spec.rb +14 -15
- data/spec/unit/provider/service/runit_spec.rb +11 -11
- data/spec/unit/provider/service/smf_spec.rb +19 -19
- data/spec/unit/provider/service/src_spec.rb +9 -9
- data/spec/unit/provider/service/systemd_spec.rb +33 -15
- data/spec/unit/provider/service/upstart_spec.rb +59 -59
- data/spec/unit/provider/service/windows_spec.rb +6 -6
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +18 -18
- data/spec/unit/provider/sshkey/parsed_spec.rb +11 -11
- data/spec/unit/provider/user/aix_spec.rb +19 -19
- data/spec/unit/provider/user/directoryservice_spec.rb +51 -95
- data/spec/unit/provider/user/hpux_spec.rb +24 -3
- data/spec/unit/provider/user/ldap_spec.rb +12 -12
- data/spec/unit/provider/user/openbsd_spec.rb +77 -0
- data/spec/unit/provider/user/pw_spec.rb +5 -5
- data/spec/unit/provider/user/user_role_add_spec.rb +20 -20
- data/spec/unit/provider/user/useradd_spec.rb +48 -32
- data/spec/unit/provider/user/windows_adsi_spec.rb +9 -31
- data/spec/unit/provider/vlan/cisco_spec.rb +3 -3
- data/spec/unit/provider/yumrepo/inifile_spec.rb +3 -3
- data/spec/unit/provider/zfs/zfs_spec.rb +11 -11
- data/spec/unit/provider/zone/solaris_spec.rb +22 -55
- data/spec/unit/provider/zpool/zpool_spec.rb +22 -22
- data/spec/unit/provider_spec.rb +110 -102
- data/spec/unit/puppet_spec.rb +15 -8
- data/spec/unit/relationship_spec.rb +37 -41
- data/spec/unit/reports/http_spec.rb +0 -0
- data/spec/unit/reports/store_spec.rb +3 -3
- data/spec/unit/reports_spec.rb +5 -5
- data/spec/unit/resource/catalog_spec.rb +93 -111
- data/spec/unit/resource/status_spec.rb +49 -75
- data/spec/unit/resource/type_collection_helper_spec.rb +1 -1
- data/spec/unit/resource/type_collection_spec.rb +59 -164
- data/spec/unit/resource/type_spec.rb +115 -120
- data/spec/unit/resource_spec.rb +176 -159
- data/spec/unit/scheduler/job_spec.rb +12 -12
- data/spec/unit/scheduler/scheduler_spec.rb +8 -8
- data/spec/unit/scheduler/splay_job_spec.rb +4 -4
- data/spec/unit/semver_spec.rb +66 -64
- data/spec/unit/settings/autosign_setting_spec.rb +1 -0
- data/spec/unit/settings/config_file_spec.rb +13 -40
- data/spec/unit/settings/directory_setting_spec.rb +1 -1
- data/spec/unit/settings/duration_setting_spec.rb +9 -5
- data/spec/unit/settings/environment_conf_spec.rb +0 -11
- data/spec/unit/settings/file_setting_spec.rb +38 -69
- data/spec/unit/settings/ini_file_spec.rb +2 -2
- data/spec/unit/settings/path_setting_spec.rb +5 -5
- data/spec/unit/settings/priority_setting_spec.rb +7 -7
- data/spec/unit/settings/string_setting_spec.rb +7 -7
- data/spec/unit/settings/terminus_setting_spec.rb +4 -4
- data/spec/unit/settings/value_translator_spec.rb +22 -22
- data/spec/unit/settings_spec.rb +189 -338
- data/spec/unit/ssl/base_spec.rb +5 -5
- data/spec/unit/ssl/certificate_authority/autosign_command_spec.rb +2 -2
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +40 -13
- data/spec/unit/ssl/certificate_authority_spec.rb +23 -23
- data/spec/unit/ssl/certificate_factory_spec.rb +39 -26
- data/spec/unit/ssl/certificate_request_attributes_spec.rb +2 -2
- data/spec/unit/ssl/certificate_request_spec.rb +52 -40
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +10 -10
- data/spec/unit/ssl/certificate_spec.rb +35 -38
- data/spec/unit/ssl/configuration_spec.rb +12 -14
- data/spec/unit/ssl/digest_spec.rb +5 -5
- data/spec/unit/ssl/host_spec.rb +91 -91
- data/spec/unit/ssl/inventory_spec.rb +11 -34
- data/spec/unit/ssl/key_spec.rb +23 -23
- data/spec/unit/ssl/oids_spec.rb +28 -15
- data/spec/unit/ssl/validator_spec.rb +16 -17
- data/spec/unit/status_spec.rb +6 -12
- data/spec/unit/transaction/additional_resource_generator_spec.rb +2 -2
- data/spec/unit/transaction/event_manager_spec.rb +38 -8
- data/spec/unit/transaction/event_spec.rb +29 -29
- data/spec/unit/transaction/report_spec.rb +76 -90
- data/spec/unit/transaction/resource_harness_spec.rb +42 -42
- data/spec/unit/transaction_spec.rb +66 -59
- data/spec/unit/type/augeas_spec.rb +20 -20
- data/spec/unit/type/component_spec.rb +10 -10
- data/spec/unit/type/computer_spec.rb +10 -10
- data/spec/unit/type/cron_spec.rb +21 -21
- data/spec/unit/type/exec_spec.rb +65 -73
- data/spec/unit/type/file/checksum_spec.rb +8 -8
- data/spec/unit/type/file/content_spec.rb +144 -85
- data/spec/unit/type/file/ctime_spec.rb +4 -4
- data/spec/unit/type/file/ensure_spec.rb +11 -11
- data/spec/unit/type/file/group_spec.rb +5 -5
- data/spec/unit/type/file/mode_spec.rb +30 -28
- data/spec/unit/type/file/mtime_spec.rb +4 -4
- data/spec/unit/type/file/owner_spec.rb +5 -5
- data/spec/unit/type/file/selinux_spec.rb +8 -8
- data/spec/unit/type/file/source_spec.rb +118 -135
- data/spec/unit/type/file/type_spec.rb +2 -2
- data/spec/unit/type/file_spec.rb +161 -160
- data/spec/unit/type/filebucket_spec.rb +8 -8
- data/spec/unit/type/group_spec.rb +12 -12
- data/spec/unit/type/host_spec.rb +41 -25
- data/spec/unit/type/interface_spec.rb +6 -6
- data/spec/unit/type/k5login_spec.rb +18 -18
- data/spec/unit/type/macauthorization_spec.rb +17 -17
- data/spec/unit/type/mailalias_spec.rb +34 -6
- data/spec/unit/type/maillist_spec.rb +2 -2
- data/spec/unit/type/mcx_spec.rb +13 -13
- data/spec/unit/type/mount_spec.rb +40 -40
- data/spec/unit/type/nagios_spec.rb +23 -23
- data/spec/unit/type/noop_metaparam_spec.rb +5 -5
- data/spec/unit/type/package/package_settings_spec.rb +9 -9
- data/spec/unit/type/package_spec.rb +87 -18
- data/spec/unit/type/resources_spec.rb +46 -46
- data/spec/unit/type/schedule_spec.rb +83 -83
- data/spec/unit/type/scheduled_task_spec.rb +15 -15
- data/spec/unit/type/selboolean_spec.rb +2 -2
- data/spec/unit/type/selmodule_spec.rb +2 -2
- data/spec/unit/type/service_spec.rb +24 -24
- data/spec/unit/type/ssh_authorized_key_spec.rb +2 -2
- data/spec/unit/type/sshkey_spec.rb +0 -0
- data/spec/unit/type/stage_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +58 -39
- data/spec/unit/type/user_spec.rb +56 -56
- data/spec/unit/type/vlan_spec.rb +6 -6
- data/spec/unit/type/whit_spec.rb +1 -1
- data/spec/unit/type/yumrepo_spec.rb +15 -0
- data/spec/unit/type/zfs_spec.rb +3 -3
- data/spec/unit/type/zone_spec.rb +19 -19
- data/spec/unit/type/zpool_spec.rb +15 -15
- data/spec/unit/type_spec.rb +236 -163
- data/spec/unit/util/autoload_spec.rb +31 -25
- data/spec/unit/util/backups_spec.rb +4 -4
- data/spec/unit/util/checksums_spec.rb +55 -27
- data/spec/unit/util/colors_spec.rb +6 -50
- data/spec/unit/util/command_line_spec.rb +13 -41
- data/spec/unit/util/command_line_utils/puppet_option_parser_spec.rb +2 -2
- data/spec/unit/util/constant_inflector_spec.rb +12 -12
- data/spec/unit/util/diff_spec.rb +4 -4
- data/spec/unit/util/errors_spec.rb +5 -5
- data/spec/unit/util/execution_spec.rb +74 -29
- data/spec/unit/util/execution_stub_spec.rb +10 -10
- data/spec/unit/util/feature_spec.rb +15 -19
- data/spec/unit/util/filetype_spec.rb +9 -9
- data/spec/unit/util/http_proxy_spec.rb +18 -18
- data/spec/unit/util/inifile_spec.rb +2 -2
- data/spec/unit/util/json_lockfile_spec.rb +1 -1
- data/spec/unit/util/ldap/connection_spec.rb +6 -6
- data/spec/unit/util/ldap/generator_spec.rb +8 -8
- data/spec/unit/util/ldap/manager_spec.rb +40 -40
- data/spec/unit/util/lockfile_spec.rb +13 -13
- data/spec/unit/util/log/destinations_spec.rb +52 -49
- data/spec/unit/util/log_spec.rb +48 -173
- data/spec/unit/util/logging_spec.rb +120 -3
- data/spec/unit/util/metric_spec.rb +18 -33
- data/spec/unit/util/monkey_patches_spec.rb +18 -139
- data/spec/unit/util/nagios_maker_spec.rb +2 -2
- data/spec/unit/util/network_device/cisco/device_spec.rb +23 -23
- data/spec/unit/util/network_device/cisco/facts_spec.rb +3 -3
- data/spec/unit/util/network_device/cisco/interface_spec.rb +0 -0
- data/spec/unit/util/network_device/config_spec.rb +10 -16
- data/spec/unit/util/network_device/ipcalc_spec.rb +10 -10
- data/spec/unit/util/network_device/transport/base_spec.rb +2 -2
- data/spec/unit/util/network_device/transport/ssh_spec.rb +10 -10
- data/spec/unit/util/network_device/transport/telnet_spec.rb +3 -3
- data/spec/unit/util/network_device_spec.rb +2 -2
- data/spec/unit/util/package_spec.rb +2 -2
- data/spec/unit/util/pidlock_spec.rb +38 -38
- data/spec/unit/util/posix_spec.rb +25 -25
- data/spec/unit/util/profiler/aggregate_spec.rb +14 -18
- data/spec/unit/util/profiler/around_profiler_spec.rb +6 -6
- data/spec/unit/util/profiler/logging_spec.rb +8 -8
- data/spec/unit/util/profiler/object_counts_spec.rb +3 -5
- data/spec/unit/util/profiler/wall_clock_spec.rb +1 -1
- data/spec/unit/util/profiler_spec.rb +6 -14
- data/spec/unit/util/rdoc_spec.rb +0 -85
- data/spec/unit/util/reference_spec.rb +1 -1
- data/spec/unit/util/resource_template_spec.rb +2 -2
- data/spec/unit/util/{retryaction_spec.rb → retry_action_spec.rb} +25 -2
- data/spec/unit/util/rubygems_spec.rb +8 -8
- data/spec/unit/util/run_mode_spec.rb +159 -17
- data/spec/unit/util/selinux_spec.rb +61 -39
- data/spec/unit/util/ssl_spec.rb +13 -13
- data/spec/unit/util/storage_spec.rb +27 -27
- data/spec/unit/util/suidmanager_spec.rb +56 -67
- data/spec/unit/util/symbolic_file_mode_spec.rb +15 -16
- data/spec/unit/util/tag_set_spec.rb +5 -5
- data/spec/unit/util/tagging_spec.rb +0 -0
- data/spec/unit/util/terminal_spec.rb +5 -5
- data/spec/unit/util/user_attr_spec.rb +6 -6
- data/spec/unit/util/warnings_spec.rb +9 -1
- data/spec/unit/util/watcher_spec.rb +1 -1
- data/spec/unit/util/windows/access_control_entry_spec.rb +9 -9
- data/spec/unit/util/windows/access_control_list_spec.rb +21 -21
- data/spec/unit/util/windows/adsi_spec.rb +71 -209
- data/spec/unit/util/windows/api_types_spec.rb +3 -3
- data/spec/unit/util/windows/registry_spec.rb +71 -46
- data/spec/unit/util/windows/root_certs_spec.rb +1 -1
- data/spec/unit/util/windows/security_descriptor_spec.rb +18 -18
- data/spec/unit/util/windows/sid_spec.rb +40 -20
- data/spec/unit/util/windows/string_spec.rb +4 -4
- data/spec/unit/util/yaml_spec.rb +1 -1
- data/spec/unit/util_spec.rb +73 -124
- data/spec/unit/version_spec.rb +4 -4
- data/spec/watchr.rb +1 -5
- data/tasks/benchmark.rake +1 -6
- data/tasks/ci.rake +1 -1
- data/tasks/manpages.rake +0 -9
- data/tasks/parallel.rake +4 -7
- data/tasks/parser.rake +0 -5
- metadata +179 -481
- data/conf/tagmail.conf +0 -16
- data/ext/debian/puppet.conf +0 -14
- data/ext/debian/puppetmaster-common.puppetqd.default +0 -27
- data/ext/debian/puppetmaster-common.puppetqd.init +0 -84
- data/ext/gentoo/puppet/puppet.conf +0 -25
- data/ext/ips/puppet.conf +0 -29
- data/ext/nagios/naggen +0 -309
- data/ext/puppet-load.rb +0 -393
- data/ext/redhat/puppet.conf +0 -25
- data/ext/redhat/queue.init +0 -105
- data/lib/hiera/backend/puppet_backend.rb +0 -103
- data/lib/puppet/application/instrumentation_data.rb +0 -7
- data/lib/puppet/application/instrumentation_listener.rb +0 -7
- data/lib/puppet/application/instrumentation_probe.rb +0 -7
- data/lib/puppet/application/kick.rb +0 -351
- data/lib/puppet/application/queue.rb +0 -161
- data/lib/puppet/application/secret_agent.rb +0 -9
- data/lib/puppet/dsl.rb +0 -7
- data/lib/puppet/dsl/resource_api.rb +0 -120
- data/lib/puppet/dsl/resource_type_api.rb +0 -34
- data/lib/puppet/face/instrumentation_data.rb +0 -30
- data/lib/puppet/face/instrumentation_listener.rb +0 -98
- data/lib/puppet/face/instrumentation_probe.rb +0 -79
- data/lib/puppet/face/secret_agent.rb +0 -54
- data/lib/puppet/feature/pson.rb +0 -4
- data/lib/puppet/feature/rails.rb +0 -47
- data/lib/puppet/feature/rdoc1.rb +0 -16
- data/lib/puppet/feature/rubygems.rb +0 -7
- data/lib/puppet/feature/stomp.rb +0 -5
- data/lib/puppet/file_collection.rb +0 -19
- data/lib/puppet/file_collection/lookup.rb +0 -10
- data/lib/puppet/file_system/file18.rb +0 -5
- data/lib/puppet/functions/defined.rb +0 -130
- data/lib/puppet/indirector/active_record.rb +0 -29
- data/lib/puppet/indirector/catalog/active_record.rb +0 -39
- data/lib/puppet/indirector/catalog/queue.rb +0 -9
- data/lib/puppet/indirector/couch.rb +0 -78
- data/lib/puppet/indirector/facts/active_record.rb +0 -44
- data/lib/puppet/indirector/facts/couch.rb +0 -36
- data/lib/puppet/indirector/facts/inventory_active_record.rb +0 -110
- data/lib/puppet/indirector/facts/inventory_service.rb +0 -20
- data/lib/puppet/indirector/facts/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_data.rb +0 -3
- data/lib/puppet/indirector/instrumentation_data/local.rb +0 -22
- data/lib/puppet/indirector/instrumentation_data/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_listener.rb +0 -3
- data/lib/puppet/indirector/instrumentation_listener/local.rb +0 -26
- data/lib/puppet/indirector/instrumentation_listener/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_probe.rb +0 -3
- data/lib/puppet/indirector/instrumentation_probe/local.rb +0 -27
- data/lib/puppet/indirector/instrumentation_probe/rest.rb +0 -8
- data/lib/puppet/indirector/node/active_record.rb +0 -22
- data/lib/puppet/indirector/queue.rb +0 -80
- data/lib/puppet/indirector/resource/active_record.rb +0 -104
- data/lib/puppet/indirector/resource/rest.rb +0 -17
- data/lib/puppet/indirector/run/local.rb +0 -15
- data/lib/puppet/indirector/run/rest.rb +0 -12
- data/lib/puppet/module_tool/modulefile.rb +0 -78
- data/lib/puppet/network/authentication.rb +0 -35
- data/lib/puppet/network/http/api/v2.rb +0 -32
- data/lib/puppet/network/http/api/v2/authorization.rb +0 -15
- data/lib/puppet/parser/ast/arithmetic_operator.rb +0 -91
- data/lib/puppet/parser/ast/astarray.rb +0 -50
- data/lib/puppet/parser/ast/asthash.rb +0 -37
- data/lib/puppet/parser/ast/boolean_operator.rb +0 -46
- data/lib/puppet/parser/ast/caseopt.rb +0 -52
- data/lib/puppet/parser/ast/casestatement.rb +0 -41
- data/lib/puppet/parser/ast/collection.rb +0 -53
- data/lib/puppet/parser/ast/collexpr.rb +0 -109
- data/lib/puppet/parser/ast/comparison_operator.rb +0 -38
- data/lib/puppet/parser/ast/definition.rb +0 -17
- data/lib/puppet/parser/ast/else.rb +0 -22
- data/lib/puppet/parser/ast/function.rb +0 -59
- data/lib/puppet/parser/ast/ifstatement.rb +0 -34
- data/lib/puppet/parser/ast/in_operator.rb +0 -24
- data/lib/puppet/parser/ast/lambda.rb +0 -135
- data/lib/puppet/parser/ast/match_operator.rb +0 -28
- data/lib/puppet/parser/ast/method_call.rb +0 -77
- data/lib/puppet/parser/ast/minus.rb +0 -23
- data/lib/puppet/parser/ast/nop.rb +0 -11
- data/lib/puppet/parser/ast/not.rb +0 -19
- data/lib/puppet/parser/ast/relationship.rb +0 -47
- data/lib/puppet/parser/ast/resource_defaults.rb +0 -24
- data/lib/puppet/parser/ast/resource_override.rb +0 -62
- data/lib/puppet/parser/ast/resource_reference.rb +0 -28
- data/lib/puppet/parser/ast/selector.rb +0 -50
- data/lib/puppet/parser/ast/vardef.rb +0 -38
- data/lib/puppet/parser/code_merger.rb +0 -13
- data/lib/puppet/parser/collector.rb +0 -177
- data/lib/puppet/parser/functions/extlookup.rb +0 -153
- data/lib/puppet/parser/functions/search.rb +0 -12
- data/lib/puppet/parser/grammar.ra +0 -806
- data/lib/puppet/parser/lexer.rb +0 -608
- data/lib/puppet/parser/makefile +0 -8
- data/lib/puppet/parser/methods.rb +0 -69
- data/lib/puppet/parser/parser.rb +0 -2559
- data/lib/puppet/parser/parser_support.rb +0 -195
- data/lib/puppet/pops/binder/lookup.rb +0 -216
- data/lib/puppet/pops/migration/migration_checker.rb +0 -45
- data/lib/puppet/pops/model/ast_tree_dumper.rb +0 -386
- data/lib/puppet/provider/package/msi.rb +0 -125
- data/lib/puppet/provider/package/yumhelper.py +0 -159
- data/lib/puppet/rails.rb +0 -139
- data/lib/puppet/rails/benchmark.rb +0 -63
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +0 -13
- data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +0 -13
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +0 -9
- data/lib/puppet/rails/database/004_add_inventory_service_tables.rb +0 -36
- data/lib/puppet/rails/database/schema.rb +0 -136
- data/lib/puppet/rails/fact_name.rb +0 -7
- data/lib/puppet/rails/fact_value.rb +0 -10
- data/lib/puppet/rails/host.rb +0 -258
- data/lib/puppet/rails/inventory_fact.rb +0 -5
- data/lib/puppet/rails/inventory_node.rb +0 -43
- data/lib/puppet/rails/param_name.rb +0 -25
- data/lib/puppet/rails/param_value.rb +0 -74
- data/lib/puppet/rails/puppet_tag.rb +0 -10
- data/lib/puppet/rails/resource.rb +0 -235
- data/lib/puppet/rails/resource_tag.rb +0 -26
- data/lib/puppet/rails/source_file.rb +0 -8
- data/lib/puppet/reports/rrdgraph.rb +0 -128
- data/lib/puppet/reports/tagmail.rb +0 -179
- data/lib/puppet/run.rb +0 -109
- data/lib/puppet/util/cacher.rb +0 -74
- data/lib/puppet/util/inline_docs.rb +0 -26
- data/lib/puppet/util/instrumentation.rb +0 -152
- data/lib/puppet/util/instrumentation/data.rb +0 -46
- data/lib/puppet/util/instrumentation/indirection_probe.rb +0 -41
- data/lib/puppet/util/instrumentation/instrumentable.rb +0 -136
- data/lib/puppet/util/instrumentation/listener.rb +0 -72
- data/lib/puppet/util/instrumentation/listeners/log.rb +0 -23
- data/lib/puppet/util/instrumentation/listeners/performance.rb +0 -24
- data/lib/puppet/util/log/rate_limited_logger.rb +0 -40
- data/lib/puppet/util/monkey_patches/lines.rb +0 -13
- data/lib/puppet/util/plugins.rb +0 -82
- data/lib/puppet/util/pson.rb +0 -13
- data/lib/puppet/util/queue.rb +0 -96
- data/lib/puppet/util/queue/stomp.rb +0 -60
- data/lib/puppet/util/rails/cache_accumulator.rb +0 -65
- data/lib/puppet/util/rails/collection_merger.rb +0 -17
- data/lib/puppet/util/rails/reference_serializer.rb +0 -32
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc1.rb +0 -19
- data/lib/puppet/util/retryaction.rb +0 -47
- data/lib/puppet/util/zaml.rb +0 -419
- data/lib/puppet/vendor/load_safe_yaml.rb +0 -1
- data/lib/puppet/vendor/safe_yaml/CHANGES.md +0 -104
- data/lib/puppet/vendor/safe_yaml/Gemfile +0 -11
- data/lib/puppet/vendor/safe_yaml/LICENSE.txt +0 -22
- data/lib/puppet/vendor/safe_yaml/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/safe_yaml/README.md +0 -179
- data/lib/puppet/vendor/safe_yaml/Rakefile +0 -6
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb +0 -253
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/deep.rb +0 -34
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/date.rb +0 -27
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb +0 -12
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/sexagesimal.rb +0 -26
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/psych_handler.rb +0 -92
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/psych_resolver.rb +0 -52
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/resolver.rb +0 -94
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -17
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_hack.rb +0 -36
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb +0 -43
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_resolver.rb +0 -38
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform.rb +0 -41
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_boolean.rb +0 -21
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_date.rb +0 -11
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_float.rb +0 -33
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_integer.rb +0 -25
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_nil.rb +0 -18
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb +0 -13
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/transformation_map.rb +0 -47
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/version.rb +0 -3
- data/lib/puppet/vendor/safe_yaml/run_specs_all_ruby_versions.sh +0 -21
- data/lib/puppet/vendor/safe_yaml/safe_yaml.gemspec +0 -18
- data/lib/puppet/vendor/safe_yaml/spec/exploit.1.9.2.yaml +0 -2
- data/lib/puppet/vendor/safe_yaml/spec/exploit.1.9.3.yaml +0 -2
- data/lib/puppet/vendor/safe_yaml/spec/psych_resolver_spec.rb +0 -10
- data/lib/puppet/vendor/safe_yaml/spec/resolver_specs.rb +0 -250
- data/lib/puppet/vendor/safe_yaml/spec/safe_yaml_spec.rb +0 -702
- data/lib/puppet/vendor/safe_yaml/spec/spec_helper.rb +0 -18
- data/lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb +0 -29
- data/lib/puppet/vendor/safe_yaml/spec/syck_resolver_spec.rb +0 -10
- data/lib/puppet/vendor/safe_yaml/spec/transform/base64_spec.rb +0 -11
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_date_spec.rb +0 -34
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_float_spec.rb +0 -42
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_integer_spec.rb +0 -59
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_symbol_spec.rb +0 -49
- data/lib/puppet/vendor/safe_yaml_patches.rb +0 -9
- data/lib/puppetx.rb +0 -89
- data/man/man8/puppet-instrumentation_data.8 +0 -141
- data/man/man8/puppet-instrumentation_listener.8 +0 -218
- data/man/man8/puppet-instrumentation_probe.8 +0 -203
- data/man/man8/puppet-kick.8 +0 -131
- data/man/man8/puppet-queue.8 +0 -55
- data/man/man8/puppet-secret_agent.8 +0 -70
- data/spec/fixtures/module.tar.gz +0 -0
- data/spec/fixtures/unit/provider/package/pkg/publisher +0 -2
- data/spec/fixtures/unit/provider/package/pkg/simple +0 -2
- data/spec/fixtures/yaml/report0.25.x.yaml +0 -64
- data/spec/integration/indirector/catalog/queue_spec.rb +0 -55
- data/spec/integration/module_tool/tar/mini_spec.rb +0 -28
- data/spec/integration/parser/dynamic_scoping_spec.rb +0 -131
- data/spec/integration/parser/future_compiler_spec.rb +0 -822
- data/spec/integration/parser/parser_spec.rb +0 -207
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -119
- data/spec/integration/type/sshkey_spec.rb +0 -22
- data/spec/integration/util/feature_spec.rb +0 -53
- data/spec/lib/puppet_spec/database.rb +0 -29
- data/spec/monkey_patches/alias_should_to_must.rb +0 -21
- data/spec/shared_contexts/platform.rb +0 -52
- data/spec/unit/application/kick_spec.rb +0 -296
- data/spec/unit/application/queue_spec.rb +0 -168
- data/spec/unit/application/secret_agent_spec.rb +0 -34
- data/spec/unit/dsl/resource_api_spec.rb +0 -180
- data/spec/unit/dsl/resource_type_api_spec.rb +0 -53
- data/spec/unit/face/instrumentation_data_spec.rb +0 -7
- data/spec/unit/face/instrumentation_listener_spec.rb +0 -38
- data/spec/unit/face/instrumentation_probe_spec.rb +0 -21
- data/spec/unit/face/secret_agent_spec.rb +0 -27
- data/spec/unit/functions/defined_spec.rb +0 -291
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +0 -148
- data/spec/unit/indirector/active_record_spec.rb +0 -75
- data/spec/unit/indirector/catalog/active_record_spec.rb +0 -107
- data/spec/unit/indirector/catalog/queue_spec.rb +0 -19
- data/spec/unit/indirector/facts/active_record_spec.rb +0 -113
- data/spec/unit/indirector/facts/couch_spec.rb +0 -102
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +0 -175
- data/spec/unit/indirector/facts/inventory_service_spec.rb +0 -21
- data/spec/unit/indirector/facts/rest_spec.rb +0 -10
- data/spec/unit/indirector/instrumentation_data/local_spec.rb +0 -52
- data/spec/unit/indirector/instrumentation_data/rest_spec.rb +0 -11
- data/spec/unit/indirector/instrumentation_listener/local_spec.rb +0 -65
- data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +0 -11
- data/spec/unit/indirector/instrumentation_probe/local_spec.rb +0 -65
- data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +0 -11
- data/spec/unit/indirector/node/active_record_spec.rb +0 -48
- data/spec/unit/indirector/queue_spec.rb +0 -115
- data/spec/unit/indirector/resource/active_record_spec.rb +0 -166
- data/spec/unit/indirector/resource/rest_spec.rb +0 -10
- data/spec/unit/indirector/run/local_spec.rb +0 -21
- data/spec/unit/indirector/run/rest_spec.rb +0 -10
- data/spec/unit/network/authentication_spec.rb +0 -104
- data/spec/unit/network/http/api/v2_spec.rb +0 -14
- data/spec/unit/parser/ast/arithmetic_operator_spec.rb +0 -160
- data/spec/unit/parser/ast/astarray_spec.rb +0 -56
- data/spec/unit/parser/ast/asthash_spec.rb +0 -98
- data/spec/unit/parser/ast/boolean_operator_spec.rb +0 -54
- data/spec/unit/parser/ast/casestatement_spec.rb +0 -168
- data/spec/unit/parser/ast/collection_spec.rb +0 -70
- data/spec/unit/parser/ast/collexpr_spec.rb +0 -120
- data/spec/unit/parser/ast/comparison_operator_spec.rb +0 -118
- data/spec/unit/parser/ast/definition_spec.rb +0 -21
- data/spec/unit/parser/ast/function_spec.rb +0 -92
- data/spec/unit/parser/ast/hostclass_spec.rb +0 -72
- data/spec/unit/parser/ast/ifstatement_spec.rb +0 -77
- data/spec/unit/parser/ast/in_operator_spec.rb +0 -61
- data/spec/unit/parser/ast/match_operator_spec.rb +0 -51
- data/spec/unit/parser/ast/minus_spec.rb +0 -37
- data/spec/unit/parser/ast/node_spec.rb +0 -30
- data/spec/unit/parser/ast/nop_spec.rb +0 -19
- data/spec/unit/parser/ast/not_spec.rb +0 -31
- data/spec/unit/parser/ast/relationship_spec.rb +0 -87
- data/spec/unit/parser/ast/resource_defaults_spec.rb +0 -21
- data/spec/unit/parser/ast/resource_override_spec.rb +0 -50
- data/spec/unit/parser/ast/resource_reference_spec.rb +0 -56
- data/spec/unit/parser/ast/resource_spec.rb +0 -183
- data/spec/unit/parser/ast/resourceparam_spec.rb +0 -51
- data/spec/unit/parser/ast/selector_spec.rb +0 -88
- data/spec/unit/parser/ast/vardef_spec.rb +0 -68
- data/spec/unit/parser/ast_spec.rb +0 -76
- data/spec/unit/parser/collector_spec.rb +0 -438
- data/spec/unit/parser/functions/extlookup_spec.rb +0 -102
- data/spec/unit/parser/functions/search_spec.rb +0 -28
- data/spec/unit/parser/lexer_spec.rb +0 -877
- data/spec/unit/parser/parser_spec.rb +0 -535
- data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +0 -19
- data/spec/unit/pops/migration_spec.rb +0 -180
- data/spec/unit/pops/model/ast_transformer_spec.rb +0 -76
- data/spec/unit/pops/transformer/transform_basic_expressions_spec.rb +0 -243
- data/spec/unit/pops/transformer/transform_calls_spec.rb +0 -115
- data/spec/unit/pops/transformer/transform_conditionals_spec.rb +0 -123
- data/spec/unit/pops/transformer/transform_containers_spec.rb +0 -190
- data/spec/unit/pops/transformer/transformer_rspec_helper.rb +0 -27
- data/spec/unit/pops/validation_spec.rb +0 -66
- data/spec/unit/provider/package/msi_spec.rb +0 -229
- data/spec/unit/rails/host_spec.rb +0 -162
- data/spec/unit/rails/param_value_spec.rb +0 -46
- data/spec/unit/rails/resource_spec.rb +0 -115
- data/spec/unit/rails_spec.rb +0 -244
- data/spec/unit/reports/rrdgraph_spec.rb +0 -29
- data/spec/unit/reports/tagmail_spec.rb +0 -218
- data/spec/unit/run_spec.rb +0 -175
- data/spec/unit/util/cache_accumulator_spec.rb +0 -74
- data/spec/unit/util/cacher_spec.rb +0 -107
- data/spec/unit/util/inline_docs_spec.rb +0 -31
- data/spec/unit/util/instrumentation/data_spec.rb +0 -46
- data/spec/unit/util/instrumentation/indirection_probe_spec.rb +0 -21
- data/spec/unit/util/instrumentation/instrumentable_spec.rb +0 -186
- data/spec/unit/util/instrumentation/listener_spec.rb +0 -101
- data/spec/unit/util/instrumentation/listeners/log_spec.rb +0 -34
- data/spec/unit/util/instrumentation/listeners/performance_spec.rb +0 -36
- data/spec/unit/util/instrumentation_spec.rb +0 -181
- data/spec/unit/util/log/rate_limited_logger_spec.rb +0 -51
- data/spec/unit/util/monkey_patches/lines_spec.rb +0 -83
- data/spec/unit/util/queue/stomp_spec.rb +0 -137
- data/spec/unit/util/queue_spec.rb +0 -94
- data/spec/unit/util/rdoc/parser_spec.rb +0 -608
- data/spec/unit/util/reference_serializer_spec.rb +0 -51
- data/spec/unit/util/zaml_spec.rb +0 -308
@@ -36,11 +36,11 @@ describe Puppet::Network::FormatHandler.format(:s) do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should support certificates" do
|
39
|
-
@format.
|
39
|
+
expect(@format).to be_supported(Puppet::SSL::Certificate)
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should not support catalogs" do
|
43
|
-
@format.
|
43
|
+
expect(@format).not_to be_supported(Puppet::Resource::Catalog)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -51,41 +51,41 @@ describe Puppet::Network::FormatHandler.format(:pson) do
|
|
51
51
|
|
52
52
|
it "should be able to render an instance to pson" do
|
53
53
|
instance = PsonIntTest.new("foo")
|
54
|
-
PsonIntTest.canonical_order(@pson.render(instance)).
|
54
|
+
expect(PsonIntTest.canonical_order(@pson.render(instance))).to eq(PsonIntTest.canonical_order('{"type":"PsonIntTest","data":["foo"]}' ))
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should be able to render arrays to pson" do
|
58
|
-
@pson.render([1,2]).
|
58
|
+
expect(@pson.render([1,2])).to eq('[1,2]')
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should be able to render arrays containing hashes to pson" do
|
62
|
-
@pson.render([{"one"=>1},{"two"=>2}]).
|
62
|
+
expect(@pson.render([{"one"=>1},{"two"=>2}])).to eq('[{"one":1},{"two":2}]')
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should be able to render multiple instances to pson" do
|
66
66
|
one = PsonIntTest.new("one")
|
67
67
|
two = PsonIntTest.new("two")
|
68
68
|
|
69
|
-
PsonIntTest.canonical_order(@pson.render([one,two])).
|
69
|
+
expect(PsonIntTest.canonical_order(@pson.render([one,two]))).to eq(PsonIntTest.canonical_order('[{"type":"PsonIntTest","data":["one"]},{"type":"PsonIntTest","data":["two"]}]'))
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should be able to intern pson into an instance" do
|
73
|
-
@pson.intern(PsonIntTest, '{"type":"PsonIntTest","data":["foo"]}').
|
73
|
+
expect(@pson.intern(PsonIntTest, '{"type":"PsonIntTest","data":["foo"]}')).to eq(PsonIntTest.new("foo"))
|
74
74
|
end
|
75
75
|
|
76
76
|
it "should be able to intern pson with no class information into an instance" do
|
77
|
-
@pson.intern(PsonIntTest, '["foo"]').
|
77
|
+
expect(@pson.intern(PsonIntTest, '["foo"]')).to eq(PsonIntTest.new("foo"))
|
78
78
|
end
|
79
79
|
|
80
80
|
it "should be able to intern multiple instances from pson" do
|
81
|
-
@pson.intern_multiple(PsonIntTest, '[{"type": "PsonIntTest", "data": ["one"]},{"type": "PsonIntTest", "data": ["two"]}]').
|
81
|
+
expect(@pson.intern_multiple(PsonIntTest, '[{"type": "PsonIntTest", "data": ["one"]},{"type": "PsonIntTest", "data": ["two"]}]')).to eq([
|
82
82
|
PsonIntTest.new("one"), PsonIntTest.new("two")
|
83
|
-
]
|
83
|
+
])
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should be able to intern multiple instances from pson with no class information" do
|
87
|
-
@pson.intern_multiple(PsonIntTest, '[["one"],["two"]]').
|
87
|
+
expect(@pson.intern_multiple(PsonIntTest, '[["one"],["two"]]')).to eq([
|
88
88
|
PsonIntTest.new("one"), PsonIntTest.new("two")
|
89
|
-
]
|
89
|
+
])
|
90
90
|
end
|
91
91
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/network/http'
|
4
|
+
require 'puppet/network/http/api/indirected_routes'
|
5
|
+
require 'puppet/indirector_proxy'
|
6
|
+
require 'puppet_spec/files'
|
7
|
+
require 'puppet_spec/network'
|
8
|
+
require 'json'
|
9
|
+
|
10
|
+
describe Puppet::Network::HTTP::API::IndirectedRoutes do
|
11
|
+
include PuppetSpec::Files
|
12
|
+
include PuppetSpec::Network
|
13
|
+
include_context 'with supported checksum types'
|
14
|
+
|
15
|
+
describe "when running the master application" do
|
16
|
+
before :each do
|
17
|
+
Puppet::Application[:master].setup_terminuses
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "using Puppet API to request file metadata" do
|
21
|
+
let(:handler) { Puppet::Network::HTTP::API::IndirectedRoutes.new }
|
22
|
+
let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
|
23
|
+
|
24
|
+
with_checksum_types 'file_content', 'lib/files/file.rb' do
|
25
|
+
before :each do
|
26
|
+
Puppet.settings[:modulepath] = env_path
|
27
|
+
end
|
28
|
+
|
29
|
+
it "should find the file metadata with expected checksum" do
|
30
|
+
request = a_request_that_finds(Puppet::IndirectorProxy.new("modules/lib/file.rb", "file_metadata"),
|
31
|
+
{:accept_header => 'unknown, text/pson'},
|
32
|
+
{:environment => 'production', :checksum_type => checksum_type})
|
33
|
+
handler.call(request, response)
|
34
|
+
resp = JSON.parse(response.body)
|
35
|
+
|
36
|
+
expect(resp['checksum']['type']).to eq(checksum_type)
|
37
|
+
expect(checksum_valid(checksum_type, checksum, resp['checksum']['value'])).to be_truthy
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should search for the file metadata with expected checksum" do
|
41
|
+
request = a_request_that_searches(Puppet::IndirectorProxy.new("modules/lib", "file_metadata"),
|
42
|
+
{:accept_header => 'unknown, text/pson'},
|
43
|
+
{:environment => 'production', :checksum_type => checksum_type, :recurse => 'yes'})
|
44
|
+
handler.call(request, response)
|
45
|
+
resp = JSON.parse(response.body)
|
46
|
+
|
47
|
+
expect(resp.length).to eq(2)
|
48
|
+
file = resp.find {|x| x['relative_path'] == 'file.rb'}
|
49
|
+
|
50
|
+
expect(file['checksum']['type']).to eq(checksum_type)
|
51
|
+
expect(checksum_valid(checksum_type, checksum, file['checksum']['value'])).to be_truthy
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -32,8 +32,8 @@ describe Puppet::Node::Environment do
|
|
32
32
|
environment = Puppet::Node::Environment.create(:foo, dirs)
|
33
33
|
|
34
34
|
environment.modules.each do |mod|
|
35
|
-
mod.environment.
|
36
|
-
mod.path.
|
35
|
+
expect(mod.environment).to eq(environment)
|
36
|
+
expect(mod.path).to eq(mods[mod.name])
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -52,8 +52,8 @@ describe Puppet::Node::Environment do
|
|
52
52
|
environment = Puppet::Node::Environment.create(:foo, dirs)
|
53
53
|
|
54
54
|
mods = environment.modules
|
55
|
-
mods.length.
|
56
|
-
mods[0].path.
|
55
|
+
expect(mods.length).to eq(1)
|
56
|
+
expect(mods[0].path).to eq(File.join(base, "dir1", "mod"))
|
57
57
|
end
|
58
58
|
|
59
59
|
shared_examples_for "the environment's initial import" do |settings|
|
@@ -80,7 +80,7 @@ describe Puppet::Node::Environment do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
shared_examples_for "the environment's initial import in
|
83
|
+
shared_examples_for "the environment's initial import in 4x" do |settings|
|
84
84
|
it "a manifest referring to a directory invokes recursive parsing of all its files in sorted order" do
|
85
85
|
settings.each do |name, value|
|
86
86
|
Puppet[name] = value
|
@@ -104,22 +104,19 @@ describe Puppet::Node::Environment do
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
describe 'using
|
107
|
+
describe 'using 4x parser' do
|
108
108
|
it_behaves_like "the environment's initial import",
|
109
|
-
:parser => 'current',
|
110
109
|
# fixture uses variables that are set in a particular order (this ensures
|
111
110
|
# that files are parsed and combined in the right order or an error will
|
112
111
|
# be raised if 'b' is evaluated before 'a').
|
113
112
|
:strict_variables => true
|
114
113
|
end
|
115
114
|
|
116
|
-
describe 'using
|
117
|
-
it_behaves_like "the environment's initial import",
|
118
|
-
|
119
|
-
#
|
120
|
-
#
|
121
|
-
|
122
|
-
# is taken out of the equation.
|
123
|
-
:strict_variables => false
|
115
|
+
describe 'using 4x parser' do
|
116
|
+
it_behaves_like "the environment's initial import in 4x",
|
117
|
+
# fixture uses variables that are set in a particular order (this ensures
|
118
|
+
# that files are parsed and combined in the right order or an error will
|
119
|
+
# be raised if 'b' is evaluated before 'a').
|
120
|
+
:strict_variables => true
|
124
121
|
end
|
125
122
|
end
|
@@ -6,7 +6,7 @@ describe Puppet::Node::Facts do
|
|
6
6
|
it "should expire any cached node instances when it is saved" do
|
7
7
|
Puppet::Node::Facts.indirection.stubs(:terminus_class).returns :yaml
|
8
8
|
|
9
|
-
Puppet::Node::Facts.indirection.terminus(:yaml).
|
9
|
+
expect(Puppet::Node::Facts.indirection.terminus(:yaml)).to equal(Puppet::Node::Facts.indirection.terminus(:yaml))
|
10
10
|
terminus = Puppet::Node::Facts.indirection.terminus(:yaml)
|
11
11
|
terminus.stubs :save
|
12
12
|
|
@@ -25,7 +25,7 @@ describe Puppet::Node::Facts do
|
|
25
25
|
terminus.expects(:path).with("me").returns "/my/yaml/file"
|
26
26
|
Puppet::FileSystem.expects(:exist?).with("/my/yaml/file").returns false
|
27
27
|
|
28
|
-
Puppet::Node::Facts.indirection.find("me").
|
28
|
+
expect(Puppet::Node::Facts.indirection.find("me")).to be_nil
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should be able to delegate to the :facter terminus" do
|
@@ -35,7 +35,7 @@ describe Puppet::Node::Facts do
|
|
35
35
|
facts = Puppet::Node::Facts.new("me")
|
36
36
|
Puppet::Node::Facts.expects(:new).with("me", "facter_hash").returns facts
|
37
37
|
|
38
|
-
Puppet::Node::Facts.indirection.find("me").
|
38
|
+
expect(Puppet::Node::Facts.indirection.find("me")).to equal(facts)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -22,11 +22,11 @@ describe Puppet::Node do
|
|
22
22
|
terminus.expects(:path).with(@name).returns "/my/yaml/file"
|
23
23
|
|
24
24
|
Puppet::FileSystem.expects(:exist?).with("/my/yaml/file").returns false
|
25
|
-
Puppet::Node.indirection.find(@name).
|
25
|
+
expect(Puppet::Node.indirection.find(@name)).to be_nil
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should have an ldap terminus" do
|
29
|
-
Puppet::Node.indirection.terminus(:ldap).
|
29
|
+
expect(Puppet::Node.indirection.terminus(:ldap)).not_to be_nil
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should be able to use the plain terminus" do
|
@@ -37,7 +37,7 @@ describe Puppet::Node do
|
|
37
37
|
|
38
38
|
Puppet::Node.expects(:new).with(@name).returns @node
|
39
39
|
|
40
|
-
Puppet::Node.indirection.find(@name).
|
40
|
+
expect(Puppet::Node.indirection.find(@name)).to equal(@node)
|
41
41
|
end
|
42
42
|
|
43
43
|
describe "and using the memory terminus" do
|
@@ -53,29 +53,29 @@ describe Puppet::Node do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
it "should find no nodes by default" do
|
56
|
-
Puppet::Node.indirection.find(@name).
|
56
|
+
expect(Puppet::Node.indirection.find(@name)).to be_nil
|
57
57
|
end
|
58
58
|
|
59
59
|
it "should be able to find nodes that were previously saved" do
|
60
60
|
Puppet::Node.indirection.save(@node)
|
61
|
-
Puppet::Node.indirection.find(@name).
|
61
|
+
expect(Puppet::Node.indirection.find(@name)).to equal(@node)
|
62
62
|
end
|
63
63
|
|
64
64
|
it "should replace existing saved nodes when a new node with the same name is saved" do
|
65
65
|
Puppet::Node.indirection.save(@node)
|
66
66
|
two = Puppet::Node.new(@name)
|
67
67
|
Puppet::Node.indirection.save(two)
|
68
|
-
Puppet::Node.indirection.find(@name).
|
68
|
+
expect(Puppet::Node.indirection.find(@name)).to equal(two)
|
69
69
|
end
|
70
70
|
|
71
71
|
it "should be able to remove previously saved nodes" do
|
72
72
|
Puppet::Node.indirection.save(@node)
|
73
73
|
Puppet::Node.indirection.destroy(@node.name)
|
74
|
-
Puppet::Node.indirection.find(@name).
|
74
|
+
expect(Puppet::Node.indirection.find(@name)).to be_nil
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should fail when asked to destroy a node that does not exist" do
|
78
|
-
|
78
|
+
expect { Puppet::Node.indirection.destroy(@node) }.to raise_error(ArgumentError)
|
79
79
|
end
|
80
80
|
end
|
81
81
|
end
|
@@ -6,7 +6,7 @@ require 'puppet/indirector/catalog/compiler'
|
|
6
6
|
describe "A catalog" do
|
7
7
|
include PuppetSpec::Compiler
|
8
8
|
|
9
|
-
|
9
|
+
context "when compiled" do
|
10
10
|
context "when transmitted to the agent" do
|
11
11
|
|
12
12
|
it "preserves the order in which the resources are added to the catalog" do
|
@@ -77,37 +77,6 @@ describe "A catalog" do
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
describe 'using classic parser' do
|
81
|
-
before :each do
|
82
|
-
Puppet[:parser] = 'current'
|
83
|
-
end
|
84
|
-
it_behaves_like 'when compiled' do
|
85
|
-
end
|
86
|
-
|
87
|
-
it "compiles resource creation from appended array as two separate resources" do
|
88
|
-
# moved here from acceptance test "jeff_append_to_array.rb"
|
89
|
-
master_catalog = master_catalog_for(<<-EOM)
|
90
|
-
class parent {
|
91
|
-
$arr1 = [ "parent array element" ]
|
92
|
-
}
|
93
|
-
class parent::child inherits parent {
|
94
|
-
$arr1 += ["child array element"]
|
95
|
-
notify { $arr1: }
|
96
|
-
}
|
97
|
-
include parent::child
|
98
|
-
EOM
|
99
|
-
expect(resources_in(master_catalog)).to include('Notify[parent array element]', 'Notify[child array element]')
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
describe 'using future parser' do
|
104
|
-
before :each do
|
105
|
-
Puppet[:parser] = 'future'
|
106
|
-
end
|
107
|
-
it_behaves_like 'when compiled' do
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
80
|
def master_catalog_for(manifest)
|
112
81
|
master_catalog = Puppet::Resource::Catalog::Compiler.new.filter(compile_to_catalog(manifest))
|
113
82
|
end
|
@@ -2,19 +2,17 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'puppet_spec/compiler'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
describe Puppet::Parser::Collector do
|
5
|
+
describe 'collectors' do
|
8
6
|
include PuppetSpec::Compiler
|
9
7
|
|
10
8
|
def expect_the_message_to_be(expected_messages, code, node = Puppet::Node.new('the node'))
|
11
9
|
catalog = compile_to_catalog(code, node)
|
12
10
|
messages = catalog.resources.find_all { |resource| resource.type == 'Notify' }.
|
13
11
|
collect { |notify| notify[:message] }
|
14
|
-
messages.
|
12
|
+
expect(messages).to include(*expected_messages)
|
15
13
|
end
|
16
14
|
|
17
|
-
|
15
|
+
context "virtual resource collection" do
|
18
16
|
it "matches everything when no query given" do
|
19
17
|
expect_the_message_to_be(["the other message", "the message"], <<-MANIFEST)
|
20
18
|
@notify { "testing": message => "the message" }
|
@@ -299,26 +297,4 @@ describe Puppet::Parser::Collector do
|
|
299
297
|
end
|
300
298
|
end
|
301
299
|
|
302
|
-
describe "in the current parser" do
|
303
|
-
before :each do
|
304
|
-
Puppet[:parser] = 'current'
|
305
|
-
end
|
306
|
-
|
307
|
-
it_behaves_like "virtual resource collection"
|
308
|
-
end
|
309
|
-
|
310
|
-
describe "in the future parser" do
|
311
|
-
before :each do
|
312
|
-
Puppet[:parser] = 'future'
|
313
|
-
end
|
314
|
-
|
315
|
-
it_behaves_like "virtual resource collection"
|
316
|
-
|
317
|
-
it "collects and overrides attributes specified with a * => hash" do
|
318
|
-
expect_the_message_to_be(["overridden1"], <<-MANIFEST)
|
319
|
-
notify { "testing": message => "original" }
|
320
|
-
Notify <| |> { * => { message => 'overridden1' }}
|
321
|
-
MANIFEST
|
322
|
-
end
|
323
|
-
end
|
324
300
|
end
|
@@ -1,527 +1,911 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
1
|
require 'spec_helper'
|
3
|
-
require 'puppet/parser/parser_factory'
|
4
2
|
require 'puppet_spec/compiler'
|
5
3
|
require 'matchers/resource'
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
class CompilerTestResource
|
6
|
+
attr_accessor :builtin, :virtual, :evaluated, :type, :title
|
7
|
+
|
8
|
+
def initialize(type, title)
|
9
|
+
@type = type
|
10
|
+
@title = title
|
11
|
+
end
|
12
|
+
|
13
|
+
def [](attr)
|
14
|
+
return nil if attr == :stage
|
15
|
+
:main
|
16
|
+
end
|
17
|
+
|
18
|
+
def ref
|
19
|
+
"#{type.to_s.capitalize}[#{title}]"
|
20
|
+
end
|
21
|
+
|
22
|
+
def evaluated?
|
23
|
+
@evaluated
|
24
|
+
end
|
25
|
+
|
26
|
+
def builtin_type?
|
27
|
+
@builtin
|
28
|
+
end
|
29
|
+
|
30
|
+
def virtual?
|
31
|
+
@virtual
|
32
|
+
end
|
33
|
+
|
34
|
+
def class?
|
35
|
+
false
|
36
|
+
end
|
37
|
+
|
38
|
+
def stage?
|
39
|
+
false
|
40
|
+
end
|
41
|
+
|
42
|
+
def evaluate
|
43
|
+
end
|
44
|
+
|
45
|
+
def file
|
46
|
+
"/fake/file/goes/here"
|
47
|
+
end
|
48
|
+
|
49
|
+
def line
|
50
|
+
"42"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe Puppet::Parser::Compiler do
|
55
|
+
include PuppetSpec::Files
|
9
56
|
include Matchers::Resource
|
10
57
|
|
58
|
+
def resource(type, title)
|
59
|
+
Puppet::Parser::Resource.new(type, title, :scope => @scope)
|
60
|
+
end
|
61
|
+
|
62
|
+
let(:environment) { Puppet::Node::Environment.create(:testing, []) }
|
63
|
+
|
11
64
|
before :each do
|
12
|
-
|
65
|
+
# Push me faster, I wanna go back in time! (Specifically, freeze time
|
66
|
+
# across the test since we have a bunch of version == timestamp code
|
67
|
+
# hidden away in the implementation and we keep losing the race.)
|
68
|
+
# --daniel 2011-04-21
|
69
|
+
now = Time.now
|
70
|
+
Time.stubs(:now).returns(now)
|
71
|
+
|
72
|
+
@node = Puppet::Node.new("testnode",
|
73
|
+
:facts => Puppet::Node::Facts.new("facts", {}),
|
74
|
+
:environment => environment)
|
75
|
+
@known_resource_types = environment.known_resource_types
|
76
|
+
@compiler = Puppet::Parser::Compiler.new(@node)
|
77
|
+
@scope = Puppet::Parser::Scope.new(@compiler, :source => stub('source'))
|
78
|
+
@scope_resource = Puppet::Parser::Resource.new(:file, "/my/file", :scope => @scope)
|
79
|
+
@scope.resource = @scope_resource
|
80
|
+
end
|
81
|
+
|
82
|
+
it "should fail intelligently when a class-level compile fails" do
|
83
|
+
Puppet::Parser::Compiler.expects(:new).raises ArgumentError
|
84
|
+
expect { Puppet::Parser::Compiler.compile(@node) }.to raise_error(Puppet::Error)
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should use the node's environment as its environment" do
|
88
|
+
expect(@compiler.environment).to equal(@node.environment)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "fails if the node's environment has validation errors" do
|
92
|
+
conflicted_environment = Puppet::Node::Environment.create(:testing, [], '/some/environment.conf/manifest.pp')
|
93
|
+
conflicted_environment.stubs(:validation_errors).returns(['bad environment'])
|
94
|
+
@node.environment = conflicted_environment
|
95
|
+
expect { Puppet::Parser::Compiler.compile(@node) }.to raise_error(Puppet::Error, /Compilation has been halted because.*bad environment/)
|
96
|
+
end
|
13
97
|
|
14
|
-
|
15
|
-
|
98
|
+
it "should include the resource type collection helper" do
|
99
|
+
expect(Puppet::Parser::Compiler.ancestors).to be_include(Puppet::Resource::TypeCollectionHelper)
|
16
100
|
end
|
17
101
|
|
18
|
-
it "should be able to
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
102
|
+
it "should be able to return a class list containing all added classes" do
|
103
|
+
@compiler.add_class ""
|
104
|
+
@compiler.add_class "one"
|
105
|
+
@compiler.add_class "two"
|
106
|
+
|
107
|
+
expect(@compiler.classlist.sort).to eq(%w{one two}.sort)
|
108
|
+
end
|
23
109
|
|
24
|
-
|
110
|
+
describe "when initializing" do
|
25
111
|
|
26
|
-
|
27
|
-
@compiler
|
112
|
+
it "should set its node attribute" do
|
113
|
+
expect(@compiler.node).to equal(@node)
|
114
|
+
end
|
115
|
+
it "should detect when ast nodes are absent" do
|
116
|
+
expect(@compiler.ast_nodes?).to be_falsey
|
117
|
+
end
|
28
118
|
|
29
|
-
|
119
|
+
it "should detect when ast nodes are present" do
|
120
|
+
@known_resource_types.expects(:nodes?).returns true
|
121
|
+
expect(@compiler.ast_nodes?).to be_truthy
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should copy the known_resource_types version to the catalog" do
|
125
|
+
expect(@compiler.catalog.version).to eq(@known_resource_types.version)
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should copy any node classes into the class list" do
|
129
|
+
node = Puppet::Node.new("mynode")
|
130
|
+
node.classes = %w{foo bar}
|
131
|
+
compiler = Puppet::Parser::Compiler.new(node)
|
132
|
+
|
133
|
+
expect(compiler.classlist).to match_array(['foo', 'bar'])
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should transform node class hashes into a class list" do
|
137
|
+
node = Puppet::Node.new("mynode")
|
138
|
+
node.classes = {'foo'=>{'one'=>'p1'}, 'bar'=>{'two'=>'p2'}}
|
139
|
+
compiler = Puppet::Parser::Compiler.new(node)
|
140
|
+
|
141
|
+
expect(compiler.classlist).to match_array(['foo', 'bar'])
|
142
|
+
end
|
143
|
+
|
144
|
+
it "should add a 'main' stage to the catalog" do
|
145
|
+
expect(@compiler.catalog.resource(:stage, :main)).to be_instance_of(Puppet::Parser::Resource)
|
30
146
|
end
|
31
147
|
end
|
32
148
|
|
33
|
-
|
34
|
-
Puppet[:code] = <<-PP
|
35
|
-
class foo
|
36
|
-
{
|
37
|
-
notify { foo_notify: }
|
38
|
-
include bar
|
39
|
-
}
|
40
|
-
class bar
|
41
|
-
{
|
42
|
-
notify { bar_notify: }
|
43
|
-
}
|
44
|
-
PP
|
149
|
+
describe "when managing scopes" do
|
45
150
|
|
46
|
-
|
151
|
+
it "should create a top scope" do
|
152
|
+
expect(@compiler.topscope).to be_instance_of(Puppet::Parser::Scope)
|
153
|
+
end
|
154
|
+
|
155
|
+
it "should be able to create new scopes" do
|
156
|
+
expect(@compiler.newscope(@compiler.topscope)).to be_instance_of(Puppet::Parser::Scope)
|
157
|
+
end
|
158
|
+
|
159
|
+
it "should set the parent scope of the new scope to be the passed-in parent" do
|
160
|
+
scope = mock 'scope'
|
161
|
+
newscope = @compiler.newscope(scope)
|
47
162
|
|
48
|
-
|
163
|
+
expect(newscope.parent).to equal(scope)
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should set the parent scope of the new scope to its topscope if the parent passed in is nil" do
|
167
|
+
scope = mock 'scope'
|
168
|
+
newscope = @compiler.newscope(nil)
|
49
169
|
|
50
|
-
|
51
|
-
|
170
|
+
expect(newscope.parent).to equal(@compiler.topscope)
|
171
|
+
end
|
52
172
|
end
|
53
173
|
|
54
|
-
describe "when
|
55
|
-
it "should favor local scope, even if there's an included class in topscope" do
|
56
|
-
Puppet[:code] = <<-PP
|
57
|
-
class experiment {
|
58
|
-
class baz {
|
59
|
-
}
|
60
|
-
notify {"x" : require => Class[Baz] }
|
61
|
-
}
|
62
|
-
class baz {
|
63
|
-
}
|
64
|
-
include baz
|
65
|
-
include experiment
|
66
|
-
include experiment::baz
|
67
|
-
PP
|
174
|
+
describe "when compiling" do
|
68
175
|
|
69
|
-
|
176
|
+
def compile_methods
|
177
|
+
[:set_node_parameters, :evaluate_main, :evaluate_ast_node, :evaluate_node_classes, :evaluate_generators, :fail_on_unevaluated,
|
178
|
+
:finish, :store, :extract, :evaluate_relationships]
|
179
|
+
end
|
70
180
|
|
71
|
-
|
181
|
+
# Stub all of the main compile methods except the ones we're specifically interested in.
|
182
|
+
def compile_stub(*except)
|
183
|
+
(compile_methods - except).each { |m| @compiler.stubs(m) }
|
184
|
+
end
|
72
185
|
|
73
|
-
|
186
|
+
it "should set node parameters as variables in the top scope" do
|
187
|
+
params = {"a" => "b", "c" => "d"}
|
188
|
+
@node.stubs(:parameters).returns(params)
|
189
|
+
compile_stub(:set_node_parameters)
|
190
|
+
@compiler.compile
|
191
|
+
expect(@compiler.topscope['a']).to eq("b")
|
192
|
+
expect(@compiler.topscope['c']).to eq("d")
|
74
193
|
end
|
75
194
|
|
76
|
-
it "should
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
}
|
85
|
-
include experiment
|
86
|
-
include experiment::baz
|
87
|
-
PP
|
195
|
+
it "should set the client and server versions on the catalog" do
|
196
|
+
params = {"clientversion" => "2", "serverversion" => "3"}
|
197
|
+
@node.stubs(:parameters).returns(params)
|
198
|
+
compile_stub(:set_node_parameters)
|
199
|
+
@compiler.compile
|
200
|
+
expect(@compiler.catalog.client_version).to eq("2")
|
201
|
+
expect(@compiler.catalog.server_version).to eq("3")
|
202
|
+
end
|
88
203
|
|
89
|
-
|
204
|
+
it "should evaluate the main class if it exists" do
|
205
|
+
compile_stub(:evaluate_main)
|
206
|
+
main_class = @known_resource_types.add Puppet::Resource::Type.new(:hostclass, "")
|
207
|
+
main_class.expects(:evaluate_code).with { |r| r.is_a?(Puppet::Parser::Resource) }
|
208
|
+
@compiler.topscope.expects(:source=).with(main_class)
|
90
209
|
|
91
|
-
|
210
|
+
@compiler.compile
|
211
|
+
end
|
92
212
|
|
93
|
-
|
213
|
+
it "should create a new, empty 'main' if no main class exists" do
|
214
|
+
compile_stub(:evaluate_main)
|
215
|
+
@compiler.compile
|
216
|
+
expect(@known_resource_types.find_hostclass("")).to be_instance_of(Puppet::Resource::Type)
|
94
217
|
end
|
95
|
-
end
|
96
|
-
describe "(ticket #13349) when explicitly specifying top scope" do
|
97
|
-
["class {'::bar::baz':}", "include ::bar::baz"].each do |include|
|
98
|
-
describe "with #{include}" do
|
99
|
-
it "should find the top level class" do
|
100
|
-
Puppet[:code] = <<-MANIFEST
|
101
|
-
class { 'foo::test': }
|
102
|
-
class foo::test {
|
103
|
-
#{include}
|
104
|
-
}
|
105
|
-
class bar::baz {
|
106
|
-
notify { 'good!': }
|
107
|
-
}
|
108
|
-
class foo::bar::baz {
|
109
|
-
notify { 'bad!': }
|
110
|
-
}
|
111
|
-
MANIFEST
|
112
218
|
|
113
|
-
|
219
|
+
it "should add an edge between the main stage and main class" do
|
220
|
+
@compiler.compile
|
221
|
+
expect(stage = @compiler.catalog.resource(:stage, "main")).to be_instance_of(Puppet::Parser::Resource)
|
222
|
+
expect(klass = @compiler.catalog.resource(:class, "")).to be_instance_of(Puppet::Parser::Resource)
|
114
223
|
|
115
|
-
|
116
|
-
catalog.resource("Notify[good!]").should_not be_nil
|
117
|
-
catalog.resource("Class[Foo::Bar::Baz]").should be_nil
|
118
|
-
catalog.resource("Notify[bad!]").should be_nil
|
119
|
-
end
|
120
|
-
end
|
224
|
+
expect(@compiler.catalog.edge?(stage, klass)).to be_truthy
|
121
225
|
end
|
122
|
-
end
|
123
226
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
expect(Puppet::Parser::Compiler.compile(node).version).to eq(first_time.to_i)
|
131
|
-
Time.stubs(:now).returns(second_time)
|
132
|
-
expect(Puppet::Parser::Compiler.compile(node).version).to eq(first_time.to_i) # no change because files didn't change
|
133
|
-
Puppet[:code] = nil
|
134
|
-
expect(Puppet::Parser::Compiler.compile(node).version).to eq(second_time.to_i)
|
135
|
-
end
|
227
|
+
it "should evaluate all added collections" do
|
228
|
+
colls = []
|
229
|
+
# And when the collections fail to evaluate.
|
230
|
+
colls << mock("coll1-false")
|
231
|
+
colls << mock("coll2-false")
|
232
|
+
colls.each { |c| c.expects(:evaluate).returns(false) }
|
136
233
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
}
|
143
|
-
notify { decoy: }
|
144
|
-
}
|
145
|
-
PP
|
146
|
-
|
147
|
-
begin
|
148
|
-
Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode"))
|
149
|
-
raise "compilation should have raised Puppet::Error"
|
150
|
-
rescue Puppet::Error => e
|
151
|
-
e.message.should =~ /at line 2/
|
152
|
-
end
|
234
|
+
@compiler.add_collection(colls[0])
|
235
|
+
@compiler.add_collection(colls[1])
|
236
|
+
|
237
|
+
compile_stub(:evaluate_generators)
|
238
|
+
@compiler.compile
|
153
239
|
end
|
154
|
-
end
|
155
240
|
|
156
|
-
|
157
|
-
|
158
|
-
if false {
|
159
|
-
class foo {
|
160
|
-
}
|
161
|
-
}
|
162
|
-
PP
|
241
|
+
it "should ignore builtin resources" do
|
242
|
+
resource = resource(:file, "testing")
|
163
243
|
|
164
|
-
|
165
|
-
|
244
|
+
@compiler.add_resource(@scope, resource)
|
245
|
+
resource.expects(:evaluate).never
|
166
246
|
|
167
|
-
|
168
|
-
def extract_name(ref)
|
169
|
-
ref.sub(/File\[(\w+)\]/, '\1')
|
247
|
+
@compiler.compile
|
170
248
|
end
|
171
249
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
MANIFEST
|
250
|
+
it "should evaluate unevaluated resources" do
|
251
|
+
resource = CompilerTestResource.new(:file, "testing")
|
252
|
+
|
253
|
+
@compiler.add_resource(@scope, resource)
|
254
|
+
|
255
|
+
# We have to now mark the resource as evaluated
|
256
|
+
resource.expects(:evaluate).with { |*whatever| resource.evaluated = true }
|
257
|
+
|
258
|
+
@compiler.compile
|
182
259
|
end
|
183
|
-
let(:expected_relationships) { [] }
|
184
|
-
let(:expected_subscriptions) { [] }
|
185
260
|
|
186
|
-
|
187
|
-
|
261
|
+
it "should not evaluate already-evaluated resources" do
|
262
|
+
resource = resource(:file, "testing")
|
263
|
+
resource.stubs(:evaluated?).returns true
|
264
|
+
|
265
|
+
@compiler.add_resource(@scope, resource)
|
266
|
+
resource.expects(:evaluate).never
|
267
|
+
|
268
|
+
@compiler.compile
|
188
269
|
end
|
189
270
|
|
190
|
-
|
191
|
-
|
271
|
+
it "should evaluate unevaluated resources created by evaluating other resources" do
|
272
|
+
resource = CompilerTestResource.new(:file, "testing")
|
273
|
+
@compiler.add_resource(@scope, resource)
|
274
|
+
|
275
|
+
resource2 = CompilerTestResource.new(:file, "other")
|
192
276
|
|
193
|
-
|
277
|
+
# We have to now mark the resource as evaluated
|
278
|
+
resource.expects(:evaluate).with { |*whatever| resource.evaluated = true; @compiler.add_resource(@scope, resource2) }
|
279
|
+
resource2.expects(:evaluate).with { |*whatever| resource2.evaluated = true }
|
194
280
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
281
|
+
|
282
|
+
@compiler.compile
|
283
|
+
end
|
284
|
+
|
285
|
+
describe "when finishing" do
|
286
|
+
before do
|
287
|
+
@compiler.send(:evaluate_main)
|
288
|
+
@catalog = @compiler.catalog
|
289
|
+
end
|
290
|
+
|
291
|
+
def add_resource(name, parent = nil)
|
292
|
+
resource = Puppet::Parser::Resource.new "file", name, :scope => @scope
|
293
|
+
@compiler.add_resource(@scope, resource)
|
294
|
+
@catalog.add_edge(parent, resource) if parent
|
295
|
+
resource
|
296
|
+
end
|
297
|
+
|
298
|
+
it "should call finish() on all resources" do
|
299
|
+
# Add a resource that does respond to :finish
|
300
|
+
resource = Puppet::Parser::Resource.new "file", "finish", :scope => @scope
|
301
|
+
resource.expects(:finish)
|
302
|
+
|
303
|
+
@compiler.add_resource(@scope, resource)
|
304
|
+
|
305
|
+
# And one that does not
|
306
|
+
dnf_resource = stub_everything "dnf", :ref => "File[dnf]", :type => "file"
|
307
|
+
|
308
|
+
@compiler.add_resource(@scope, dnf_resource)
|
309
|
+
|
310
|
+
@compiler.send(:finish)
|
311
|
+
end
|
312
|
+
|
313
|
+
it "should call finish() in add_resource order" do
|
314
|
+
resources = sequence('resources')
|
315
|
+
|
316
|
+
resource1 = add_resource("finish1")
|
317
|
+
resource1.expects(:finish).in_sequence(resources)
|
318
|
+
|
319
|
+
resource2 = add_resource("finish2")
|
320
|
+
resource2.expects(:finish).in_sequence(resources)
|
321
|
+
|
322
|
+
@compiler.send(:finish)
|
200
323
|
end
|
201
324
|
|
202
|
-
|
203
|
-
|
325
|
+
it "should add each container's metaparams to its contained resources" do
|
326
|
+
main = @catalog.resource(:class, :main)
|
327
|
+
main[:noop] = true
|
328
|
+
|
329
|
+
resource1 = add_resource("meh", main)
|
330
|
+
|
331
|
+
@compiler.send(:finish)
|
332
|
+
expect(resource1[:noop]).to be_truthy
|
333
|
+
end
|
334
|
+
|
335
|
+
it "should add metaparams recursively" do
|
336
|
+
main = @catalog.resource(:class, :main)
|
337
|
+
main[:noop] = true
|
338
|
+
|
339
|
+
resource1 = add_resource("meh", main)
|
340
|
+
resource2 = add_resource("foo", resource1)
|
341
|
+
|
342
|
+
@compiler.send(:finish)
|
343
|
+
expect(resource2[:noop]).to be_truthy
|
344
|
+
end
|
345
|
+
|
346
|
+
it "should prefer metaparams from immediate parents" do
|
347
|
+
main = @catalog.resource(:class, :main)
|
348
|
+
main[:noop] = true
|
349
|
+
|
350
|
+
resource1 = add_resource("meh", main)
|
351
|
+
resource2 = add_resource("foo", resource1)
|
352
|
+
|
353
|
+
resource1[:noop] = false
|
354
|
+
|
355
|
+
@compiler.send(:finish)
|
356
|
+
expect(resource2[:noop]).to be_falsey
|
357
|
+
end
|
358
|
+
|
359
|
+
it "should merge tags downward" do
|
360
|
+
main = @catalog.resource(:class, :main)
|
361
|
+
main.tag("one")
|
362
|
+
|
363
|
+
resource1 = add_resource("meh", main)
|
364
|
+
resource1.tag "two"
|
365
|
+
resource2 = add_resource("foo", resource1)
|
366
|
+
|
367
|
+
@compiler.send(:finish)
|
368
|
+
expect(resource2.tags).to be_include("one")
|
369
|
+
expect(resource2.tags).to be_include("two")
|
370
|
+
end
|
371
|
+
|
372
|
+
it "should work if only middle resources have metaparams set" do
|
373
|
+
main = @catalog.resource(:class, :main)
|
374
|
+
|
375
|
+
resource1 = add_resource("meh", main)
|
376
|
+
resource1[:noop] = true
|
377
|
+
resource2 = add_resource("foo", resource1)
|
378
|
+
|
379
|
+
@compiler.send(:finish)
|
380
|
+
expect(resource2[:noop]).to be_truthy
|
381
|
+
end
|
204
382
|
end
|
205
383
|
|
206
|
-
it "should
|
207
|
-
|
384
|
+
it "should return added resources in add order" do
|
385
|
+
resource1 = resource(:file, "yay")
|
386
|
+
@compiler.add_resource(@scope, resource1)
|
387
|
+
resource2 = resource(:file, "youpi")
|
388
|
+
@compiler.add_resource(@scope, resource2)
|
208
389
|
|
209
|
-
|
390
|
+
expect(@compiler.resources).to eq([resource1, resource2])
|
210
391
|
end
|
211
392
|
|
212
|
-
it "should
|
213
|
-
|
393
|
+
it "should add resources that do not conflict with existing resources" do
|
394
|
+
resource = resource(:file, "yay")
|
395
|
+
@compiler.add_resource(@scope, resource)
|
214
396
|
|
215
|
-
|
397
|
+
expect(@compiler.catalog).to be_vertex(resource)
|
216
398
|
end
|
217
399
|
|
218
|
-
it "should
|
219
|
-
|
400
|
+
it "should fail to add resources that conflict with existing resources" do
|
401
|
+
path = make_absolute("/foo")
|
402
|
+
file1 = resource(:file, path)
|
403
|
+
file2 = resource(:file, path)
|
220
404
|
|
221
|
-
|
222
|
-
|
223
|
-
['b', 'c'],
|
224
|
-
['a', 'd'],
|
225
|
-
['b', 'd'],
|
226
|
-
]
|
405
|
+
@compiler.add_resource(@scope, file1)
|
406
|
+
expect { @compiler.add_resource(@scope, file2) }.to raise_error(Puppet::Resource::Catalog::DuplicateResourceError)
|
227
407
|
end
|
228
408
|
|
229
|
-
it "should
|
230
|
-
|
409
|
+
it "should add an edge from the scope resource to the added resource" do
|
410
|
+
resource = resource(:file, "yay")
|
411
|
+
@compiler.add_resource(@scope, resource)
|
231
412
|
|
232
|
-
|
233
|
-
['a', 'd'],
|
234
|
-
['b', 'd'],
|
235
|
-
['c', 'd'],
|
236
|
-
['a', 'e'],
|
237
|
-
['b', 'e'],
|
238
|
-
['c', 'e'],
|
239
|
-
]
|
413
|
+
expect(@compiler.catalog).to be_edge(@scope.resource, resource)
|
240
414
|
end
|
241
415
|
|
242
|
-
it "should
|
243
|
-
|
416
|
+
it "should not add non-class resources that don't specify a stage to the 'main' stage" do
|
417
|
+
main = @compiler.catalog.resource(:stage, :main)
|
418
|
+
resource = resource(:file, "foo")
|
419
|
+
@compiler.add_resource(@scope, resource)
|
244
420
|
|
245
|
-
|
421
|
+
expect(@compiler.catalog).not_to be_edge(main, resource)
|
246
422
|
end
|
247
423
|
|
248
|
-
it "should
|
249
|
-
|
250
|
-
|
251
|
-
$var -> File[b]
|
252
|
-
MANIFEST
|
424
|
+
it "should not add any parent-edges to stages" do
|
425
|
+
stage = resource(:stage, "other")
|
426
|
+
@compiler.add_resource(@scope, stage)
|
253
427
|
|
254
|
-
|
428
|
+
@scope.resource = resource(:class, "foo")
|
429
|
+
|
430
|
+
expect(@compiler.catalog.edge?(@scope.resource, stage)).to be_falsey
|
255
431
|
end
|
256
432
|
|
257
|
-
it "should
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
433
|
+
it "should not attempt to add stages to other stages" do
|
434
|
+
other_stage = resource(:stage, "other")
|
435
|
+
second_stage = resource(:stage, "second")
|
436
|
+
@compiler.add_resource(@scope, other_stage)
|
437
|
+
@compiler.add_resource(@scope, second_stage)
|
438
|
+
|
439
|
+
second_stage[:stage] = "other"
|
440
|
+
|
441
|
+
expect(@compiler.catalog.edge?(other_stage, second_stage)).to be_falsey
|
442
|
+
end
|
443
|
+
|
444
|
+
it "should have a method for looking up resources" do
|
445
|
+
resource = resource(:yay, "foo")
|
446
|
+
@compiler.add_resource(@scope, resource)
|
447
|
+
expect(@compiler.findresource("Yay[foo]")).to equal(resource)
|
448
|
+
end
|
449
|
+
|
450
|
+
it "should be able to look resources up by type and title" do
|
451
|
+
resource = resource(:yay, "foo")
|
452
|
+
@compiler.add_resource(@scope, resource)
|
453
|
+
expect(@compiler.findresource("Yay", "foo")).to equal(resource)
|
454
|
+
end
|
455
|
+
|
456
|
+
it "should not evaluate virtual defined resources" do
|
457
|
+
resource = resource(:file, "testing")
|
458
|
+
resource.virtual = true
|
459
|
+
@compiler.add_resource(@scope, resource)
|
460
|
+
|
461
|
+
resource.expects(:evaluate).never
|
278
462
|
|
279
|
-
|
463
|
+
@compiler.compile
|
280
464
|
end
|
465
|
+
end
|
466
|
+
|
467
|
+
describe "when evaluating collections" do
|
468
|
+
|
469
|
+
it "should evaluate each collection" do
|
470
|
+
2.times { |i|
|
471
|
+
coll = mock 'coll%s' % i
|
472
|
+
@compiler.add_collection(coll)
|
281
473
|
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
474
|
+
# This is the hard part -- we have to emulate the fact that
|
475
|
+
# collections delete themselves if they are done evaluating.
|
476
|
+
coll.expects(:evaluate).with do
|
477
|
+
@compiler.delete_collection(coll)
|
478
|
+
end
|
479
|
+
}
|
287
480
|
|
288
|
-
|
481
|
+
@compiler.compile
|
289
482
|
end
|
290
483
|
|
291
|
-
it "should
|
292
|
-
|
293
|
-
|
294
|
-
$var[foo][bar][source] -> $var[foo][bar][target]
|
295
|
-
MANIFEST
|
484
|
+
it "should not fail when there are unevaluated resource collections that do not refer to specific resources" do
|
485
|
+
coll = stub 'coll', :evaluate => false
|
486
|
+
coll.expects(:unresolved_resources).returns(nil)
|
296
487
|
|
297
|
-
|
488
|
+
@compiler.add_collection(coll)
|
489
|
+
|
490
|
+
expect { @compiler.compile }.not_to raise_error
|
298
491
|
end
|
299
492
|
|
300
|
-
it "should
|
301
|
-
|
493
|
+
it "should fail when there are unevaluated resource collections that refer to a specific resource" do
|
494
|
+
coll = stub 'coll', :evaluate => false
|
495
|
+
coll.expects(:unresolved_resources).returns(:something)
|
496
|
+
|
497
|
+
@compiler.add_collection(coll)
|
302
498
|
|
303
|
-
|
499
|
+
expect { @compiler.compile }.to raise_error(Puppet::ParseError, 'Failed to realize virtual resources something')
|
304
500
|
end
|
305
501
|
|
306
|
-
it "should
|
307
|
-
|
502
|
+
it "should fail when there are unevaluated resource collections that refer to multiple specific resources" do
|
503
|
+
coll = stub 'coll', :evaluate => false
|
504
|
+
coll.expects(:unresolved_resources).returns([:one, :two])
|
308
505
|
|
309
|
-
|
310
|
-
|
506
|
+
@compiler.add_collection(coll)
|
507
|
+
|
508
|
+
expect { @compiler.compile }.to raise_error(Puppet::ParseError, 'Failed to realize virtual resources one, two')
|
311
509
|
end
|
312
510
|
end
|
313
511
|
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
512
|
+
describe "when evaluating relationships" do
|
513
|
+
it "should evaluate each relationship with its catalog" do
|
514
|
+
dep = stub 'dep'
|
515
|
+
dep.expects(:evaluate).with(@compiler.catalog)
|
516
|
+
@compiler.add_relationship dep
|
517
|
+
@compiler.evaluate_relationships
|
518
|
+
end
|
519
|
+
end
|
520
|
+
|
521
|
+
describe "when told to evaluate missing classes" do
|
522
|
+
|
523
|
+
it "should fail if there's no source listed for the scope" do
|
524
|
+
scope = stub 'scope', :source => nil
|
525
|
+
expect { @compiler.evaluate_classes(%w{one two}, scope) }.to raise_error(Puppet::DevError)
|
526
|
+
end
|
527
|
+
|
528
|
+
it "should raise an error if a class is not found" do
|
529
|
+
@scope.expects(:find_hostclass).with("notfound").returns(nil)
|
530
|
+
expect{ @compiler.evaluate_classes(%w{notfound}, @scope) }.to raise_error(Puppet::Error, /Could not find class/)
|
531
|
+
end
|
532
|
+
|
533
|
+
it "should raise an error when it can't find class" do
|
534
|
+
klasses = {'foo'=>nil}
|
535
|
+
@node.classes = klasses
|
536
|
+
@compiler.topscope.expects(:find_hostclass).with('foo').returns(nil)
|
537
|
+
expect{ @compiler.compile }.to raise_error(Puppet::Error, /Could not find class foo for testnode/)
|
538
|
+
end
|
539
|
+
end
|
540
|
+
|
541
|
+
describe "when evaluating found classes" do
|
542
|
+
|
543
|
+
before do
|
544
|
+
Puppet.settings[:data_binding_terminus] = "none"
|
545
|
+
@class = stub 'class', :name => "my::class"
|
546
|
+
@scope.stubs(:find_hostclass).with("myclass").returns(@class)
|
547
|
+
|
548
|
+
@resource = stub 'resource', :ref => "Class[myclass]", :type => "file"
|
549
|
+
end
|
550
|
+
|
551
|
+
around do |example|
|
552
|
+
Puppet.override(
|
553
|
+
:environments => Puppet::Environments::Static.new(environment),
|
554
|
+
:description => "Static loader for specs"
|
555
|
+
) do
|
556
|
+
example.run
|
318
557
|
end
|
558
|
+
end
|
559
|
+
|
560
|
+
it "should evaluate each class" do
|
561
|
+
@compiler.catalog.stubs(:tag)
|
319
562
|
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
563
|
+
@class.expects(:ensure_in_catalog).with(@scope)
|
564
|
+
@scope.stubs(:class_scope).with(@class)
|
565
|
+
|
566
|
+
@compiler.evaluate_classes(%w{myclass}, @scope)
|
567
|
+
end
|
568
|
+
|
569
|
+
describe "and the classes are specified as a hash with parameters" do
|
570
|
+
before do
|
571
|
+
@node.classes = {}
|
572
|
+
@ast_obj = Puppet::Parser::AST::Leaf.new(:value => 'foo')
|
326
573
|
end
|
327
574
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
rescue Puppet::Error => e
|
335
|
-
@error = e
|
336
|
-
message_regex.match(e.message)
|
337
|
-
end
|
338
|
-
end
|
575
|
+
# Define the given class with default parameters
|
576
|
+
def define_class(name, parameters)
|
577
|
+
@node.classes[name] = parameters
|
578
|
+
klass = Puppet::Resource::Type.new(:hostclass, name, :arguments => {'p1' => @ast_obj, 'p2' => @ast_obj})
|
579
|
+
@compiler.topscope.known_resource_types.add klass
|
580
|
+
end
|
339
581
|
|
340
|
-
|
341
|
-
|
342
|
-
"failed with #{@error}\n#{@error.backtrace}"
|
343
|
-
else
|
344
|
-
"did not fail"
|
345
|
-
end
|
346
|
-
end
|
582
|
+
def compile
|
583
|
+
@catalog = @compiler.compile
|
347
584
|
end
|
348
585
|
|
349
|
-
it
|
350
|
-
|
586
|
+
it "should record which classes are evaluated" do
|
587
|
+
classes = {'foo'=>{}, 'bar::foo'=>{}, 'bar'=>{}}
|
588
|
+
classes.each { |c, params| define_class(c, params) }
|
589
|
+
compile()
|
590
|
+
classes.each { |name, p| expect(@catalog.classes).to include(name) }
|
591
|
+
end
|
351
592
|
|
352
|
-
|
353
|
-
|
354
|
-
|
593
|
+
it "should provide default values for parameters that have no values specified" do
|
594
|
+
define_class('foo', {})
|
595
|
+
compile()
|
596
|
+
expect(@catalog.resource(:class, 'foo')['p1']).to eq("foo")
|
597
|
+
end
|
355
598
|
|
356
|
-
|
599
|
+
it "should use any provided values" do
|
600
|
+
define_class('foo', {'p1' => 'real_value'})
|
601
|
+
compile()
|
602
|
+
expect(@catalog.resource(:class, 'foo')['p1']).to eq("real_value")
|
357
603
|
end
|
358
604
|
|
359
|
-
it
|
360
|
-
|
605
|
+
it "should support providing some but not all values" do
|
606
|
+
define_class('foo', {'p1' => 'real_value'})
|
607
|
+
compile()
|
608
|
+
expect(@catalog.resource(:class, 'Foo')['p1']).to eq("real_value")
|
609
|
+
expect(@catalog.resource(:class, 'Foo')['p2']).to eq("foo")
|
610
|
+
end
|
361
611
|
|
362
|
-
|
363
|
-
|
612
|
+
it "should ensure each node class is in catalog and has appropriate tags" do
|
613
|
+
klasses = ['bar::foo']
|
614
|
+
@node.classes = klasses
|
615
|
+
ast_obj = Puppet::Parser::AST::Leaf.new(:value => 'foo')
|
616
|
+
klasses.each do |name|
|
617
|
+
klass = Puppet::Resource::Type.new(:hostclass, name, :arguments => {'p1' => ast_obj, 'p2' => ast_obj})
|
618
|
+
@compiler.topscope.known_resource_types.add klass
|
619
|
+
end
|
620
|
+
catalog = @compiler.compile
|
621
|
+
|
622
|
+
r2 = catalog.resources.detect {|r| r.title == 'Bar::Foo' }
|
623
|
+
expect(r2.tags).to eq(Puppet::Util::TagSet.new(['bar::foo', 'class', 'bar', 'foo']))
|
364
624
|
end
|
625
|
+
end
|
365
626
|
|
366
|
-
|
367
|
-
|
627
|
+
it "should fail if required parameters are missing" do
|
628
|
+
klass = {'foo'=>{'a'=>'one'}}
|
629
|
+
@node.classes = klass
|
630
|
+
klass = Puppet::Resource::Type.new(:hostclass, 'foo', :arguments => {'a' => nil, 'b' => nil})
|
631
|
+
@compiler.topscope.known_resource_types.add klass
|
632
|
+
expect { @compiler.compile }.to raise_error(Puppet::ParseError, "Must pass b to Class[Foo]")
|
633
|
+
end
|
368
634
|
|
369
|
-
|
370
|
-
|
635
|
+
it "should fail if invalid parameters are passed" do
|
636
|
+
klass = {'foo'=>{'3'=>'one'}}
|
637
|
+
@node.classes = klass
|
638
|
+
klass = Puppet::Resource::Type.new(:hostclass, 'foo', :arguments => {})
|
639
|
+
@compiler.topscope.known_resource_types.add klass
|
640
|
+
expect { @compiler.compile }.to raise_error(Puppet::ParseError, "Invalid parameter: '3' on Class[Foo]")
|
641
|
+
end
|
371
642
|
|
372
|
-
|
373
|
-
|
643
|
+
it "should ensure class is in catalog without params" do
|
644
|
+
@node.classes = klasses = {'foo'=>nil}
|
645
|
+
foo = Puppet::Resource::Type.new(:hostclass, 'foo')
|
646
|
+
@compiler.topscope.known_resource_types.add foo
|
647
|
+
catalog = @compiler.compile
|
648
|
+
expect(catalog.classes).to include 'foo'
|
649
|
+
end
|
374
650
|
|
375
|
-
|
376
|
-
|
377
|
-
end
|
651
|
+
it "should not evaluate the resources created for found classes unless asked" do
|
652
|
+
@compiler.catalog.stubs(:tag)
|
378
653
|
|
379
|
-
|
380
|
-
Puppet[:facts_terminus] = :memory
|
381
|
-
node = Puppet::Node.new("testing2")
|
382
|
-
node.fact_merge
|
654
|
+
@resource.expects(:evaluate).never
|
383
655
|
|
384
|
-
|
385
|
-
|
386
|
-
MANIFEST
|
656
|
+
@class.expects(:ensure_in_catalog).returns(@resource)
|
657
|
+
@scope.stubs(:class_scope).with(@class)
|
387
658
|
|
388
|
-
|
389
|
-
end
|
659
|
+
@compiler.evaluate_classes(%w{myclass}, @scope)
|
390
660
|
end
|
391
661
|
|
392
|
-
|
393
|
-
|
394
|
-
Puppet[:immutable_node_data] = false
|
395
|
-
end
|
662
|
+
it "should immediately evaluate the resources created for found classes when asked" do
|
663
|
+
@compiler.catalog.stubs(:tag)
|
396
664
|
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
Puppet::Node::Facts.indirection.save(facts)
|
401
|
-
node = Puppet::Node.new("testing")
|
402
|
-
node.fact_merge
|
665
|
+
@resource.expects(:evaluate)
|
666
|
+
@class.expects(:ensure_in_catalog).returns(@resource)
|
667
|
+
@scope.stubs(:class_scope).with(@class)
|
403
668
|
|
404
|
-
|
405
|
-
|
406
|
-
MANIFEST
|
669
|
+
@compiler.evaluate_classes(%w{myclass}, @scope, false)
|
670
|
+
end
|
407
671
|
|
408
|
-
|
409
|
-
|
672
|
+
it "should skip classes that have already been evaluated" do
|
673
|
+
@compiler.catalog.stubs(:tag)
|
674
|
+
|
675
|
+
@scope.stubs(:class_scope).with(@class).returns(@scope)
|
676
|
+
|
677
|
+
@compiler.expects(:add_resource).never
|
678
|
+
|
679
|
+
@resource.expects(:evaluate).never
|
680
|
+
|
681
|
+
Puppet::Parser::Resource.expects(:new).never
|
682
|
+
@compiler.evaluate_classes(%w{myclass}, @scope, false)
|
683
|
+
end
|
684
|
+
|
685
|
+
it "should skip classes previously evaluated with different capitalization" do
|
686
|
+
@compiler.catalog.stubs(:tag)
|
687
|
+
@scope.stubs(:find_hostclass).with("MyClass").returns(@class)
|
688
|
+
@scope.stubs(:class_scope).with(@class).returns(@scope)
|
689
|
+
@compiler.expects(:add_resource).never
|
690
|
+
@resource.expects(:evaluate).never
|
691
|
+
Puppet::Parser::Resource.expects(:new).never
|
692
|
+
@compiler.evaluate_classes(%w{MyClass}, @scope, false)
|
410
693
|
end
|
411
694
|
end
|
412
695
|
|
413
|
-
|
414
|
-
context 'and have opted in to trusted_node_data' do
|
415
|
-
before :each do
|
416
|
-
Puppet[:trusted_node_data] = true
|
417
|
-
end
|
696
|
+
describe "when evaluating AST nodes with no AST nodes present" do
|
418
697
|
|
419
|
-
|
420
|
-
|
421
|
-
|
698
|
+
it "should do nothing" do
|
699
|
+
@compiler.expects(:ast_nodes?).returns(false)
|
700
|
+
@compiler.known_resource_types.expects(:nodes).never
|
701
|
+
Puppet::Parser::Resource.expects(:new).never
|
422
702
|
|
423
|
-
|
424
|
-
|
425
|
-
|
703
|
+
@compiler.send(:evaluate_ast_node)
|
704
|
+
end
|
705
|
+
end
|
426
706
|
|
427
|
-
|
428
|
-
end
|
707
|
+
describe "when evaluating AST nodes with AST nodes present" do
|
429
708
|
|
430
|
-
|
431
|
-
|
432
|
-
node.trusted_data = { "data" => "value" }
|
709
|
+
before do
|
710
|
+
@compiler.known_resource_types.stubs(:nodes?).returns true
|
433
711
|
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
catalog.resource("Notify[test]")[:message].should == true
|
440
|
-
end.to raise_error(Puppet::Error, /Attempt to assign to a reserved variable name: 'trusted'/)
|
441
|
-
end
|
712
|
+
# Set some names for our test
|
713
|
+
@node.stubs(:names).returns(%w{a b c})
|
714
|
+
@compiler.known_resource_types.stubs(:node).with("a").returns(nil)
|
715
|
+
@compiler.known_resource_types.stubs(:node).with("b").returns(nil)
|
716
|
+
@compiler.known_resource_types.stubs(:node).with("c").returns(nil)
|
442
717
|
|
443
|
-
|
444
|
-
|
445
|
-
|
718
|
+
# It should check this last, of course.
|
719
|
+
@compiler.known_resource_types.stubs(:node).with("default").returns(nil)
|
720
|
+
end
|
446
721
|
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
722
|
+
it "should fail if the named node cannot be found" do
|
723
|
+
expect { @compiler.send(:evaluate_ast_node) }.to raise_error(Puppet::ParseError)
|
724
|
+
end
|
725
|
+
|
726
|
+
it "should evaluate the first node class matching the node name" do
|
727
|
+
node_class = stub 'node', :name => "c", :evaluate_code => nil
|
728
|
+
@compiler.known_resource_types.stubs(:node).with("c").returns(node_class)
|
729
|
+
|
730
|
+
node_resource = stub 'node resource', :ref => "Node[c]", :evaluate => nil, :type => "node"
|
731
|
+
node_class.expects(:ensure_in_catalog).returns(node_resource)
|
732
|
+
|
733
|
+
@compiler.compile
|
734
|
+
end
|
735
|
+
|
736
|
+
it "should match the default node if no matching node can be found" do
|
737
|
+
node_class = stub 'node', :name => "default", :evaluate_code => nil
|
738
|
+
@compiler.known_resource_types.stubs(:node).with("default").returns(node_class)
|
739
|
+
|
740
|
+
node_resource = stub 'node resource', :ref => "Node[default]", :evaluate => nil, :type => "node"
|
741
|
+
node_class.expects(:ensure_in_catalog).returns(node_resource)
|
742
|
+
|
743
|
+
@compiler.compile
|
744
|
+
end
|
456
745
|
|
457
|
-
|
458
|
-
|
459
|
-
|
746
|
+
it "should evaluate the node resource immediately rather than using lazy evaluation" do
|
747
|
+
node_class = stub 'node', :name => "c"
|
748
|
+
@compiler.known_resource_types.stubs(:node).with("c").returns(node_class)
|
460
749
|
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
750
|
+
node_resource = stub 'node resource', :ref => "Node[c]", :type => "node"
|
751
|
+
node_class.expects(:ensure_in_catalog).returns(node_resource)
|
752
|
+
|
753
|
+
node_resource.expects(:evaluate)
|
754
|
+
|
755
|
+
@compiler.send(:evaluate_ast_node)
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
759
|
+
describe "when evaluating node classes" do
|
760
|
+
include PuppetSpec::Compiler
|
761
|
+
|
762
|
+
describe "when provided classes in array format" do
|
763
|
+
let(:node) { Puppet::Node.new('someone', :classes => ['something']) }
|
764
|
+
|
765
|
+
describe "when the class exists" do
|
766
|
+
it "should succeed if the class is already included" do
|
767
|
+
manifest = <<-MANIFEST
|
768
|
+
class something {}
|
769
|
+
include something
|
465
770
|
MANIFEST
|
466
|
-
|
467
|
-
|
771
|
+
|
772
|
+
catalog = compile_to_catalog(manifest, node)
|
773
|
+
|
774
|
+
expect(catalog.resource('Class', 'Something')).not_to be_nil
|
775
|
+
end
|
776
|
+
|
777
|
+
it "should evaluate the class without parameters if it's not already included" do
|
778
|
+
manifest = "class something {}"
|
779
|
+
|
780
|
+
catalog = compile_to_catalog(manifest, node)
|
781
|
+
|
782
|
+
expect(catalog.resource('Class', 'Something')).not_to be_nil
|
783
|
+
end
|
468
784
|
end
|
469
|
-
end
|
470
785
|
|
471
|
-
|
472
|
-
|
473
|
-
Puppet[:trusted_node_data] = false
|
786
|
+
it "should fail if the class doesn't exist" do
|
787
|
+
expect { compile_to_catalog('', node) }.to raise_error(Puppet::Error, /Could not find class something/)
|
474
788
|
end
|
789
|
+
end
|
475
790
|
|
476
|
-
|
477
|
-
|
478
|
-
node.
|
791
|
+
describe "when provided classes in hash format" do
|
792
|
+
describe "for classes without parameters" do
|
793
|
+
let(:node) { Puppet::Node.new('someone', :classes => {'something' => {}}) }
|
479
794
|
|
480
|
-
|
481
|
-
|
482
|
-
|
795
|
+
describe "when the class exists" do
|
796
|
+
it "should succeed if the class is already included" do
|
797
|
+
manifest = <<-MANIFEST
|
798
|
+
class something {}
|
799
|
+
include something
|
800
|
+
MANIFEST
|
801
|
+
|
802
|
+
catalog = compile_to_catalog(manifest, node)
|
803
|
+
|
804
|
+
expect(catalog.resource('Class', 'Something')).not_to be_nil
|
805
|
+
end
|
483
806
|
|
484
|
-
|
807
|
+
it "should evaluate the class if it's not already included" do
|
808
|
+
manifest = <<-MANIFEST
|
809
|
+
class something {}
|
810
|
+
MANIFEST
|
811
|
+
|
812
|
+
catalog = compile_to_catalog(manifest, node)
|
813
|
+
|
814
|
+
expect(catalog.resource('Class', 'Something')).not_to be_nil
|
815
|
+
end
|
816
|
+
end
|
817
|
+
|
818
|
+
it "should fail if the class doesn't exist" do
|
819
|
+
expect { compile_to_catalog('', node) }.to raise_error(Puppet::Error, /Could not find class something/)
|
820
|
+
end
|
485
821
|
end
|
486
822
|
|
487
|
-
|
488
|
-
node
|
823
|
+
describe "for classes with parameters" do
|
824
|
+
let(:node) { Puppet::Node.new('someone', :classes => {'something' => {'configuron' => 'defrabulated'}}) }
|
489
825
|
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
826
|
+
describe "when the class exists" do
|
827
|
+
it "should fail if the class is already included" do
|
828
|
+
manifest = <<-MANIFEST
|
829
|
+
class something($configuron=frabulated) {}
|
830
|
+
include something
|
831
|
+
MANIFEST
|
832
|
+
|
833
|
+
expect { compile_to_catalog(manifest, node) }.to raise_error(Puppet::Error, /Class\[Something\] is already declared/)
|
834
|
+
end
|
835
|
+
|
836
|
+
it "should evaluate the class if it's not already included" do
|
837
|
+
manifest = <<-MANIFEST
|
838
|
+
class something($configuron=frabulated) {}
|
839
|
+
MANIFEST
|
840
|
+
|
841
|
+
catalog = compile_to_catalog(manifest, node)
|
842
|
+
|
843
|
+
resource = catalog.resource('Class', 'Something')
|
844
|
+
expect(resource['configuron']).to eq('defrabulated')
|
845
|
+
end
|
846
|
+
end
|
847
|
+
|
848
|
+
it "should fail if the class doesn't exist" do
|
849
|
+
expect { compile_to_catalog('', node) }.to raise_error(Puppet::Error, /Could not find class something/)
|
850
|
+
end
|
851
|
+
|
852
|
+
it 'evaluates classes declared with parameters before unparameterized classes' do
|
853
|
+
node = Puppet::Node.new('someone', :classes => { 'app::web' => {}, 'app' => { 'port' => 8080 } })
|
854
|
+
manifest = <<-MANIFEST
|
855
|
+
class app($port = 80) { }
|
856
|
+
|
857
|
+
class app::web($port = $app::port) inherits app {
|
858
|
+
notify { expected: message => "$port" }
|
859
|
+
}
|
860
|
+
MANIFEST
|
494
861
|
|
495
|
-
|
862
|
+
catalog = compile_to_catalog(manifest, node)
|
863
|
+
|
864
|
+
expect(catalog).to have_resource("Class[App]").with_parameter(:port, 8080)
|
865
|
+
expect(catalog).to have_resource("Class[App::Web]")
|
866
|
+
expect(catalog).to have_resource("Notify[expected]").with_parameter(:message, "8080")
|
867
|
+
end
|
496
868
|
end
|
497
869
|
end
|
498
870
|
end
|
499
871
|
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
872
|
+
describe "when managing resource overrides" do
|
873
|
+
|
874
|
+
before do
|
875
|
+
@override = stub 'override', :ref => "File[/foo]", :type => "my"
|
876
|
+
@resource = resource(:file, "/foo")
|
877
|
+
end
|
878
|
+
|
879
|
+
it "should be able to store overrides" do
|
880
|
+
expect { @compiler.add_override(@override) }.not_to raise_error
|
881
|
+
end
|
882
|
+
|
883
|
+
it "should apply overrides to the appropriate resources" do
|
884
|
+
@compiler.add_resource(@scope, @resource)
|
885
|
+
@resource.expects(:merge).with(@override)
|
886
|
+
|
887
|
+
@compiler.add_override(@override)
|
888
|
+
|
889
|
+
@compiler.compile
|
890
|
+
end
|
891
|
+
|
892
|
+
it "should accept overrides before the related resource has been created" do
|
893
|
+
@resource.expects(:merge).with(@override)
|
894
|
+
|
895
|
+
# First store the override
|
896
|
+
@compiler.add_override(@override)
|
897
|
+
|
898
|
+
# Then the resource
|
899
|
+
@compiler.add_resource(@scope, @resource)
|
900
|
+
|
901
|
+
# And compile, so they get resolved
|
902
|
+
@compiler.compile
|
903
|
+
end
|
520
904
|
|
521
|
-
|
905
|
+
it "should fail if the compile is finished and resource overrides have not been applied" do
|
906
|
+
@compiler.add_override(@override)
|
522
907
|
|
523
|
-
expect
|
524
|
-
expect(catalog).to have_resource("Notify[nbr2]").with_parameter(:message, 'overridden')
|
908
|
+
expect { @compiler.compile }.to raise_error Puppet::ParseError, 'Could not find resource(s) File[/foo] for overriding'
|
525
909
|
end
|
526
910
|
end
|
527
911
|
|