puppet 5.3.7-universal-darwin → 5.4.0-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +42 -29
- data/README.md +8 -6
- data/ext/cert_inspector +2 -2
- data/ext/envpuppet +1 -1
- data/ext/gentoo/init.d/puppetmaster +4 -4
- data/ext/ips/puppet-agent +11 -11
- data/ext/ips/puppet-master +11 -11
- data/ext/puppet-test +1 -2
- data/ext/redhat/client.init +2 -2
- data/ext/redhat/logrotate +1 -1
- data/ext/solaris/smf/puppet +11 -11
- data/ext/solaris/smf/svc-puppetd +5 -5
- data/ext/solaris/smf/svc-puppetmasterd +5 -5
- data/ext/windows/service/daemon.rb +1 -1
- data/install.rb +2 -3
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application/cert.rb +1 -3
- data/lib/puppet/application/describe.rb +0 -1
- data/lib/puppet/application/device.rb +12 -99
- data/lib/puppet/application/filebucket.rb +32 -11
- data/lib/puppet/application/lookup.rb +1 -11
- data/lib/puppet/application/script.rb +261 -0
- data/lib/puppet/configurer.rb +3 -4
- data/lib/puppet/configurer/plugin_handler.rb +26 -9
- data/lib/puppet/context.rb +1 -1
- data/lib/puppet/datatypes.rb +213 -0
- data/lib/puppet/datatypes/error.rb +21 -0
- data/lib/puppet/datatypes/impl/error.rb +40 -0
- data/lib/puppet/defaults.rb +51 -20
- data/lib/puppet/environments.rb +17 -0
- data/lib/puppet/error.rb +17 -0
- data/lib/puppet/etc.rb +2 -2
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +1 -1
- data/lib/puppet/face/config.rb +45 -0
- data/lib/puppet/face/epp.rb +3 -3
- data/lib/puppet/face/help/action.erb +3 -0
- data/lib/puppet/face/module/build.rb +1 -0
- data/lib/puppet/face/module/generate.rb +5 -0
- data/lib/puppet/face/module/install.rb +1 -0
- data/lib/puppet/face/module/search.rb +6 -2
- data/lib/puppet/face/module/uninstall.rb +1 -0
- data/lib/puppet/face/module/upgrade.rb +1 -0
- data/lib/puppet/face/parser.rb +0 -1
- data/lib/puppet/face/plugin.rb +1 -3
- data/lib/puppet/feature/base.rb +1 -1
- data/lib/puppet/feature/bolt.rb +3 -0
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system/uniquefile.rb +2 -2
- data/lib/puppet/forge.rb +6 -0
- data/lib/puppet/functions.rb +70 -88
- data/lib/puppet/functions/all.rb +6 -2
- data/lib/puppet/functions/annotate.rb +1 -1
- data/lib/puppet/functions/any.rb +7 -3
- data/lib/puppet/functions/contain.rb +6 -0
- data/lib/puppet/functions/convert_to.rb +32 -0
- data/lib/puppet/functions/defined.rb +0 -3
- data/lib/puppet/functions/each.rb +10 -6
- data/lib/puppet/functions/filter.rb +16 -10
- data/lib/puppet/functions/find_file.rb +0 -1
- data/lib/puppet/functions/include.rb +6 -0
- data/lib/puppet/functions/map.rb +12 -9
- data/lib/puppet/functions/module_directory.rb +41 -0
- data/lib/puppet/functions/new.rb +1 -4
- data/lib/puppet/functions/regsubst.rb +1 -1
- data/lib/puppet/functions/require.rb +6 -0
- data/lib/puppet/generate/type.rb +1 -1
- data/lib/puppet/gettext/config.rb +2 -2
- data/lib/puppet/gettext/stubs.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
- data/lib/puppet/indirector/file_server.rb +1 -1
- data/lib/puppet/indirector/node/ldap.rb +19 -3
- data/lib/puppet/indirector/request.rb +10 -6
- data/lib/puppet/indirector/rest.rb +11 -12
- data/lib/puppet/info_service/class_information_service.rb +1 -1
- data/lib/puppet/interface/action.rb +11 -0
- data/lib/puppet/interface/action_builder.rb +8 -0
- data/lib/puppet/interface/option_manager.rb +1 -1
- data/lib/puppet/loaders.rb +2 -0
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/module_tool/applications/builder.rb +4 -0
- data/lib/puppet/module_tool/applications/installer.rb +3 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
- data/lib/puppet/module_tool/installed_modules.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +0 -1
- data/lib/puppet/network/authstore.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/network/http/connection.rb +1 -9
- data/lib/puppet/network/http/factory.rb +0 -3
- data/lib/puppet/network/http/webrick.rb +1 -0
- data/lib/puppet/network/rights.rb +1 -1
- data/lib/puppet/node.rb +53 -0
- data/lib/puppet/node/environment.rb +1 -1
- data/lib/puppet/parameter/boolean.rb +1 -1
- data/lib/puppet/parser.rb +1 -0
- data/lib/puppet/parser/abstract_compiler.rb +36 -0
- data/lib/puppet/parser/ast/branch.rb +1 -1
- data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
- data/lib/puppet/parser/compiler.rb +4 -54
- data/lib/puppet/parser/functions.rb +0 -1
- data/lib/puppet/parser/functions/create_resources.rb +6 -0
- data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
- data/lib/puppet/parser/functions/inline_template.rb +6 -0
- data/lib/puppet/parser/functions/new.rb +47 -32
- data/lib/puppet/parser/functions/realize.rb +6 -0
- data/lib/puppet/parser/functions/return.rb +1 -22
- data/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/sha256.rb +5 -0
- data/lib/puppet/parser/functions/tag.rb +6 -0
- data/lib/puppet/parser/functions/tagged.rb +6 -0
- data/lib/puppet/parser/functions/template.rb +5 -0
- data/lib/puppet/parser/scope.rb +28 -4
- data/lib/puppet/parser/script_compiler.rb +118 -0
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/pops.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
- data/lib/puppet/pops/evaluator/closure.rb +12 -4
- data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
- data/lib/puppet/pops/functions/dispatch.rb +6 -5
- data/lib/puppet/pops/functions/function.rb +2 -2
- data/lib/puppet/pops/issues.rb +34 -2
- data/lib/puppet/pops/loader/base_loader.rb +10 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
- data/lib/puppet/pops/loader/loader.rb +21 -2
- data/lib/puppet/pops/loader/loader_paths.rb +180 -30
- data/lib/puppet/pops/loader/module_loaders.rb +202 -33
- data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
- data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
- data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
- data/lib/puppet/pops/loader/static_loader.rb +23 -8
- data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +122 -11
- data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
- data/lib/puppet/pops/lookup/interpolation.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
- data/lib/puppet/pops/model/ast.pp +3 -0
- data/lib/puppet/pops/model/ast.rb +34 -1
- data/lib/puppet/pops/model/factory.rb +30 -3
- data/lib/puppet/pops/model/model_label_provider.rb +1 -0
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/code_merger.rb +2 -2
- data/lib/puppet/pops/parser/egrammar.ra +44 -15
- data/lib/puppet/pops/parser/eparser.rb +1687 -1571
- data/lib/puppet/pops/parser/epp_support.rb +1 -3
- data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
- data/lib/puppet/pops/parser/lexer2.rb +4 -4
- data/lib/puppet/pops/parser/lexer_support.rb +2 -2
- data/lib/puppet/pops/parser/locatable.rb +1 -1
- data/lib/puppet/pops/parser/locator.rb +7 -13
- data/lib/puppet/pops/parser/parser_support.rb +3 -3
- data/lib/puppet/pops/parser/slurp_support.rb +0 -3
- data/lib/puppet/pops/pcore.rb +45 -0
- data/lib/puppet/pops/resource/param.rb +1 -1
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/abstract_reader.rb +4 -0
- data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
- data/lib/puppet/pops/serialization/extension.rb +1 -0
- data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
- data/lib/puppet/pops/serialization/json_path.rb +2 -1
- data/lib/puppet/pops/serialization/object.rb +3 -4
- data/lib/puppet/pops/serialization/serializer.rb +2 -1
- data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
- data/lib/puppet/pops/time/timespan.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +38 -9
- data/lib/puppet/pops/types/p_init_type.rb +1 -1
- data/lib/puppet/pops/types/p_meta_type.rb +4 -0
- data/lib/puppet/pops/types/p_object_type.rb +146 -14
- data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
- data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
- data/lib/puppet/pops/types/p_uri_type.rb +190 -0
- data/lib/puppet/pops/types/puppet_object.rb +15 -1
- data/lib/puppet/pops/types/ruby_generator.rb +46 -54
- data/lib/puppet/pops/types/string_converter.rb +22 -1
- data/lib/puppet/pops/types/type_acceptor.rb +1 -1
- data/lib/puppet/pops/types/type_calculator.rb +13 -4
- data/lib/puppet/pops/types/type_factory.rb +29 -5
- data/lib/puppet/pops/types/type_formatter.rb +67 -4
- data/lib/puppet/pops/types/type_parser.rb +92 -4
- data/lib/puppet/pops/types/type_with_members.rb +43 -0
- data/lib/puppet/pops/types/types.rb +212 -80
- data/lib/puppet/pops/validation/checker4_0.rb +10 -6
- data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/provider.rb +18 -8
- data/lib/puppet/provider/augeas/augeas.rb +3 -4
- data/lib/puppet/provider/exec.rb +0 -2
- data/lib/puppet/provider/group/groupadd.rb +25 -1
- data/lib/puppet/provider/group/windows_adsi.rb +7 -4
- data/lib/puppet/provider/mount.rb +25 -8
- data/lib/puppet/provider/nameservice.rb +9 -4
- data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
- data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
- data/lib/puppet/provider/nameservice/pw.rb +14 -14
- data/lib/puppet/provider/package/appdmg.rb +0 -1
- data/lib/puppet/provider/package/apple.rb +0 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/macports.rb +2 -2
- data/lib/puppet/provider/package/pkg.rb +3 -0
- data/lib/puppet/provider/package/pkgdmg.rb +0 -1
- data/lib/puppet/provider/package/portage.rb +0 -1
- data/lib/puppet/provider/package/yum.rb +23 -8
- data/lib/puppet/provider/package/zypper.rb +2 -2
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/init.rb +1 -0
- data/lib/puppet/provider/service/launchd.rb +6 -7
- data/lib/puppet/provider/service/redhat.rb +3 -2
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +3 -2
- data/lib/puppet/provider/user/openbsd.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +7 -1
- data/lib/puppet/provider/user/useradd.rb +36 -6
- data/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
- data/lib/puppet/provider/zfs/zfs.rb +23 -3
- data/lib/puppet/provider/zpool/zpool.rb +1 -1
- data/lib/puppet/reference/configuration.rb +0 -2
- data/lib/puppet/reference/type.rb +0 -1
- data/lib/puppet/resource.rb +1 -2
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/status.rb +0 -1
- data/lib/puppet/resource/type.rb +4 -4
- data/lib/puppet/resource/type_collection.rb +1 -1
- data/lib/puppet/settings/base_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +0 -1
- data/lib/puppet/settings/ini_file.rb +66 -12
- data/lib/puppet/ssl/certificate_authority.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
- data/lib/puppet/ssl/certificate_signer.rb +11 -0
- data/lib/puppet/ssl/host.rb +2 -2
- data/lib/puppet/syntax_checkers/base64.rb +1 -1
- data/lib/puppet/transaction.rb +37 -14
- data/lib/puppet/transaction/report.rb +3 -1
- data/lib/puppet/type.rb +17 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +5 -4
- data/lib/puppet/type/file.rb +3 -3
- data/lib/puppet/type/file/checksum.rb +7 -1
- data/lib/puppet/type/file/checksum_value.rb +4 -3
- data/lib/puppet/type/group.rb +3 -0
- data/lib/puppet/type/k5login.rb +101 -0
- data/lib/puppet/type/macauthorization.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -2
- data/lib/puppet/type/tidy.rb +6 -4
- data/lib/puppet/type/user.rb +26 -39
- data/lib/puppet/type/yumrepo.rb +9 -0
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/util.rb +8 -15
- data/lib/puppet/util/character_encoding.rb +2 -2
- data/lib/puppet/util/checksums.rb +82 -1
- data/lib/puppet/util/errors.rb +0 -2
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/json_lockfile.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +10 -1
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/network_device/cisco/device.rb +5 -5
- data/lib/puppet/util/network_device/config.rb +2 -3
- data/lib/puppet/util/platform.rb +13 -0
- data/lib/puppet/util/plist.rb +4 -4
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
- data/lib/puppet/util/reference.rb +8 -1
- data/lib/puppet/util/windows/adsi.rb +18 -15
- data/lib/puppet/util/windows/principal.rb +6 -7
- data/lib/puppet/util/windows/process.rb +1 -1
- data/lib/puppet/util/windows/registry.rb +2 -2
- data/lib/puppet/util/windows/sid.rb +7 -62
- data/lib/puppet/vendor/deep_merge/README.md +2 -2
- data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
- data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +874 -0
- data/locales/ja/puppet.po +140 -163
- data/locales/puppet.pot +940 -597
- data/man/man5/puppet.conf.5 +16 -91
- data/man/man8/puppet-agent.8 +2 -6
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +11 -33
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +4 -22
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +2 -11
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/lookup_spec.rb +0 -21
- data/spec/integration/parser/compiler_spec.rb +18 -0
- data/spec/integration/parser/script_compiler_spec.rb +113 -0
- data/spec/integration/provider/mount_spec.rb +2 -0
- data/spec/integration/type/file_spec.rb +11 -3
- data/spec/integration/util/windows/adsi_spec.rb +1 -86
- data/spec/integration/util/windows/principal_spec.rb +1 -10
- data/spec/shared_contexts/checksum.rb +4 -1
- data/spec/shared_contexts/digests.rb +46 -1
- data/spec/shared_contexts/types_setup.rb +8 -3
- data/spec/unit/agent_spec.rb +2 -2
- data/spec/unit/application/cert_spec.rb +5 -17
- data/spec/unit/application/device_spec.rb +2 -96
- data/spec/unit/application/filebucket_spec.rb +18 -4
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
- data/spec/unit/configurer_spec.rb +3 -3
- data/spec/unit/datatypes_spec.rb +304 -0
- data/spec/unit/defaults_spec.rb +41 -20
- data/spec/unit/face/config_spec.rb +46 -1
- data/spec/unit/face/epp_face_spec.rb +7 -3
- data/spec/unit/face/module/search_spec.rb +11 -0
- data/spec/unit/face/parser_spec.rb +2 -2
- data/spec/unit/file_bucket/dipper_spec.rb +12 -1
- data/spec/unit/forge/module_release_spec.rb +70 -0
- data/spec/unit/functions/break_spec.rb +34 -2
- data/spec/unit/functions/contain_spec.rb +1 -0
- data/spec/unit/functions/convert_to_spec.rb +22 -0
- data/spec/unit/functions/epp_spec.rb +5 -0
- data/spec/unit/functions/include_spec.rb +15 -0
- data/spec/unit/functions/module_directory_spec.rb +43 -0
- data/spec/unit/functions/new_spec.rb +14 -14
- data/spec/unit/functions/require_spec.rb +2 -0
- data/spec/unit/functions/shared.rb +12 -0
- data/spec/unit/functions/step_spec.rb +1 -1
- data/spec/unit/functions4_spec.rb +49 -4
- data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
- data/spec/unit/indirector/node/ldap_spec.rb +15 -12
- data/spec/unit/indirector/rest_spec.rb +0 -43
- data/spec/unit/interface/action_spec.rb +33 -0
- data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
- data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
- data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
- data/spec/unit/network/http/connection_spec.rb +1 -1
- data/spec/unit/network/http/factory_spec.rb +28 -35
- data/spec/unit/parser/compiler_spec.rb +0 -8
- data/spec/unit/parser/environment_compiler_spec.rb +36 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
- data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
- data/spec/unit/parser/functions/realize_spec.rb +9 -0
- data/spec/unit/parser/functions/tag_spec.rb +7 -0
- data/spec/unit/parser/functions/tagged_spec.rb +25 -0
- data/spec/unit/parser/functions/template_spec.rb +8 -0
- data/spec/unit/parser/scope_spec.rb +19 -0
- data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
- data/spec/unit/pops/loaders/loader_spec.rb +516 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
- data/spec/unit/pops/model/model_spec.rb +5 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
- data/spec/unit/pops/parser/locator_spec.rb +20 -0
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
- data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
- data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
- data/spec/unit/pops/serialization/packer_spec.rb +8 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
- data/spec/unit/pops/types/error_spec.rb +207 -0
- data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
- data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
- data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
- data/spec/unit/pops/types/task_spec.rb +353 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
- data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
- data/spec/unit/pops/types/type_parser_spec.rb +13 -1
- data/spec/unit/pops/types/types_spec.rb +60 -0
- data/spec/unit/pops/validator/validator_spec.rb +76 -0
- data/spec/unit/provider/group/groupadd_spec.rb +77 -1
- data/spec/unit/provider/group/pw_spec.rb +4 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
- data/spec/unit/provider/mount_spec.rb +18 -5
- data/spec/unit/provider/nameservice_spec.rb +5 -5
- data/spec/unit/provider/package/dnf_spec.rb +2 -2
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +3 -0
- data/spec/unit/provider/package/yum_spec.rb +40 -0
- data/spec/unit/provider/service/launchd_spec.rb +2 -1
- data/spec/unit/provider/service/redhat_spec.rb +5 -0
- data/spec/unit/provider/service/systemd_spec.rb +1 -1
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/openbsd_spec.rb +2 -2
- data/spec/unit/provider/user/pw_spec.rb +14 -14
- data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
- data/spec/unit/provider/user/useradd_spec.rb +188 -22
- data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
- data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
- data/spec/unit/provider_spec.rb +48 -0
- data/spec/unit/puppet_pal_2pec.rb +1005 -0
- data/spec/unit/puppet_pal_spec.rb +11 -0
- data/spec/unit/settings/ini_file_spec.rb +313 -2
- data/spec/unit/ssl/certificate_request_spec.rb +42 -1
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
- data/spec/unit/transaction/report_spec.rb +1 -0
- data/spec/unit/transaction_spec.rb +112 -21
- data/spec/unit/type/file/checksum_spec.rb +20 -0
- data/spec/unit/type/file_spec.rb +8 -0
- data/spec/unit/type/group_spec.rb +8 -0
- data/spec/unit/type/k5login_spec.rb +22 -1
- data/spec/unit/type/scheduled_task_spec.rb +15 -0
- data/spec/unit/type/user_spec.rb +11 -1
- data/spec/unit/type/yumrepo_spec.rb +5 -0
- data/spec/unit/util/checksums_spec.rb +3 -3
- data/spec/unit/util/log/destinations_spec.rb +14 -0
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/plist_spec.rb +3 -3
- data/spec/unit/util/windows/adsi_spec.rb +27 -31
- data/spec/unit/util/windows/sid_spec.rb +15 -86
- data/spec/unit/util_spec.rb +17 -3
- data/tasks/manpages.rake +1 -1
- metadata +218 -180
- data/lib/puppet/bindings.rb +0 -148
- data/lib/puppet/configurer/downloader_factory.rb +0 -44
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
@@ -93,7 +93,8 @@ describe Puppet::Application::Filebucket do
|
|
93
93
|
end
|
94
94
|
|
95
95
|
it "should create a client with the default bucket if none passed" do
|
96
|
-
Puppet[:
|
96
|
+
Puppet[:clientbucketdir] = path
|
97
|
+
Puppet[:bucketdir] = path + "2"
|
97
98
|
|
98
99
|
Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Path] == path }
|
99
100
|
|
@@ -111,17 +112,30 @@ describe Puppet::Application::Filebucket do
|
|
111
112
|
end
|
112
113
|
|
113
114
|
describe "with remote bucket" do
|
114
|
-
|
115
115
|
it "should create a remote Client to the configured server" do
|
116
116
|
Puppet[:server] = "puppet.reductivelabs.com"
|
117
|
-
|
118
117
|
Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Server] == "puppet.reductivelabs.com" }
|
118
|
+
@filebucket.setup
|
119
|
+
end
|
119
120
|
|
121
|
+
it "should default to the first server_list entry if set" do
|
122
|
+
Puppet[:server_list] = "foo,bar,baz"
|
123
|
+
Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Server] == "foo" }
|
120
124
|
@filebucket.setup
|
121
125
|
end
|
122
126
|
|
123
|
-
|
127
|
+
it "should fall back to server if server_list is empty" do
|
128
|
+
Puppet[:server_list] = ""
|
129
|
+
Puppet::FileBucket::Dipper.expects(:new).with { |h| h[:Server] == "puppet" }
|
130
|
+
@filebucket.setup
|
131
|
+
end
|
124
132
|
|
133
|
+
it "should take both the server and port specified in server_list" do
|
134
|
+
Puppet[:server_list] = "foo:632,bar:6215,baz:351"
|
135
|
+
Puppet::FileBucket::Dipper.expects(:new).with({ :Server => "foo", :Port => "632" })
|
136
|
+
@filebucket.setup
|
137
|
+
end
|
138
|
+
end
|
125
139
|
end
|
126
140
|
|
127
141
|
describe "when running" do
|
@@ -4,13 +4,10 @@ require 'puppet/configurer'
|
|
4
4
|
require 'puppet/configurer/plugin_handler'
|
5
5
|
|
6
6
|
describe Puppet::Configurer::PluginHandler do
|
7
|
-
let(:
|
8
|
-
let(:pluginhandler) { Puppet::Configurer::PluginHandler.new(factory) }
|
7
|
+
let(:pluginhandler) { Puppet::Configurer::PluginHandler.new() }
|
9
8
|
let(:environment) { Puppet::Node::Environment.create(:myenv, []) }
|
10
9
|
|
11
|
-
|
12
10
|
context "server agent version is 5.3.4" do
|
13
|
-
|
14
11
|
before :each do
|
15
12
|
# PluginHandler#load_plugin has an extra-strong rescue clause
|
16
13
|
# this mock is to make sure that we don't silently ignore errors
|
@@ -20,32 +17,19 @@ describe Puppet::Configurer::PluginHandler do
|
|
20
17
|
end
|
21
18
|
|
22
19
|
it "downloads plugins, facts, and locales" do
|
23
|
-
|
24
|
-
facts_downloader = stub('facts-downloader', :evaluate => [])
|
25
|
-
locales_downloader = stub('locales-downloader', :evaluate => [])
|
26
|
-
|
27
|
-
factory.expects(:create_plugin_downloader).returns(plugin_downloader)
|
28
|
-
factory.expects(:create_plugin_facts_downloader).returns(facts_downloader)
|
29
|
-
factory.expects(:create_locales_downloader).returns(locales_downloader)
|
20
|
+
Puppet::Configurer::Downloader.any_instance.expects(:evaluate).times(3).returns([])
|
30
21
|
|
31
22
|
pluginhandler.download_plugins(environment)
|
32
23
|
end
|
33
24
|
|
34
25
|
it "returns downloaded plugin, fact, and locale filenames" do
|
35
|
-
|
36
|
-
facts_downloader = stub('facts-downloader', :evaluate => %w[/b])
|
37
|
-
locales_downloader = stub('locales-downloader', :evaluate => %w[/c])
|
38
|
-
|
39
|
-
factory.expects(:create_plugin_downloader).returns(plugin_downloader)
|
40
|
-
factory.expects(:create_plugin_facts_downloader).returns(facts_downloader)
|
41
|
-
factory.expects(:create_locales_downloader).returns(locales_downloader)
|
26
|
+
Puppet::Configurer::Downloader.any_instance.expects(:evaluate).times(3).returns(%w[/a]).then.returns(%w[/b]).then.returns(%w[/c])
|
42
27
|
|
43
28
|
expect(pluginhandler.download_plugins(environment)).to match_array(%w[/a /b /c])
|
44
29
|
end
|
45
30
|
end
|
46
31
|
|
47
32
|
context "server agent version is 5.3.3" do
|
48
|
-
|
49
33
|
before :each do
|
50
34
|
# PluginHandler#load_plugin has an extra-strong rescue clause
|
51
35
|
# this mock is to make sure that we don't silently ignore errors
|
@@ -55,12 +39,7 @@ describe Puppet::Configurer::PluginHandler do
|
|
55
39
|
end
|
56
40
|
|
57
41
|
it "returns downloaded plugin, fact, but not locale filenames" do
|
58
|
-
|
59
|
-
facts_downloader = stub('facts-downloader', :evaluate => %w[/b])
|
60
|
-
|
61
|
-
factory.expects(:create_plugin_downloader).returns(plugin_downloader)
|
62
|
-
factory.expects(:create_plugin_facts_downloader).returns(facts_downloader)
|
63
|
-
factory.expects(:create_locales_downloader).never
|
42
|
+
Puppet::Configurer::Downloader.any_instance.expects(:evaluate).times(2).returns(%w[/a]).then.returns(%w[/b])
|
64
43
|
|
65
44
|
expect(pluginhandler.download_plugins(environment)).to match_array(%w[/a /b])
|
66
45
|
end
|
@@ -77,15 +56,9 @@ describe Puppet::Configurer::PluginHandler do
|
|
77
56
|
end
|
78
57
|
|
79
58
|
it "returns downloaded plugin, fact, but not locale filenames" do
|
80
|
-
|
81
|
-
facts_downloader = stub('facts-downloader', :evaluate => %w[/b])
|
82
|
-
|
83
|
-
factory.expects(:create_plugin_downloader).returns(plugin_downloader)
|
84
|
-
factory.expects(:create_plugin_facts_downloader).returns(facts_downloader)
|
85
|
-
factory.expects(:create_locales_downloader).never
|
59
|
+
Puppet::Configurer::Downloader.any_instance.expects(:evaluate).times(2).returns(%w[/a]).then.returns(%w[/b])
|
86
60
|
|
87
61
|
expect(pluginhandler.download_plugins(environment)).to match_array(%w[/a /b])
|
88
62
|
end
|
89
|
-
|
90
63
|
end
|
91
64
|
end
|
@@ -200,7 +200,7 @@ describe Puppet::Configurer do
|
|
200
200
|
end
|
201
201
|
|
202
202
|
it "should create report with passed transaction_uuid and job_id" do
|
203
|
-
@agent = Puppet::Configurer.new(
|
203
|
+
@agent = Puppet::Configurer.new("test_tuuid", "test_jid")
|
204
204
|
@agent.stubs(:init_storage)
|
205
205
|
|
206
206
|
report = Puppet::Transaction::Report.new(nil, "test", "aaaa")
|
@@ -399,7 +399,7 @@ describe Puppet::Configurer do
|
|
399
399
|
|
400
400
|
it "sets the checksum_type query param to the default supported_checksum_types in a catalog request" do
|
401
401
|
Puppet::Resource::Catalog.indirection.expects(:find).with(anything,
|
402
|
-
has_entries(:checksum_type => 'md5.sha256'))
|
402
|
+
has_entries(:checksum_type => 'md5.sha256.sha384.sha512.sha224'))
|
403
403
|
@agent.run
|
404
404
|
end
|
405
405
|
|
@@ -444,7 +444,7 @@ describe Puppet::Configurer do
|
|
444
444
|
describe "when initialized with a transaction_uuid" do
|
445
445
|
it "stores it" do
|
446
446
|
SecureRandom.expects(:uuid).never
|
447
|
-
configurer = Puppet::Configurer.new(
|
447
|
+
configurer = Puppet::Configurer.new('foo')
|
448
448
|
expect(configurer.instance_variable_get(:@transaction_uuid) == 'foo')
|
449
449
|
end
|
450
450
|
end
|
@@ -0,0 +1,304 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet_spec/compiler'
|
4
|
+
require 'puppet_spec/files'
|
5
|
+
require 'puppet/pops'
|
6
|
+
|
7
|
+
module PuppetSpec::DataTypes
|
8
|
+
describe "Puppet::DataTypes" do
|
9
|
+
include PuppetSpec::Compiler
|
10
|
+
include PuppetSpec::Files
|
11
|
+
|
12
|
+
let(:modules) { { 'mytest' => mytest } }
|
13
|
+
let(:datatypes) { {} }
|
14
|
+
let(:environments_dir) { Puppet[:environmentpath] }
|
15
|
+
|
16
|
+
let(:mytest) {{
|
17
|
+
'lib' => {
|
18
|
+
'puppet' => {
|
19
|
+
'datatypes' => mytest_datatypes,
|
20
|
+
'functions' => mytest_functions },
|
21
|
+
'puppetx' => { 'mytest' => mytest_classes },
|
22
|
+
}
|
23
|
+
}}
|
24
|
+
|
25
|
+
let(:mytest_datatypes) { {} }
|
26
|
+
let(:mytest_classes) { {} }
|
27
|
+
let(:mytest_functions) { {
|
28
|
+
'mytest' => {
|
29
|
+
'to_data.rb' => <<-RUBY.unindent,
|
30
|
+
Puppet::Functions.create_function('mytest::to_data') do
|
31
|
+
def to_data(data)
|
32
|
+
Puppet::Pops::Serialization::ToDataConverter.convert(data, {
|
33
|
+
:rich_data => true,
|
34
|
+
:symbol_as_string => true,
|
35
|
+
:type_by_reference => true,
|
36
|
+
:message_prefix => 'test'
|
37
|
+
})
|
38
|
+
end
|
39
|
+
end
|
40
|
+
RUBY
|
41
|
+
|
42
|
+
'from_data.rb' => <<-RUBY.unindent,
|
43
|
+
Puppet::Functions.create_function('mytest::from_data') do
|
44
|
+
def from_data(data)
|
45
|
+
Puppet::Pops::Serialization::FromDataConverter.convert(data)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
RUBY
|
49
|
+
|
50
|
+
'serialize.rb' => <<-RUBY.unindent,
|
51
|
+
Puppet::Functions.create_function('mytest::serialize') do
|
52
|
+
def serialize(data)
|
53
|
+
buffer = ''
|
54
|
+
serializer = Puppet::Pops::Serialization::Serializer.new(
|
55
|
+
Puppet::Pops::Serialization::JSON::Writer.new(buffer))
|
56
|
+
serializer.write(data)
|
57
|
+
serializer.finish
|
58
|
+
buffer
|
59
|
+
end
|
60
|
+
end
|
61
|
+
RUBY
|
62
|
+
|
63
|
+
'deserialize.rb' => <<-RUBY.unindent,
|
64
|
+
Puppet::Functions.create_function('mytest::deserialize') do
|
65
|
+
def deserialize(data)
|
66
|
+
deserializer = Puppet::Pops::Serialization::Deserializer.new(
|
67
|
+
Puppet::Pops::Serialization::JSON::Reader.new(data), Puppet::Pops::Loaders.find_loader(nil))
|
68
|
+
deserializer.read
|
69
|
+
end
|
70
|
+
end
|
71
|
+
RUBY
|
72
|
+
}
|
73
|
+
} }
|
74
|
+
|
75
|
+
let(:testing_env_dir) do
|
76
|
+
dir_contained_in(environments_dir, testing_env)
|
77
|
+
env_dir = File.join(environments_dir, 'testing')
|
78
|
+
PuppetSpec::Files.record_tmp(env_dir)
|
79
|
+
env_dir
|
80
|
+
end
|
81
|
+
|
82
|
+
let(:modules_dir) { File.join(testing_env_dir, 'modules') }
|
83
|
+
let(:env) { Puppet::Node::Environment.create(:testing, [modules_dir]) }
|
84
|
+
let(:node) { Puppet::Node.new('test', :environment => env) }
|
85
|
+
|
86
|
+
let(:testing_env) do
|
87
|
+
{
|
88
|
+
'testing' => {
|
89
|
+
'lib' => { 'puppet' => { 'datatypes' => datatypes } },
|
90
|
+
'modules' => modules,
|
91
|
+
}
|
92
|
+
}
|
93
|
+
end
|
94
|
+
|
95
|
+
before(:each) do
|
96
|
+
Puppet[:environment] = 'testing'
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when creating type with derived attributes using implementation' do
|
100
|
+
let(:datatypes) {
|
101
|
+
{
|
102
|
+
'mytype.rb' => <<-RUBY.unindent,
|
103
|
+
Puppet::DataTypes.create_type('Mytype') do
|
104
|
+
interface <<-PUPPET
|
105
|
+
attributes => {
|
106
|
+
name => { type => String },
|
107
|
+
year_of_birth => { type => Integer },
|
108
|
+
age => { type => Integer, kind => derived },
|
109
|
+
}
|
110
|
+
PUPPET
|
111
|
+
|
112
|
+
implementation do
|
113
|
+
def age
|
114
|
+
DateTime.now.year - @year_of_birth
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
RUBY
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
it 'loads and returns value of attribute' do
|
123
|
+
expect(eval_and_collect_notices('notice(Mytype("Bob", 1984).age)', node)).to eql(["#{DateTime.now.year - 1984}"])
|
124
|
+
end
|
125
|
+
|
126
|
+
it 'can convert value to and from data' do
|
127
|
+
expect(eval_and_collect_notices(<<-PUPPET.unindent, node)).to eql(['false', 'true', 'true', "#{DateTime.now.year - 1984}"])
|
128
|
+
$m = Mytype("Bob", 1984)
|
129
|
+
$d = $m.mytest::to_data
|
130
|
+
notice($m == $d)
|
131
|
+
notice($d =~ Data)
|
132
|
+
$m2 = $d.mytest::from_data
|
133
|
+
notice($m == $m2)
|
134
|
+
notice($m2.age)
|
135
|
+
PUPPET
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context 'when creating type for an already implemented class' do
|
140
|
+
let(:datatypes) {
|
141
|
+
{
|
142
|
+
'mytest.rb' => <<-RUBY.unindent,
|
143
|
+
Puppet::DataTypes.create_type('Mytest') do
|
144
|
+
interface <<-PUPPET
|
145
|
+
attributes => {
|
146
|
+
name => { type => String },
|
147
|
+
year_of_birth => { type => Integer },
|
148
|
+
age => { type => Integer, kind => derived },
|
149
|
+
},
|
150
|
+
functions => {
|
151
|
+
'[]' => Callable[[String[1]], Variant[String, Integer]]
|
152
|
+
}
|
153
|
+
PUPPET
|
154
|
+
|
155
|
+
implementation_class PuppetSpec::DataTypes::MyTest
|
156
|
+
end
|
157
|
+
RUBY
|
158
|
+
}
|
159
|
+
}
|
160
|
+
|
161
|
+
before(:each) do
|
162
|
+
class ::PuppetSpec::DataTypes::MyTest
|
163
|
+
attr_reader :name, :year_of_birth
|
164
|
+
|
165
|
+
def initialize(name, year_of_birth)
|
166
|
+
@name = name
|
167
|
+
@year_of_birth = year_of_birth
|
168
|
+
end
|
169
|
+
|
170
|
+
def age
|
171
|
+
DateTime.now.year - @year_of_birth
|
172
|
+
end
|
173
|
+
|
174
|
+
def [](key)
|
175
|
+
case key
|
176
|
+
when 'name'
|
177
|
+
@name
|
178
|
+
when 'year_of_birth'
|
179
|
+
@year_of_birth
|
180
|
+
when 'age'
|
181
|
+
age
|
182
|
+
else
|
183
|
+
nil
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def ==(o)
|
188
|
+
self.class == o.class && @name == o.name && @year_of_birth == o.year_of_birth
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
after(:each) do
|
194
|
+
::PuppetSpec::DataTypes.send(:remove_const, :MyTest)
|
195
|
+
end
|
196
|
+
|
197
|
+
it 'loads and returns value of attribute' do
|
198
|
+
expect(eval_and_collect_notices('notice(Mytest("Bob", 1984).age)', node)).to eql(["#{DateTime.now.year - 1984}"])
|
199
|
+
end
|
200
|
+
|
201
|
+
it 'can convert value to and from data' do
|
202
|
+
expect(eval_and_collect_notices(<<-PUPPET.unindent, node)).to eql(['true', 'true', "#{DateTime.now.year - 1984}"])
|
203
|
+
$m = Mytest("Bob", 1984)
|
204
|
+
$d = $m.mytest::to_data
|
205
|
+
notice($d =~ Data)
|
206
|
+
$m2 = $d.mytest::from_data
|
207
|
+
notice($m == $m2)
|
208
|
+
notice($m2.age)
|
209
|
+
PUPPET
|
210
|
+
end
|
211
|
+
|
212
|
+
it 'can access using implemented [] method' do
|
213
|
+
expect(eval_and_collect_notices(<<-PUPPET.unindent, node)).to eql(['Bob', "#{DateTime.now.year - 1984}"])
|
214
|
+
$m = Mytest("Bob", 1984)
|
215
|
+
notice($m['name'])
|
216
|
+
notice($m['age'])
|
217
|
+
PUPPET
|
218
|
+
end
|
219
|
+
|
220
|
+
it 'can serialize and deserialize data' do
|
221
|
+
expect(eval_and_collect_notices(<<-PUPPET.unindent, node)).to eql(['true', 'true', "#{DateTime.now.year - 1984}"])
|
222
|
+
$m = Mytest("Bob", 1984)
|
223
|
+
$d = $m.mytest::serialize
|
224
|
+
notice($d =~ String)
|
225
|
+
$m2 = $d.mytest::deserialize
|
226
|
+
notice($m == $m2)
|
227
|
+
notice($m2.age)
|
228
|
+
PUPPET
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
context 'with data type and class defined in a module' do
|
233
|
+
let(:mytest_classes) {
|
234
|
+
{
|
235
|
+
'position.rb' => <<-RUBY
|
236
|
+
module PuppetX; module Mytest; class Position
|
237
|
+
attr_reader :x, :y
|
238
|
+
|
239
|
+
def initialize(x, y)
|
240
|
+
@x = x
|
241
|
+
@y = y
|
242
|
+
end
|
243
|
+
end; end; end
|
244
|
+
RUBY
|
245
|
+
}
|
246
|
+
}
|
247
|
+
|
248
|
+
after(:each) do
|
249
|
+
::PuppetX.send(:remove_const, :Mytest)
|
250
|
+
end
|
251
|
+
|
252
|
+
context 'in module namespace' do
|
253
|
+
let(:mytest_datatypes) {
|
254
|
+
{
|
255
|
+
'mytest' => { 'position.rb' => <<-RUBY
|
256
|
+
Puppet::DataTypes.create_type('Mytest::Position') do
|
257
|
+
interface <<-PUPPET
|
258
|
+
attributes => {
|
259
|
+
x => Integer,
|
260
|
+
y => Integer
|
261
|
+
}
|
262
|
+
PUPPET
|
263
|
+
|
264
|
+
load_file('puppetx/mytest/position')
|
265
|
+
|
266
|
+
implementation_class PuppetX::Mytest::Position
|
267
|
+
end
|
268
|
+
RUBY
|
269
|
+
}
|
270
|
+
}
|
271
|
+
}
|
272
|
+
|
273
|
+
it 'loads and returns value of attribute' do
|
274
|
+
expect(eval_and_collect_notices('notice(Mytest::Position(23, 12).x)', node)).to eql(['23'])
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
context 'in top namespace' do
|
279
|
+
let(:mytest_datatypes) {
|
280
|
+
{
|
281
|
+
'position.rb' => <<-RUBY
|
282
|
+
Puppet::DataTypes.create_type('Position') do
|
283
|
+
interface <<-PUPPET
|
284
|
+
attributes => {
|
285
|
+
x => Integer,
|
286
|
+
y => Integer
|
287
|
+
}
|
288
|
+
PUPPET
|
289
|
+
|
290
|
+
load_file('puppetx/mytest/position')
|
291
|
+
|
292
|
+
implementation_class PuppetX::Mytest::Position
|
293
|
+
end
|
294
|
+
RUBY
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
it 'loads and returns value of attribute' do
|
299
|
+
expect(eval_and_collect_notices('notice(Position(23, 12).x)', node)).to eql(['23'])
|
300
|
+
end
|
301
|
+
end
|
302
|
+
end
|
303
|
+
end
|
304
|
+
end
|