puppet 3.0.0.rc5 → 3.0.0.rc7
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/LICENSE +1 -1
- data/README_DEVELOPER.md +209 -1
- data/README_HIERA.md +148 -0
- data/Rakefile +25 -27
- data/bin/extlookup2hiera +56 -0
- data/conf/auth.conf +34 -34
- data/examples/hiera/README.md +91 -0
- data/examples/hiera/etc/hiera.yaml +15 -0
- data/examples/hiera/etc/hieradb/common.yaml +3 -0
- data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
- data/examples/hiera/etc/hieradb/development.yaml +2 -0
- data/examples/hiera/etc/puppet.conf +3 -0
- data/examples/hiera/modules/data/manifests/common.pp +3 -0
- data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
- data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
- data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
- data/examples/hiera/modules/users/manifests/common.pp +3 -0
- data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
- data/examples/hiera/modules/users/manifests/development.pp +3 -0
- data/examples/hiera/site.pp +3 -0
- data/ext/build_defaults.yaml +23 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +143 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +4 -0
- data/ext/debian/puppet-common.lintian-overrides +5 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +2 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +32 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +2 -0
- data/ext/debian/puppetmaster-common.manpages +2 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +128 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/ext/envpuppet +4 -0
- data/ext/envpuppet.bat +3 -2
- data/{conf → ext}/freebsd/puppetd +0 -0
- data/{conf → ext}/freebsd/puppetmasterd +0 -0
- data/{conf → ext}/gentoo/conf.d/puppet +0 -0
- data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/init.d/puppet +0 -0
- data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
- data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
- data/ext/ips/puppet-agent +49 -0
- data/ext/ips/puppet-master +44 -0
- data/ext/ips/puppet.conf +29 -0
- data/ext/ips/puppet.p5m.erb +12 -0
- data/ext/ips/puppetagent.xml +46 -0
- data/ext/ips/puppetmaster.xml +42 -0
- data/ext/ips/rules +19 -0
- data/ext/ips/transforms +34 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +1 -1
- data/ext/osx/file_mapping.yaml +33 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +236 -0
- data/ext/packaging/tasks/10_setupvars.rake +62 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +52 -0
- data/ext/packaging/tasks/ips.rake +78 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +20 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +34 -0
- data/ext/packaging/tasks/sign.rake +76 -0
- data/ext/packaging/tasks/tar.rake +20 -0
- data/ext/project_data.yaml +25 -0
- data/ext/rack/files/apache2.conf +2 -1
- data/{conf → ext}/redhat/client.init +0 -0
- data/{conf → ext}/redhat/client.sysconfig +0 -0
- data/{conf → ext}/redhat/fileserver.conf +0 -0
- data/{conf → ext}/redhat/logrotate +0 -0
- data/{conf → ext}/redhat/puppet.conf +0 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
- data/{conf → ext}/redhat/queue.init +0 -0
- data/{conf → ext}/redhat/rundir-perms.patch +0 -0
- data/{conf → ext}/redhat/server.init +0 -0
- data/{conf → ext}/redhat/server.sysconfig +0 -0
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
- data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
- data/{conf → ext}/suse/client.init +0 -0
- data/{conf → ext}/suse/fileserver.conf +0 -0
- data/{conf → ext}/suse/logrotate +0 -0
- data/{conf → ext}/suse/puppet.conf +0 -0
- data/{conf → ext}/suse/puppet.spec +1 -1
- data/{conf → ext}/suse/server.init +0 -0
- data/ext/systemd/puppetagent.service +13 -0
- data/ext/systemd/puppetmaster.service +13 -0
- data/{conf → ext}/windows/eventlog/Rakefile +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
- data/ext/windows/service/daemon.bat +6 -0
- data/ext/windows/service/daemon.rb +90 -0
- data/install.rb +22 -32
- data/lib/hiera/backend/puppet_backend.rb +102 -0
- data/lib/hiera/scope.rb +42 -0
- data/lib/hiera_puppet.rb +89 -0
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/agent/locker.rb +12 -9
- data/lib/puppet/application.rb +10 -8
- data/lib/puppet/application/agent.rb +12 -8
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/cert.rb +6 -6
- data/lib/puppet/application/certificate.rb +1 -4
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +5 -2
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/face_base.rb +3 -13
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +4 -2
- data/lib/puppet/application/master.rb +2 -2
- data/lib/puppet/application/queue.rb +3 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/configurer.rb +11 -7
- data/lib/puppet/configurer/downloader.rb +1 -4
- data/lib/puppet/daemon.rb +4 -4
- data/lib/puppet/defaults.rb +64 -60
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/pson/common.rb +15 -0
- data/lib/puppet/external/pson/pure.rb +0 -62
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -2
- data/lib/puppet/face/ca.rb +19 -14
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help/action.erb +0 -1
- data/lib/puppet/face/help/face.erb +0 -1
- data/lib/puppet/face/help/man.erb +3 -6
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node.rb +1 -1
- data/lib/puppet/face/node/clean.rb +30 -25
- data/lib/puppet/feature/base.rb +0 -3
- data/lib/puppet/feature/rails.rb +2 -1
- data/lib/puppet/file_serving/terminus_selector.rb +1 -1
- data/lib/puppet/indirector/catalog/active_record.rb +5 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +3 -3
- data/lib/puppet/indirector/facts/active_record.rb +5 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -4
- data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
- data/lib/puppet/indirector/indirection.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/active_record.rb +5 -0
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/indirector/resource/active_record.rb +5 -0
- data/lib/puppet/network/authentication.rb +30 -0
- data/lib/puppet/network/http.rb +0 -13
- data/lib/puppet/network/http/connection.rb +10 -2
- data/lib/puppet/network/http/handler.rb +8 -0
- data/lib/puppet/network/http/mongrel/rest.rb +5 -0
- data/lib/puppet/network/http/rack/rest.rb +7 -0
- data/lib/puppet/network/http/webrick.rb +3 -6
- data/lib/puppet/network/http/webrick/rest.rb +4 -0
- data/lib/puppet/network/server.rb +9 -33
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/node/facts.rb +0 -1
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -1
- data/lib/puppet/parser/functions/hiera.rb +8 -0
- data/lib/puppet/parser/functions/hiera_array.rb +8 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
- data/lib/puppet/parser/functions/hiera_include.rb +11 -0
- data/lib/puppet/parser/functions/shellquote.rb +21 -29
- data/lib/puppet/parser/lexer.rb +2 -1
- data/lib/puppet/parser/scope.rb +8 -0
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/package/pkg.rb +37 -10
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +11 -0
- data/lib/puppet/provider/zfs/zfs.rb +29 -2
- data/lib/puppet/provider/zone/solaris.rb +144 -39
- data/lib/puppet/provider/zpool/zpool.rb +7 -10
- data/lib/puppet/settings.rb +50 -86
- data/lib/puppet/settings/duration_setting.rb +34 -0
- data/lib/puppet/settings/terminus_setting.rb +16 -0
- data/lib/puppet/ssl/base.rb +49 -9
- data/lib/puppet/ssl/certificate.rb +13 -9
- data/lib/puppet/ssl/certificate_authority.rb +4 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
- data/lib/puppet/ssl/certificate_factory.rb +4 -21
- data/lib/puppet/ssl/certificate_request.rb +1 -10
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
- data/lib/puppet/ssl/digest.rb +20 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -8
- data/lib/puppet/type/file.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -2
- 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 +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/zone.rb +126 -253
- data/lib/puppet/util.rb +10 -23
- data/lib/puppet/util/adsi.rb +22 -14
- data/lib/puppet/util/log/destinations.rb +7 -0
- data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +7 -7
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +90 -46
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/hiera.yaml +9 -0
- data/spec/fixtures/manifests/site.pp +0 -0
- data/spec/integration/defaults_spec.rb +25 -11
- data/spec/integration/faces/ca_spec.rb +11 -16
- data/spec/integration/network/server/webrick_spec.rb +14 -27
- data/spec/integration/node_spec.rb +4 -1
- data/spec/integration/parser/functions/require_spec.rb +3 -3
- data/spec/integration/parser/undef_param_spec.rb +88 -0
- data/spec/integration/provider/mount_spec.rb +4 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/lib/puppet_spec/settings.rb +0 -1
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/unit/agent/locker_spec.rb +8 -2
- data/spec/unit/application/agent_spec.rb +29 -7
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/device_spec.rb +18 -1
- data/spec/unit/application/face_base_spec.rb +16 -2
- data/spec/unit/application/kick_spec.rb +8 -0
- data/spec/unit/application/queue_spec.rb +5 -0
- data/spec/unit/application_spec.rb +13 -23
- data/spec/unit/configurer/downloader_spec.rb +2 -11
- data/spec/unit/configurer_spec.rb +6 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
- data/spec/unit/hiera/scope_spec.rb +62 -0
- data/spec/unit/hiera_puppet_spec.rb +111 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +2 -1
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/node/active_record_spec.rb +7 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/network/authentication_spec.rb +86 -0
- data/spec/unit/network/http/connection_spec.rb +21 -0
- data/spec/unit/network/http/handler_spec.rb +12 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/webrick_spec.rb +11 -26
- data/spec/unit/network/server_spec.rb +79 -192
- data/spec/unit/node/facts_spec.rb +2 -2
- data/spec/unit/parser/ast/vardef_spec.rb +4 -4
- data/spec/unit/parser/files_spec.rb +3 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -5
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
- data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_spec.rb +21 -0
- data/spec/unit/parser/functions/include_spec.rb +3 -3
- data/spec/unit/parser/functions/realize_spec.rb +3 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -5
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
- data/spec/unit/parser/functions_spec.rb +6 -10
- data/spec/unit/parser/lexer_spec.rb +13 -0
- data/spec/unit/parser/scope_spec.rb +16 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/package/pkg_spec.rb +16 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
- data/spec/unit/provider/user/useradd_spec.rb +147 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
- data/spec/unit/provider/zone/solaris_spec.rb +126 -7
- data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
- data/spec/unit/puppet_spec.rb +7 -0
- data/spec/unit/settings/duration_setting_spec.rb +45 -0
- data/spec/unit/settings/terminus_setting_spec.rb +28 -0
- data/spec/unit/settings_spec.rb +21 -23
- data/spec/unit/ssl/base_spec.rb +68 -19
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
- data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
- data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
- data/spec/unit/ssl/certificate_request_spec.rb +80 -113
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/ssl/certificate_spec.rb +26 -2
- data/spec/unit/ssl/digest_spec.rb +35 -0
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +2 -1
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/type/zone_spec.rb +52 -10
- data/spec/unit/util/adsi_spec.rb +19 -0
- data/spec/unit/util/checksums_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +1 -1
- data/spec/unit/util/log/destinations_spec.rb +1 -0
- data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
- data/spec/unit/util/logging_spec.rb +6 -6
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/zaml_spec.rb +94 -6
- data/spec/unit/util_spec.rb +17 -0
- data/spec/watchr.rb +2 -6
- data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
- data/tasks/{rake/parser.rake → parser.rake} +0 -0
- metadata +1003 -119
- data/CHANGELOG +0 -9233
- data/conf/osx/preflight +0 -24
- data/lib/puppet/network/http/mongrel.rb +0 -35
- data/lib/puppet/util/config_timeout.rb +0 -24
- data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
- data/spec/unit/network/http/mongrel_spec.rb +0 -91
- data/spec/unit/network/http_spec.rb +0 -31
- data/spec/unit/util/config_timeout_spec.rb +0 -57
- data/tasks/rake/apple.rake +0 -176
- data/tasks/rake/changelog.rake +0 -15
- data/tasks/rake/ci.rake +0 -22
- data/tasks/rake/dailybuild.rake +0 -9
- data/tasks/rake/gem.rake +0 -63
- data/tasks/rake/git_workflow.rake +0 -134
- data/tasks/rake/metrics.rake +0 -14
- data/tasks/rake/sign.rake +0 -14
- data/tasks/rake/testbranch.rake +0 -16
- data/tasks/rake/yard.rake +0 -11
data/spec/spec_helper.rb
CHANGED
@@ -48,6 +48,12 @@ RSpec.configure do |config|
|
|
48
48
|
|
49
49
|
config.mock_with :mocha
|
50
50
|
|
51
|
+
if Puppet::Util::Platform.windows?
|
52
|
+
config.output_stream = $stdout
|
53
|
+
config.error_stream = $stderr
|
54
|
+
config.formatters.each { |f| f.instance_variable_set(:@output, $stdout) }
|
55
|
+
end
|
56
|
+
|
51
57
|
config.before :all do
|
52
58
|
Puppet::Test::TestHelper.before_all_tests()
|
53
59
|
end
|
@@ -23,15 +23,21 @@ describe Puppet::Agent::Locker do
|
|
23
23
|
@locker.send(:lockfile).should be_instance_of(Puppet::Util::Pidlock)
|
24
24
|
end
|
25
25
|
|
26
|
-
it "should use puppet's
|
26
|
+
it "should use puppet's agent_catalog_run_lockfile' setting to determine its lockfile path" do
|
27
27
|
lockfile = File.expand_path("/my/lock")
|
28
|
-
Puppet[:
|
28
|
+
Puppet[:agent_catalog_run_lockfile] = lockfile
|
29
29
|
lock = Puppet::Util::Pidlock.new(lockfile)
|
30
30
|
Puppet::Util::Pidlock.expects(:new).with(lockfile).returns lock
|
31
31
|
|
32
32
|
@locker.send(:lockfile)
|
33
33
|
end
|
34
34
|
|
35
|
+
it "#lockfile_path provides the path to the lockfile" do
|
36
|
+
lockfile = File.expand_path("/my/lock")
|
37
|
+
Puppet[:agent_catalog_run_lockfile] = lockfile
|
38
|
+
@locker.lockfile_path.should == File.expand_path("/my/lock")
|
39
|
+
end
|
40
|
+
|
35
41
|
it "should reuse the same lock file each time" do
|
36
42
|
@locker.send(:lockfile).should equal(@locker.send(:lockfile))
|
37
43
|
end
|
@@ -70,10 +70,10 @@ describe Puppet::Application::Agent do
|
|
70
70
|
@puppetd.options[:serve].should == []
|
71
71
|
end
|
72
72
|
|
73
|
-
it "should use
|
73
|
+
it "should use SHA256 as default digest algorithm" do
|
74
74
|
@puppetd.preinit
|
75
75
|
|
76
|
-
@puppetd.options[:digest].should ==
|
76
|
+
@puppetd.options[:digest].should == 'SHA256'
|
77
77
|
end
|
78
78
|
|
79
79
|
it "should not fingerprint by default" do
|
@@ -337,9 +337,26 @@ describe Puppet::Application::Agent do
|
|
337
337
|
Puppet[:node_terminus].should == :rest
|
338
338
|
end
|
339
339
|
|
340
|
-
it "
|
340
|
+
it "has an application default :catalog_cache_terminus setting of 'json'" do
|
341
|
+
Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:json)
|
342
|
+
|
343
|
+
@puppetd.initialize_app_defaults
|
344
|
+
@puppetd.setup
|
345
|
+
end
|
346
|
+
|
347
|
+
it "should tell the catalog cache class based on the :catalog_cache_terminus setting" do
|
348
|
+
Puppet[:catalog_cache_terminus] = "yaml"
|
341
349
|
Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:yaml)
|
342
350
|
|
351
|
+
@puppetd.initialize_app_defaults
|
352
|
+
@puppetd.setup
|
353
|
+
end
|
354
|
+
|
355
|
+
it "should not set catalog cache class if :catalog_cache_terminus is explicitly nil" do
|
356
|
+
Puppet[:catalog_cache_terminus] = nil
|
357
|
+
Puppet::Resource::Catalog.indirection.expects(:cache_class=).never
|
358
|
+
|
359
|
+
@puppetd.initialize_app_defaults
|
343
360
|
@puppetd.setup
|
344
361
|
end
|
345
362
|
|
@@ -456,10 +473,15 @@ describe Puppet::Application::Agent do
|
|
456
473
|
it "should use puppet default port" do
|
457
474
|
Puppet[:puppetport] = 32768
|
458
475
|
|
459
|
-
Puppet::Network::Server.expects(:new).with
|
476
|
+
Puppet::Network::Server.expects(:new).with(anything, 32768)
|
460
477
|
|
461
478
|
@puppetd.setup_listen
|
462
479
|
end
|
480
|
+
|
481
|
+
it "should issue a warning that listen is deprecated" do
|
482
|
+
Puppet.expects(:warning).with() { |msg| msg =~ /kick is deprecated/ }
|
483
|
+
@puppetd.setup_listen
|
484
|
+
end
|
463
485
|
end
|
464
486
|
|
465
487
|
describe "when setting up for fingerprint" do
|
@@ -589,20 +611,20 @@ describe Puppet::Application::Agent do
|
|
589
611
|
|
590
612
|
it "should fingerprint the certificate if it exists" do
|
591
613
|
@host.expects(:certificate).returns(@cert)
|
592
|
-
@cert.expects(:
|
614
|
+
@cert.expects(:digest).with('MD5').returns "fingerprint"
|
593
615
|
@puppetd.fingerprint
|
594
616
|
end
|
595
617
|
|
596
618
|
it "should fingerprint the certificate request if no certificate have been signed" do
|
597
619
|
@host.expects(:certificate).returns(nil)
|
598
620
|
@host.expects(:certificate_request).returns(@cert)
|
599
|
-
@cert.expects(:
|
621
|
+
@cert.expects(:digest).with('MD5').returns "fingerprint"
|
600
622
|
@puppetd.fingerprint
|
601
623
|
end
|
602
624
|
|
603
625
|
it "should display the fingerprint" do
|
604
626
|
@host.stubs(:certificate).returns(@cert)
|
605
|
-
@cert.stubs(:
|
627
|
+
@cert.stubs(:digest).with('MD5').returns("DIGEST")
|
606
628
|
|
607
629
|
@puppetd.expects(:puts).with "DIGEST"
|
608
630
|
|
@@ -103,7 +103,7 @@ describe Puppet::Application::Apply do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it "should set default_file_terminus to `file_server` to be local" do
|
106
|
-
@apply.app_defaults[:default_file_terminus].should ==
|
106
|
+
@apply.app_defaults[:default_file_terminus].should == :file_server
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -219,9 +219,26 @@ describe Puppet::Application::Device do
|
|
219
219
|
Puppet[:node_terminus].should == :rest
|
220
220
|
end
|
221
221
|
|
222
|
-
it "
|
222
|
+
it "has an application default :catalog_cache_terminus setting of 'json'" do
|
223
|
+
Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:json)
|
224
|
+
|
225
|
+
@device.initialize_app_defaults
|
226
|
+
@device.setup
|
227
|
+
end
|
228
|
+
|
229
|
+
it "should tell the catalog cache class based on the :catalog_cache_terminus setting" do
|
230
|
+
Puppet[:catalog_cache_terminus] = "yaml"
|
223
231
|
Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:yaml)
|
224
232
|
|
233
|
+
@device.initialize_app_defaults
|
234
|
+
@device.setup
|
235
|
+
end
|
236
|
+
|
237
|
+
it "should not set catalog cache class if :catalog_cache_terminus is explicitly nil" do
|
238
|
+
Puppet[:catalog_cache_terminus] = nil
|
239
|
+
Puppet::Resource::Catalog.indirection.expects(:cache_class=).never
|
240
|
+
|
241
|
+
@device.initialize_app_defaults
|
225
242
|
@device.setup
|
226
243
|
end
|
227
244
|
|
@@ -14,6 +14,10 @@ describe Puppet::Application::FaceBase do
|
|
14
14
|
app
|
15
15
|
end
|
16
16
|
|
17
|
+
after :each do
|
18
|
+
app.class.clear_everything_for_tests
|
19
|
+
end
|
20
|
+
|
17
21
|
describe "#find_global_settings_argument" do
|
18
22
|
it "should not match --ca to --ca-location" do
|
19
23
|
option = mock('ca option', :optparse_args => ["--ca"])
|
@@ -155,6 +159,16 @@ describe Puppet::Application::FaceBase do
|
|
155
159
|
to raise_error OptionParser::InvalidOption, /invalid option: --bar/
|
156
160
|
end
|
157
161
|
|
162
|
+
it "does not skip when a puppet global setting is given as one item" do
|
163
|
+
app.command_line.stubs(:args).returns %w{--confdir=/tmp/puppet foo}
|
164
|
+
expect { app.preinit; app.parse_options }.not_to raise_error
|
165
|
+
end
|
166
|
+
|
167
|
+
it "does not skip when a puppet global setting is given as two items" do
|
168
|
+
app.command_line.stubs(:args).returns %w{--confdir /tmp/puppet foo}
|
169
|
+
expect { app.preinit; app.parse_options }.not_to raise_error
|
170
|
+
end
|
171
|
+
|
158
172
|
{ "boolean options before" => %w{--trace foo},
|
159
173
|
"boolean options after" => %w{foo --trace}
|
160
174
|
}.each do |name, args|
|
@@ -269,8 +283,8 @@ describe Puppet::Application::FaceBase do
|
|
269
283
|
|
270
284
|
describe "#render" do
|
271
285
|
before :each do
|
272
|
-
app.face = Puppet::
|
273
|
-
app.action = app.face
|
286
|
+
app.face = Puppet::Interface.new('basetest', '0.0.1')
|
287
|
+
app.action = Puppet::Interface::Action.new(app.face, :foo)
|
274
288
|
end
|
275
289
|
|
276
290
|
context "default rendering" do
|
@@ -121,6 +121,11 @@ describe Puppet::Application::Kick, :if => Puppet.features.posix? do
|
|
121
121
|
@kick.options.stubs(:[]).with(any_parameters)
|
122
122
|
end
|
123
123
|
|
124
|
+
it "should issue a warning that kick is deprecated" do
|
125
|
+
Puppet.expects(:warning).with() { |msg| msg =~ /kick is deprecated/ }
|
126
|
+
@kick.setup
|
127
|
+
end
|
128
|
+
|
124
129
|
it "should abort stating that kick is not supported on Windows" do
|
125
130
|
Puppet.features.stubs(:microsoft_windows?).returns(true)
|
126
131
|
|
@@ -216,6 +221,9 @@ describe Puppet::Application::Kick, :if => Puppet.features.posix? do
|
|
216
221
|
@kick.options.stubs(:[]).with(:ignoreschedules).returns(false)
|
217
222
|
@kick.options.stubs(:[]).with(:foreground).returns(false)
|
218
223
|
@kick.options.stubs(:[]).with(:debug).returns(false)
|
224
|
+
@kick.options.stubs(:[]).with(:verbose).returns(false) # needed when logging is initialized
|
225
|
+
@kick.options.stubs(:[]).with(:setdest).returns(false) # needed when logging is initialized
|
226
|
+
|
219
227
|
@kick.stubs(:print)
|
220
228
|
@kick.preinit
|
221
229
|
@kick.stubs(:parse_options)
|
@@ -82,6 +82,11 @@ describe Puppet::Application::Queue, :unless => Puppet.features.microsoft_window
|
|
82
82
|
lambda { @queue.setup }.should raise_error(ArgumentError)
|
83
83
|
end
|
84
84
|
|
85
|
+
it "should issue a warning that queue is deprecated" do
|
86
|
+
Puppet.expects(:warning).with() { |msg| msg =~ /queue is deprecated/ }
|
87
|
+
@queue.setup
|
88
|
+
end
|
89
|
+
|
85
90
|
it "should print puppet config if asked to in Puppet config" do
|
86
91
|
Puppet.settings.stubs(:print_configs?).returns(true)
|
87
92
|
Puppet.settings.expects(:print_configs).returns(true)
|
@@ -86,27 +86,20 @@ describe Puppet::Application do
|
|
86
86
|
|
87
87
|
it "should sadly and frighteningly allow run_mode to change at runtime via #initialize_app_defaults" do
|
88
88
|
Puppet.features.stubs(:syslog?).returns(true)
|
89
|
-
Puppet[:run_mode].should == :user
|
90
89
|
|
91
|
-
|
92
|
-
|
93
|
-
app.initialize_app_defaults
|
90
|
+
app = TestApp.new
|
91
|
+
app.initialize_app_defaults
|
94
92
|
|
95
|
-
|
96
|
-
}.to_not raise_error
|
93
|
+
Puppet.run_mode.should be_master
|
97
94
|
end
|
98
95
|
|
99
96
|
it "should sadly and frighteningly allow run_mode to change at runtime via #run" do
|
100
|
-
|
101
|
-
|
102
|
-
app.run
|
103
|
-
|
104
|
-
app.class.run_mode.name.should == :master
|
97
|
+
app = TestApp.new
|
98
|
+
app.run
|
105
99
|
|
106
|
-
|
107
|
-
|
108
|
-
}.to_not raise_error
|
100
|
+
app.class.run_mode.name.should == :master
|
109
101
|
|
102
|
+
Puppet.run_mode.should be_master
|
110
103
|
end
|
111
104
|
end
|
112
105
|
|
@@ -124,16 +117,13 @@ describe Puppet::Application do
|
|
124
117
|
|
125
118
|
|
126
119
|
it "should explode when an invalid run mode is set at runtime, for great victory" do
|
127
|
-
class InvalidRunModeTestApp < Puppet::Application
|
128
|
-
run_mode :abracadabra
|
129
|
-
def run_command
|
130
|
-
# no-op
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
120
|
expect {
|
135
|
-
|
136
|
-
|
121
|
+
class InvalidRunModeTestApp < Puppet::Application
|
122
|
+
run_mode :abracadabra
|
123
|
+
def run_command
|
124
|
+
# no-op
|
125
|
+
end
|
126
|
+
end
|
137
127
|
}.to raise_error
|
138
128
|
end
|
139
129
|
|
@@ -21,15 +21,6 @@ describe Puppet::Configurer::Downloader do
|
|
21
21
|
dler.source.should == "source"
|
22
22
|
end
|
23
23
|
|
24
|
-
it "should be able to provide a timeout value" do
|
25
|
-
Puppet::Configurer::Downloader.should respond_to(:timeout_interval)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should use the configtimeout, converted to an integer, as its timeout" do
|
29
|
-
Puppet[:configtimeout] = "50"
|
30
|
-
Puppet::Configurer::Downloader.timeout_interval.should == 50
|
31
|
-
end
|
32
|
-
|
33
24
|
describe "when creating the file that does the downloading" do
|
34
25
|
before do
|
35
26
|
@dler = Puppet::Configurer::Downloader.new("foo", "path", "source")
|
@@ -154,8 +145,8 @@ describe Puppet::Configurer::Downloader do
|
|
154
145
|
@dler.evaluate
|
155
146
|
end
|
156
147
|
|
157
|
-
it "should set a timeout for the download" do
|
158
|
-
Puppet
|
148
|
+
it "should set a timeout for the download using the `configtimeout` setting" do
|
149
|
+
Puppet[:configtimeout] = 50
|
159
150
|
Timeout.expects(:timeout).with(50)
|
160
151
|
|
161
152
|
@dler.evaluate
|
@@ -104,6 +104,12 @@ describe Puppet::Configurer do
|
|
104
104
|
@agent.run(:pluginsync => false)
|
105
105
|
end
|
106
106
|
|
107
|
+
it "should carry on when it can't fetch it's node definition" do
|
108
|
+
error = Net::HTTPError.new(400, 'dummy server communication error')
|
109
|
+
Puppet::Node.indirection.expects(:find).raises(error)
|
110
|
+
@agent.run.should == 0
|
111
|
+
end
|
112
|
+
|
107
113
|
it "should initialize a transaction report if one is not provided" do
|
108
114
|
report = Puppet::Transaction::Report.new("apply")
|
109
115
|
Puppet::Transaction::Report.expects(:new).returns report
|
data/spec/unit/face/node_spec.rb
CHANGED
@@ -0,0 +1,140 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'hiera/backend/puppet_backend'
|
3
|
+
|
4
|
+
|
5
|
+
describe Hiera::Backend::Puppet_backend do
|
6
|
+
before do
|
7
|
+
Hiera.stubs(:warn)
|
8
|
+
Hiera.stubs(:debug)
|
9
|
+
Hiera::Backend.stubs(:datasources).yields([])
|
10
|
+
Puppet::Parser::Functions.stubs(:function).with(:include)
|
11
|
+
|
12
|
+
@mockresource = mock
|
13
|
+
@mockresource.stubs(:name).returns("ntp::config")
|
14
|
+
|
15
|
+
@mockscope = mock
|
16
|
+
@mockscope.stubs(:resource).returns(@mockresource)
|
17
|
+
|
18
|
+
@scope = Hiera::Scope.new(@mockscope)
|
19
|
+
|
20
|
+
@backend = Hiera::Backend::Puppet_backend.new
|
21
|
+
end
|
22
|
+
|
23
|
+
describe "#hierarchy" do
|
24
|
+
it "should use the configured datasource" do
|
25
|
+
Hiera::Config.expects("[]").with(:puppet).returns({:datasource => "rspec"})
|
26
|
+
Hiera::Config.expects("[]").with(:hierarchy)
|
27
|
+
|
28
|
+
["ntp", "ntp::config"].each do |klass|
|
29
|
+
Hiera::Backend.expects(:parse_string).with(klass, @scope, {"calling_module" => "ntp", "calling_class" => "ntp::config"}).returns(klass)
|
30
|
+
end
|
31
|
+
|
32
|
+
@backend.hierarchy(@scope, nil).should == ["rspec::ntp::config", "rspec::ntp", "ntp::config::rspec", "ntp::rspec"]
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should not include empty class names" do
|
36
|
+
Hiera::Config.expects("[]").with(:puppet).returns({:datasource => "rspec"})
|
37
|
+
Hiera::Config.expects("[]").with(:hierarchy).returns(["%{foo}", "common"])
|
38
|
+
|
39
|
+
Hiera::Backend.expects(:parse_string).with("common", @scope, {"calling_module" => "ntp", "calling_class" => "ntp::config"}).returns("common")
|
40
|
+
Hiera::Backend.expects(:parse_string).with("%{foo}", @scope, {"calling_module" => "ntp", "calling_class" => "ntp::config"}).returns("")
|
41
|
+
|
42
|
+
@backend.hierarchy(@scope, nil).should == ["rspec::common", "ntp::config::rspec", "ntp::rspec"]
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should allow for an override data source" do
|
46
|
+
Hiera::Config.expects("[]").with(:puppet).returns({:datasource => "rspec"})
|
47
|
+
Hiera::Config.expects("[]").with(:hierarchy)
|
48
|
+
|
49
|
+
["ntp", "ntp::config"].each do |klass|
|
50
|
+
Hiera::Backend.expects(:parse_string).with(klass, @scope, {"calling_module" => "ntp", "calling_class" => "ntp::config"}).returns(klass)
|
51
|
+
end
|
52
|
+
|
53
|
+
@backend.hierarchy(@scope, "override").should == ["rspec::override", "rspec::ntp::config", "rspec::ntp", "ntp::config::rspec", "ntp::rspec"]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "#lookup" do
|
58
|
+
it "should attempt to load data from unincluded classes" do
|
59
|
+
Hiera::Backend.expects(:parse_answer).with("rspec", @scope).returns("rspec")
|
60
|
+
|
61
|
+
catalog = mock
|
62
|
+
catalog.expects(:classes).returns([])
|
63
|
+
|
64
|
+
@scope.expects(:catalog).returns(catalog)
|
65
|
+
@scope.expects(:function_include).with(["rspec"])
|
66
|
+
@mockscope.expects(:lookupvar).with("rspec::key").returns("rspec")
|
67
|
+
|
68
|
+
@backend.expects(:hierarchy).with(@scope, nil).returns(["rspec"])
|
69
|
+
@backend.lookup("key", @scope, nil, nil).should == "rspec"
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should not load loaded classes" do
|
73
|
+
Hiera::Backend.expects(:parse_answer).with("rspec", @scope).returns("rspec")
|
74
|
+
catalog = mock
|
75
|
+
catalog.expects(:classes).returns(["rspec"])
|
76
|
+
@mockscope.expects(:catalog).returns(catalog)
|
77
|
+
@mockscope.expects(:function_include).never
|
78
|
+
@mockscope.expects(:lookupvar).with("rspec::key").returns("rspec")
|
79
|
+
|
80
|
+
@backend.expects(:hierarchy).with(@scope, nil).returns(["rspec"])
|
81
|
+
@backend.lookup("key", @scope, nil, nil).should == "rspec"
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should return the first found data" do
|
85
|
+
Hiera::Backend.expects(:parse_answer).with("rspec", @scope).returns("rspec")
|
86
|
+
catalog = mock
|
87
|
+
catalog.expects(:classes).returns(["rspec", "override"])
|
88
|
+
@mockscope.expects(:catalog).returns(catalog)
|
89
|
+
@mockscope.expects(:function_include).never
|
90
|
+
@mockscope.expects(:lookupvar).with("override::key").returns("rspec")
|
91
|
+
@mockscope.expects(:lookupvar).with("rspec::key").never
|
92
|
+
|
93
|
+
@backend.expects(:hierarchy).with(@scope, "override").returns(["override", "rspec"])
|
94
|
+
@backend.lookup("key", @scope, "override", nil).should == "rspec"
|
95
|
+
end
|
96
|
+
|
97
|
+
it "should return an array of found data for array searches" do
|
98
|
+
Hiera::Backend.expects(:parse_answer).with("rspec::key", @scope).returns("rspec::key")
|
99
|
+
Hiera::Backend.expects(:parse_answer).with("test::key", @scope).returns("test::key")
|
100
|
+
catalog = mock
|
101
|
+
catalog.expects(:classes).returns(["rspec", "test"])
|
102
|
+
@mockscope.expects(:catalog).returns(catalog)
|
103
|
+
@mockscope.expects(:function_include).never
|
104
|
+
@mockscope.expects(:lookupvar).with("rspec::key").returns("rspec::key")
|
105
|
+
@mockscope.expects(:lookupvar).with("test::key").returns("test::key")
|
106
|
+
|
107
|
+
@backend.expects(:hierarchy).with(@scope, nil).returns(["rspec", "test"])
|
108
|
+
@backend.lookup("key", @scope, nil, :array).should == ["rspec::key", "test::key"]
|
109
|
+
end
|
110
|
+
|
111
|
+
|
112
|
+
it "should return a hash of found data for hash searches" do
|
113
|
+
Hiera::Backend.expects(:parse_answer).with("rspec::key", @scope).returns({'rspec'=>'key'})
|
114
|
+
Hiera::Backend.expects(:parse_answer).with("test::key", @scope).returns({'test'=>'key'})
|
115
|
+
catalog = mock
|
116
|
+
catalog.expects(:classes).returns(["rspec", "test"])
|
117
|
+
@mockscope.expects(:catalog).returns(catalog)
|
118
|
+
@mockscope.expects(:function_include).never
|
119
|
+
@mockscope.expects(:lookupvar).with("rspec::key").returns("rspec::key")
|
120
|
+
@mockscope.expects(:lookupvar).with("test::key").returns("test::key")
|
121
|
+
|
122
|
+
@backend.expects(:hierarchy).with(@scope, nil).returns(["rspec", "test"])
|
123
|
+
@backend.lookup("key", @scope, nil, :hash).should == {'rspec'=>'key', 'test'=>'key'}
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should return a merged hash of found data for hash searches" do
|
127
|
+
Hiera::Backend.expects(:parse_answer).with("rspec::key", @scope).returns({'rspec'=>'key', 'common'=>'rspec'})
|
128
|
+
Hiera::Backend.expects(:parse_answer).with("test::key", @scope).returns({'test'=>'key', 'common'=>'rspec'})
|
129
|
+
catalog = mock
|
130
|
+
catalog.expects(:classes).returns(["rspec", "test"])
|
131
|
+
@mockscope.expects(:catalog).returns(catalog)
|
132
|
+
@mockscope.expects(:function_include).never
|
133
|
+
@mockscope.expects(:lookupvar).with("rspec::key").returns("rspec::key")
|
134
|
+
@mockscope.expects(:lookupvar).with("test::key").returns("test::key")
|
135
|
+
|
136
|
+
@backend.expects(:hierarchy).with(@scope, nil).returns(["rspec", "test"])
|
137
|
+
@backend.lookup("key", @scope, nil, :hash).should == {'rspec'=>'key', 'common'=>'rspec', 'test'=>'key'}
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|