puppet 3.5.1-x86-mingw32 → 3.6.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 +5 -0
- data/Gemfile +17 -9
- data/README.md +1 -0
- data/conf/fileserver.conf +4 -3
- data/ext/README.environment +8 -0
- data/ext/build_defaults.yaml +1 -1
- data/ext/debian/control +2 -2
- data/ext/debian/puppet-common.dirs +4 -0
- data/ext/debian/rules +4 -0
- data/ext/emacs/puppet-mode-init.el +1 -1
- data/ext/emacs/puppet-mode.el +36 -17
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/puppet.spec.erb +9 -0
- data/ext/systemd/puppet.service +3 -4
- data/ext/systemd/puppetmaster.service +1 -3
- data/install.rb +1 -1
- data/lib/puppet.rb +2 -1
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application.rb +17 -17
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/configurer.rb +4 -1
- data/lib/puppet/configurer/downloader.rb +13 -12
- data/lib/puppet/configurer/plugin_handler.rb +3 -3
- data/lib/puppet/context.rb +6 -1
- data/lib/puppet/defaults.rb +82 -12
- data/lib/puppet/environments.rb +169 -13
- data/lib/puppet/external/nagios/grammar.ry +2 -0
- data/lib/puppet/external/nagios/parser.rb +28 -19
- data/lib/puppet/face/config.rb +19 -6
- data/lib/puppet/face/module/generate.rb +209 -7
- data/lib/puppet/face/module/install.rb +17 -16
- data/lib/puppet/face/module/list.rb +83 -82
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +10 -9
- data/lib/puppet/face/parser.rb +3 -2
- data/lib/puppet/face/plugin.rb +8 -4
- data/lib/puppet/file_bucket/dipper.rb +6 -3
- data/lib/puppet/file_bucket/file.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +1 -1
- data/lib/puppet/file_system/memory_file.rb +27 -1
- data/lib/puppet/file_system/memory_impl.rb +15 -1
- data/lib/puppet/forge.rb +148 -52
- data/lib/puppet/forge/cache.rb +5 -1
- data/lib/puppet/forge/errors.rb +10 -0
- data/lib/puppet/forge/repository.rb +61 -26
- data/lib/puppet/functions.rb +548 -0
- data/lib/puppet/functions/assert_type.rb +42 -0
- data/lib/puppet/functions/import.rb +7 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +3 -2
- data/lib/puppet/indirector/rest.rb +18 -0
- data/lib/puppet/loaders.rb +20 -0
- data/lib/puppet/module.rb +2 -2
- data/lib/puppet/module_tool.rb +40 -14
- data/lib/puppet/module_tool/applications.rb +0 -1
- data/lib/puppet/module_tool/applications/application.rb +35 -26
- data/lib/puppet/module_tool/applications/builder.rb +16 -6
- data/lib/puppet/module_tool/applications/checksummer.rb +25 -19
- data/lib/puppet/module_tool/applications/installer.rb +196 -35
- data/lib/puppet/module_tool/applications/searcher.rb +1 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +7 -1
- data/lib/puppet/module_tool/applications/unpacker.rb +57 -31
- data/lib/puppet/module_tool/applications/upgrader.rb +221 -65
- data/lib/puppet/module_tool/checksums.rb +5 -8
- data/lib/puppet/module_tool/errors/installer.rb +12 -44
- data/lib/puppet/module_tool/errors/shared.rb +84 -11
- data/lib/puppet/module_tool/errors/upgrader.rb +16 -45
- data/lib/puppet/module_tool/install_directory.rb +7 -6
- data/lib/puppet/module_tool/installed_modules.rb +92 -0
- data/lib/puppet/module_tool/local_tarball.rb +91 -0
- data/lib/puppet/module_tool/metadata.rb +119 -115
- data/lib/puppet/module_tool/modulefile.rb +9 -9
- data/lib/puppet/module_tool/shared_behaviors.rb +19 -7
- data/lib/puppet/module_tool/skeleton/templates/generator/README.md.erb +79 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +18 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/metadata.json.erb +1 -0
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +7 -0
- data/lib/puppet/module_tool/tar.rb +3 -7
- data/lib/puppet/module_tool/tar/gnu.rb +21 -9
- data/lib/puppet/module_tool/tar/mini.rb +2 -8
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/api/v2/authorization.rb +4 -2
- data/lib/puppet/network/http/issues.rb +1 -0
- data/lib/puppet/network/http_pool.rb +15 -6
- data/lib/puppet/node/environment.rb +91 -20
- data/lib/puppet/parser/ast/pops_bridge.rb +44 -3
- data/lib/puppet/parser/collector.rb +1 -1
- data/lib/puppet/parser/compiler.rb +50 -7
- data/lib/puppet/parser/functions.rb +6 -0
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/resource.rb +1 -1
- data/lib/puppet/pops.rb +22 -1
- data/lib/puppet/pops/adapters.rb +8 -1
- data/lib/puppet/pops/binder/bindings_composer.rb +1 -1
- data/lib/puppet/pops/binder/bindings_factory.rb +1 -1
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/producers.rb +2 -2
- data/lib/puppet/pops/evaluator/access_operator.rb +65 -25
- data/lib/puppet/pops/evaluator/callable_signature.rb +101 -0
- data/lib/puppet/pops/evaluator/closure.rb +57 -2
- data/lib/puppet/pops/evaluator/compare_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +9 -11
- data/lib/puppet/pops/evaluator/runtime3_support.rb +72 -21
- data/lib/puppet/pops/functions/dispatch.rb +71 -0
- data/lib/puppet/pops/functions/dispatcher.rb +237 -0
- data/lib/puppet/pops/functions/function.rb +77 -0
- data/lib/puppet/pops/issues.rb +12 -0
- data/lib/puppet/pops/loader/base_loader.rb +102 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +60 -0
- data/lib/puppet/pops/loader/gem_support.rb +49 -0
- data/lib/puppet/pops/loader/loader.rb +180 -0
- data/lib/puppet/pops/loader/loader_paths.rb +137 -0
- data/lib/puppet/pops/loader/module_loaders.rb +242 -0
- data/lib/puppet/pops/loader/null_loader.rb +44 -0
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +34 -0
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +109 -0
- data/lib/puppet/pops/loader/simple_environment_loader.rb +20 -0
- data/lib/puppet/pops/loader/static_loader.rb +69 -0
- data/lib/puppet/pops/loader/uri_helper.rb +22 -0
- data/lib/puppet/pops/loaders.rb +240 -0
- data/lib/puppet/pops/model/factory.rb +13 -5
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -4
- data/lib/puppet/pops/parser/egrammar.ra +31 -18
- data/lib/puppet/pops/parser/eparser.rb +1137 -1106
- data/lib/puppet/pops/parser/lexer2.rb +17 -16
- data/lib/puppet/pops/semantic_error.rb +17 -0
- data/lib/puppet/pops/types/type_calculator.rb +150 -15
- data/lib/puppet/pops/types/type_factory.rb +69 -0
- data/lib/puppet/pops/types/type_parser.rb +9 -0
- data/lib/puppet/pops/types/types.rb +65 -4
- data/lib/puppet/pops/validation/checker4_0.rb +1 -1
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -1
- data/lib/puppet/property/list.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +2 -2
- data/lib/puppet/provider/cron/crontab.rb +13 -2
- data/lib/puppet/provider/package.rb +24 -0
- data/lib/puppet/provider/package/apt.rb +6 -1
- data/lib/puppet/provider/package/gem.rb +8 -2
- data/lib/puppet/provider/package/msi.rb +0 -15
- data/lib/puppet/provider/package/openbsd.rb +0 -24
- data/lib/puppet/provider/package/rpm.rb +3 -29
- data/lib/puppet/provider/package/windows.rb +0 -15
- data/lib/puppet/provider/package/yum.rb +101 -24
- data/lib/puppet/provider/package/yumhelper.py +31 -1
- data/lib/puppet/provider/package/zypper.rb +10 -28
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +3 -0
- data/lib/puppet/provider/service/openbsd.rb +318 -0
- data/lib/puppet/provider/service/redhat.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/yumrepo/inifile.rb +115 -42
- data/lib/puppet/resource.rb +13 -9
- data/lib/puppet/resource/catalog.rb +12 -6
- data/lib/puppet/resource/type_collection.rb +3 -3
- data/lib/puppet/settings.rb +57 -36
- data/lib/puppet/settings/config_file.rb +5 -0
- data/lib/puppet/settings/environment_conf.rb +147 -0
- data/lib/puppet/settings/ttl_setting.rb +48 -0
- data/lib/puppet/ssl/certificate_authority.rb +2 -3
- data/lib/puppet/ssl/certificate_authority/autosign_command.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +4 -4
- data/lib/puppet/ssl/validator/default_validator.rb +2 -2
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/test/test_helper.rb +1 -0
- data/lib/puppet/type/augeas.rb +13 -1
- data/lib/puppet/type/cron.rb +32 -18
- data/lib/puppet/type/file.rb +4 -2
- data/lib/puppet/type/file/checksum.rb +15 -5
- data/lib/puppet/type/file/content.rb +3 -1
- data/lib/puppet/type/file/source.rb +5 -5
- data/lib/puppet/type/package.rb +12 -17
- data/lib/puppet/type/resources.rb +3 -1
- data/lib/puppet/type/scheduled_task.rb +4 -5
- data/lib/puppet/type/service.rb +12 -2
- data/lib/puppet/type/user.rb +106 -0
- data/lib/puppet/type/yumrepo.rb +9 -1
- data/lib/puppet/util/checksums.rb +60 -1
- data/lib/puppet/util/diff.rb +3 -1
- data/lib/puppet/util/execution.rb +20 -16
- data/lib/puppet/util/feature.rb +3 -0
- data/lib/puppet/util/logging.rb +19 -12
- data/lib/puppet/util/rubygems.rb +10 -0
- data/lib/puppet/util/watched_file.rb +1 -1
- data/lib/puppet/util/windows/security.rb +5 -3
- data/lib/puppet/vendor/load_semantic.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +2 -0
- data/lib/puppet/vendor/semantic/Gemfile +20 -0
- data/lib/puppet/vendor/semantic/Rakefile +69 -0
- data/lib/puppet/vendor/semantic/lib/semantic.rb +7 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency.rb +181 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph.rb +60 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/graph_node.rb +117 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +46 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/source.rb +25 -0
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/unsatisfiable_graph.rb +31 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version.rb +168 -0
- data/lib/puppet/vendor/semantic/lib/semantic/version_range.rb +424 -0
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +24 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +141 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +162 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +143 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +5 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +44 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +383 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +307 -0
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +608 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/java.tgz +0 -0
- data/spec/fixtures/stdlib.tgz +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/usee/lib/puppet/functions/usee/callee.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/lib/puppet/functions/user/caller.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/user/metadata.json +9 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/modulea/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/lib/puppet/functions/rb_func_a.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/manifests/init.pp +3 -0
- data/spec/fixtures/unit/pops/loaders/loaders/single_module/modules/modulea/metadata.json +19 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/lib/puppet/functions/moduleb/rb_func_b.rb +6 -0
- data/spec/fixtures/unit/pops/loaders/loaders/wo_metadata_module/modules/moduleb/manifests/init.pp +3 -0
- data/spec/fixtures/unit/provider/naginator/define_empty_param +6 -0
- data/spec/fixtures/unit/provider/service/systemd/list_unit_files_services +7 -0
- data/spec/fixtures/unit/type/user/authorized_keys +5 -0
- data/spec/integration/application/apply_spec.rb +1 -2
- data/spec/integration/configurer_spec.rb +2 -2
- data/spec/integration/faces/plugin_spec.rb +62 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -1
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +2 -2
- data/spec/integration/parser/future_compiler_spec.rb +96 -142
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -5
- data/spec/integration/provider/cron/crontab_spec.rb +35 -0
- data/spec/integration/type/file_spec.rb +74 -72
- data/spec/integration/util/windows/security_spec.rb +17 -0
- data/spec/lib/matchers/resource.rb +45 -13
- data/spec/lib/puppet_spec/files.rb +18 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +56 -0
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +133 -0
- data/spec/shared_contexts/checksums.rb +55 -0
- data/spec/unit/application/apply_spec.rb +10 -7
- data/spec/unit/application/doc_spec.rb +17 -10
- data/spec/unit/application/indirection_base_spec.rb +18 -10
- data/spec/unit/application/inspect_spec.rb +22 -20
- data/spec/unit/configurer/downloader_spec.rb +7 -6
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -8
- data/spec/unit/configurer_spec.rb +1 -1
- data/spec/unit/context_spec.rb +23 -0
- data/spec/unit/environments_spec.rb +274 -16
- data/spec/unit/face/config_spec.rb +111 -11
- data/spec/unit/face/module/install_spec.rb +14 -85
- data/spec/unit/face/module/list_spec.rb +108 -62
- data/spec/unit/face/module/search_spec.rb +1 -1
- data/spec/unit/face/module/uninstall_spec.rb +21 -42
- data/spec/unit/face/parser_spec.rb +5 -2
- data/spec/unit/file_bucket/dipper_spec.rb +92 -86
- data/spec/unit/file_bucket/file_spec.rb +23 -75
- data/spec/unit/file_serving/metadata_spec.rb +74 -74
- data/spec/unit/forge/module_release_spec.rb +131 -0
- data/spec/unit/forge/repository_spec.rb +21 -20
- data/spec/unit/forge_spec.rb +99 -23
- data/spec/unit/functions/assert_type_spec.rb +59 -0
- data/spec/unit/functions4_spec.rb +671 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +2 -2
- data/spec/unit/indirector/facts/facter_spec.rb +9 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +156 -155
- data/spec/unit/indirector/rest_spec.rb +8 -0
- data/spec/unit/interface/face_collection_spec.rb +35 -23
- data/spec/unit/module_spec.rb +20 -8
- data/spec/unit/module_tool/applications/builder_spec.rb +40 -12
- data/spec/unit/module_tool/applications/checksummer_spec.rb +86 -105
- data/spec/unit/module_tool/applications/installer_spec.rb +293 -261
- data/spec/unit/module_tool/applications/searcher_spec.rb +1 -1
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +90 -154
- data/spec/unit/module_tool/applications/unpacker_spec.rb +12 -12
- data/spec/unit/module_tool/applications/upgrader_spec.rb +286 -18
- data/spec/unit/module_tool/metadata_spec.rb +223 -14
- data/spec/unit/module_tool/tar/gnu_spec.rb +12 -9
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/module_tool/tar_spec.rb +4 -18
- data/spec/unit/module_tool_spec.rb +123 -27
- data/spec/unit/network/formats_spec.rb +2 -2
- data/spec/unit/network/http_pool_spec.rb +21 -0
- data/spec/unit/network/rights_spec.rb +10 -8
- data/spec/unit/node/environment_spec.rb +27 -2
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +1 -1
- data/spec/unit/parser/functions/generate_spec.rb +4 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +50 -11
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +25 -0
- data/spec/unit/pops/loaders/dependency_loader_spec.rb +44 -0
- data/spec/unit/pops/loaders/loader_paths_spec.rb +66 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +105 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +119 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +46 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +145 -10
- data/spec/unit/pops/types/type_factory_spec.rb +101 -0
- data/spec/unit/pops/types/type_parser_spec.rb +22 -0
- data/spec/unit/property/list_spec.rb +9 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +58 -11
- data/spec/unit/provider/cron/crontab_spec.rb +1 -0
- data/spec/unit/provider/cron/parsed_spec.rb +15 -0
- data/spec/unit/provider/naginator_spec.rb +14 -0
- data/spec/unit/provider/package/apt_spec.rb +78 -64
- data/spec/unit/provider/package/gem_spec.rb +15 -0
- data/spec/unit/provider/package/rpm_spec.rb +6 -6
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +199 -104
- data/spec/unit/provider/package/zypper_spec.rb +41 -15
- data/spec/unit/provider/service/openbsd_spec.rb +129 -22
- data/spec/unit/provider/service/redhat_spec.rb +18 -4
- data/spec/unit/provider/service/systemd_spec.rb +5 -9
- data/spec/unit/provider/service/upstart_spec.rb +1 -1
- data/spec/unit/provider/user/directoryservice_spec.rb +10 -0
- data/spec/unit/provider/yumrepo/inifile_spec.rb +171 -15
- data/spec/unit/resource/catalog_spec.rb +20 -104
- data/spec/unit/resource/type_collection_spec.rb +10 -9
- data/spec/unit/settings/config_file_spec.rb +29 -6
- data/spec/unit/settings/environment_conf_spec.rb +51 -0
- data/spec/unit/settings_spec.rb +97 -12
- data/spec/unit/ssl/certificate_authority_spec.rb +2 -0
- data/spec/unit/type/augeas_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +6 -7
- data/spec/unit/type/file/checksum_spec.rb +6 -0
- data/spec/unit/type/file/content_spec.rb +277 -207
- data/spec/unit/type/file_spec.rb +9 -7
- data/spec/unit/type/user_spec.rb +106 -18
- data/spec/unit/type/yumrepo_spec.rb +8 -0
- data/spec/unit/util/checksums_spec.rb +12 -5
- data/spec/unit/util/diff_spec.rb +8 -0
- data/spec/unit/util/execution_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +2 -0
- data/spec/unit/util/logging_spec.rb +14 -4
- data/spec/unit/util/rdoc/parser_spec.rb +5 -4
- data/spec/unit/util/rubygems_spec.rb +14 -0
- data/tasks/parallel.rake +2 -2
- metadata +154 -21
- checksums.yaml +0 -7
- data/lib/puppet/module_tool/applications/generator.rb +0 -142
- data/lib/puppet/module_tool/skeleton.rb +0 -37
- data/lib/puppet/module_tool/skeleton/templates/generator/Modulefile.erb +0 -11
- data/lib/puppet/module_tool/skeleton/templates/generator/README.erb +0 -16
- data/lib/puppet/module_tool/tar/solaris.rb +0 -5
- data/spec/fixtures/unit/provider/service/systemd/list_units_services +0 -17
- data/spec/unit/module_tool/tar/solaris_spec.rb +0 -22
data/lib/puppet/version.rb
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "test-modulea",
|
3
|
+
"author": "test",
|
4
|
+
"description": "",
|
5
|
+
"license": "",
|
6
|
+
"project_page": "",
|
7
|
+
"source": "",
|
8
|
+
"summary": "",
|
9
|
+
"version": "1.0.0",
|
10
|
+
"checksums": {
|
11
|
+
"Modulefile": "55ef13d250cf6c477561becd8f2edcbe",
|
12
|
+
"functions/func_a.pp": "4a1f48920cd37c487dbf7468a5e78364",
|
13
|
+
"functions/modulea/func_a.pp": "296a3330c602b919ae063d6d6fde2460",
|
14
|
+
"lib/puppet/functions/modulea/rb_func_a.rb": "d5b3b83f77b742292008cd06361d6673",
|
15
|
+
"lib/puppet/functions/rb_func_a.rb": "a255470197127a6e512c9ab9dbd914c1",
|
16
|
+
"manifests/init.pp": "e50d8b91b632fb8357f021e6e0b6e043"
|
17
|
+
},
|
18
|
+
"dependencies": []
|
19
|
+
}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
# fixture for testing ssh key purging
|
2
|
+
|
3
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTXvM7AslzjNUYrPLiNVBsF5VnqL2RmqrkzscdVdHzVxvieNwmLGeUkg8EfXPiz7j5F/Lr0J8oItTCWzyN2KmM+DhUMjvP4AbELO/VYbnVrZICRiUNYSO3EN9/uapKAuiev88d7ynbonCU0VZoTPg/ug4OondOrLCtcGri5ltF+mausGfAYiFAQVEWqXV+1tyejoawJ884etb3n4ilpsrH9JK6AtOkEWVD3TDrNi29O1mQQ/Cn88g472zAJ+DhsIn+iehtfX5nmOtDNN/1t1bGMIBzkSYEAYwUiRJbRXvbobT7qKZQPA3dh0m8AYQS5/hd4/c4pmlxL8kgr24SnBY5 key1 keyname1
|
4
|
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTXvM7AslzjNUYrPLiNVBsF5VnqL2RmqrkzscdVdHzVxvieNwmLGeUkg8EfXPiz7j5F/Lr0J8oItTCWzyN2KmM+DhUMjvP4AbELO/VYbnVrZICRiUNYSO3EN9/uapKAuiev88d7ynbonCU0VZoTPg/ug4OondOrLCtcGri5ltF+mausGfAYiFAQVEWqXV+1tyejoawJ884etb3n4ilpsrH9JK6AtOkEWVD3TDrNi29O1mQQ/Cn88g472zAJ+DhsIn+iehtfX5nmOtDNN/1t1bGMIBzkSYEAYwUiRJbRXvbobT7qKZQPA3dh0m8AYQS5/hd4/c4pmlxL8kgr24SnBY5 keyname2
|
5
|
+
#ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTXvM7AslzjNUYrPLiNVBsF5VnqL2RmqrkzscdVdHzVxvieNwmLGeUkg8EfXPiz7j5F/Lr0J8oItTCWzyN2KmM+DhUMjvP4AbELO/VYbnVrZICRiUNYSO3EN9/uapKAuiev88d7ynbonCU0VZoTPg/ug4OondOrLCtcGri5ltF+mausGfAYiFAQVEWqXV+1tyejoawJ884etb3n4ilpsrH9JK6AtOkEWVD3TDrNi29O1mQQ/Cn88g472zAJ+DhsIn+iehtfX5nmOtDNN/1t1bGMIBzkSYEAYwUiRJbRXvbobT7qKZQPA3dh0m8AYQS5/hd4/c4pmlxL8kgr24SnBY5 keyname3
|
@@ -13,14 +13,13 @@ describe "apply" do
|
|
13
13
|
describe "when applying provided catalogs" do
|
14
14
|
it "can apply catalogs provided in a file in pson" do
|
15
15
|
file_to_create = tmpfile("pson_catalog")
|
16
|
-
catalog = Puppet::Resource::Catalog.new
|
16
|
+
catalog = Puppet::Resource::Catalog.new('mine', Puppet.lookup(:environments).get(Puppet[:environment]))
|
17
17
|
resource = Puppet::Resource.new(:file, file_to_create, :parameters => {:content => "my stuff"})
|
18
18
|
catalog.add_resource resource
|
19
19
|
|
20
20
|
manifest = tmpfile("manifest")
|
21
21
|
|
22
22
|
File.open(manifest, "w") { |f| f.print catalog.to_pson }
|
23
|
-
|
24
23
|
puppet = Puppet::Application[:apply]
|
25
24
|
puppet.options[:catalog] = manifest
|
26
25
|
|
@@ -16,13 +16,13 @@ describe Puppet::Configurer do
|
|
16
16
|
|
17
17
|
configurer = Puppet::Configurer.new
|
18
18
|
configurer.stubs(:download_plugins?).returns true
|
19
|
-
configurer.download_plugins
|
19
|
+
configurer.download_plugins(Puppet::Node::Environment.remote(:testing))
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "when running" do
|
24
24
|
before(:each) do
|
25
|
-
@catalog = Puppet::Resource::Catalog.new
|
25
|
+
@catalog = Puppet::Resource::Catalog.new("testing", Puppet.lookup(:environments).get(Puppet[:environment]))
|
26
26
|
@catalog.add_resource(Puppet::Type.type(:notify).new(:title => "testing"))
|
27
27
|
|
28
28
|
# Make sure we don't try to persist the local state after the transaction ran,
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'puppet/face'
|
3
|
+
require 'puppet/file_serving/metadata'
|
4
|
+
require 'puppet/file_serving/content'
|
5
|
+
require 'puppet/indirector/memory'
|
6
|
+
|
7
|
+
module PuppetFaceIntegrationSpecs
|
8
|
+
describe "Puppet plugin face" do
|
9
|
+
INDIRECTORS = [
|
10
|
+
Puppet::Indirector::FileMetadata,
|
11
|
+
Puppet::Indirector::FileContent,
|
12
|
+
]
|
13
|
+
|
14
|
+
INDIRECTED_CLASSES = [
|
15
|
+
Puppet::FileServing::Metadata,
|
16
|
+
Puppet::FileServing::Content,
|
17
|
+
Puppet::Node::Facts,
|
18
|
+
]
|
19
|
+
|
20
|
+
INDIRECTORS.each do |indirector|
|
21
|
+
class indirector::Memory < Puppet::Indirector::Memory
|
22
|
+
def find(request)
|
23
|
+
model.new('/dev/null', { 'type' => 'directory' })
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
before do
|
29
|
+
FileUtils.mkdir(Puppet[:vardir])
|
30
|
+
FileUtils.mkdir(File.join(Puppet[:vardir], 'lib'))
|
31
|
+
FileUtils.mkdir(File.join(Puppet[:vardir], 'facts.d'))
|
32
|
+
@termini_classes = {}
|
33
|
+
INDIRECTED_CLASSES.each do |indirected|
|
34
|
+
@termini_classes[indirected] = indirected.indirection.terminus_class
|
35
|
+
indirected.indirection.terminus_class = :memory
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
after do
|
40
|
+
FileUtils.rmdir(File.join(Puppet[:vardir],'lib'))
|
41
|
+
FileUtils.rmdir(File.join(Puppet[:vardir],'facts.d'))
|
42
|
+
FileUtils.rmdir(Puppet[:vardir])
|
43
|
+
INDIRECTED_CLASSES.each do |indirected|
|
44
|
+
indirected.indirection.terminus_class = @termini_classes[indirected]
|
45
|
+
indirected.indirection.termini.clear
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def init_cli_args_and_apply_app(args = ["download"])
|
50
|
+
Puppet::Application.find(:plugin).new(stub('command_line', :subcommand_name => :plugin, :args => args))
|
51
|
+
end
|
52
|
+
|
53
|
+
it "processes a download request" do
|
54
|
+
app = init_cli_args_and_apply_app
|
55
|
+
expect do
|
56
|
+
expect {
|
57
|
+
app.run
|
58
|
+
}.to exit_with(0)
|
59
|
+
end.to have_printed(/No plugins downloaded/)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -8,7 +8,7 @@ Puppet::Resource::Catalog.indirection.terminus(:compiler)
|
|
8
8
|
describe Puppet::Resource::Catalog::Compiler do
|
9
9
|
before do
|
10
10
|
Facter.stubs(:value).returns "something"
|
11
|
-
@catalog = Puppet::Resource::Catalog.new
|
11
|
+
@catalog = Puppet::Resource::Catalog.new("testing", Puppet::Node::Environment::NONE)
|
12
12
|
@catalog.add_resource(@one = Puppet::Resource.new(:file, "/one"))
|
13
13
|
@catalog.add_resource(@two = Puppet::Resource.new(:file, "/two"))
|
14
14
|
end
|
@@ -6,7 +6,7 @@ require 'puppet/resource/catalog'
|
|
6
6
|
describe "Puppet::Resource::Catalog::Queue" do
|
7
7
|
before do
|
8
8
|
Puppet::Resource::Catalog.indirection.terminus(:queue)
|
9
|
-
@catalog = Puppet::Resource::Catalog.new("foo")
|
9
|
+
@catalog = Puppet::Resource::Catalog.new("foo", Puppet::Node::Environment::NONE)
|
10
10
|
|
11
11
|
@one = Puppet::Resource.new(:file, "/one")
|
12
12
|
@two = Puppet::Resource.new(:file, "/two")
|
@@ -74,8 +74,8 @@ describe Puppet::Node::Environment do
|
|
74
74
|
|
75
75
|
catalog = Puppet::Parser::Compiler.compile(node)
|
76
76
|
|
77
|
-
expect(catalog).to have_resource('Class[
|
78
|
-
expect(catalog).to have_resource('Class[
|
77
|
+
expect(catalog).to have_resource('Class[A]')
|
78
|
+
expect(catalog).to have_resource('Class[B]')
|
79
79
|
expect(catalog).to have_resource('Notify[variables]').with_parameter(:message, "a: 10, b: 10")
|
80
80
|
end
|
81
81
|
end
|
@@ -1,28 +1,19 @@
|
|
1
|
-
#! /usr/bin/env ruby
|
2
1
|
require 'spec_helper'
|
3
2
|
require 'puppet/pops'
|
4
3
|
require 'puppet/parser/parser_factory'
|
5
4
|
require 'puppet_spec/compiler'
|
6
5
|
require 'puppet_spec/pops'
|
7
6
|
require 'puppet_spec/scope'
|
7
|
+
require 'matchers/resource'
|
8
8
|
require 'rgen/metamodel_builder'
|
9
9
|
|
10
10
|
# Test compilation using the future evaluator
|
11
|
-
#
|
12
11
|
describe "Puppet::Parser::Compiler" do
|
13
12
|
include PuppetSpec::Compiler
|
13
|
+
include Matchers::Resource
|
14
14
|
|
15
15
|
before :each do
|
16
16
|
Puppet[:parser] = 'future'
|
17
|
-
|
18
|
-
# This is in the original test - what is this for? Does not seem to make a difference at all
|
19
|
-
@scope_resource = stub 'scope_resource', :builtin? => true, :finish => nil, :ref => 'Class[main]'
|
20
|
-
@scope = stub 'scope', :resource => @scope_resource, :source => mock("source")
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
after do
|
25
|
-
Puppet.settings.clear
|
26
17
|
end
|
27
18
|
|
28
19
|
describe "the compiler when using future parser and evaluator" do
|
@@ -34,14 +25,15 @@ describe "Puppet::Parser::Compiler" do
|
|
34
25
|
|
35
26
|
Puppet.settings[:config_version] = 'git rev-parse HEAD'
|
36
27
|
|
37
|
-
parser = Puppet::Parser::ParserFactory.parser "development"
|
38
28
|
compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("testnode"))
|
39
29
|
compiler.catalog.version.should == version
|
40
30
|
end
|
41
31
|
end
|
42
32
|
|
43
33
|
it "should not create duplicate resources when a class is referenced both directly and indirectly by the node classifier (4792)" do
|
44
|
-
|
34
|
+
node = Puppet::Node.new("testnodex")
|
35
|
+
node.classes = ['foo', 'bar']
|
36
|
+
catalog = compile_to_catalog(<<-PP, node)
|
45
37
|
class foo
|
46
38
|
{
|
47
39
|
notify { foo_notify: }
|
@@ -53,17 +45,25 @@ describe "Puppet::Parser::Compiler" do
|
|
53
45
|
}
|
54
46
|
PP
|
55
47
|
|
56
|
-
node = Puppet::Node.new("testnodex")
|
57
|
-
node.classes = ['foo', 'bar']
|
58
48
|
catalog = Puppet::Parser::Compiler.compile(node)
|
59
|
-
|
60
|
-
catalog.
|
61
|
-
catalog.
|
49
|
+
|
50
|
+
expect(catalog).to have_resource("Notify[foo_notify]")
|
51
|
+
expect(catalog).to have_resource("Notify[bar_notify]")
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'applies defaults for defines with qualified names (PUP-2302)' do
|
55
|
+
catalog = compile_to_catalog(<<-CODE)
|
56
|
+
define my::thing($msg = 'foo') { notify {'check_me': message => $msg } }
|
57
|
+
My::Thing { msg => 'evoe' }
|
58
|
+
my::thing { 'name': }
|
59
|
+
CODE
|
60
|
+
|
61
|
+
expect(catalog).to have_resource("Notify[check_me]").with_parameter(:message, "evoe")
|
62
62
|
end
|
63
63
|
|
64
64
|
describe "when resolving class references" do
|
65
65
|
it "should favor local scope, even if there's an included class in topscope" do
|
66
|
-
|
66
|
+
catalog = compile_to_catalog(<<-PP)
|
67
67
|
class experiment {
|
68
68
|
class baz {
|
69
69
|
}
|
@@ -76,15 +76,11 @@ describe "Puppet::Parser::Compiler" do
|
|
76
76
|
include experiment::baz
|
77
77
|
PP
|
78
78
|
|
79
|
-
catalog
|
80
|
-
|
81
|
-
notify_resource = catalog.resource( "Notify[x]" )
|
82
|
-
|
83
|
-
notify_resource[:require].title.should == "Experiment::Baz"
|
79
|
+
expect(catalog).to have_resource("Notify[x]").with_parameter(:require, be_resource("Class[Experiment::Baz]"))
|
84
80
|
end
|
85
81
|
|
86
82
|
it "should favor local scope, even if there's an unincluded class in topscope" do
|
87
|
-
|
83
|
+
catalog = compile_to_catalog(<<-PP)
|
88
84
|
class experiment {
|
89
85
|
class baz {
|
90
86
|
}
|
@@ -96,18 +92,15 @@ describe "Puppet::Parser::Compiler" do
|
|
96
92
|
include experiment::baz
|
97
93
|
PP
|
98
94
|
|
99
|
-
catalog
|
100
|
-
|
101
|
-
notify_resource = catalog.resource( "Notify[x]" )
|
102
|
-
|
103
|
-
notify_resource[:require].title.should == "Experiment::Baz"
|
95
|
+
expect(catalog).to have_resource("Notify[x]").with_parameter(:require, be_resource("Class[Experiment::Baz]"))
|
104
96
|
end
|
105
97
|
end
|
98
|
+
|
106
99
|
describe "(ticket #13349) when explicitly specifying top scope" do
|
107
100
|
["class {'::bar::baz':}", "include ::bar::baz"].each do |include|
|
108
101
|
describe "with #{include}" do
|
109
102
|
it "should find the top level class" do
|
110
|
-
|
103
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
111
104
|
class { 'foo::test': }
|
112
105
|
class foo::test {
|
113
106
|
#{include}
|
@@ -120,12 +113,10 @@ describe "Puppet::Parser::Compiler" do
|
|
120
113
|
}
|
121
114
|
MANIFEST
|
122
115
|
|
123
|
-
catalog
|
124
|
-
|
125
|
-
catalog.
|
126
|
-
catalog.
|
127
|
-
catalog.resource("Class[Foo::Bar::Baz]").should be_nil
|
128
|
-
catalog.resource("Notify[bad!]").should be_nil
|
116
|
+
expect(catalog).to have_resource("Class[Bar::Baz]")
|
117
|
+
expect(catalog).to have_resource("Notify[good!]")
|
118
|
+
expect(catalog).to_not have_resource("Class[Foo::Bar::Baz]")
|
119
|
+
expect(catalog).to_not have_resource("Notify[bad!]")
|
129
120
|
end
|
130
121
|
end
|
131
122
|
end
|
@@ -144,39 +135,27 @@ describe "Puppet::Parser::Compiler" do
|
|
144
135
|
|
145
136
|
['define', 'class', 'node'].each do |thing|
|
146
137
|
it "'#{thing}' is not allowed inside evaluated conditional constructs" do
|
147
|
-
|
148
|
-
|
149
|
-
|
138
|
+
expect do
|
139
|
+
compile_to_catalog(<<-PP)
|
140
|
+
if true {
|
141
|
+
#{thing} foo {
|
142
|
+
}
|
143
|
+
notify { decoy: }
|
150
144
|
}
|
151
|
-
|
152
|
-
|
153
|
-
PP
|
154
|
-
|
155
|
-
begin
|
156
|
-
catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode"))
|
157
|
-
raise "compilation should have raised Puppet::Error"
|
158
|
-
rescue Puppet::Error => e
|
159
|
-
e.message.should =~ /Classes, definitions, and nodes may only appear at toplevel/
|
160
|
-
end
|
145
|
+
PP
|
146
|
+
end.to raise_error(Puppet::Error, /Classes, definitions, and nodes may only appear at toplevel/)
|
161
147
|
end
|
162
|
-
end
|
163
148
|
|
164
|
-
['define', 'class', 'node'].each do |thing|
|
165
149
|
it "'#{thing}' is not allowed inside un-evaluated conditional constructs" do
|
166
|
-
|
167
|
-
|
168
|
-
|
150
|
+
expect do
|
151
|
+
compile_to_catalog(<<-PP)
|
152
|
+
if false {
|
153
|
+
#{thing} foo {
|
154
|
+
}
|
155
|
+
notify { decoy: }
|
169
156
|
}
|
170
|
-
|
171
|
-
|
172
|
-
PP
|
173
|
-
|
174
|
-
begin
|
175
|
-
catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new("mynode"))
|
176
|
-
raise "compilation should have raised Puppet::Error"
|
177
|
-
rescue Puppet::Error => e
|
178
|
-
e.message.should =~ /Classes, definitions, and nodes may only appear at toplevel/
|
179
|
-
end
|
157
|
+
PP
|
158
|
+
end.to raise_error(Puppet::Error, /Classes, definitions, and nodes may only appear at toplevel/)
|
180
159
|
end
|
181
160
|
end
|
182
161
|
|
@@ -185,9 +164,8 @@ describe "Puppet::Parser::Compiler" do
|
|
185
164
|
ref.sub(/File\[(\w+)\]/, '\1')
|
186
165
|
end
|
187
166
|
|
188
|
-
|
189
|
-
|
190
|
-
<<-MANIFEST
|
167
|
+
def assert_creates_relationships(relationship_code, expectations)
|
168
|
+
base_manifest = <<-MANIFEST
|
191
169
|
file { [a,b,c]:
|
192
170
|
mode => 0644,
|
193
171
|
}
|
@@ -195,17 +173,7 @@ describe "Puppet::Parser::Compiler" do
|
|
195
173
|
mode => 0755,
|
196
174
|
}
|
197
175
|
MANIFEST
|
198
|
-
|
199
|
-
let(:expected_relationships) { [] }
|
200
|
-
let(:expected_subscriptions) { [] }
|
201
|
-
|
202
|
-
before :each do
|
203
|
-
Puppet[:parser] = 'future'
|
204
|
-
Puppet[:code] = code
|
205
|
-
end
|
206
|
-
|
207
|
-
after :each do
|
208
|
-
catalog = Puppet::Parser::Compiler.compile(node)
|
176
|
+
catalog = compile_to_catalog(base_manifest + relationship_code)
|
209
177
|
|
210
178
|
resources = catalog.resources.select { |res| res.type == 'File' }
|
211
179
|
|
@@ -216,63 +184,53 @@ describe "Puppet::Parser::Compiler" do
|
|
216
184
|
end.inject(&:concat)
|
217
185
|
end
|
218
186
|
|
219
|
-
actual_relationships.should =~
|
220
|
-
actual_subscriptions.should =~
|
187
|
+
actual_relationships.should =~ (expectations[:relationships] || [])
|
188
|
+
actual_subscriptions.should =~ (expectations[:subscriptions] || [])
|
221
189
|
end
|
222
190
|
|
223
191
|
it "of regular type" do
|
224
|
-
|
225
|
-
|
226
|
-
expected_relationships << ['a','b']
|
192
|
+
assert_creates_relationships("File[a] -> File[b]",
|
193
|
+
:relationships => [['a','b']])
|
227
194
|
end
|
228
195
|
|
229
196
|
it "of subscription type" do
|
230
|
-
|
231
|
-
|
232
|
-
expected_subscriptions << ['a', 'b']
|
197
|
+
assert_creates_relationships("File[a] ~> File[b]",
|
198
|
+
:subscriptions => [['a', 'b']])
|
233
199
|
end
|
234
200
|
|
235
201
|
it "between multiple resources expressed as resource with multiple titles" do
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
['a', 'd'],
|
242
|
-
['b', 'd'],
|
243
|
-
]
|
202
|
+
assert_creates_relationships("File[a,b] -> File[c,d]",
|
203
|
+
:relationships => [['a', 'c'],
|
204
|
+
['b', 'c'],
|
205
|
+
['a', 'd'],
|
206
|
+
['b', 'd']])
|
244
207
|
end
|
245
208
|
|
246
209
|
it "between collection expressions" do
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
['b', 'e'],
|
255
|
-
['c', 'e'],
|
256
|
-
]
|
210
|
+
assert_creates_relationships("File <| mode == 0644 |> -> File <| mode == 0755 |>",
|
211
|
+
:relationships => [['a', 'd'],
|
212
|
+
['b', 'd'],
|
213
|
+
['c', 'd'],
|
214
|
+
['a', 'e'],
|
215
|
+
['b', 'e'],
|
216
|
+
['c', 'e']])
|
257
217
|
end
|
258
218
|
|
259
219
|
it "between resources expressed as Strings" do
|
260
|
-
|
261
|
-
|
262
|
-
expected_relationships << ['a', 'b']
|
220
|
+
assert_creates_relationships("'File[a]' -> 'File[b]'",
|
221
|
+
:relationships => [['a', 'b']])
|
263
222
|
end
|
264
223
|
|
265
224
|
it "between resources expressed as variables" do
|
266
|
-
|
225
|
+
assert_creates_relationships(<<-MANIFEST, :relationships => [['a', 'b']])
|
267
226
|
$var = File[a]
|
268
227
|
$var -> File[b]
|
269
228
|
MANIFEST
|
270
229
|
|
271
|
-
expected_relationships << ['a', 'b']
|
272
230
|
end
|
273
231
|
|
274
232
|
it "between resources expressed as case statements" do
|
275
|
-
|
233
|
+
assert_creates_relationships(<<-MANIFEST, :relationships => [['s1', 't2']])
|
276
234
|
$var = 10
|
277
235
|
case $var {
|
278
236
|
10: {
|
@@ -292,63 +250,63 @@ describe "Puppet::Parser::Compiler" do
|
|
292
250
|
}
|
293
251
|
}
|
294
252
|
MANIFEST
|
295
|
-
|
296
|
-
expected_relationships << ['s1', 't2']
|
297
253
|
end
|
298
254
|
|
299
255
|
it "using deep access in array" do
|
300
|
-
|
256
|
+
assert_creates_relationships(<<-MANIFEST, :relationships => [['a', 'b']])
|
301
257
|
$var = [ [ [ File[a], File[b] ] ] ]
|
302
258
|
$var[0][0][0] -> $var[0][0][1]
|
303
259
|
MANIFEST
|
304
260
|
|
305
|
-
expected_relationships << ['a', 'b']
|
306
261
|
end
|
307
262
|
|
308
263
|
it "using deep access in hash" do
|
309
|
-
|
264
|
+
assert_creates_relationships(<<-MANIFEST, :relationships => [['a', 'b']])
|
310
265
|
$var = {'foo' => {'bar' => {'source' => File[a], 'target' => File[b]}}}
|
311
266
|
$var[foo][bar][source] -> $var[foo][bar][target]
|
312
267
|
MANIFEST
|
313
268
|
|
314
|
-
expected_relationships << ['a', 'b']
|
315
269
|
end
|
316
270
|
|
317
271
|
it "using resource declarations" do
|
318
|
-
|
319
|
-
|
320
|
-
expected_relationships << ['l', 'r']
|
272
|
+
assert_creates_relationships("file { l: } -> file { r: }", :relationships => [['l', 'r']])
|
321
273
|
end
|
322
274
|
|
323
275
|
it "between entries in a chain of relationships" do
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
expected_subscriptions << ['b', 'c'] << ['e', 'd']
|
276
|
+
assert_creates_relationships("File[a] -> File[b] ~> File[c] <- File[d] <~ File[e]",
|
277
|
+
:relationships => [['a', 'b'], ['d', 'c']],
|
278
|
+
:subscriptions => [['b', 'c'], ['e', 'd']])
|
328
279
|
end
|
329
280
|
end
|
330
281
|
|
331
282
|
context "when dealing with variable references" do
|
332
283
|
it 'an initial underscore in a variable name is ok' do
|
333
|
-
|
334
|
-
catalog = compile_to_catalog(<<-MANIFEST, node)
|
284
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
335
285
|
class a { $_a = 10}
|
336
286
|
include a
|
337
287
|
notify { 'test': message => $a::_a }
|
338
288
|
MANIFEST
|
339
289
|
|
340
|
-
catalog.
|
290
|
+
expect(catalog).to have_resource("Notify[test]").with_parameter(:message, 10)
|
341
291
|
end
|
342
292
|
|
343
293
|
it 'an initial underscore in not ok if elsewhere than last segment' do
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
294
|
+
expect do
|
295
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
296
|
+
class a { $_a = 10}
|
297
|
+
include a
|
298
|
+
notify { 'test': message => $_a::_a }
|
299
|
+
MANIFEST
|
300
|
+
end.to raise_error(/Illegal variable name/)
|
301
|
+
end
|
302
|
+
|
303
|
+
it 'a missing variable as default value becomes undef' do
|
304
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
305
|
+
class a ($b=$x) { notify {$b: message=>'meh'} }
|
348
306
|
include a
|
349
|
-
notify { 'test': message => $_a::_a }
|
350
307
|
MANIFEST
|
351
|
-
|
308
|
+
|
309
|
+
expect(catalog).to have_resource("Notify[undef]").with_parameter(:message, "meh")
|
352
310
|
end
|
353
311
|
end
|
354
312
|
|
@@ -366,7 +324,7 @@ describe "Puppet::Parser::Compiler" do
|
|
366
324
|
notify { 'test': message => $trusted[data] }
|
367
325
|
MANIFEST
|
368
326
|
|
369
|
-
catalog.
|
327
|
+
expect(catalog).to have_resource("Notify[test]").with_parameter(:message, "value")
|
370
328
|
end
|
371
329
|
|
372
330
|
it 'should not allow assignment to $trusted' do
|
@@ -374,11 +332,10 @@ describe "Puppet::Parser::Compiler" do
|
|
374
332
|
node.trusted_data = { "data" => "value" }
|
375
333
|
|
376
334
|
expect do
|
377
|
-
|
335
|
+
compile_to_catalog(<<-MANIFEST, node)
|
378
336
|
$trusted = 'changed'
|
379
337
|
notify { 'test': message => $trusted == 'changed' }
|
380
338
|
MANIFEST
|
381
|
-
catalog.resource("Notify[test]")[:message].should == true
|
382
339
|
end.to raise_error(Puppet::Error, /Attempt to assign to a reserved variable name: 'trusted'/)
|
383
340
|
end
|
384
341
|
end
|
@@ -396,21 +353,18 @@ describe "Puppet::Parser::Compiler" do
|
|
396
353
|
notify { 'test': message => ($trusted == undef) }
|
397
354
|
MANIFEST
|
398
355
|
|
399
|
-
catalog.
|
356
|
+
expect(catalog).to have_resource("Notify[test]").with_parameter(:message, true)
|
400
357
|
end
|
401
358
|
|
402
359
|
it 'should allow assignment to $trusted' do
|
403
|
-
|
404
|
-
|
405
|
-
catalog = compile_to_catalog(<<-MANIFEST, node)
|
360
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
406
361
|
$trusted = 'changed'
|
407
362
|
notify { 'test': message => $trusted == 'changed' }
|
408
363
|
MANIFEST
|
409
364
|
|
410
|
-
catalog.
|
365
|
+
expect(catalog).to have_resource("Notify[test]").with_parameter(:message, true)
|
411
366
|
end
|
412
367
|
end
|
413
368
|
end
|
414
369
|
end
|
415
|
-
|
416
370
|
end
|