puppet 2.7.26 → 3.0.0.rc4
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/CHANGELOG +533 -204
- data/Gemfile +8 -24
- data/Gemfile.lock +44 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/README_DEVELOPER.md +18 -210
- data/Rakefile +30 -47
- data/bin/puppet +5 -3
- data/conf/auth.conf +3 -3
- data/{ext → conf}/osx/PackageInfo.plist +0 -0
- data/{ext → conf}/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +24 -0
- data/conf/redhat/client.init +8 -8
- data/{ext/redhat/puppet.spec.erb → conf/redhat/puppet.spec} +29 -46
- data/conf/redhat/queue.init +105 -0
- data/conf/redhat/rundir-perms.patch +13 -13
- data/conf/redhat/server.init +4 -4
- data/conf/solaris/pkginfo +1 -1
- data/conf/suse/puppet.spec +8 -3
- data/conf/windows/eventlog/puppetres.dll +0 -0
- data/ext/emacs/puppet-mode.el +204 -150
- data/ext/nagios/naggen +1 -1
- data/ext/puppet-test +1 -1
- data/ext/puppetlisten/puppetlisten.rb +1 -2
- data/ext/puppetlisten/puppetrun.rb +1 -2
- data/ext/rack/files/config.ru +21 -3
- data/ext/regexp_nodes/environment/development +2 -0
- data/ext/regexp_nodes/parameters/{environment → service}/prod +0 -0
- data/ext/regexp_nodes/parameters/{environment → service}/qa +0 -0
- data/ext/regexp_nodes/parameters/service/sandbox +1 -0
- data/ext/regexp_nodes/regexp_nodes.rb +115 -59
- data/ext/upload_facts.rb +0 -1
- data/install.rb +10 -10
- data/lib/puppet.rb +49 -24
- data/lib/puppet/agent.rb +40 -16
- data/lib/puppet/agent/disabler.rb +53 -0
- data/lib/puppet/agent/locker.rb +18 -24
- data/lib/puppet/application.rb +93 -72
- data/lib/puppet/application/agent.rb +29 -47
- data/lib/puppet/application/apply.rb +40 -39
- data/lib/puppet/application/cert.rb +9 -11
- data/lib/puppet/application/certificate.rb +7 -2
- data/lib/puppet/application/certificate_request.rb +3 -0
- data/lib/puppet/application/certificate_revocation_list.rb +3 -0
- data/lib/puppet/application/describe.rb +1 -3
- data/lib/puppet/application/device.rb +15 -16
- data/lib/puppet/application/doc.rb +12 -11
- data/lib/puppet/application/face_base.rb +9 -13
- data/lib/puppet/application/filebucket.rb +2 -8
- data/lib/puppet/application/inspect.rb +3 -6
- data/lib/puppet/application/instrumentation_data.rb +3 -0
- data/lib/puppet/application/instrumentation_listener.rb +3 -0
- data/lib/puppet/application/instrumentation_probe.rb +3 -0
- data/lib/puppet/application/kick.rb +2 -8
- data/lib/puppet/application/master.rb +9 -15
- data/lib/puppet/application/module.rb +0 -7
- data/lib/puppet/application/queue.rb +7 -6
- data/lib/puppet/application/resource.rb +1 -5
- data/lib/puppet/application/resource_type.rb +3 -0
- data/lib/puppet/application/secret_agent.rb +3 -0
- data/lib/puppet/configurer.rb +87 -88
- data/lib/puppet/configurer/downloader.rb +8 -23
- data/lib/puppet/configurer/fact_handler.rb +5 -17
- data/lib/puppet/configurer/plugin_handler.rb +4 -23
- data/lib/puppet/daemon.rb +24 -6
- data/lib/puppet/data_binding.rb +11 -0
- data/lib/puppet/defaults.rb +1058 -518
- data/lib/puppet/error.rb +31 -25
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/nagios/base.rb +8 -4
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/catalog.rb +1 -2
- data/lib/puppet/face/certificate.rb +12 -0
- data/lib/puppet/face/config.rb +3 -0
- data/lib/puppet/face/help.rb +92 -28
- data/lib/puppet/face/help/action.erb +36 -3
- data/lib/puppet/face/help/face.erb +35 -3
- data/lib/puppet/face/help/global.erb +8 -12
- data/lib/puppet/face/help/man.erb +20 -2
- data/lib/puppet/face/instrumentation_data.rb +1 -0
- data/lib/puppet/face/instrumentation_listener.rb +1 -0
- data/lib/puppet/face/instrumentation_probe.rb +1 -0
- data/lib/puppet/face/module.rb +2 -0
- data/lib/puppet/face/module/build.rb +32 -6
- data/lib/puppet/face/module/changes.rb +1 -0
- data/lib/puppet/face/module/generate.rb +1 -0
- data/lib/puppet/face/module/install.rb +10 -41
- data/lib/puppet/face/module/list.rb +2 -19
- data/lib/puppet/face/module/search.rb +12 -6
- data/lib/puppet/face/module/uninstall.rb +3 -18
- data/lib/puppet/face/module/upgrade.rb +2 -9
- data/lib/puppet/face/node/clean.rb +25 -27
- data/lib/puppet/face/report.rb +2 -4
- data/lib/puppet/face/resource.rb +1 -1
- data/lib/puppet/feature/base.rb +9 -3
- data/lib/puppet/feature/rails.rb +18 -0
- data/lib/puppet/feature/rdoc1.rb +16 -0
- data/lib/puppet/file_bucket/dipper.rb +3 -2
- data/lib/puppet/file_serving/base.rb +4 -8
- data/lib/puppet/file_serving/configuration.rb +1 -12
- data/lib/puppet/file_serving/configuration/parser.rb +1 -1
- data/lib/puppet/file_serving/metadata.rb +0 -14
- data/lib/puppet/file_serving/mount/plugins.rb +10 -1
- data/lib/puppet/file_serving/terminus_selector.rb +15 -13
- data/lib/puppet/forge.rb +29 -13
- data/lib/puppet/forge/cache.rb +1 -1
- data/lib/puppet/forge/errors.rb +69 -0
- data/lib/puppet/forge/repository.rb +84 -21
- data/lib/puppet/indirector/catalog/active_record.rb +2 -12
- data/lib/puppet/indirector/catalog/compiler.rb +8 -18
- data/lib/puppet/indirector/catalog/json.rb +6 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +3 -2
- data/lib/puppet/indirector/certificate/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_status/file.rb +0 -5
- data/lib/puppet/indirector/data_binding/hiera.rb +6 -0
- data/lib/puppet/indirector/data_binding/none.rb +5 -0
- data/lib/puppet/indirector/exec.rb +8 -18
- data/lib/puppet/indirector/face.rb +5 -4
- data/lib/puppet/indirector/facts/facter.rb +6 -33
- data/lib/puppet/indirector/facts/network_device.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +0 -4
- data/lib/puppet/indirector/file_bucket_file/selector.rb +0 -4
- data/lib/puppet/indirector/file_content/rest.rb +2 -0
- data/lib/puppet/indirector/hiera.rb +69 -0
- data/lib/puppet/indirector/indirection.rb +20 -26
- data/lib/puppet/indirector/json.rb +76 -0
- data/lib/puppet/indirector/ldap.rb +3 -2
- data/lib/puppet/indirector/node/active_record.rb +1 -0
- data/lib/puppet/indirector/node/exec.rb +9 -0
- data/lib/puppet/indirector/node/ldap.rb +6 -3
- data/lib/puppet/indirector/node/plain.rb +1 -0
- data/lib/puppet/indirector/none.rb +9 -0
- data/lib/puppet/indirector/queue.rb +1 -2
- data/lib/puppet/indirector/report/processor.rb +2 -3
- data/lib/puppet/indirector/report/rest.rb +1 -7
- data/lib/puppet/indirector/request.rb +80 -18
- data/lib/puppet/indirector/resource/active_record.rb +0 -3
- data/lib/puppet/indirector/resource/ral.rb +0 -4
- data/lib/puppet/indirector/resource/rest.rb +0 -9
- data/lib/puppet/indirector/resource/store_configs.rb +0 -3
- data/lib/puppet/indirector/resource_type/parser.rb +30 -1
- data/lib/puppet/indirector/rest.rb +103 -126
- data/lib/puppet/indirector/run/local.rb +0 -4
- data/lib/puppet/indirector/run/rest.rb +0 -6
- data/lib/puppet/indirector/terminus.rb +0 -20
- data/lib/puppet/indirector/yaml.rb +11 -5
- data/lib/puppet/interface.rb +6 -14
- data/lib/puppet/interface/action.rb +21 -3
- data/lib/puppet/interface/action_builder.rb +5 -0
- data/lib/puppet/interface/action_manager.rb +1 -1
- data/lib/puppet/interface/documentation.rb +12 -0
- data/lib/puppet/interface/face_collection.rb +1 -1
- data/lib/puppet/interface/option.rb +19 -3
- data/lib/puppet/interface/option_manager.rb +27 -9
- data/lib/puppet/metatype/manager.rb +1 -0
- data/lib/puppet/module.rb +40 -83
- data/lib/puppet/module_tool.rb +42 -5
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +11 -11
- data/lib/puppet/module_tool/applications/searcher.rb +15 -2
- data/lib/puppet/module_tool/applications/unpacker.rb +4 -8
- data/lib/puppet/module_tool/applications/upgrader.rb +6 -5
- data/lib/puppet/module_tool/errors/base.rb +1 -1
- data/lib/puppet/module_tool/errors/installer.rb +24 -4
- data/lib/puppet/module_tool/install_directory.rb +41 -0
- data/lib/puppet/module_tool/metadata.rb +4 -4
- data/lib/puppet/module_tool/shared_behaviors.rb +6 -6
- data/lib/puppet/network/auth_config_parser.rb +81 -0
- data/lib/puppet/network/authconfig.rb +49 -147
- data/lib/puppet/network/authorization.rb +20 -62
- data/lib/puppet/network/authstore.rb +43 -27
- data/lib/puppet/network/formats.rb +10 -20
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/connection.rb +184 -0
- data/lib/puppet/network/http/handler.rb +4 -14
- data/lib/puppet/network/http/mongrel.rb +5 -25
- data/lib/puppet/network/http/rack.rb +2 -34
- data/lib/puppet/network/http/rack/httphandler.rb +0 -3
- data/lib/puppet/network/http/rack/rest.rb +2 -7
- data/lib/puppet/network/http/webrick.rb +9 -32
- data/lib/puppet/network/http_pool.rb +10 -48
- data/lib/puppet/network/resolver.rb +85 -0
- data/lib/puppet/network/rights.rb +33 -89
- data/lib/puppet/network/server.rb +14 -43
- data/lib/puppet/node.rb +13 -11
- data/lib/puppet/node/environment.rb +29 -12
- data/lib/puppet/node/facts.rb +13 -38
- data/lib/puppet/parameter.rb +0 -21
- data/lib/puppet/parameter/package_options.rb +26 -0
- data/lib/puppet/parser/ast.rb +2 -13
- data/lib/puppet/parser/ast/function.rb +0 -2
- data/lib/puppet/parser/ast/leaf.rb +12 -22
- data/lib/puppet/parser/ast/resource.rb +3 -10
- data/lib/puppet/parser/ast/resource_defaults.rb +1 -1
- data/lib/puppet/parser/ast/resource_override.rb +1 -4
- data/lib/puppet/parser/ast/resourceparam.rb +4 -7
- data/lib/puppet/parser/ast/selector.rb +7 -1
- data/lib/puppet/parser/ast/vardef.rb +0 -2
- data/lib/puppet/parser/collector.rb +2 -1
- data/lib/puppet/parser/compiler.rb +43 -46
- data/lib/puppet/parser/files.rb +15 -20
- data/lib/puppet/parser/functions.rb +8 -39
- data/lib/puppet/parser/functions/extlookup.rb +8 -8
- data/lib/puppet/parser/functions/file.rb +18 -18
- data/lib/puppet/parser/functions/fqdn_rand.rb +2 -2
- data/lib/puppet/parser/functions/generate.rb +3 -3
- data/lib/puppet/parser/functions/include.rb +6 -1
- data/lib/puppet/parser/functions/require.rb +16 -21
- data/lib/puppet/parser/functions/shellquote.rb +29 -21
- data/lib/puppet/parser/functions/versioncmp.rb +2 -5
- data/lib/puppet/parser/grammar.ra +44 -14
- data/lib/puppet/parser/lexer.rb +101 -169
- data/lib/puppet/parser/parser.rb +1103 -1014
- data/lib/puppet/parser/parser_support.rb +10 -61
- data/lib/puppet/parser/relationship.rb +1 -3
- data/lib/puppet/parser/resource.rb +21 -56
- data/lib/puppet/parser/scope.rb +138 -165
- data/lib/puppet/parser/templatewrapper.rb +25 -20
- data/lib/puppet/parser/type_loader.rb +33 -67
- data/lib/puppet/parser/yaml_trimmer.rb +1 -1
- data/lib/puppet/property.rb +5 -4
- data/lib/puppet/provider.rb +133 -28
- data/lib/puppet/provider/augeas/augeas.rb +66 -6
- data/lib/puppet/provider/command.rb +25 -0
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +14 -9
- data/lib/puppet/provider/exec/posix.rb +1 -1
- data/lib/puppet/provider/exec/windows.rb +2 -3
- data/lib/puppet/provider/file/windows.rb +29 -10
- data/lib/puppet/provider/group/groupadd.rb +3 -2
- data/lib/puppet/provider/group/ldap.rb +1 -1
- data/lib/puppet/provider/group/windows_adsi.rb +1 -1
- data/lib/puppet/provider/host/parsed.rb +1 -1
- data/lib/puppet/provider/ldap.rb +1 -5
- data/lib/puppet/provider/mount/parsed.rb +3 -3
- data/lib/puppet/provider/nameservice.rb +22 -22
- data/lib/puppet/provider/nameservice/directoryservice.rb +58 -121
- data/lib/puppet/provider/package/apt.rb +8 -11
- data/lib/puppet/provider/package/blastwave.rb +3 -3
- data/lib/puppet/provider/package/dpkg.rb +1 -1
- data/lib/puppet/provider/package/freebsd.rb +2 -2
- data/lib/puppet/provider/package/gem.rb +1 -1
- data/lib/puppet/provider/package/macports.rb +11 -9
- data/lib/puppet/provider/package/msi.rb +37 -32
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pacman.rb +69 -6
- data/lib/puppet/provider/package/pkg.rb +126 -75
- data/lib/puppet/provider/package/pkgin.rb +60 -0
- data/lib/puppet/provider/package/pkgutil.rb +32 -20
- data/lib/puppet/provider/package/portage.rb +2 -2
- data/lib/puppet/provider/package/sun.rb +83 -116
- data/lib/puppet/provider/package/sunfreeware.rb +1 -1
- data/lib/puppet/provider/package/up2date.rb +2 -3
- data/lib/puppet/provider/package/windows.rb +130 -0
- data/lib/puppet/provider/package/windows/exe_package.rb +70 -0
- data/lib/puppet/provider/package/windows/msi_package.rb +62 -0
- data/lib/puppet/provider/package/windows/package.rb +79 -0
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/base.rb +1 -0
- data/lib/puppet/provider/service/bsd.rb +7 -5
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +9 -9
- data/lib/puppet/provider/service/launchd.rb +7 -11
- data/lib/puppet/provider/service/redhat.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +9 -2
- data/lib/puppet/provider/service/smf.rb +14 -2
- data/lib/puppet/provider/service/systemd.rb +3 -3
- data/lib/puppet/provider/service/upstart.rb +6 -6
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -0
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +3 -8
- data/lib/puppet/provider/user/windows_adsi.rb +1 -12
- data/lib/puppet/provider/zfs/{solaris.rb → zfs.rb} +16 -5
- data/lib/puppet/provider/zone/solaris.rb +10 -13
- data/lib/puppet/provider/zpool/{solaris.rb → zpool.rb} +11 -4
- data/lib/puppet/rails.rb +6 -4
- data/lib/puppet/rails/database/schema.rb +9 -4
- data/lib/puppet/rails/inventory_node.rb +13 -26
- data/lib/puppet/reference/configuration.rb +1 -2
- data/lib/puppet/reference/metaparameter.rb +1 -2
- data/lib/puppet/reports/http.rb +9 -10
- data/lib/puppet/reports/rrdgraph.rb +2 -2
- data/lib/puppet/reports/store.rb +1 -2
- data/lib/puppet/reports/tagmail.rb +6 -6
- data/lib/puppet/resource.rb +69 -64
- data/lib/puppet/resource/catalog.rb +11 -60
- data/lib/puppet/resource/status.rb +6 -32
- data/lib/puppet/resource/type.rb +94 -34
- data/lib/puppet/resource/type_collection.rb +17 -8
- data/lib/puppet/run.rb +4 -26
- data/lib/puppet/settings.rb +1315 -0
- data/lib/puppet/settings/base_setting.rb +163 -0
- data/lib/puppet/{util/settings → settings}/boolean_setting.rb +7 -3
- data/lib/puppet/settings/directory_setting.rb +7 -0
- data/lib/puppet/settings/errors.rb +11 -0
- data/lib/puppet/{util/settings → settings}/file_setting.rb +4 -20
- data/lib/puppet/settings/path_setting.rb +10 -0
- data/lib/puppet/settings/string_setting.rb +12 -0
- data/lib/puppet/simple_graph.rb +2 -5
- data/lib/puppet/ssl/base.rb +2 -2
- data/lib/puppet/ssl/certificate_authority.rb +4 -5
- data/lib/puppet/ssl/certificate_authority/interface.rb +5 -7
- data/lib/puppet/ssl/certificate_factory.rb +1 -2
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +53 -30
- data/lib/puppet/ssl/configuration.rb +32 -0
- data/lib/puppet/ssl/host.rb +9 -37
- data/lib/puppet/status.rb +2 -6
- data/lib/puppet/test/test_helper.rb +58 -25
- data/lib/puppet/transaction.rb +6 -9
- data/lib/puppet/transaction/event.rb +13 -24
- data/lib/puppet/transaction/event_manager.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -41
- data/lib/puppet/transaction/resource_harness.rb +2 -3
- data/lib/puppet/type.rb +18 -191
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +6 -4
- data/lib/puppet/type/file.rb +33 -44
- data/lib/puppet/type/file/content.rb +13 -9
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +2 -6
- data/lib/puppet/type/file/source.rb +8 -4
- data/lib/puppet/type/filebucket.rb +3 -2
- data/lib/puppet/type/mount.rb +1 -11
- data/lib/puppet/type/package.rb +40 -23
- data/lib/puppet/type/schedule.rb +127 -21
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/service.rb +2 -3
- data/lib/puppet/type/tidy.rb +8 -17
- data/lib/puppet/type/yumrepo.rb +35 -7
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/type/zone.rb +48 -38
- data/lib/puppet/util.rb +178 -249
- data/lib/puppet/util/adsi.rb +23 -25
- data/lib/puppet/util/autoload.rb +184 -114
- data/lib/puppet/util/backups.rb +3 -2
- data/lib/puppet/util/colors.rb +0 -1
- data/lib/puppet/util/command_line.rb +42 -104
- data/lib/puppet/util/command_line/puppet_option_parser.rb +89 -0
- data/lib/puppet/util/command_line/trollop.rb +824 -0
- data/lib/puppet/util/config_timeout.rb +24 -0
- data/lib/puppet/util/constant_inflector.rb +15 -7
- data/lib/puppet/util/diff.rb +2 -2
- data/lib/puppet/util/docs.rb +1 -2
- data/lib/puppet/util/errors.rb +3 -4
- data/lib/puppet/util/execution.rb +239 -14
- data/lib/puppet/util/execution_stub.rb +2 -2
- data/lib/puppet/util/feature.rb +2 -4
- data/lib/puppet/util/fileparsing.rb +1 -1
- data/lib/puppet/util/filetype.rb +12 -10
- data/lib/puppet/util/json_lockfile.rb +41 -0
- data/lib/puppet/util/ldap/connection.rb +4 -7
- data/lib/puppet/util/lockfile.rb +62 -0
- data/lib/puppet/util/log.rb +16 -20
- data/lib/puppet/util/log/destinations.rb +12 -27
- data/lib/puppet/util/logging.rb +95 -3
- data/lib/puppet/util/metric.rb +0 -6
- data/lib/puppet/util/monkey_patches.rb +101 -82
- data/lib/puppet/util/monkey_patches/lines.rb +13 -0
- data/lib/puppet/util/network_device/cisco/device.rb +2 -2
- data/lib/puppet/util/network_device/config.rb +1 -0
- data/lib/puppet/util/network_device/transport.rb +2 -0
- data/lib/puppet/util/pidlock.rb +13 -77
- data/lib/puppet/util/platform.rb +0 -7
- data/lib/puppet/util/posix.rb +10 -0
- data/lib/puppet/util/rdoc.rb +12 -8
- data/lib/puppet/util/reference.rb +3 -3
- data/lib/puppet/util/rubygems.rb +55 -0
- data/lib/puppet/util/run_mode.rb +7 -16
- data/lib/puppet/util/selinux.rb +36 -31
- data/lib/puppet/util/storage.rb +14 -19
- data/lib/puppet/util/suidmanager.rb +27 -2
- data/lib/puppet/util/windows.rb +9 -6
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/registry.rb +36 -0
- data/lib/puppet/util/windows/security.rb +46 -9
- data/lib/puppet/util/windows/user.rb +2 -65
- data/lib/puppet/util/zaml.rb +47 -91
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +97 -69
- data/man/man8/puppet-agent.8 +5 -6
- data/man/man8/puppet-apply.8 +7 -3
- data/man/man8/puppet-ca.8 +5 -17
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +3 -9
- 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 +1 -1
- data/man/man8/puppet-doc.8 +7 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-file.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-help.8 +2 -5
- data/man/man8/puppet-inspect.8 +1 -1
- data/man/man8/puppet-instrumentation_data.8 +1 -1
- data/man/man8/puppet-instrumentation_listener.8 +1 -1
- data/man/man8/puppet-instrumentation_probe.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-kick.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 +19 -50
- data/man/man8/puppet-node.8 +2 -5
- data/man/man8/puppet-parser.8 +7 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-queue.8 +1 -1
- data/man/man8/puppet-report.8 +2 -3
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-resource_type.8 +1 -1
- data/man/man8/puppet-secret_agent.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +1 -1
- data/spec/fixtures/unit/indirector/hiera/global.yaml +10 -0
- data/{test/data/providers/cron/crontab_sample_records.yaml → spec/fixtures/unit/provider/cron/crontab/single_line.yaml} +0 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris10 +1 -1
- data/spec/fixtures/unit/provider/package/pkg/{dummy_solaris11 → dummy_solaris11.ifo.installed} +0 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.known +1 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.installed +1 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.known +1 -0
- data/spec/fixtures/unit/provider/package/pkg/publisher +2 -2
- data/spec/fixtures/unit/provider/package/pkg/simple +2 -4
- data/spec/fixtures/unit/provider/package/pkg/solaris11 +2 -12
- data/spec/fixtures/unit/provider/package/sun/dummy.server +12 -0
- data/spec/fixtures/unit/provider/package/sun/simple +24 -0
- data/spec/fixtures/unit/provider/service/smf/svcs.out +3 -0
- data/{test/data/types/sshkey/1 → spec/fixtures/unit/provider/sshkey/parsed/sample} +0 -0
- data/spec/fixtures/unit/provider/zfs/zfs/zfs-list.out +2 -0
- data/spec/fixtures/unit/provider/zpool/zpool/zpool-list.out +2 -0
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/application/doc_spec.rb +3 -2
- data/spec/integration/configurer_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +21 -51
- data/spec/{unit/face → integration/faces}/ca_spec.rb +89 -130
- data/spec/integration/faces/documentation_spec.rb +36 -29
- data/spec/integration/file_serving/content_spec.rb +1 -2
- data/spec/integration/file_serving/fileset_spec.rb +1 -1
- data/spec/integration/file_serving/metadata_spec.rb +1 -2
- data/spec/integration/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -2
- data/spec/integration/indirector/catalog/queue_spec.rb +3 -3
- data/spec/integration/indirector/direct_file_server_spec.rb +14 -10
- data/spec/integration/indirector/facts/facter_spec.rb +22 -0
- data/spec/integration/indirector/file_content/file_server_spec.rb +1 -1
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +1 -1
- data/spec/integration/indirector/node/ldap_spec.rb +1 -1
- data/spec/integration/network/authconfig_spec.rb +238 -0
- data/spec/integration/network/formats_spec.rb +2 -4
- data/spec/integration/network/server/mongrel_spec.rb +2 -10
- data/spec/integration/network/server/webrick_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +1 -1
- data/spec/integration/node/facts_spec.rb +2 -2
- data/spec/integration/node_spec.rb +2 -15
- data/spec/integration/parser/collector_spec.rb +2 -2
- data/spec/integration/parser/compiler_spec.rb +38 -10
- data/spec/integration/parser/functions/require_spec.rb +1 -1
- data/spec/integration/parser/functions_spec.rb +1 -1
- data/spec/integration/parser/parser_spec.rb +1 -1
- data/spec/integration/parser/ruby_manifest_spec.rb +1 -1
- data/spec/integration/parser/scope_spec.rb +608 -0
- data/spec/integration/provider/mailalias/aliases_spec.rb +1 -1
- data/spec/integration/provider/mount_spec.rb +1 -0
- data/spec/integration/provider/package_spec.rb +3 -3
- data/spec/integration/provider/service/init_spec.rb +2 -2
- data/spec/integration/provider/ssh_authorized_key_spec.rb +1 -1
- data/spec/integration/reference/providers_spec.rb +1 -1
- data/spec/integration/reports_spec.rb +1 -1
- data/spec/integration/resource/catalog_spec.rb +1 -2
- data/spec/integration/resource/type_collection_spec.rb +1 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +1 -1
- data/spec/integration/ssl/certificate_request_spec.rb +1 -1
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/integration/ssl/host_spec.rb +1 -1
- data/spec/integration/transaction/report_spec.rb +1 -1
- data/spec/integration/transaction_spec.rb +2 -2
- data/spec/integration/type/exec_spec.rb +1 -1
- data/spec/integration/type/file_spec.rb +140 -158
- data/spec/integration/type/package_spec.rb +6 -2
- data/spec/integration/type/tidy_spec.rb +1 -1
- data/spec/integration/type_spec.rb +1 -1
- data/spec/integration/util/autoload_spec.rb +8 -14
- data/spec/integration/util/feature_spec.rb +1 -1
- data/spec/integration/util/rdoc/parser_spec.rb +11 -9
- data/spec/integration/util/settings_spec.rb +19 -6
- data/spec/integration/util/windows/security_spec.rb +23 -3
- data/spec/integration/util_spec.rb +3 -3
- data/spec/lib/puppet/indirector/indirector_testing/json.rb +6 -0
- data/spec/lib/puppet/indirector_testing.rb +27 -0
- data/spec/lib/puppet_spec/compiler.rb +2 -2
- data/spec/lib/puppet_spec/database.rb +1 -1
- data/spec/lib/puppet_spec/files.rb +4 -4
- data/spec/lib/puppet_spec/matchers.rb +26 -24
- data/spec/lib/puppet_spec/modules.rb +1 -1
- data/spec/lib/puppet_spec/settings.rb +16 -0
- data/spec/shared_behaviours/file_server_terminus.rb +2 -2
- data/spec/shared_behaviours/file_serving.rb +10 -15
- data/spec/shared_behaviours/file_serving_model.rb +2 -6
- data/spec/shared_contexts/platform.rb +0 -8
- data/spec/spec_helper.rb +14 -15
- data/spec/unit/agent/disabler_spec.rb +64 -0
- data/spec/unit/agent/locker_spec.rb +31 -36
- data/spec/unit/agent_spec.rb +79 -26
- data/spec/unit/application/agent_spec.rb +66 -39
- data/spec/unit/application/apply_spec.rb +46 -36
- data/spec/unit/application/cert_spec.rb +1 -5
- data/spec/unit/application/certificate_spec.rb +1 -1
- data/spec/unit/application/config_spec.rb +1 -1
- data/spec/unit/application/describe_spec.rb +1 -5
- data/spec/unit/application/device_spec.rb +22 -12
- data/spec/unit/application/doc_spec.rb +37 -69
- data/spec/unit/application/face_base_spec.rb +10 -6
- data/spec/unit/application/facts_spec.rb +3 -3
- data/spec/unit/application/filebucket_spec.rb +7 -18
- data/spec/unit/application/indirection_base_spec.rb +11 -5
- data/spec/unit/application/inspect_spec.rb +3 -2
- data/spec/unit/application/kick_spec.rb +6 -22
- data/spec/unit/application/master_spec.rb +15 -39
- data/spec/unit/application/queue_spec.rb +2 -6
- data/spec/unit/application/resource_spec.rb +15 -12
- data/spec/unit/application/secret_agent_spec.rb +1 -1
- data/spec/unit/application_spec.rb +110 -123
- data/spec/unit/configurer/downloader_spec.rb +5 -5
- data/spec/unit/configurer/fact_handler_spec.rb +1 -40
- data/spec/unit/configurer/plugin_handler_spec.rb +11 -96
- data/spec/unit/configurer_spec.rb +61 -59
- data/spec/unit/daemon_spec.rb +26 -19
- data/spec/unit/data_binding_spec.rb +11 -0
- data/spec/unit/dsl/resource_api_spec.rb +2 -2
- data/spec/unit/dsl/resource_type_api_spec.rb +1 -1
- data/spec/unit/face/catalog_spec.rb +1 -1
- data/spec/unit/face/certificate_request_spec.rb +1 -1
- data/spec/unit/face/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/face/certificate_spec.rb +18 -1
- data/spec/unit/face/config_spec.rb +8 -1
- data/spec/unit/face/facts_spec.rb +1 -1
- data/spec/unit/face/file_spec.rb +1 -1
- data/spec/unit/face/help_spec.rb +39 -22
- data/spec/unit/face/instrumentation_data_spec.rb +1 -1
- data/spec/unit/face/instrumentation_listener_spec.rb +1 -1
- data/spec/unit/face/instrumentation_probe_spec.rb +1 -1
- data/spec/unit/face/key_spec.rb +1 -1
- data/spec/unit/face/module/build_spec.rb +68 -0
- data/spec/unit/face/module/install_spec.rb +46 -31
- data/spec/unit/face/module/list_spec.rb +18 -21
- data/spec/unit/face/module/search_spec.rb +87 -49
- data/spec/unit/face/module/uninstall_spec.rb +4 -4
- data/spec/unit/face/node_spec.rb +3 -3
- data/spec/unit/face/plugin_spec.rb +1 -1
- data/spec/unit/face/report_spec.rb +1 -1
- data/spec/unit/face/resource_spec.rb +1 -1
- data/spec/unit/face/resource_type_spec.rb +1 -1
- data/spec/unit/face/secret_agent_spec.rb +1 -1
- data/spec/unit/file_bucket/dipper_spec.rb +1 -1
- data/spec/unit/file_bucket/file_spec.rb +1 -1
- data/spec/unit/file_serving/base_spec.rb +1 -1
- data/spec/unit/file_serving/configuration/parser_spec.rb +1 -1
- data/spec/unit/file_serving/configuration_spec.rb +7 -21
- data/spec/unit/file_serving/content_spec.rb +1 -1
- data/spec/unit/file_serving/fileset_spec.rb +13 -13
- data/spec/unit/file_serving/metadata_spec.rb +29 -47
- data/spec/unit/file_serving/mount/file_spec.rb +1 -1
- data/spec/unit/file_serving/mount/modules_spec.rb +1 -1
- data/spec/unit/file_serving/mount/plugins_spec.rb +17 -4
- data/spec/unit/file_serving/mount_spec.rb +1 -1
- data/spec/unit/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/unit/file_serving/terminus_selector_spec.rb +5 -5
- data/spec/unit/forge/errors_spec.rb +42 -0
- data/spec/unit/forge/repository_spec.rb +108 -31
- data/spec/unit/forge_spec.rb +17 -23
- data/spec/unit/indirector/active_record_spec.rb +1 -1
- data/spec/unit/indirector/catalog/active_record_spec.rb +11 -49
- data/spec/unit/indirector/catalog/compiler_spec.rb +18 -45
- data/spec/unit/indirector/catalog/json_spec.rb +12 -0
- data/spec/unit/indirector/catalog/queue_spec.rb +1 -1
- data/spec/unit/indirector/catalog/rest_spec.rb +1 -1
- data/spec/unit/indirector/catalog/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/catalog/yaml_spec.rb +1 -1
- data/spec/unit/indirector/certificate/ca_spec.rb +5 -6
- data/spec/unit/indirector/certificate/file_spec.rb +5 -6
- data/spec/unit/indirector/certificate/rest_spec.rb +6 -2
- data/spec/unit/indirector/certificate_request/ca_spec.rb +3 -3
- data/spec/unit/indirector/certificate_request/file_spec.rb +3 -3
- data/spec/unit/indirector/certificate_request/rest_spec.rb +1 -1
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +3 -4
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +4 -3
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +1 -1
- data/spec/unit/indirector/certificate_status/file_spec.rb +41 -31
- data/spec/unit/indirector/certificate_status/rest_spec.rb +1 -1
- data/spec/unit/indirector/code_spec.rb +1 -1
- data/spec/unit/indirector/data_binding/hiera_spec.rb +21 -0
- data/spec/unit/indirector/data_binding/none_spec.rb +28 -0
- data/spec/unit/indirector/direct_file_server_spec.rb +2 -2
- data/spec/unit/indirector/envelope_spec.rb +1 -1
- data/spec/unit/indirector/exec_spec.rb +1 -1
- data/spec/unit/indirector/face_spec.rb +1 -1
- data/spec/unit/indirector/facts/active_record_spec.rb +1 -1
- data/spec/unit/indirector/facts/couch_spec.rb +3 -3
- data/spec/unit/indirector/facts/facter_spec.rb +13 -20
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +2 -2
- data/spec/unit/indirector/facts/inventory_service_spec.rb +2 -3
- data/spec/unit/indirector/facts/network_device_spec.rb +2 -9
- data/spec/unit/indirector/facts/rest_spec.rb +1 -1
- data/spec/unit/indirector/facts/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/facts/yaml_spec.rb +2 -2
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +2 -2
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_server_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_spec.rb +1 -1
- data/spec/unit/indirector/file_content/rest_spec.rb +7 -3
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +1 -1
- data/spec/unit/indirector/file_metadata/file_spec.rb +3 -3
- data/spec/unit/indirector/file_metadata/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_server_spec.rb +1 -1
- data/spec/unit/indirector/hiera_spec.rb +149 -0
- data/spec/unit/indirector/indirection_spec.rb +10 -29
- data/spec/unit/indirector/instrumentation_data/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_data/rest_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_listener/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_probe/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +1 -1
- data/spec/unit/indirector/json_spec.rb +193 -0
- data/spec/unit/indirector/key/ca_spec.rb +5 -6
- data/spec/unit/indirector/key/file_spec.rb +10 -12
- data/spec/unit/indirector/ldap_spec.rb +3 -3
- data/spec/unit/indirector/memory_spec.rb +1 -1
- data/spec/unit/indirector/node/active_record_spec.rb +11 -7
- data/spec/unit/indirector/node/exec_spec.rb +12 -5
- data/spec/unit/indirector/node/ldap_spec.rb +173 -194
- data/spec/unit/indirector/node/memory_spec.rb +1 -1
- data/spec/unit/indirector/node/plain_spec.rb +16 -8
- data/spec/unit/indirector/node/rest_spec.rb +1 -1
- data/spec/unit/indirector/node/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/node/yaml_spec.rb +1 -1
- data/spec/unit/indirector/none_spec.rb +33 -0
- data/spec/unit/indirector/plain_spec.rb +1 -1
- data/spec/unit/indirector/queue_spec.rb +1 -1
- data/spec/unit/indirector/report/processor_spec.rb +4 -4
- data/spec/unit/indirector/report/rest_spec.rb +3 -46
- data/spec/unit/indirector/report/yaml_spec.rb +3 -12
- data/spec/unit/indirector/request_spec.rb +238 -61
- data/spec/unit/indirector/resource/active_record_spec.rb +2 -2
- data/spec/unit/indirector/resource/ral_spec.rb +2 -2
- data/spec/unit/indirector/resource/rest_spec.rb +1 -1
- data/spec/unit/indirector/resource/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/resource_type/parser_spec.rb +153 -53
- data/spec/unit/indirector/resource_type/rest_spec.rb +1 -1
- data/spec/unit/indirector/rest_spec.rb +350 -361
- data/spec/unit/indirector/run/local_spec.rb +2 -2
- data/spec/unit/indirector/run/rest_spec.rb +1 -1
- data/spec/unit/indirector/ssl_file_spec.rb +12 -10
- data/spec/unit/indirector/status/rest_spec.rb +1 -1
- data/spec/unit/indirector/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/terminus_spec.rb +1 -46
- data/spec/unit/indirector/yaml_spec.rb +36 -36
- data/spec/unit/indirector_spec.rb +1 -1
- data/spec/unit/interface/action_builder_spec.rb +1 -1
- data/spec/unit/interface/action_manager_spec.rb +1 -1
- data/spec/unit/interface/action_spec.rb +1 -1
- data/spec/unit/interface/documentation_spec.rb +3 -2
- data/spec/unit/interface/face_collection_spec.rb +19 -9
- data/spec/unit/interface/option_builder_spec.rb +9 -1
- data/spec/unit/interface/option_spec.rb +8 -0
- data/spec/unit/interface_spec.rb +49 -11
- data/spec/unit/module_spec.rb +95 -303
- data/spec/unit/module_tool/application_spec.rb +6 -6
- data/spec/unit/module_tool/applications/installer_spec.rb +131 -69
- data/spec/unit/module_tool/applications/searcher_spec.rb +37 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +27 -19
- data/spec/unit/module_tool/applications/unpacker_spec.rb +4 -10
- data/spec/unit/module_tool/applications/upgrader_spec.rb +1 -4
- data/spec/unit/module_tool/install_directory_spec.rb +70 -0
- data/spec/unit/module_tool_spec.rb +132 -1
- data/spec/unit/network/auth_config_parser_spec.rb +101 -0
- data/spec/unit/network/authconfig_spec.rb +54 -272
- data/spec/unit/network/authorization_spec.rb +20 -0
- data/spec/unit/network/authstore_spec.rb +17 -15
- data/spec/unit/network/format_handler_spec.rb +3 -3
- data/spec/unit/network/format_spec.rb +1 -1
- data/spec/unit/network/formats_spec.rb +28 -37
- data/spec/unit/network/http/api/v1_spec.rb +3 -3
- data/spec/unit/network/http/compression_spec.rb +3 -3
- data/spec/unit/network/http/connection_spec.rb +244 -0
- data/spec/unit/network/http/handler_spec.rb +4 -20
- data/spec/unit/network/http/mongrel/rest_spec.rb +12 -31
- data/spec/unit/network/http/mongrel_spec.rb +7 -37
- data/spec/unit/network/http/rack/rest_spec.rb +10 -44
- data/spec/unit/network/http/rack_spec.rb +2 -59
- data/spec/unit/network/http/webrick/rest_spec.rb +14 -4
- data/spec/unit/network/http/webrick_spec.rb +129 -193
- data/spec/unit/network/http_pool_spec.rb +6 -115
- data/spec/unit/network/http_spec.rb +1 -1
- data/spec/unit/network/resolver_spec.rb +207 -0
- data/spec/unit/network/rights_spec.rb +15 -115
- data/spec/unit/network/server_spec.rb +58 -166
- data/spec/unit/node/environment_spec.rb +7 -7
- data/spec/unit/node/facts_spec.rb +15 -30
- data/spec/unit/node_spec.rb +14 -26
- data/spec/unit/other/selinux_spec.rb +1 -1
- data/spec/unit/parameter/package_options_spec.rb +44 -0
- data/spec/unit/parameter/path_spec.rb +1 -1
- data/spec/unit/parameter/value_collection_spec.rb +1 -1
- data/spec/unit/parameter/value_spec.rb +1 -1
- data/spec/unit/parameter_spec.rb +1 -1
- data/spec/unit/parser/ast/arithmetic_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/astarray_spec.rb +4 -2
- data/spec/unit/parser/ast/asthash_spec.rb +4 -2
- data/spec/unit/parser/ast/boolean_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/casestatement_spec.rb +9 -5
- data/spec/unit/parser/ast/collection_spec.rb +2 -2
- data/spec/unit/parser/ast/collexpr_spec.rb +4 -2
- data/spec/unit/parser/ast/comparison_operator_spec.rb +5 -2
- data/spec/unit/parser/ast/definition_spec.rb +1 -1
- data/spec/unit/parser/ast/function_spec.rb +3 -3
- data/spec/unit/parser/ast/hostclass_spec.rb +1 -1
- data/spec/unit/parser/ast/ifstatement_spec.rb +4 -2
- data/spec/unit/parser/ast/in_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/leaf_spec.rb +66 -39
- data/spec/unit/parser/ast/match_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/minus_spec.rb +4 -2
- data/spec/unit/parser/ast/node_spec.rb +1 -1
- data/spec/unit/parser/ast/nop_spec.rb +1 -1
- data/spec/unit/parser/ast/not_spec.rb +4 -2
- data/spec/unit/parser/ast/relationship_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_defaults_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_override_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_reference_spec.rb +5 -3
- data/spec/unit/parser/ast/resource_spec.rb +5 -32
- data/spec/unit/parser/ast/selector_spec.rb +56 -106
- data/spec/unit/parser/ast/vardef_spec.rb +4 -2
- data/spec/unit/parser/ast_spec.rb +22 -51
- data/spec/unit/parser/collector_spec.rb +2 -2
- data/spec/unit/parser/compiler_spec.rb +89 -42
- data/spec/unit/parser/files_spec.rb +81 -10
- data/spec/unit/parser/functions/create_resources_spec.rb +5 -4
- data/spec/unit/parser/functions/defined_spec.rb +2 -2
- data/spec/unit/parser/functions/extlookup_spec.rb +9 -8
- data/spec/unit/parser/functions/fail_spec.rb +28 -0
- data/spec/unit/parser/functions/file_spec.rb +55 -0
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +6 -12
- data/spec/unit/parser/functions/generate_spec.rb +54 -3
- data/spec/unit/parser/functions/include_spec.rb +19 -2
- data/spec/unit/parser/functions/inline_template_spec.rb +9 -20
- data/spec/unit/parser/functions/realize_spec.rb +4 -4
- data/spec/unit/parser/functions/regsubst_spec.rb +4 -2
- data/spec/unit/parser/functions/require_spec.rb +5 -14
- data/spec/unit/parser/functions/search_spec.rb +23 -0
- data/spec/unit/parser/functions/shellquote_spec.rb +31 -38
- data/spec/unit/parser/functions/split_spec.rb +4 -2
- data/spec/unit/parser/functions/sprintf_spec.rb +4 -2
- data/spec/unit/parser/functions/tag_spec.rb +4 -3
- data/spec/unit/parser/functions/template_spec.rb +45 -27
- data/spec/unit/parser/functions/versioncmp_spec.rb +4 -2
- data/spec/unit/parser/functions_spec.rb +14 -22
- data/spec/unit/parser/lexer_spec.rb +10 -134
- data/spec/unit/parser/parser_spec.rb +126 -35
- data/spec/unit/parser/relationship_spec.rb +1 -25
- data/spec/unit/parser/resource_spec.rb +15 -79
- data/spec/unit/parser/scope_spec.rb +175 -602
- data/spec/unit/parser/templatewrapper_spec.rb +8 -25
- data/spec/unit/parser/type_loader_spec.rb +37 -21
- data/spec/unit/property/ensure_spec.rb +1 -1
- data/spec/unit/property/keyvalue_spec.rb +1 -1
- data/spec/unit/property/list_spec.rb +1 -1
- data/spec/unit/property/ordered_list_spec.rb +1 -1
- data/spec/unit/property_spec.rb +1 -1
- data/spec/unit/{puppet/provider → provider}/README.markdown +0 -0
- data/spec/unit/provider/augeas/augeas_spec.rb +88 -1
- data/spec/unit/provider/cisco_spec.rb +1 -1
- data/spec/unit/provider/command_spec.rb +62 -0
- data/spec/unit/provider/confine/exists_spec.rb +8 -1
- data/spec/unit/provider/confine/false_spec.rb +1 -1
- data/spec/unit/provider/confine/feature_spec.rb +1 -1
- data/spec/unit/provider/confine/true_spec.rb +1 -1
- data/spec/unit/provider/confine/variable_spec.rb +1 -1
- data/spec/unit/provider/confine_collection_spec.rb +1 -1
- data/spec/unit/provider/confine_spec.rb +1 -1
- data/spec/unit/provider/confiner_spec.rb +1 -1
- data/spec/unit/provider/cron/crontab_spec.rb +116 -0
- data/spec/unit/provider/exec/posix_spec.rb +99 -12
- data/spec/unit/provider/exec/shell_spec.rb +1 -1
- data/spec/unit/provider/exec/windows_spec.rb +1 -1
- data/spec/unit/provider/exec_spec.rb +1 -1
- data/spec/unit/provider/file/posix_spec.rb +1 -1
- data/spec/unit/provider/file/windows_spec.rb +30 -30
- data/spec/unit/provider/group/groupadd_spec.rb +31 -37
- data/spec/unit/provider/group/ldap_spec.rb +1 -1
- data/spec/unit/provider/group/pw_spec.rb +1 -1
- data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
- data/spec/unit/provider/host/parsed_spec.rb +1 -1
- data/spec/unit/provider/interface/cisco_spec.rb +1 -1
- data/spec/unit/provider/ldap_spec.rb +1 -1
- data/spec/unit/provider/macauthorization_spec.rb +1 -1
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +1 -1
- data/spec/unit/provider/mount/parsed_spec.rb +18 -12
- data/spec/unit/provider/mount_spec.rb +1 -1
- data/spec/unit/provider/naginator_spec.rb +1 -1
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +9 -29
- data/spec/unit/provider/network_device_spec.rb +1 -1
- data/spec/unit/provider/package/aix_spec.rb +1 -1
- data/spec/unit/provider/package/appdmg_spec.rb +1 -1
- data/spec/unit/provider/package/apt_spec.rb +1 -1
- data/spec/unit/provider/package/aptitude_spec.rb +38 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +39 -0
- data/spec/unit/provider/package/dpkg_spec.rb +4 -4
- data/spec/unit/provider/package/freebsd_spec.rb +3 -3
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/hpux_spec.rb +1 -1
- data/spec/unit/provider/package/macports_spec.rb +27 -10
- data/spec/unit/provider/package/msi_spec.rb +29 -14
- data/spec/unit/provider/package/nim_spec.rb +1 -1
- data/spec/unit/provider/package/openbsd_spec.rb +3 -3
- data/spec/unit/provider/package/pacman_spec.rb +109 -81
- data/spec/unit/provider/package/pip_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +205 -97
- data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
- data/spec/unit/provider/package/pkgin_spec.rb +176 -0
- data/spec/unit/provider/package/pkgutil_spec.rb +64 -10
- data/spec/unit/provider/package/rpm_spec.rb +58 -0
- data/spec/unit/provider/package/sun_spec.rb +122 -0
- data/spec/unit/provider/package/up2date_spec.rb +24 -0
- data/spec/unit/provider/package/windows/exe_package_spec.rb +99 -0
- data/spec/unit/provider/package/windows/msi_package_spec.rb +115 -0
- data/spec/unit/provider/package/windows/package_spec.rb +126 -0
- data/spec/unit/provider/package/windows_spec.rb +255 -0
- data/spec/unit/provider/package/yum_spec.rb +1 -1
- data/spec/unit/provider/package/zypper_spec.rb +1 -1
- data/spec/unit/provider/parsedfile_spec.rb +1 -1
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +12 -15
- data/spec/unit/provider/selboolean_spec.rb +1 -1
- data/spec/unit/provider/selmodule-example.pp +0 -0
- data/spec/unit/provider/selmodule_spec.rb +1 -1
- data/spec/unit/provider/service/base_spec.rb +77 -0
- data/spec/unit/provider/service/daemontools_spec.rb +1 -1
- data/spec/unit/provider/service/debian_spec.rb +1 -1
- data/spec/unit/provider/service/freebsd_spec.rb +1 -1
- data/spec/unit/provider/service/gentoo_spec.rb +1 -1
- data/spec/unit/provider/service/init_spec.rb +1 -1
- data/spec/unit/provider/service/launchd_spec.rb +0 -17
- data/spec/unit/provider/service/redhat_spec.rb +12 -3
- data/spec/unit/provider/service/runit_spec.rb +2 -1
- data/spec/unit/provider/service/smf_spec.rb +16 -1
- data/spec/unit/provider/service/src_spec.rb +6 -6
- data/spec/unit/provider/service/systemd_spec.rb +18 -1
- data/spec/unit/provider/service/upstart_spec.rb +12 -7
- data/spec/unit/provider/service/windows_spec.rb +1 -1
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +1 -1
- data/spec/unit/provider/sshkey/parsed_spec.rb +42 -12
- data/spec/unit/provider/user/hpux_spec.rb +1 -1
- data/spec/unit/provider/user/ldap_spec.rb +9 -23
- data/spec/unit/provider/user/pw_spec.rb +1 -1
- data/spec/unit/provider/user/user_role_add_spec.rb +5 -2
- data/spec/unit/provider/user/useradd_spec.rb +118 -146
- data/spec/unit/provider/user/windows_adsi_spec.rb +2 -24
- data/spec/unit/provider/vlan/cisco_spec.rb +1 -1
- data/spec/unit/provider/zfs/zfs_spec.rb +106 -0
- data/spec/unit/provider/zone/solaris_spec.rb +56 -34
- data/spec/unit/provider/zpool/zpool_spec.rb +213 -0
- data/spec/unit/provider_spec.rb +621 -16
- data/spec/unit/puppet_spec.rb +21 -9
- data/spec/unit/rails/host_spec.rb +1 -1
- data/spec/unit/rails/param_value_spec.rb +1 -1
- data/spec/unit/rails/resource_spec.rb +1 -1
- data/spec/unit/rails_spec.rb +70 -70
- data/spec/unit/relationship_spec.rb +1 -1
- data/spec/unit/reports/http_spec.rb +48 -15
- data/spec/unit/reports/rrdgraph_spec.rb +1 -1
- data/spec/unit/reports/store_spec.rb +1 -1
- data/spec/unit/reports/tagmail_spec.rb +1 -1
- data/spec/unit/reports_spec.rb +1 -1
- data/spec/unit/resource/catalog_spec.rb +8 -175
- data/spec/unit/resource/status_spec.rb +2 -2
- data/spec/unit/resource/type_collection_helper_spec.rb +1 -1
- data/spec/unit/resource/type_collection_spec.rb +72 -45
- data/spec/unit/resource/type_spec.rb +31 -33
- data/spec/unit/resource_spec.rb +163 -98
- data/spec/unit/run_spec.rb +7 -23
- data/spec/unit/settings/directory_setting_spec.rb +32 -0
- data/spec/unit/{util/settings → settings}/file_setting_spec.rb +14 -23
- data/spec/unit/settings/path_setting_spec.rb +30 -0
- data/spec/unit/settings/string_setting_spec.rb +75 -0
- data/spec/unit/settings_spec.rb +1583 -0
- data/spec/unit/simple_graph_spec.rb +19 -5
- data/spec/unit/ssl/base_spec.rb +2 -2
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +7 -7
- data/spec/unit/ssl/certificate_authority_spec.rb +27 -53
- data/spec/unit/ssl/certificate_factory_spec.rb +1 -1
- data/spec/unit/ssl/certificate_request_spec.rb +2 -4
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +3 -3
- data/spec/unit/ssl/certificate_spec.rb +1 -1
- data/spec/unit/ssl/configuration_spec.rb +60 -0
- data/spec/unit/ssl/host_spec.rb +37 -89
- data/spec/unit/ssl/inventory_spec.rb +13 -20
- data/spec/unit/ssl/key_spec.rb +11 -9
- data/spec/unit/status_spec.rb +1 -7
- data/spec/unit/transaction/event_manager_spec.rb +1 -1
- data/spec/unit/transaction/event_spec.rb +6 -6
- data/spec/unit/transaction/report_spec.rb +1 -1
- data/spec/unit/transaction/resource_harness_spec.rb +2 -2
- data/spec/unit/transaction_spec.rb +8 -8
- data/spec/unit/{puppet/type → type}/README.markdown +0 -0
- data/spec/unit/type/augeas_spec.rb +2 -2
- data/spec/unit/type/component_spec.rb +1 -1
- data/spec/unit/type/computer_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +1 -1
- data/spec/unit/type/exec_spec.rb +40 -12
- data/spec/unit/type/file/checksum_spec.rb +1 -1
- data/spec/unit/type/file/content_spec.rb +9 -6
- data/spec/unit/type/file/ctime_spec.rb +1 -1
- data/spec/unit/type/file/ensure_spec.rb +1 -1
- data/spec/unit/type/file/group_spec.rb +1 -1
- data/spec/unit/type/file/mode_spec.rb +1 -1
- data/spec/unit/type/file/mtime_spec.rb +1 -1
- data/spec/unit/type/file/owner_spec.rb +1 -1
- data/spec/unit/type/file/selinux_spec.rb +1 -1
- data/spec/unit/type/file/source_spec.rb +14 -13
- data/spec/unit/type/file/type_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +39 -87
- data/spec/unit/type/filebucket_spec.rb +1 -1
- data/spec/unit/type/group_spec.rb +5 -5
- data/spec/unit/type/host_spec.rb +1 -1
- data/spec/unit/type/interface_spec.rb +1 -1
- data/spec/unit/type/macauthorization_spec.rb +1 -1
- data/spec/unit/type/mailalias_spec.rb +21 -0
- data/spec/unit/type/maillist_spec.rb +1 -1
- data/spec/unit/type/mcx_spec.rb +1 -1
- data/spec/unit/type/mount_spec.rb +2 -2
- data/spec/unit/type/nagios_spec.rb +1 -1
- data/spec/unit/type/noop_metaparam_spec.rb +3 -3
- data/spec/unit/type/package_spec.rb +1 -1
- data/spec/unit/type/resources_spec.rb +2 -2
- data/spec/unit/type/schedule_spec.rb +297 -39
- data/spec/unit/type/scheduled_task_spec.rb +3 -3
- data/spec/unit/type/selboolean_spec.rb +1 -1
- data/spec/unit/type/selmodule_spec.rb +1 -1
- data/spec/unit/type/service_spec.rb +1 -1
- data/spec/unit/type/ssh_authorized_key_spec.rb +3 -3
- data/spec/unit/type/sshkey_spec.rb +1 -1
- data/spec/unit/type/stage_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +1 -1
- data/spec/unit/type/user_spec.rb +1 -1
- data/spec/unit/type/vlan_spec.rb +1 -1
- data/spec/unit/type/whit_spec.rb +1 -1
- data/spec/unit/type/yumrepo_spec.rb +243 -0
- data/spec/unit/type/zfs_spec.rb +8 -6
- data/spec/unit/type/zone_spec.rb +41 -36
- data/spec/unit/type/zpool_spec.rb +1 -1
- data/spec/unit/type_spec.rb +180 -31
- data/spec/unit/util/adsi_spec.rb +8 -23
- data/spec/unit/util/autoload_spec.rb +181 -45
- data/spec/unit/util/backups_spec.rb +1 -1
- data/spec/unit/util/cache_accumulator_spec.rb +1 -1
- data/spec/unit/util/cacher_spec.rb +1 -1
- data/spec/unit/util/checksums_spec.rb +1 -1
- data/spec/unit/util/command_line_spec.rb +114 -108
- data/spec/unit/util/command_line_utils/puppet_option_parser_spec.rb +129 -0
- data/spec/unit/util/config_timeout_spec.rb +57 -0
- data/spec/unit/util/constant_inflector_spec.rb +13 -23
- data/spec/unit/util/diff_spec.rb +5 -4
- data/spec/unit/util/errors_spec.rb +1 -1
- data/spec/unit/util/execution_spec.rb +532 -28
- data/spec/unit/util/execution_stub_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +12 -13
- data/spec/unit/util/filetype_spec.rb +9 -9
- data/spec/unit/util/inline_docs_spec.rb +1 -1
- data/spec/unit/util/instrumentation/data_spec.rb +1 -1
- data/spec/unit/util/instrumentation/indirection_probe_spec.rb +1 -1
- data/spec/unit/util/instrumentation/instrumentable_spec.rb +1 -1
- data/spec/unit/util/instrumentation/listener_spec.rb +1 -1
- data/spec/unit/util/instrumentation_spec.rb +1 -1
- data/spec/unit/util/json_lockfile_spec.rb +29 -0
- data/spec/unit/util/ldap/connection_spec.rb +11 -15
- data/spec/unit/util/ldap/generator_spec.rb +1 -1
- data/spec/unit/util/ldap/manager_spec.rb +14 -23
- data/spec/unit/util/loadedfile_spec.rb +1 -1
- data/spec/unit/util/lockfile_spec.rb +76 -0
- data/spec/unit/util/log/destinations_spec.rb +11 -28
- data/spec/unit/util/log_spec.rb +6 -6
- data/spec/unit/util/logging_spec.rb +43 -11
- data/spec/unit/util/metric_spec.rb +4 -3
- data/spec/unit/util/monkey_patches/lines_spec.rb +83 -0
- data/spec/unit/util/monkey_patches_spec.rb +91 -28
- data/spec/unit/util/nagios_maker_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/device_spec.rb +3 -3
- data/spec/unit/util/network_device/cisco/facts_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/interface_spec.rb +1 -1
- data/spec/unit/util/network_device/config_spec.rb +1 -1
- data/spec/unit/util/network_device/ipcalc_spec.rb +1 -1
- data/spec/unit/util/network_device/transport/base_spec.rb +1 -1
- data/spec/unit/util/network_device/transport/ssh_spec.rb +2 -2
- data/spec/unit/util/network_device/transport/telnet_spec.rb +1 -1
- data/spec/unit/util/network_device_spec.rb +1 -1
- data/spec/unit/util/package_spec.rb +1 -1
- data/spec/unit/util/pidlock_spec.rb +179 -0
- data/spec/unit/util/posix_spec.rb +2 -2
- data/spec/unit/util/pson_spec.rb +23 -9
- data/spec/unit/util/queue/stomp_spec.rb +10 -13
- data/spec/unit/util/queue_spec.rb +2 -2
- data/spec/unit/util/rdoc/parser_spec.rb +11 -9
- data/spec/unit/util/rdoc_spec.rb +9 -3
- data/spec/unit/util/reference_serializer_spec.rb +1 -1
- data/spec/unit/util/reference_spec.rb +1 -1
- data/spec/unit/util/resource_template_spec.rb +1 -1
- data/spec/unit/util/retryaction_spec.rb +1 -1
- data/spec/unit/util/rubygems_spec.rb +66 -0
- data/spec/unit/util/run_mode_spec.rb +4 -9
- data/spec/unit/util/selinux_spec.rb +33 -25
- data/spec/unit/util/storage_spec.rb +2 -18
- data/spec/unit/util/suidmanager_spec.rb +11 -4
- data/spec/unit/util/symbolic_file_mode_spec.rb +1 -1
- data/spec/unit/util/tagging_spec.rb +1 -1
- data/spec/unit/util/terminal_spec.rb +1 -1
- data/spec/unit/util/user_attr_spec.rb +1 -1
- data/spec/unit/util/warnings_spec.rb +1 -1
- data/spec/unit/util/windows/registry_spec.rb +86 -0
- data/spec/unit/util/zaml_spec.rb +30 -146
- data/spec/unit/util_spec.rb +148 -440
- data/spec/watchr.rb +6 -2
- data/tasks/rake/apple.rake +176 -0
- data/tasks/rake/gem.rake +6 -5
- data/tasks/rake/manpages.rake +8 -1
- data/tasks/rake/metrics.rake +11 -3
- data/tasks/rake/parser.rake +5 -0
- data/{ext/osx → tasks/rake/templates}/prototype.plist.erb +0 -0
- metadata +293 -580
- data/bin/filebucket +0 -7
- data/bin/pi +0 -5
- data/bin/puppetca +0 -4
- data/bin/puppetd +0 -4
- data/bin/puppetdoc +0 -4
- data/bin/puppetmasterd +0 -4
- data/bin/puppetqd +0 -4
- data/bin/puppetrun +0 -5
- data/bin/ralsh +0 -4
- data/ext/build_defaults.yaml +0 -19
- data/ext/debian/README.Debian +0 -8
- data/ext/debian/README.source +0 -2
- data/ext/debian/TODO.Debian +0 -1
- data/ext/debian/changelog.erb +0 -1104
- data/ext/debian/compat +0 -1
- data/ext/debian/control +0 -142
- data/ext/debian/copyright +0 -361
- data/ext/debian/docs +0 -1
- data/ext/debian/fileserver.conf +0 -17
- data/ext/debian/puppet-common.dirs +0 -8
- data/ext/debian/puppet-common.install +0 -3
- data/ext/debian/puppet-common.lintian-overrides +0 -7
- data/ext/debian/puppet-common.manpages +0 -2
- data/ext/debian/puppet-common.postinst +0 -35
- data/ext/debian/puppet-common.postrm +0 -32
- data/ext/debian/puppet-el.dirs +0 -1
- data/ext/debian/puppet-el.emacsen-install +0 -25
- data/ext/debian/puppet-el.emacsen-remove +0 -11
- data/ext/debian/puppet-el.emacsen-startup +0 -9
- data/ext/debian/puppet-el.install +0 -1
- data/ext/debian/puppet-testsuite.install +0 -3
- data/ext/debian/puppet-testsuite.lintian-overrides +0 -4
- data/ext/debian/puppet.NEWS +0 -86
- data/ext/debian/puppet.conf +0 -14
- data/ext/debian/puppet.default +0 -7
- data/ext/debian/puppet.dirs +0 -1
- data/ext/debian/puppet.init +0 -118
- data/ext/debian/puppet.install +0 -4
- data/ext/debian/puppet.lintian-overrides +0 -3
- data/ext/debian/puppet.logrotate +0 -11
- data/ext/debian/puppet.manpages +0 -36
- data/ext/debian/puppet.postinst +0 -20
- data/ext/debian/puppet.postrm +0 -20
- data/ext/debian/puppet.preinst +0 -20
- data/ext/debian/puppetmaster-common.install +0 -5
- data/ext/debian/puppetmaster-common.manpages +0 -5
- data/ext/debian/puppetmaster-common.puppetqd.default +0 -27
- data/ext/debian/puppetmaster-common.puppetqd.init +0 -84
- data/ext/debian/puppetmaster-passenger.dirs +0 -4
- data/ext/debian/puppetmaster-passenger.postinst +0 -66
- data/ext/debian/puppetmaster-passenger.postrm +0 -33
- data/ext/debian/puppetmaster.NEWS +0 -13
- data/ext/debian/puppetmaster.README.debian +0 -16
- data/ext/debian/puppetmaster.default +0 -38
- data/ext/debian/puppetmaster.dirs +0 -1
- data/ext/debian/puppetmaster.init +0 -158
- data/ext/debian/puppetmaster.install +0 -1
- data/ext/debian/puppetmaster.lintian-overrides +0 -3
- data/ext/debian/puppetmaster.manpages +0 -1
- data/ext/debian/puppetmaster.postinst +0 -20
- data/ext/debian/puppetmaster.postrm +0 -5
- data/ext/debian/puppetmaster.preinst +0 -22
- data/ext/debian/rules +0 -127
- data/ext/debian/source/format +0 -1
- data/ext/debian/source/options +0 -1
- data/ext/debian/vim-puppet.README.Debian +0 -13
- data/ext/debian/vim-puppet.dirs +0 -3
- data/ext/debian/vim-puppet.yaml +0 -5
- data/ext/debian/watch +0 -2
- data/ext/osx/file_mapping.yaml +0 -38
- data/ext/osx/preflight.erb +0 -37
- data/ext/packaging/Gemfile +0 -8
- data/ext/packaging/Gemfile.lock +0 -28
- data/ext/packaging/LICENSE +0 -17
- data/ext/packaging/README-Solaris.md +0 -117
- data/ext/packaging/README.md +0 -1074
- data/ext/packaging/lib/packaging.rb +0 -21
- data/ext/packaging/lib/packaging/config.rb +0 -277
- data/ext/packaging/lib/packaging/config/params.rb +0 -175
- data/ext/packaging/lib/packaging/tar.rb +0 -186
- data/ext/packaging/lib/packaging/util.rb +0 -44
- data/ext/packaging/lib/packaging/util/date.rb +0 -15
- data/ext/packaging/lib/packaging/util/file.rb +0 -60
- data/ext/packaging/lib/packaging/util/jira.rb +0 -83
- data/ext/packaging/lib/packaging/util/net.rb +0 -16
- data/ext/packaging/lib/packaging/util/rake_utils.rb +0 -57
- data/ext/packaging/lib/packaging/util/serialization.rb +0 -19
- data/ext/packaging/lib/packaging/util/tool.rb +0 -30
- data/ext/packaging/lib/packaging/util/version.rb +0 -300
- data/ext/packaging/packaging.rake +0 -50
- data/ext/packaging/spec/fixtures/config/ext/build_defaults.yaml +0 -2
- data/ext/packaging/spec/fixtures/config/ext/project_data.yaml +0 -2
- data/ext/packaging/spec/fixtures/config/params.yaml +0 -2
- data/ext/packaging/spec/fixtures/util/pre_tasks.yaml +0 -4
- data/ext/packaging/spec/lib/packaging/config_spec.rb +0 -330
- data/ext/packaging/spec/lib/packaging/tar_spec.rb +0 -122
- data/ext/packaging/spec/lib/packaging/util/file_spec.rb +0 -48
- data/ext/packaging/spec/lib/packaging/util/jira_spec.rb +0 -50
- data/ext/packaging/spec/lib/packaging/util/net_spec.rb +0 -23
- data/ext/packaging/spec/lib/packaging/util/rake_utils_spec.rb +0 -70
- data/ext/packaging/spec/lib/packaging/util/version_spec.rb +0 -67
- data/ext/packaging/spec/lib/packaging_spec.rb +0 -19
- data/ext/packaging/spec/spec_helper.rb +0 -22
- data/ext/packaging/spec/tasks/00_utils_spec.rb +0 -248
- data/ext/packaging/static_artifacts/PackageInfo.plist +0 -3
- data/ext/packaging/tasks/00_utils.rake +0 -402
- data/ext/packaging/tasks/30_metrics.rake +0 -33
- data/ext/packaging/tasks/apple.rake +0 -267
- data/ext/packaging/tasks/build.rake +0 -12
- data/ext/packaging/tasks/clean.rake +0 -5
- data/ext/packaging/tasks/deb.rake +0 -127
- data/ext/packaging/tasks/deb_repos.rake +0 -128
- data/ext/packaging/tasks/doc.rake +0 -20
- data/ext/packaging/tasks/fetch.rake +0 -58
- data/ext/packaging/tasks/gem.rake +0 -158
- data/ext/packaging/tasks/ips.rake +0 -122
- data/ext/packaging/tasks/jenkins.rake +0 -360
- data/ext/packaging/tasks/jenkins_dynamic.rake +0 -123
- data/ext/packaging/tasks/load_extras.rake +0 -21
- data/ext/packaging/tasks/mock.rake +0 -290
- data/ext/packaging/tasks/pe_deb.rake +0 -12
- data/ext/packaging/tasks/pe_remote.rake +0 -41
- data/ext/packaging/tasks/pe_rpm.rake +0 -13
- data/ext/packaging/tasks/pe_ship.rake +0 -179
- data/ext/packaging/tasks/pe_sign.rake +0 -47
- data/ext/packaging/tasks/pe_tar.rake +0 -5
- data/ext/packaging/tasks/release.rake +0 -91
- data/ext/packaging/tasks/remote_build.rake +0 -158
- data/ext/packaging/tasks/retrieve.rake +0 -45
- data/ext/packaging/tasks/rpm.rake +0 -71
- data/ext/packaging/tasks/rpm_repos.rake +0 -139
- data/ext/packaging/tasks/ship.rake +0 -192
- data/ext/packaging/tasks/sign.rake +0 -164
- data/ext/packaging/tasks/tag.rake +0 -8
- data/ext/packaging/tasks/tar.rake +0 -34
- data/ext/packaging/tasks/tickets.rake +0 -449
- data/ext/packaging/tasks/update.rake +0 -16
- data/ext/packaging/tasks/vendor_gems.rake +0 -110
- data/ext/packaging/tasks/version.rake +0 -33
- data/ext/packaging/tasks/z_data_dump.rake +0 -65
- data/ext/packaging/templates/README +0 -1
- data/ext/packaging/templates/downstream.xml.erb +0 -45
- data/ext/packaging/templates/packaging.xml.erb +0 -330
- data/ext/packaging/templates/repo.xml.erb +0 -106
- data/ext/project_data.yaml +0 -24
- data/lib/puppet/file_system.rb +0 -3
- data/lib/puppet/file_system/path_pattern.rb +0 -97
- data/lib/puppet/indirector/certificate/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/errors.rb +0 -5
- data/lib/puppet/indirector/inventory/yaml.rb +0 -81
- data/lib/puppet/indirector/key/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/resource/validator.rb +0 -8
- data/lib/puppet/network/handler.rb +0 -50
- data/lib/puppet/network/handler/ca.rb +0 -61
- data/lib/puppet/network/handler/filebucket.rb +0 -53
- data/lib/puppet/network/handler/fileserver.rb +0 -732
- data/lib/puppet/network/handler/master.rb +0 -87
- data/lib/puppet/network/handler/report.rb +0 -82
- data/lib/puppet/network/handler/runner.rb +0 -33
- data/lib/puppet/network/handler/status.rb +0 -18
- data/lib/puppet/network/http/rack/xmlrpc.rb +0 -65
- data/lib/puppet/network/http_server.rb +0 -3
- data/lib/puppet/network/http_server/mongrel.rb +0 -129
- data/lib/puppet/network/rest_authconfig.rb +0 -102
- data/lib/puppet/network/rest_authorization.rb +0 -23
- data/lib/puppet/network/xmlrpc/processor.rb +0 -86
- data/lib/puppet/network/xmlrpc/server.rb +0 -19
- data/lib/puppet/network/xmlrpc/webrick_servlet.rb +0 -114
- data/lib/puppet/node/inventory.rb +0 -7
- data/lib/puppet/reference/network.rb +0 -39
- data/lib/puppet/transportable.rb +0 -248
- data/lib/puppet/util/autoload/file_cache.rb +0 -92
- data/lib/puppet/util/file_locking.rb +0 -47
- data/lib/puppet/util/settings.rb +0 -926
- data/lib/puppet/util/settings/setting.rb +0 -94
- data/lib/puppet/util/windows/sid.rb +0 -96
- data/lib/puppet/vendor.rb +0 -55
- data/lib/puppet/vendor/load_safe_yaml.rb +0 -1
- data/lib/puppet/vendor/require_vendored.rb +0 -4
- 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/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/man/man8/filebucket.8 +0 -81
- data/man/man8/pi.8 +0 -51
- data/man/man8/puppetca.8 +0 -97
- data/man/man8/puppetd.8 +0 -154
- data/man/man8/puppetdoc.8 +0 -113
- data/man/man8/puppetmasterd.8 +0 -78
- data/man/man8/puppetqd.8 +0 -55
- data/man/man8/puppetrun.8 +0 -127
- data/man/man8/ralsh.8 +0 -84
- data/spec/integration/network/handler_spec.rb +0 -24
- data/spec/integration/network/rest_authconfig_spec.rb +0 -164
- data/spec/integration/util/file_locking_spec.rb +0 -56
- data/spec/unit/agent_backward_compatibility_spec.rb +0 -152
- data/spec/unit/file_system/path_pattern_spec.rb +0 -139
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +0 -194
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/inventory/yaml_spec.rb +0 -220
- data/spec/unit/indirector/key/disabled_ca_spec.rb +0 -33
- data/spec/unit/network/handler/ca_spec.rb +0 -87
- data/spec/unit/network/handler/fileserver_spec.rb +0 -201
- data/spec/unit/network/http/mongrel/xmlrpc_spec.rb +0 -0
- data/spec/unit/network/http/rack/xmlrpc_spec.rb +0 -155
- data/spec/unit/network/http/webrick/xmlrpc_spec.rb +0 -0
- data/spec/unit/network/rest_authconfig_spec.rb +0 -142
- data/spec/unit/other/transbucket_spec.rb +0 -184
- data/spec/unit/other/transobject_spec.rb +0 -111
- data/spec/unit/provider/zfs/solaris_spec.rb +0 -99
- data/spec/unit/provider/zpool/solaris_spec.rb +0 -208
- data/spec/unit/transportable_spec.rb +0 -0
- data/spec/unit/util/autoload/file_cache_spec.rb +0 -158
- data/spec/unit/util/file_locking_spec.rb +0 -159
- data/spec/unit/util/settings_spec.rb +0 -1088
- data/spec/unit/util/windows/sid_spec.rb +0 -100
- data/test/README +0 -24
- data/test/Rakefile +0 -96
- data/test/data/failers/badclassnoparam +0 -10
- data/test/data/failers/badclassparam +0 -10
- data/test/data/failers/badcompnoparam +0 -9
- data/test/data/failers/badcompparam +0 -9
- data/test/data/failers/badtypeparam +0 -3
- data/test/data/failers/noobjectrvalue +0 -1
- data/test/data/providers/cron/crontab.allthree +0 -17
- data/test/data/providers/cron/crontab.envNcomment +0 -12
- data/test/data/providers/cron/crontab.envNname +0 -11
- data/test/data/providers/cron/crontab.multirecords +0 -12
- data/test/data/providers/cron/crontab_collections.yaml +0 -44
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +0 -54
- data/test/data/providers/cron/examples/freebsd +0 -2
- data/test/data/providers/cron/examples/one +0 -14
- data/test/data/providers/cron/examples/openbsd +0 -20
- data/test/data/providers/host/parsed/valid_hosts +0 -19
- data/test/data/providers/mailalias/aliases/test1 +0 -28
- data/test/data/providers/mount/parsed/aix.mount +0 -7
- data/test/data/providers/mount/parsed/darwin.mount +0 -6
- data/test/data/providers/mount/parsed/hpux.mount +0 -17
- data/test/data/providers/mount/parsed/linux.mount +0 -5
- data/test/data/providers/mount/parsed/solaris.mount +0 -6
- data/test/data/providers/package/testpackages.yaml +0 -65
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +0 -7
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys1 +0 -3
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys2 +0 -1
- data/test/data/reports/1.yaml +0 -108
- data/test/data/reports/2.yaml +0 -108
- data/test/data/reports/tagmail_failers.conf +0 -3
- data/test/data/reports/tagmail_passers.conf +0 -30
- data/test/data/snippets/aliastest.pp +0 -16
- data/test/data/snippets/append.pp +0 -11
- data/test/data/snippets/argumentdefaults +0 -14
- data/test/data/snippets/arithmetic_expression.pp +0 -8
- data/test/data/snippets/arraytrailingcomma.pp +0 -3
- data/test/data/snippets/casestatement.pp +0 -65
- data/test/data/snippets/classheirarchy.pp +0 -15
- data/test/data/snippets/classincludes.pp +0 -17
- data/test/data/snippets/classpathtest +0 -11
- data/test/data/snippets/collection.pp +0 -10
- data/test/data/snippets/collection_override.pp +0 -8
- data/test/data/snippets/collection_within_virtual_definitions.pp +0 -20
- data/test/data/snippets/componentmetaparams.pp +0 -11
- data/test/data/snippets/componentrequire.pp +0 -8
- data/test/data/snippets/deepclassheirarchy.pp +0 -23
- data/test/data/snippets/defineoverrides.pp +0 -17
- data/test/data/snippets/emptyclass.pp +0 -9
- data/test/data/snippets/emptyexec.pp +0 -3
- data/test/data/snippets/emptyifelse.pp +0 -9
- data/test/data/snippets/falsevalues.pp +0 -3
- data/test/data/snippets/filecreate +0 -11
- data/test/data/snippets/fqdefinition.pp +0 -5
- data/test/data/snippets/fqparents.pp +0 -11
- data/test/data/snippets/funccomma.pp +0 -5
- data/test/data/snippets/hash.pp +0 -33
- data/test/data/snippets/ifexpression.pp +0 -12
- data/test/data/snippets/implicititeration +0 -15
- data/test/data/snippets/multilinecomments.pp +0 -10
- data/test/data/snippets/multipleclass.pp +0 -9
- data/test/data/snippets/multipleinstances +0 -7
- data/test/data/snippets/multisubs.pp +0 -13
- data/test/data/snippets/namevartest +0 -9
- data/test/data/snippets/scopetest +0 -13
- data/test/data/snippets/selectorvalues.pp +0 -49
- data/test/data/snippets/simpledefaults +0 -5
- data/test/data/snippets/simpleselector +0 -38
- data/test/data/snippets/singleary.pp +0 -19
- data/test/data/snippets/singlequote.pp +0 -11
- data/test/data/snippets/singleselector.pp +0 -22
- data/test/data/snippets/subclass_name_duplication.pp +0 -11
- data/test/data/snippets/tag.pp +0 -9
- data/test/data/snippets/tagged.pp +0 -35
- data/test/data/snippets/virtualresources.pp +0 -14
- data/test/data/types/hosts/1 +0 -3
- data/test/data/types/hosts/2 +0 -13
- data/test/data/types/hosts/solaris +0 -5
- data/test/data/types/mailalias/file1 +0 -183
- data/test/data/types/mount/freebsd.fstab +0 -7
- data/test/data/types/mount/linux.fstab +0 -12
- data/test/data/types/mount/solaris.fstab +0 -12
- data/test/data/types/port/1 +0 -533
- data/test/data/types/port/darwin +0 -11866
- data/test/data/types/ssh_authorized_key/1 +0 -2
- data/test/data/types/yumrepos/fedora-devel.repo +0 -26
- data/test/data/types/yumrepos/fedora.repo +0 -9
- data/test/language/ast.rb +0 -90
- data/test/language/ast/variable.rb +0 -25
- data/test/language/functions.rb +0 -540
- data/test/language/parser.rb +0 -739
- data/test/language/scope.rb +0 -261
- data/test/language/snippets.rb +0 -512
- data/test/language/transportable.rb +0 -87
- data/test/lib/puppettest.rb +0 -307
- data/test/lib/puppettest/certificates.rb +0 -74
- data/test/lib/puppettest/exetest.rb +0 -125
- data/test/lib/puppettest/fakes.rb +0 -199
- data/test/lib/puppettest/fileparsing.rb +0 -28
- data/test/lib/puppettest/filetesting.rb +0 -221
- data/test/lib/puppettest/parsertesting.rb +0 -424
- data/test/lib/puppettest/railstesting.rb +0 -18
- data/test/lib/puppettest/reporttesting.rb +0 -16
- data/test/lib/puppettest/resourcetesting.rb +0 -54
- data/test/lib/puppettest/runnable_test.rb +0 -43
- data/test/lib/puppettest/servertest.rb +0 -77
- data/test/lib/puppettest/support.rb +0 -8
- data/test/lib/puppettest/support/assertions.rb +0 -69
- data/test/lib/puppettest/support/helpers.rb +0 -18
- data/test/lib/puppettest/support/resources.rb +0 -31
- data/test/lib/puppettest/support/utils.rb +0 -141
- data/test/lib/puppettest/testcase.rb +0 -24
- data/test/lib/rake/puppet_test_loader.rb +0 -14
- data/test/lib/rake/puppet_testtask.rb +0 -19
- data/test/lib/stubba.rb +0 -2
- data/test/network/authconfig.rb +0 -69
- data/test/network/authorization.rb +0 -138
- data/test/network/authstore.rb +0 -538
- data/test/network/client_request.rb +0 -38
- data/test/network/handler/fileserver.rb +0 -1266
- data/test/network/handler/master.rb +0 -93
- data/test/network/handler/report.rb +0 -47
- data/test/network/handler/runner.rb +0 -20
- data/test/network/rights.rb +0 -40
- data/test/network/xmlrpc/processor.rb +0 -79
- data/test/network/xmlrpc/server.rb +0 -26
- data/test/network/xmlrpc/webrick_servlet.rb +0 -35
- data/test/other/provider.rb +0 -90
- data/test/other/puppet.rb +0 -85
- data/test/other/relationships.rb +0 -91
- data/test/other/report.rb +0 -135
- data/test/other/transactions.rb +0 -395
- data/test/puppet/defaults.rb +0 -65
- data/test/rails/rails.rb +0 -24
- data/test/rails/railsparameter.rb +0 -80
- data/test/ral/manager/attributes.rb +0 -296
- data/test/ral/manager/instances.rb +0 -88
- data/test/ral/manager/manager.rb +0 -50
- data/test/ral/manager/provider.rb +0 -84
- data/test/ral/manager/type.rb +0 -361
- data/test/ral/providers/cron/crontab.rb +0 -652
- data/test/ral/providers/group.rb +0 -242
- data/test/ral/providers/host/parsed.rb +0 -32
- data/test/ral/providers/mailalias/aliases.rb +0 -55
- data/test/ral/providers/nameservice.rb +0 -32
- data/test/ral/providers/package.rb +0 -245
- data/test/ral/providers/package/aptitude.rb +0 -83
- data/test/ral/providers/package/aptrpm.rb +0 -100
- data/test/ral/providers/parsedfile.rb +0 -695
- data/test/ral/providers/port/parsed.rb +0 -232
- data/test/ral/providers/provider.rb +0 -529
- data/test/ral/providers/service/base.rb +0 -76
- data/test/ral/providers/sshkey/parsed.rb +0 -112
- data/test/ral/providers/user.rb +0 -586
- data/test/ral/providers/user/useradd.rb +0 -233
- data/test/ral/type/cron.rb +0 -505
- data/test/ral/type/exec.rb +0 -717
- data/test/ral/type/file.rb +0 -912
- data/test/ral/type/file/target.rb +0 -346
- data/test/ral/type/fileignoresource.rb +0 -265
- data/test/ral/type/filesources.rb +0 -446
- data/test/ral/type/host.rb +0 -180
- data/test/ral/type/mailalias.rb +0 -45
- data/test/ral/type/port.rb +0 -147
- data/test/ral/type/resources.rb +0 -104
- data/test/ral/type/service.rb +0 -38
- data/test/ral/type/sshkey.rb +0 -148
- data/test/ral/type/user.rb +0 -167
- data/test/ral/type/yumrepo.rb +0 -116
- data/test/ral/type/zone.rb +0 -447
- data/test/test +0 -241
- data/test/util/classgen.rb +0 -241
- data/test/util/execution.rb +0 -33
- data/test/util/fileparsing.rb +0 -721
- data/test/util/inifile.rb +0 -138
- data/test/util/instance_loader.rb +0 -52
- data/test/util/log.rb +0 -219
- data/test/util/metrics.rb +0 -72
- data/test/util/package.rb +0 -25
- data/test/util/pidlock.rb +0 -125
- data/test/util/settings.rb +0 -773
- data/test/util/storage.rb +0 -81
- data/test/util/subclass_loader.rb +0 -89
- data/test/util/utiltest.rb +0 -223
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
require 'puppet/parser/relationship'
|
@@ -7,8 +7,6 @@ describe Puppet::Parser::Relationship do
|
|
7
7
|
before do
|
8
8
|
@source = Puppet::Resource.new(:mytype, "source")
|
9
9
|
@target = Puppet::Resource.new(:mytype, "target")
|
10
|
-
@extra_resource = Puppet::Resource.new(:mytype, "extra")
|
11
|
-
@extra_resource2 = Puppet::Resource.new(:mytype, "extra2")
|
12
10
|
@dep = Puppet::Parser::Relationship.new(@source, @target, :relationship)
|
13
11
|
end
|
14
12
|
|
@@ -17,8 +15,6 @@ describe Puppet::Parser::Relationship do
|
|
17
15
|
@catalog = Puppet::Resource::Catalog.new
|
18
16
|
@catalog.add_resource(@source)
|
19
17
|
@catalog.add_resource(@target)
|
20
|
-
@catalog.add_resource(@extra_resource)
|
21
|
-
@catalog.add_resource(@extra_resource2)
|
22
18
|
end
|
23
19
|
|
24
20
|
it "should fail if the source resource cannot be found" do
|
@@ -48,30 +44,10 @@ describe Puppet::Parser::Relationship do
|
|
48
44
|
it "should supplement rather than clobber existing relationship values" do
|
49
45
|
@source[:before] = "File[/bar]"
|
50
46
|
@dep.evaluate(@catalog)
|
51
|
-
# this test did not work before. It was appending the resources
|
52
|
-
# together as a string
|
53
|
-
(@source[:before].class == Array).should be_true
|
54
47
|
@source[:before].should be_include("Mytype[target]")
|
55
48
|
@source[:before].should be_include("File[/bar]")
|
56
49
|
end
|
57
50
|
|
58
|
-
it "should supplement rather than clobber existing resource relationships" do
|
59
|
-
@source[:before] = @extra_resource
|
60
|
-
@dep.evaluate(@catalog)
|
61
|
-
(@source[:before].class == Array).should be_true
|
62
|
-
@source[:before].should be_include("Mytype[target]")
|
63
|
-
@source[:before].should be_include(@extra_resource)
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should supplement rather than clobber multiple existing resource relationships" do
|
67
|
-
@source[:before] = [@extra_resource, @extra_resource2]
|
68
|
-
@dep.evaluate(@catalog)
|
69
|
-
(@source[:before].class == Array).should be_true
|
70
|
-
@source[:before].should be_include("Mytype[target]")
|
71
|
-
@source[:before].should be_include(@extra_resource)
|
72
|
-
@source[:before].should be_include(@extra_resource2)
|
73
|
-
end
|
74
|
-
|
75
51
|
it "should use the collected retargets if the target is a Collector" do
|
76
52
|
orig_target = @target
|
77
53
|
@target = Puppet::Parser::Collector.new(stub("scope"), :file, "equery", "vquery", :virtual)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
4
|
# LAK: FIXME This is just new tests for resources; I have
|
@@ -109,8 +109,10 @@ describe Puppet::Parser::Resource do
|
|
109
109
|
@arguments = {:scope => @scope}
|
110
110
|
end
|
111
111
|
|
112
|
-
it "should fail unless #{name.to_s} is specified"
|
113
|
-
|
112
|
+
it "should fail unless #{name.to_s} is specified" do
|
113
|
+
expect {
|
114
|
+
Puppet::Parser::Resource.new('file', '/my/file')
|
115
|
+
}.to raise_error(ArgumentError, /Resources require a hash as last argument/)
|
114
116
|
end
|
115
117
|
|
116
118
|
it "should set the reference correctly" do
|
@@ -133,7 +135,7 @@ describe Puppet::Parser::Resource do
|
|
133
135
|
@catalog = Puppet::Resource::Catalog.new
|
134
136
|
source = stub('source')
|
135
137
|
source.stubs(:module_name)
|
136
|
-
@scope = Puppet::Parser::Scope.new(
|
138
|
+
@scope = Puppet::Parser::Scope.new(@compiler, :source => source)
|
137
139
|
@catalog.add_resource(Puppet::Parser::Resource.new("stage", :main, :scope => @scope))
|
138
140
|
end
|
139
141
|
|
@@ -159,8 +161,8 @@ describe Puppet::Parser::Resource do
|
|
159
161
|
res.evaluate
|
160
162
|
end
|
161
163
|
|
162
|
-
it "should add an edge to any specified stage for class resources"
|
163
|
-
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo",
|
164
|
+
it "should add an edge to any specified stage for class resources" do
|
165
|
+
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", {})
|
164
166
|
|
165
167
|
other_stage = Puppet::Parser::Resource.new(:stage, "other", :scope => @scope, :catalog => @catalog)
|
166
168
|
@compiler.add_resource(@scope, other_stage)
|
@@ -173,8 +175,8 @@ describe Puppet::Parser::Resource do
|
|
173
175
|
@compiler.catalog.edge?(other_stage, resource).should be_true
|
174
176
|
end
|
175
177
|
|
176
|
-
it "should fail if an unknown stage is specified"
|
177
|
-
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo",
|
178
|
+
it "should fail if an unknown stage is specified" do
|
179
|
+
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", {})
|
178
180
|
|
179
181
|
resource = Puppet::Parser::Resource.new(:class, "foo", :scope => @scope, :catalog => @catalog)
|
180
182
|
resource[:stage] = 'other'
|
@@ -182,11 +184,11 @@ describe Puppet::Parser::Resource do
|
|
182
184
|
lambda { resource.evaluate }.should raise_error(ArgumentError, /Could not find stage other specified by/)
|
183
185
|
end
|
184
186
|
|
185
|
-
it "should add edges from the class resources to the parent's stage if no stage is specified"
|
187
|
+
it "should add edges from the class resources to the parent's stage if no stage is specified" do
|
186
188
|
main = @compiler.catalog.resource(:stage, :main)
|
187
189
|
foo_stage = Puppet::Parser::Resource.new(:stage, :foo_stage, :scope => @scope, :catalog => @catalog)
|
188
190
|
@compiler.add_resource(@scope, foo_stage)
|
189
|
-
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo",
|
191
|
+
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", {})
|
190
192
|
resource = Puppet::Parser::Resource.new(:class, "foo", :scope => @scope, :catalog => @catalog)
|
191
193
|
resource[:stage] = 'foo_stage'
|
192
194
|
@compiler.add_resource(@scope, resource)
|
@@ -240,9 +242,9 @@ describe Puppet::Parser::Resource do
|
|
240
242
|
edges.should include(["Stage[after]", "Class[Beta]"])
|
241
243
|
end
|
242
244
|
|
243
|
-
it "should add edges from top-level class resources to the main stage if no stage is specified"
|
245
|
+
it "should add edges from top-level class resources to the main stage if no stage is specified" do
|
244
246
|
main = @compiler.catalog.resource(:stage, :main)
|
245
|
-
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo",
|
247
|
+
@compiler.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "foo", {})
|
246
248
|
resource = Puppet::Parser::Resource.new(:class, "foo", :scope => @scope, :catalog => @catalog)
|
247
249
|
@compiler.add_resource(@scope, resource)
|
248
250
|
|
@@ -262,7 +264,7 @@ describe Puppet::Parser::Resource do
|
|
262
264
|
|
263
265
|
it "should do nothing if it has already been finished" do
|
264
266
|
@resource.finish
|
265
|
-
@resource.expects(:
|
267
|
+
@resource.expects(:add_defaults).never
|
266
268
|
@resource.finish
|
267
269
|
end
|
268
270
|
|
@@ -291,52 +293,6 @@ describe Puppet::Parser::Resource do
|
|
291
293
|
|
292
294
|
@resource[:owner].should == "other"
|
293
295
|
end
|
294
|
-
|
295
|
-
it "should be running in metaparam compatibility mode if running a version below 0.25" do
|
296
|
-
catalog = stub 'catalog', :client_version => "0.24.8"
|
297
|
-
@resource.stubs(:catalog).returns catalog
|
298
|
-
@resource.should be_metaparam_compatibility_mode
|
299
|
-
end
|
300
|
-
|
301
|
-
it "should be running in metaparam compatibility mode if running no client version is available" do
|
302
|
-
catalog = stub 'catalog', :client_version => nil
|
303
|
-
@resource.stubs(:catalog).returns catalog
|
304
|
-
@resource.should be_metaparam_compatibility_mode
|
305
|
-
end
|
306
|
-
|
307
|
-
it "should not be running in metaparam compatibility mode if running a version at or above 0.25" do
|
308
|
-
catalog = stub 'catalog', :client_version => "0.25.0"
|
309
|
-
@resource.stubs(:catalog).returns catalog
|
310
|
-
@resource.should_not be_metaparam_compatibility_mode
|
311
|
-
end
|
312
|
-
|
313
|
-
it "should not copy relationship metaparams when not in metaparam compatibility mode" do
|
314
|
-
@scope.setvar("require", "bar")
|
315
|
-
|
316
|
-
@resource.stubs(:metaparam_compatibility_mode?).returns false
|
317
|
-
@resource.class.publicize_methods(:add_metaparams) { @resource.add_metaparams }
|
318
|
-
|
319
|
-
@resource["require"].should be_nil
|
320
|
-
end
|
321
|
-
|
322
|
-
it "should copy relationship metaparams when in metaparam compatibility mode" do
|
323
|
-
@scope.setvar("require", "bar")
|
324
|
-
|
325
|
-
@resource.stubs(:metaparam_compatibility_mode?).returns true
|
326
|
-
@resource.class.publicize_methods(:add_metaparams) { @resource.add_metaparams }
|
327
|
-
|
328
|
-
@resource["require"].should == "bar"
|
329
|
-
end
|
330
|
-
|
331
|
-
it "should stack relationship metaparams when in metaparam compatibility mode" do
|
332
|
-
@resource.set_parameter("require", "foo")
|
333
|
-
@scope.setvar("require", "bar")
|
334
|
-
|
335
|
-
@resource.stubs(:metaparam_compatibility_mode?).returns true
|
336
|
-
@resource.class.publicize_methods(:add_metaparams) { @resource.add_metaparams }
|
337
|
-
|
338
|
-
@resource["require"].should == ["foo", "bar"]
|
339
|
-
end
|
340
296
|
end
|
341
297
|
|
342
298
|
describe "when being tagged" do
|
@@ -492,26 +448,6 @@ describe Puppet::Parser::Resource do
|
|
492
448
|
@resource.should respond_to(:to_resource)
|
493
449
|
end
|
494
450
|
|
495
|
-
it "should use its resource converter to convert to a transportable resource" do
|
496
|
-
@source = stub 'scope', :name => "myscope"
|
497
|
-
@resource = mkresource :source => @source
|
498
|
-
|
499
|
-
newresource = Puppet::Resource.new(:file, "/my")
|
500
|
-
Puppet::Resource.expects(:new).returns(newresource)
|
501
|
-
|
502
|
-
newresource.expects(:to_trans).returns "mytrans"
|
503
|
-
|
504
|
-
@resource.to_trans.should == "mytrans"
|
505
|
-
end
|
506
|
-
|
507
|
-
it "should return nil if converted to a transportable resource and it is virtual" do
|
508
|
-
@source = stub 'scope', :name => "myscope"
|
509
|
-
@resource = mkresource :source => @source
|
510
|
-
|
511
|
-
@resource.expects(:virtual?).returns true
|
512
|
-
@resource.to_trans.should be_nil
|
513
|
-
end
|
514
|
-
|
515
451
|
describe "when being converted to a resource" do
|
516
452
|
before do
|
517
453
|
@parser_resource = mkresource :scope => @scope, :parameters => {:foo => "bar", :fee => "fum"}
|
@@ -1,18 +1,37 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'puppet_spec/compiler'
|
4
4
|
|
5
5
|
describe Puppet::Parser::Scope do
|
6
6
|
before :each do
|
7
|
-
@scope = Puppet::Parser::Scope.new
|
8
|
-
|
7
|
+
@scope = Puppet::Parser::Scope.new(
|
8
|
+
Puppet::Parser::Compiler.new(Puppet::Node.new("foo"))
|
9
|
+
)
|
9
10
|
@scope.source = Puppet::Resource::Type.new(:node, :foo)
|
10
11
|
@topscope = @scope.compiler.topscope
|
11
12
|
@scope.parent = @topscope
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
describe ".new_for_test_harness" do
|
16
|
+
let(:node_name) { "node_name_foo" }
|
17
|
+
let(:scope) { described_class.new_for_test_harness(node_name) }
|
18
|
+
|
19
|
+
it "should be a kind of Scope" do
|
20
|
+
scope.should be_a_kind_of Puppet::Parser::Scope
|
21
|
+
end
|
22
|
+
it "should set the source to a node resource" do
|
23
|
+
scope.source.should be_a_kind_of Puppet::Resource::Type
|
24
|
+
end
|
25
|
+
it "should have a compiler" do
|
26
|
+
scope.compiler.should be_a_kind_of Puppet::Parser::Compiler
|
27
|
+
end
|
28
|
+
it "should set the parent to the compiler topscope" do
|
29
|
+
scope.parent.should be scope.compiler.topscope
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should return a scope for use in a test harness" do
|
34
|
+
described_class.new_for_test_harness("node_name_foo").should be_a_kind_of Puppet::Parser::Scope
|
16
35
|
end
|
17
36
|
|
18
37
|
it "should be able to retrieve class scopes by name" do
|
@@ -42,12 +61,24 @@ describe Puppet::Parser::Scope do
|
|
42
61
|
end
|
43
62
|
|
44
63
|
it "should get its environment from its compiler" do
|
45
|
-
env =
|
46
|
-
compiler = stub 'compiler', :environment => env
|
47
|
-
scope = Puppet::Parser::Scope.new
|
64
|
+
env = Puppet::Node::Environment.new
|
65
|
+
compiler = stub 'compiler', :environment => env, :is_a? => true
|
66
|
+
scope = Puppet::Parser::Scope.new(compiler)
|
48
67
|
scope.environment.should equal(env)
|
49
68
|
end
|
50
69
|
|
70
|
+
it "should fail if no compiler is supplied" do
|
71
|
+
expect {
|
72
|
+
Puppet::Parser::Scope.new
|
73
|
+
}.to raise_error(ArgumentError, /wrong number of arguments/)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "should fail if something that isn't a compiler is supplied" do
|
77
|
+
expect {
|
78
|
+
Puppet::Parser::Scope.new(:compiler => true)
|
79
|
+
}.to raise_error(Puppet::DevError, /you must pass a compiler instance/)
|
80
|
+
end
|
81
|
+
|
51
82
|
it "should use the resource type collection helper to find its known resource types" do
|
52
83
|
Puppet::Parser::Scope.ancestors.should include(Puppet::Resource::TypeCollectionHelper)
|
53
84
|
end
|
@@ -56,7 +87,7 @@ describe Puppet::Parser::Scope do
|
|
56
87
|
before :each do
|
57
88
|
@env = Puppet::Node::Environment.new('testing')
|
58
89
|
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new('foo', :environment => @env))
|
59
|
-
@scope = Puppet::Parser::Scope.new(
|
90
|
+
@scope = Puppet::Parser::Scope.new(@compiler)
|
60
91
|
end
|
61
92
|
|
62
93
|
it "should load and call the method if it looks like a function and it exists" do
|
@@ -75,82 +106,88 @@ describe Puppet::Parser::Scope do
|
|
75
106
|
describe "when initializing" do
|
76
107
|
it "should extend itself with its environment's Functions module as well as the default" do
|
77
108
|
env = Puppet::Node::Environment.new("myenv")
|
78
|
-
|
79
|
-
|
80
|
-
root_mod = Module.new
|
81
|
-
Puppet::Parser::Functions.expects(:environment_module).with(Puppet::Node::Environment.root).returns root_mod
|
82
|
-
Puppet::Parser::Functions.expects(:environment_module).with(env).returns mod
|
109
|
+
root = Puppet::Node::Environment.root
|
110
|
+
compiler = stub 'compiler', :environment => env, :is_a? => true
|
83
111
|
|
84
|
-
Puppet::Parser::Scope.new(
|
112
|
+
scope = Puppet::Parser::Scope.new(compiler)
|
113
|
+
scope.singleton_class.ancestors.should be_include(Puppet::Parser::Functions.environment_module(env))
|
114
|
+
scope.singleton_class.ancestors.should be_include(Puppet::Parser::Functions.environment_module(root))
|
85
115
|
end
|
86
116
|
|
87
|
-
it "should extend itself with the default Functions module if
|
88
|
-
|
89
|
-
Puppet::
|
90
|
-
|
91
|
-
Puppet::Parser::
|
92
|
-
|
93
|
-
Puppet::Parser::Scope.new.singleton_class.ancestors.should be_include(mod)
|
117
|
+
it "should extend itself with the default Functions module if its environment is the default" do
|
118
|
+
root = Puppet::Node::Environment.root
|
119
|
+
node = Puppet::Node.new('localhost')
|
120
|
+
compiler = Puppet::Parser::Compiler.new(node)
|
121
|
+
scope = Puppet::Parser::Scope.new(compiler)
|
122
|
+
scope.singleton_class.ancestors.should be_include(Puppet::Parser::Functions.environment_module(root))
|
94
123
|
end
|
95
124
|
end
|
96
125
|
|
97
126
|
describe "when looking up a variable" do
|
98
|
-
it "should
|
99
|
-
@scope.
|
127
|
+
it "should support :lookupvar and :setvar for backward compatibility" do
|
128
|
+
@scope.setvar("var", "yep")
|
129
|
+
@scope.lookupvar("var").should == "yep"
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should return nil for unset variables" do
|
133
|
+
@scope["var"].should be_nil
|
100
134
|
end
|
101
135
|
|
102
136
|
it "should be able to look up values" do
|
103
|
-
@scope
|
104
|
-
@scope
|
137
|
+
@scope["var"] = "yep"
|
138
|
+
@scope["var"].should == "yep"
|
105
139
|
end
|
106
140
|
|
107
141
|
it "should be able to look up hashes" do
|
108
|
-
@scope
|
109
|
-
@scope
|
142
|
+
@scope["var"] = {"a" => "b"}
|
143
|
+
@scope["var"].should == {"a" => "b"}
|
110
144
|
end
|
111
145
|
|
112
146
|
it "should be able to look up variables in parent scopes" do
|
113
|
-
@topscope
|
114
|
-
@scope
|
147
|
+
@topscope["var"] = "parentval"
|
148
|
+
@scope["var"].should == "parentval"
|
115
149
|
end
|
116
150
|
|
117
151
|
it "should prefer its own values to parent values" do
|
118
|
-
@topscope
|
119
|
-
@scope
|
120
|
-
@scope
|
152
|
+
@topscope["var"] = "parentval"
|
153
|
+
@scope["var"] = "childval"
|
154
|
+
@scope["var"].should == "childval"
|
121
155
|
end
|
122
156
|
|
123
|
-
it "should be able to
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
Puppet.expects(:deprecation_warning).with("Dynamic lookup of $var2 is deprecated. For more information, see http://docs.puppetlabs.com/guides/scope_and_puppet.html. To see the change in behavior, use the --debug flag.")
|
128
|
-
Puppet.expects(:debug).with("Currently $var2 is #{dynamic_value.inspect}")
|
129
|
-
Puppet.expects(:debug).with("In the future $var2 will be #{topscope_value.inspect}")
|
130
|
-
|
131
|
-
thirdscope = Puppet::Parser::Scope.new(:parent => @scope, :source => Puppet::Resource::Type.new(:hostclass, :foo, :module_name => "foo"))
|
132
|
-
|
133
|
-
@topscope.setvar("var2", topscope_value)
|
134
|
-
@scope.setvar("var2", dynamic_value)
|
135
|
-
thirdscope.lookupvar("var2").should == dynamic_value
|
157
|
+
it "should be able to detect when variables are set" do
|
158
|
+
@scope["var"] = "childval"
|
159
|
+
@scope.should be_include("var")
|
136
160
|
end
|
137
161
|
|
138
|
-
it "
|
139
|
-
|
162
|
+
it "does not allow changing a set value" do
|
163
|
+
@scope["var"] = "childval"
|
164
|
+
expect {
|
165
|
+
@scope["var"] = "change"
|
166
|
+
}.to raise_error(Puppet::Error, "Cannot reassign variable var")
|
167
|
+
end
|
140
168
|
|
141
|
-
|
142
|
-
|
143
|
-
|
169
|
+
it "should be able to detect when variables are not set" do
|
170
|
+
@scope.should_not be_include("var")
|
171
|
+
end
|
144
172
|
|
145
|
-
|
173
|
+
it "should support iteration over its variables" do
|
174
|
+
@scope["one"] = "two"
|
175
|
+
@scope["three"] = "four"
|
176
|
+
hash = {}
|
177
|
+
@scope.each { |name, value| hash[name] = value }
|
178
|
+
hash.should == {"one" => "two", "three" => "four" }
|
179
|
+
end
|
146
180
|
|
147
|
-
|
148
|
-
|
181
|
+
it "should include Enumerable" do
|
182
|
+
@scope.singleton_class.ancestors.should be_include(Enumerable)
|
149
183
|
end
|
150
184
|
|
151
185
|
describe "and the variable is qualified" do
|
152
186
|
before :each do
|
153
187
|
@known_resource_types = @scope.known_resource_types
|
188
|
+
|
189
|
+
node = Puppet::Node.new('localhost')
|
190
|
+
@compiler = Puppet::Parser::Compiler.new(node)
|
154
191
|
end
|
155
192
|
|
156
193
|
def newclass(name)
|
@@ -161,7 +198,7 @@ describe Puppet::Parser::Scope do
|
|
161
198
|
klass = newclass(name)
|
162
199
|
|
163
200
|
catalog = Puppet::Resource::Catalog.new
|
164
|
-
catalog.add_resource(Puppet::Parser::Resource.new("stage", :main, :scope => Puppet::Parser::Scope.new))
|
201
|
+
catalog.add_resource(Puppet::Parser::Resource.new("stage", :main, :scope => Puppet::Parser::Scope.new(@compiler)))
|
165
202
|
|
166
203
|
Puppet::Parser::Resource.new("class", name, :scope => @scope, :source => mock('source'), :catalog => catalog).evaluate
|
167
204
|
|
@@ -172,566 +209,102 @@ describe Puppet::Parser::Scope do
|
|
172
209
|
Puppet.expects(:deprecation_warning).never
|
173
210
|
other_scope = create_class_scope("")
|
174
211
|
|
175
|
-
other_scope
|
212
|
+
other_scope["othervar"] = "otherval"
|
176
213
|
|
177
|
-
@scope
|
214
|
+
@scope["::othervar"].should == "otherval"
|
178
215
|
end
|
179
216
|
|
180
217
|
it "should be able to look up explicitly fully qualified variables from other scopes" do
|
181
218
|
Puppet.expects(:deprecation_warning).never
|
182
219
|
other_scope = create_class_scope("other")
|
183
220
|
|
184
|
-
other_scope
|
221
|
+
other_scope["var"] = "otherval"
|
185
222
|
|
186
|
-
@scope
|
223
|
+
@scope["::other::var"].should == "otherval"
|
187
224
|
end
|
188
225
|
|
189
226
|
it "should be able to look up deeply qualified variables" do
|
190
227
|
Puppet.expects(:deprecation_warning).never
|
191
228
|
other_scope = create_class_scope("other::deep::klass")
|
192
229
|
|
193
|
-
other_scope
|
230
|
+
other_scope["var"] = "otherval"
|
194
231
|
|
195
|
-
@scope
|
232
|
+
@scope["other::deep::klass::var"].should == "otherval"
|
196
233
|
end
|
197
234
|
|
198
|
-
it "should return
|
199
|
-
Puppet.expects(:deprecation_warning).never
|
235
|
+
it "should return nil for qualified variables that cannot be found in other classes" do
|
200
236
|
other_scope = create_class_scope("other::deep::klass")
|
201
237
|
|
202
|
-
@scope
|
238
|
+
@scope["other::deep::klass::var"].should be_nil
|
203
239
|
end
|
204
240
|
|
205
|
-
it "should warn and return
|
206
|
-
Puppet.expects(:deprecation_warning).never
|
241
|
+
it "should warn and return nil for qualified variables whose classes have not been evaluated" do
|
207
242
|
klass = newclass("other::deep::klass")
|
208
|
-
@scope.expects(:warning)
|
209
|
-
@scope
|
243
|
+
@scope.expects(:warning)
|
244
|
+
@scope["other::deep::klass::var"].should be_nil
|
210
245
|
end
|
211
246
|
|
212
|
-
it "should warn and return
|
213
|
-
|
214
|
-
@scope.
|
215
|
-
@scope.lookupvar("other::deep::klass::var").should == :undefined
|
247
|
+
it "should warn and return nil for qualified variables whose classes do not exist" do
|
248
|
+
@scope.expects(:warning)
|
249
|
+
@scope["other::deep::klass::var"].should be_nil
|
216
250
|
end
|
217
251
|
|
218
|
-
it "should return
|
219
|
-
Puppet.expects(:deprecation_warning).never
|
252
|
+
it "should return nil when asked for a non-string qualified variable from a class that does not exist" do
|
220
253
|
@scope.stubs(:warning)
|
221
|
-
@scope
|
254
|
+
@scope["other::deep::klass::var"].should be_nil
|
222
255
|
end
|
223
256
|
|
224
|
-
it "should return
|
225
|
-
Puppet.expects(:deprecation_warning).never
|
257
|
+
it "should return nil when asked for a non-string qualified variable from a class that has not been evaluated" do
|
226
258
|
@scope.stubs(:warning)
|
227
259
|
klass = newclass("other::deep::klass")
|
228
|
-
@scope
|
229
|
-
end
|
230
|
-
end
|
231
|
-
end
|
232
|
-
|
233
|
-
describe "when mixing inheritence and inclusion" do
|
234
|
-
include PuppetSpec::Compiler
|
235
|
-
|
236
|
-
def expect_the_message_to_be(message)
|
237
|
-
catalog = compile_to_catalog(yield)
|
238
|
-
catalog.resource('Notify', 'something')[:message].should == message
|
239
|
-
end
|
240
|
-
|
241
|
-
context "deprecated scoping" do
|
242
|
-
before :each do
|
243
|
-
Puppet.expects(:deprecation_warning)
|
244
|
-
end
|
245
|
-
|
246
|
-
it "prefers values in its included scope over those from the node (DEPRECATED)" do
|
247
|
-
expect_the_message_to_be('baz_msg') do <<-MANIFEST
|
248
|
-
node default {
|
249
|
-
$var = "node_msg"
|
250
|
-
include foo
|
251
|
-
}
|
252
|
-
class baz {
|
253
|
-
$var = "baz_msg"
|
254
|
-
include bar
|
255
|
-
}
|
256
|
-
class foo inherits baz {
|
257
|
-
}
|
258
|
-
class bar {
|
259
|
-
notify { 'something': message => $var, }
|
260
|
-
}
|
261
|
-
MANIFEST
|
262
|
-
end
|
263
|
-
end
|
264
|
-
|
265
|
-
it "finds values in its included scope (DEPRECATED)" do
|
266
|
-
expect_the_message_to_be('baz_msg') do <<-MANIFEST
|
267
|
-
node default {
|
268
|
-
include baz
|
269
|
-
}
|
270
|
-
class foo {
|
271
|
-
}
|
272
|
-
class bar inherits foo {
|
273
|
-
notify { 'something': message => $var, }
|
274
|
-
}
|
275
|
-
class baz {
|
276
|
-
$var = "baz_msg"
|
277
|
-
include bar
|
278
|
-
}
|
279
|
-
MANIFEST
|
280
|
-
end
|
281
|
-
end
|
282
|
-
|
283
|
-
it "finds values in its included scope for a defined type (DEPRECATED)" do
|
284
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
285
|
-
node default {
|
286
|
-
include foo
|
287
|
-
}
|
288
|
-
class foo {
|
289
|
-
$var = "foo_msg"
|
290
|
-
bar { "testing": }
|
291
|
-
}
|
292
|
-
define bar() {
|
293
|
-
notify { 'something': message => $var, }
|
294
|
-
}
|
295
|
-
MANIFEST
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
|
-
it "recognizes a dynamically scoped boolean (DEPRECATED)" do
|
300
|
-
expect_the_message_to_be(true) do <<-MANIFEST
|
301
|
-
node default {
|
302
|
-
$var = false
|
303
|
-
include baz
|
304
|
-
}
|
305
|
-
class foo {
|
306
|
-
}
|
307
|
-
class bar inherits foo {
|
308
|
-
notify { 'something': message => $var, }
|
309
|
-
}
|
310
|
-
class baz {
|
311
|
-
$var = true
|
312
|
-
include bar
|
313
|
-
}
|
314
|
-
MANIFEST
|
315
|
-
end
|
316
|
-
end
|
317
|
-
end
|
318
|
-
|
319
|
-
context "supported scoping" do
|
320
|
-
before :each do
|
321
|
-
Puppet.expects(:deprecation_warning).never
|
322
|
-
end
|
323
|
-
|
324
|
-
it "finds value define in the inherited node" do
|
325
|
-
expect_the_message_to_be('parent_msg') do <<-MANIFEST
|
326
|
-
$var = "top_msg"
|
327
|
-
node parent {
|
328
|
-
$var = "parent_msg"
|
329
|
-
}
|
330
|
-
node default inherits parent {
|
331
|
-
include foo
|
332
|
-
}
|
333
|
-
class foo {
|
334
|
-
notify { 'something': message => $var, }
|
335
|
-
}
|
336
|
-
MANIFEST
|
337
|
-
end
|
338
|
-
end
|
339
|
-
|
340
|
-
it "finds top scope when the class is included before the node defines the var" do
|
341
|
-
expect_the_message_to_be('top_msg') do <<-MANIFEST
|
342
|
-
$var = "top_msg"
|
343
|
-
node parent {
|
344
|
-
include foo
|
345
|
-
}
|
346
|
-
node default inherits parent {
|
347
|
-
$var = "default_msg"
|
348
|
-
}
|
349
|
-
class foo {
|
350
|
-
notify { 'something': message => $var, }
|
351
|
-
}
|
352
|
-
MANIFEST
|
353
|
-
end
|
354
|
-
end
|
355
|
-
|
356
|
-
it "finds values in its local scope" do
|
357
|
-
expect_the_message_to_be('local_msg') do <<-MANIFEST
|
358
|
-
node default {
|
359
|
-
include baz
|
360
|
-
}
|
361
|
-
class foo {
|
362
|
-
}
|
363
|
-
class bar inherits foo {
|
364
|
-
$var = "local_msg"
|
365
|
-
notify { 'something': message => $var, }
|
366
|
-
}
|
367
|
-
class baz {
|
368
|
-
include bar
|
369
|
-
}
|
370
|
-
MANIFEST
|
371
|
-
end
|
372
|
-
end
|
373
|
-
|
374
|
-
it "finds values in its inherited scope" do
|
375
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
376
|
-
node default {
|
377
|
-
include baz
|
378
|
-
}
|
379
|
-
class foo {
|
380
|
-
$var = "foo_msg"
|
381
|
-
}
|
382
|
-
class bar inherits foo {
|
383
|
-
notify { 'something': message => $var, }
|
384
|
-
}
|
385
|
-
class baz {
|
386
|
-
include bar
|
387
|
-
}
|
388
|
-
MANIFEST
|
389
|
-
end
|
390
|
-
end
|
391
|
-
|
392
|
-
it "prefers values in its local scope over values in the inherited scope" do
|
393
|
-
expect_the_message_to_be('local_msg') do <<-MANIFEST
|
394
|
-
include bar
|
395
|
-
|
396
|
-
class foo {
|
397
|
-
$var = "inherited"
|
398
|
-
}
|
399
|
-
|
400
|
-
class bar inherits foo {
|
401
|
-
$var = "local_msg"
|
402
|
-
notify { 'something': message => $var, }
|
403
|
-
}
|
404
|
-
MANIFEST
|
405
|
-
end
|
406
|
-
end
|
407
|
-
|
408
|
-
it "finds a qualified variable by following parent scopes of the specified scope" do
|
409
|
-
expect_the_message_to_be("from node") do <<-MANIFEST
|
410
|
-
class c {
|
411
|
-
notify { 'something': message => "$a::b" }
|
412
|
-
}
|
413
|
-
|
414
|
-
class a { }
|
415
|
-
|
416
|
-
node default {
|
417
|
-
$b = "from node"
|
418
|
-
include a
|
419
|
-
include c
|
420
|
-
}
|
421
|
-
MANIFEST
|
422
|
-
end
|
423
|
-
end
|
424
|
-
|
425
|
-
it "finds values in its inherited scope when the inherited class is qualified to the top" do
|
426
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
427
|
-
node default {
|
428
|
-
include baz
|
429
|
-
}
|
430
|
-
class foo {
|
431
|
-
$var = "foo_msg"
|
432
|
-
}
|
433
|
-
class bar inherits ::foo {
|
434
|
-
notify { 'something': message => $var, }
|
435
|
-
}
|
436
|
-
class baz {
|
437
|
-
include bar
|
438
|
-
}
|
439
|
-
MANIFEST
|
440
|
-
end
|
441
|
-
end
|
442
|
-
|
443
|
-
it "prefers values in its local scope over values in the inherited scope when the inherited class is fully qualified" do
|
444
|
-
expect_the_message_to_be('local_msg') do <<-MANIFEST
|
445
|
-
include bar
|
446
|
-
|
447
|
-
class foo {
|
448
|
-
$var = "inherited"
|
449
|
-
}
|
450
|
-
|
451
|
-
class bar inherits ::foo {
|
452
|
-
$var = "local_msg"
|
453
|
-
notify { 'something': message => $var, }
|
454
|
-
}
|
455
|
-
MANIFEST
|
456
|
-
end
|
457
|
-
end
|
458
|
-
|
459
|
-
it "finds values in top scope when the inherited class is qualified to the top" do
|
460
|
-
expect_the_message_to_be('top msg') do <<-MANIFEST
|
461
|
-
$var = "top msg"
|
462
|
-
class foo {
|
463
|
-
}
|
464
|
-
|
465
|
-
class bar inherits ::foo {
|
466
|
-
notify { 'something': message => $var, }
|
467
|
-
}
|
468
|
-
|
469
|
-
include bar
|
470
|
-
MANIFEST
|
471
|
-
end
|
472
|
-
end
|
473
|
-
|
474
|
-
it "finds values in its inherited scope when the inherited class is a nested class that shadows another class at the top" do
|
475
|
-
expect_the_message_to_be('inner baz') do <<-MANIFEST
|
476
|
-
node default {
|
477
|
-
include foo::bar
|
478
|
-
}
|
479
|
-
class baz {
|
480
|
-
$var = "top baz"
|
481
|
-
}
|
482
|
-
class foo {
|
483
|
-
class baz {
|
484
|
-
$var = "inner baz"
|
485
|
-
}
|
486
|
-
|
487
|
-
class bar inherits baz {
|
488
|
-
notify { 'something': message => $var, }
|
489
|
-
}
|
490
|
-
}
|
491
|
-
MANIFEST
|
492
|
-
end
|
493
|
-
end
|
494
|
-
|
495
|
-
it "finds values in its inherited scope when the inherited class is qualified to a nested class and qualified to the top" do
|
496
|
-
expect_the_message_to_be('top baz') do <<-MANIFEST
|
497
|
-
node default {
|
498
|
-
include foo::bar
|
499
|
-
}
|
500
|
-
class baz {
|
501
|
-
$var = "top baz"
|
502
|
-
}
|
503
|
-
class foo {
|
504
|
-
class baz {
|
505
|
-
$var = "inner baz"
|
506
|
-
}
|
507
|
-
|
508
|
-
class bar inherits ::baz {
|
509
|
-
notify { 'something': message => $var, }
|
510
|
-
}
|
511
|
-
}
|
512
|
-
MANIFEST
|
513
|
-
end
|
514
|
-
end
|
515
|
-
|
516
|
-
it "finds values in its inherited scope when the inherited class is qualified" do
|
517
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
518
|
-
node default {
|
519
|
-
include bar
|
520
|
-
}
|
521
|
-
class foo {
|
522
|
-
class baz {
|
523
|
-
$var = "foo_msg"
|
524
|
-
}
|
525
|
-
}
|
526
|
-
class bar inherits foo::baz {
|
527
|
-
notify { 'something': message => $var, }
|
528
|
-
}
|
529
|
-
MANIFEST
|
530
|
-
end
|
531
|
-
end
|
532
|
-
|
533
|
-
it "prefers values in its inherited scope over those in the node (with intermediate inclusion)" do
|
534
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
535
|
-
node default {
|
536
|
-
$var = "node_msg"
|
537
|
-
include baz
|
538
|
-
}
|
539
|
-
class foo {
|
540
|
-
$var = "foo_msg"
|
541
|
-
}
|
542
|
-
class bar inherits foo {
|
543
|
-
notify { 'something': message => $var, }
|
544
|
-
}
|
545
|
-
class baz {
|
546
|
-
include bar
|
547
|
-
}
|
548
|
-
MANIFEST
|
549
|
-
end
|
550
|
-
end
|
551
|
-
|
552
|
-
it "prefers values in its inherited scope over those in the node (without intermediate inclusion)" do
|
553
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
554
|
-
node default {
|
555
|
-
$var = "node_msg"
|
556
|
-
include bar
|
557
|
-
}
|
558
|
-
class foo {
|
559
|
-
$var = "foo_msg"
|
560
|
-
}
|
561
|
-
class bar inherits foo {
|
562
|
-
notify { 'something': message => $var, }
|
563
|
-
}
|
564
|
-
MANIFEST
|
565
|
-
end
|
566
|
-
end
|
567
|
-
|
568
|
-
it "prefers values in its inherited scope over those from where it is included" do
|
569
|
-
expect_the_message_to_be('foo_msg') do <<-MANIFEST
|
570
|
-
node default {
|
571
|
-
include baz
|
572
|
-
}
|
573
|
-
class foo {
|
574
|
-
$var = "foo_msg"
|
575
|
-
}
|
576
|
-
class bar inherits foo {
|
577
|
-
notify { 'something': message => $var, }
|
578
|
-
}
|
579
|
-
class baz {
|
580
|
-
$var = "baz_msg"
|
581
|
-
include bar
|
582
|
-
}
|
583
|
-
MANIFEST
|
584
|
-
end
|
585
|
-
end
|
586
|
-
|
587
|
-
it "does not used variables from classes included in the inherited scope" do
|
588
|
-
expect_the_message_to_be('node_msg') do <<-MANIFEST
|
589
|
-
node default {
|
590
|
-
$var = "node_msg"
|
591
|
-
include bar
|
592
|
-
}
|
593
|
-
class quux {
|
594
|
-
$var = "quux_msg"
|
595
|
-
}
|
596
|
-
class foo inherits quux {
|
597
|
-
}
|
598
|
-
class baz {
|
599
|
-
include foo
|
600
|
-
}
|
601
|
-
class bar inherits baz {
|
602
|
-
notify { 'something': message => $var, }
|
603
|
-
}
|
604
|
-
MANIFEST
|
605
|
-
end
|
606
|
-
end
|
607
|
-
|
608
|
-
it "does not use a variable from a scope lexically enclosing it" do
|
609
|
-
expect_the_message_to_be('node_msg') do <<-MANIFEST
|
610
|
-
node default {
|
611
|
-
$var = "node_msg"
|
612
|
-
include other::bar
|
613
|
-
}
|
614
|
-
class other {
|
615
|
-
$var = "other_msg"
|
616
|
-
class bar {
|
617
|
-
notify { 'something': message => $var, }
|
618
|
-
}
|
619
|
-
}
|
620
|
-
MANIFEST
|
621
|
-
end
|
622
|
-
end
|
623
|
-
|
624
|
-
it "finds values in its node scope" do
|
625
|
-
expect_the_message_to_be('node_msg') do <<-MANIFEST
|
626
|
-
node default {
|
627
|
-
$var = "node_msg"
|
628
|
-
include baz
|
629
|
-
}
|
630
|
-
class foo {
|
631
|
-
}
|
632
|
-
class bar inherits foo {
|
633
|
-
notify { 'something': message => $var, }
|
634
|
-
}
|
635
|
-
class baz {
|
636
|
-
include bar
|
637
|
-
}
|
638
|
-
MANIFEST
|
639
|
-
end
|
640
|
-
end
|
641
|
-
|
642
|
-
it "finds values in its top scope" do
|
643
|
-
expect_the_message_to_be('top_msg') do <<-MANIFEST
|
644
|
-
$var = "top_msg"
|
645
|
-
node default {
|
646
|
-
include baz
|
647
|
-
}
|
648
|
-
class foo {
|
649
|
-
}
|
650
|
-
class bar inherits foo {
|
651
|
-
notify { 'something': message => $var, }
|
652
|
-
}
|
653
|
-
class baz {
|
654
|
-
include bar
|
655
|
-
}
|
656
|
-
MANIFEST
|
657
|
-
end
|
658
|
-
end
|
659
|
-
|
660
|
-
it "prefers variables from the node over those in the top scope" do
|
661
|
-
expect_the_message_to_be('node_msg') do <<-MANIFEST
|
662
|
-
$var = "top_msg"
|
663
|
-
node default {
|
664
|
-
$var = "node_msg"
|
665
|
-
include foo
|
666
|
-
}
|
667
|
-
class foo {
|
668
|
-
notify { 'something': message => $var, }
|
669
|
-
}
|
670
|
-
MANIFEST
|
671
|
-
end
|
672
|
-
end
|
673
|
-
|
674
|
-
it "finds top scope variables referenced inside a defined type" do
|
675
|
-
expect_the_message_to_be('top_msg') do <<-MANIFEST
|
676
|
-
$var = "top_msg"
|
677
|
-
node default {
|
678
|
-
foo { "testing": }
|
679
|
-
}
|
680
|
-
define foo() {
|
681
|
-
notify { 'something': message => $var, }
|
682
|
-
}
|
683
|
-
MANIFEST
|
684
|
-
end
|
685
|
-
end
|
686
|
-
|
687
|
-
it "finds node scope variables referenced inside a defined type" do
|
688
|
-
expect_the_message_to_be('node_msg') do <<-MANIFEST
|
689
|
-
$var = "top_msg"
|
690
|
-
node default {
|
691
|
-
$var = "node_msg"
|
692
|
-
foo { "testing": }
|
693
|
-
}
|
694
|
-
define foo() {
|
695
|
-
notify { 'something': message => $var, }
|
696
|
-
}
|
697
|
-
MANIFEST
|
698
|
-
end
|
260
|
+
@scope["other::deep::klass::var"].should be_nil
|
699
261
|
end
|
700
262
|
end
|
701
263
|
end
|
702
264
|
|
703
|
-
describe "when
|
265
|
+
describe "when variables are set with append=true" do
|
704
266
|
it "should raise error if the variable is already defined in this scope" do
|
705
|
-
@scope.setvar("var","1", :append => false)
|
706
|
-
|
267
|
+
@scope.setvar("var", "1", :append => false)
|
268
|
+
expect {
|
269
|
+
@scope.setvar("var", "1", :append => true)
|
270
|
+
}.to raise_error(
|
271
|
+
Puppet::ParseError,
|
272
|
+
"Cannot append, variable var is defined in this scope"
|
273
|
+
)
|
707
274
|
end
|
708
275
|
|
709
276
|
it "should lookup current variable value" do
|
710
|
-
@scope.expects(:
|
711
|
-
@scope.setvar("var","1", :append => true)
|
277
|
+
@scope.expects(:[]).with("var").returns("2")
|
278
|
+
@scope.setvar("var", "1", :append => true)
|
712
279
|
end
|
713
280
|
|
714
281
|
it "should store the concatenated string '42'" do
|
715
|
-
@topscope.setvar("var","4", :append => false)
|
716
|
-
@scope.setvar("var","2", :append => true)
|
717
|
-
@scope
|
282
|
+
@topscope.setvar("var", "4", :append => false)
|
283
|
+
@scope.setvar("var", "2", :append => true)
|
284
|
+
@scope["var"].should == "42"
|
718
285
|
end
|
719
286
|
|
720
287
|
it "should store the concatenated array [4,2]" do
|
721
|
-
@topscope.setvar("var",[4], :append => false)
|
722
|
-
@scope.setvar("var",[2], :append => true)
|
723
|
-
@scope
|
288
|
+
@topscope.setvar("var", [4], :append => false)
|
289
|
+
@scope.setvar("var", [2], :append => true)
|
290
|
+
@scope["var"].should == [4,2]
|
724
291
|
end
|
725
292
|
|
726
293
|
it "should store the merged hash {a => b, c => d}" do
|
727
|
-
@topscope.setvar("var",{"a" => "b"}, :append => false)
|
728
|
-
@scope.setvar("var",{"c" => "d"}, :append => true)
|
729
|
-
@scope
|
294
|
+
@topscope.setvar("var", {"a" => "b"}, :append => false)
|
295
|
+
@scope.setvar("var", {"c" => "d"}, :append => true)
|
296
|
+
@scope["var"].should == {"a" => "b", "c" => "d"}
|
730
297
|
end
|
731
298
|
|
732
299
|
it "should raise an error when appending a hash with something other than another hash" do
|
733
|
-
@topscope.setvar("var",{"a" => "b"}, :append => false)
|
734
|
-
|
300
|
+
@topscope.setvar("var", {"a" => "b"}, :append => false)
|
301
|
+
|
302
|
+
expect {
|
303
|
+
@scope.setvar("var", "not a hash", :append => true)
|
304
|
+
}.to raise_error(
|
305
|
+
ArgumentError,
|
306
|
+
"Trying to append to a hash with something which is not a hash is unsupported"
|
307
|
+
)
|
735
308
|
end
|
736
309
|
end
|
737
310
|
|
@@ -801,7 +374,7 @@ describe Puppet::Parser::Scope do
|
|
801
374
|
it "should store the variable value" do
|
802
375
|
@scope.setvar("1", :value, :ephemeral => true)
|
803
376
|
|
804
|
-
@scope
|
377
|
+
@scope["1"].should == :value
|
805
378
|
end
|
806
379
|
|
807
380
|
it "should remove the variable value when unset_ephemeral_var is called" do
|
@@ -810,22 +383,24 @@ describe Puppet::Parser::Scope do
|
|
810
383
|
|
811
384
|
@scope.unset_ephemeral_var
|
812
385
|
|
813
|
-
@scope
|
386
|
+
@scope["1"].should be_nil
|
814
387
|
end
|
815
388
|
|
816
389
|
it "should not remove classic variables when unset_ephemeral_var is called" do
|
817
|
-
@scope
|
390
|
+
@scope['myvar'] = :value1
|
818
391
|
@scope.setvar("1", :value2, :ephemeral => true)
|
819
392
|
@scope.stubs(:parent).returns(nil)
|
820
393
|
|
821
394
|
@scope.unset_ephemeral_var
|
822
395
|
|
823
|
-
@scope
|
396
|
+
@scope["myvar"].should == :value1
|
824
397
|
end
|
825
398
|
|
826
399
|
it "should raise an error when setting it again" do
|
827
400
|
@scope.setvar("1", :value2, :ephemeral => true)
|
828
|
-
|
401
|
+
expect {
|
402
|
+
@scope.setvar("1", :value3, :ephemeral => true)
|
403
|
+
}.to raise_error(Puppet::ParseError, /Cannot reassign variable 1/)
|
829
404
|
end
|
830
405
|
|
831
406
|
it "should declare ephemeral number only variable names" do
|
@@ -841,7 +416,7 @@ describe Puppet::Parser::Scope do
|
|
841
416
|
@scope.setvar("0", :earliest, :ephemeral => true)
|
842
417
|
@scope.new_ephemeral
|
843
418
|
@scope.setvar("0", :latest, :ephemeral => true)
|
844
|
-
@scope
|
419
|
+
@scope["0"].should == :latest
|
845
420
|
end
|
846
421
|
|
847
422
|
it "should be able to report the current level" do
|
@@ -872,7 +447,7 @@ describe Puppet::Parser::Scope do
|
|
872
447
|
@scope.setvar("1", :value1, :ephemeral => true)
|
873
448
|
@scope.new_ephemeral
|
874
449
|
@scope.setvar("0", :value2, :ephemeral => true)
|
875
|
-
@scope
|
450
|
+
@scope["1"].should == :value1
|
876
451
|
end
|
877
452
|
|
878
453
|
describe "when calling unset_ephemeral_var without a level" do
|
@@ -883,7 +458,7 @@ describe Puppet::Parser::Scope do
|
|
883
458
|
|
884
459
|
@scope.unset_ephemeral_var
|
885
460
|
|
886
|
-
@scope
|
461
|
+
@scope["1"].should be_nil
|
887
462
|
end
|
888
463
|
end
|
889
464
|
|
@@ -897,7 +472,7 @@ describe Puppet::Parser::Scope do
|
|
897
472
|
|
898
473
|
@scope.unset_ephemeral_var(2)
|
899
474
|
|
900
|
-
@scope
|
475
|
+
@scope["1"].should == :value2
|
901
476
|
end
|
902
477
|
end
|
903
478
|
end
|
@@ -912,7 +487,9 @@ describe Puppet::Parser::Scope do
|
|
912
487
|
end
|
913
488
|
|
914
489
|
it "should accept only MatchData" do
|
915
|
-
|
490
|
+
expect {
|
491
|
+
@scope.ephemeral_from("match")
|
492
|
+
}.to raise_error(ArgumentError, /Invalid regex match data/)
|
916
493
|
end
|
917
494
|
|
918
495
|
it "should set $0 with the full match" do
|
@@ -935,27 +512,6 @@ describe Puppet::Parser::Scope do
|
|
935
512
|
end
|
936
513
|
end
|
937
514
|
|
938
|
-
describe "when unsetting variables" do
|
939
|
-
it "should be able to unset normal variables" do
|
940
|
-
@scope.setvar("foo", "bar")
|
941
|
-
@scope.unsetvar("foo")
|
942
|
-
@scope.lookupvar("foo").should == :undefined
|
943
|
-
end
|
944
|
-
|
945
|
-
it "should be able to unset ephemeral variables" do
|
946
|
-
@scope.setvar("0", "bar", :ephemeral => true)
|
947
|
-
@scope.unsetvar("0")
|
948
|
-
@scope.lookupvar("0").should == :undefined
|
949
|
-
end
|
950
|
-
|
951
|
-
it "should not unset ephemeral variables in previous ephemeral scope" do
|
952
|
-
@scope.setvar("0", "bar", :ephemeral => true)
|
953
|
-
@scope.new_ephemeral
|
954
|
-
@scope.unsetvar("0")
|
955
|
-
@scope.lookupvar("0").should == "bar"
|
956
|
-
end
|
957
|
-
end
|
958
|
-
|
959
515
|
it "should use its namespaces to find hostclasses" do
|
960
516
|
klass = @scope.known_resource_types.add Puppet::Resource::Type.new(:hostclass, "a::b::c")
|
961
517
|
@scope.add_namespace "a::b"
|
@@ -971,34 +527,51 @@ describe Puppet::Parser::Scope do
|
|
971
527
|
describe "when managing defaults" do
|
972
528
|
it "should be able to set and lookup defaults" do
|
973
529
|
param = Puppet::Parser::Resource::Param.new(:name => :myparam, :value => "myvalue", :source => stub("source"))
|
974
|
-
@scope.
|
530
|
+
@scope.define_settings(:mytype, param)
|
975
531
|
@scope.lookupdefaults(:mytype).should == {:myparam => param}
|
976
532
|
end
|
977
533
|
|
978
534
|
it "should fail if a default is already defined and a new default is being defined" do
|
979
535
|
param = Puppet::Parser::Resource::Param.new(:name => :myparam, :value => "myvalue", :source => stub("source"))
|
980
|
-
@scope.
|
981
|
-
|
536
|
+
@scope.define_settings(:mytype, param)
|
537
|
+
expect {
|
538
|
+
@scope.define_settings(:mytype, param)
|
539
|
+
}.to raise_error(Puppet::ParseError, /Default already defined .* cannot redefine/)
|
982
540
|
end
|
983
541
|
|
984
542
|
it "should return multiple defaults at once" do
|
985
543
|
param1 = Puppet::Parser::Resource::Param.new(:name => :myparam, :value => "myvalue", :source => stub("source"))
|
986
|
-
@scope.
|
544
|
+
@scope.define_settings(:mytype, param1)
|
987
545
|
param2 = Puppet::Parser::Resource::Param.new(:name => :other, :value => "myvalue", :source => stub("source"))
|
988
|
-
@scope.
|
546
|
+
@scope.define_settings(:mytype, param2)
|
989
547
|
|
990
548
|
@scope.lookupdefaults(:mytype).should == {:myparam => param1, :other => param2}
|
991
549
|
end
|
992
550
|
|
993
551
|
it "should look up defaults defined in parent scopes" do
|
994
552
|
param1 = Puppet::Parser::Resource::Param.new(:name => :myparam, :value => "myvalue", :source => stub("source"))
|
995
|
-
@scope.
|
553
|
+
@scope.define_settings(:mytype, param1)
|
996
554
|
|
997
555
|
child_scope = @scope.newscope
|
998
556
|
param2 = Puppet::Parser::Resource::Param.new(:name => :other, :value => "myvalue", :source => stub("source"))
|
999
|
-
child_scope.
|
557
|
+
child_scope.define_settings(:mytype, param2)
|
1000
558
|
|
1001
559
|
child_scope.lookupdefaults(:mytype).should == {:myparam => param1, :other => param2}
|
1002
560
|
end
|
1003
561
|
end
|
562
|
+
|
563
|
+
context "#true?" do
|
564
|
+
{ "a string" => true,
|
565
|
+
"true" => true,
|
566
|
+
"false" => true,
|
567
|
+
true => true,
|
568
|
+
"" => false,
|
569
|
+
:undef => false,
|
570
|
+
nil => false
|
571
|
+
}.each do |input, output|
|
572
|
+
it "should treat #{input.inspect} as #{output}" do
|
573
|
+
Puppet::Parser::Scope.true?(input).should == output
|
574
|
+
end
|
575
|
+
end
|
576
|
+
end
|
1004
577
|
end
|