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,1088 +0,0 @@
|
|
1
|
-
#!/usr/bin/env rspec
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'ostruct'
|
4
|
-
|
5
|
-
describe Puppet::Util::Settings do
|
6
|
-
include PuppetSpec::Files
|
7
|
-
|
8
|
-
describe "when specifying defaults" do
|
9
|
-
before do
|
10
|
-
@settings = Puppet::Util::Settings.new
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should start with no defined parameters" do
|
14
|
-
@settings.params.length.should == 0
|
15
|
-
end
|
16
|
-
|
17
|
-
it "should allow specification of default values associated with a section as an array" do
|
18
|
-
@settings.setdefaults(:section, :myvalue => ["defaultval", "my description"])
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should not allow duplicate parameter specifications" do
|
22
|
-
@settings.setdefaults(:section, :myvalue => ["a", "b"])
|
23
|
-
lambda { @settings.setdefaults(:section, :myvalue => ["c", "d"]) }.should raise_error(ArgumentError)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should allow specification of default values associated with a section as a hash" do
|
27
|
-
@settings.setdefaults(:section, :myvalue => {:default => "defaultval", :desc => "my description"})
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should consider defined parameters to be valid" do
|
31
|
-
@settings.setdefaults(:section, :myvalue => ["defaultval", "my description"])
|
32
|
-
@settings.valid?(:myvalue).should be_true
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should require a description when defaults are specified with an array" do
|
36
|
-
lambda { @settings.setdefaults(:section, :myvalue => ["a value"]) }.should raise_error(ArgumentError)
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should require a description when defaults are specified with a hash" do
|
40
|
-
lambda { @settings.setdefaults(:section, :myvalue => {:default => "a value"}) }.should raise_error(ArgumentError)
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should raise an error if we can't guess the type" do
|
44
|
-
lambda { @settings.setdefaults(:section, :myvalue => {:default => Object.new, :desc => "An impossible object"}) }.should raise_error(ArgumentError)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should support specifying owner, group, and mode when specifying files" do
|
48
|
-
@settings.setdefaults(:section, :myvalue => {:default => "/some/file", :owner => "service", :mode => "boo", :group => "service", :desc => "whatever"})
|
49
|
-
end
|
50
|
-
|
51
|
-
it "should support specifying a short name" do
|
52
|
-
@settings.setdefaults(:section, :myvalue => {:default => "w", :desc => "b", :short => "m"})
|
53
|
-
end
|
54
|
-
|
55
|
-
it "should support specifying the setting type" do
|
56
|
-
@settings.setdefaults(:section, :myvalue => {:default => "/w", :desc => "b", :type => :setting})
|
57
|
-
@settings.setting(:myvalue).should be_instance_of(Puppet::Util::Settings::Setting)
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should fail if an invalid setting type is specified" do
|
61
|
-
lambda { @settings.setdefaults(:section, :myvalue => {:default => "w", :desc => "b", :type => :foo}) }.should raise_error(ArgumentError)
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should fail when short names conflict" do
|
65
|
-
@settings.setdefaults(:section, :myvalue => {:default => "w", :desc => "b", :short => "m"})
|
66
|
-
lambda { @settings.setdefaults(:section, :myvalue => {:default => "w", :desc => "b", :short => "m"}) }.should raise_error(ArgumentError)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe "when setting values" do
|
71
|
-
before do
|
72
|
-
@settings = Puppet::Util::Settings.new
|
73
|
-
@settings.setdefaults :main, :myval => ["val", "desc"]
|
74
|
-
@settings.setdefaults :main, :bool => [true, "desc"]
|
75
|
-
end
|
76
|
-
|
77
|
-
it "should provide a method for setting values from other objects" do
|
78
|
-
@settings[:myval] = "something else"
|
79
|
-
@settings[:myval].should == "something else"
|
80
|
-
end
|
81
|
-
|
82
|
-
it "should support a getopt-specific mechanism for setting values" do
|
83
|
-
@settings.handlearg("--myval", "newval")
|
84
|
-
@settings[:myval].should == "newval"
|
85
|
-
end
|
86
|
-
|
87
|
-
it "should support a getopt-specific mechanism for turning booleans off" do
|
88
|
-
@settings[:bool] = true
|
89
|
-
@settings.handlearg("--no-bool", "")
|
90
|
-
@settings[:bool].should == false
|
91
|
-
end
|
92
|
-
|
93
|
-
it "should support a getopt-specific mechanism for turning booleans on" do
|
94
|
-
# Turn it off first
|
95
|
-
@settings[:bool] = false
|
96
|
-
@settings.handlearg("--bool", "")
|
97
|
-
@settings[:bool].should == true
|
98
|
-
end
|
99
|
-
|
100
|
-
it "should consider a cli setting with no argument to be a boolean" do
|
101
|
-
# Turn it off first
|
102
|
-
@settings[:bool] = false
|
103
|
-
@settings.handlearg("--bool")
|
104
|
-
@settings[:bool].should == true
|
105
|
-
end
|
106
|
-
|
107
|
-
it "should consider a cli setting with an empty string as an argument to be a boolean, if the setting itself is a boolean" do
|
108
|
-
# Turn it off first
|
109
|
-
@settings[:bool] = false
|
110
|
-
@settings.handlearg("--bool", "")
|
111
|
-
@settings[:bool].should == true
|
112
|
-
end
|
113
|
-
|
114
|
-
it "should consider a cli setting with an empty string as an argument to be an empty argument, if the setting itself is not a boolean" do
|
115
|
-
@settings[:myval] = "bob"
|
116
|
-
@settings.handlearg("--myval", "")
|
117
|
-
@settings[:myval].should == ""
|
118
|
-
end
|
119
|
-
|
120
|
-
it "should consider a cli setting with a boolean as an argument to be a boolean" do
|
121
|
-
# Turn it off first
|
122
|
-
@settings[:bool] = false
|
123
|
-
@settings.handlearg("--bool", "true")
|
124
|
-
@settings[:bool].should == true
|
125
|
-
end
|
126
|
-
|
127
|
-
it "should not consider a cli setting of a non boolean with a boolean as an argument to be a boolean" do
|
128
|
-
# Turn it off first
|
129
|
-
@settings[:myval] = "bob"
|
130
|
-
@settings.handlearg("--no-myval", "")
|
131
|
-
@settings[:myval].should == ""
|
132
|
-
end
|
133
|
-
|
134
|
-
it "should flag settings from the CLI" do
|
135
|
-
@settings.handlearg("--myval")
|
136
|
-
@settings.setting(:myval).setbycli.should be_true
|
137
|
-
end
|
138
|
-
|
139
|
-
it "should not flag settings memory" do
|
140
|
-
@settings[:myval] = "12"
|
141
|
-
@settings.setting(:myval).setbycli.should be_false
|
142
|
-
end
|
143
|
-
|
144
|
-
it "should clear the cache when setting getopt-specific values" do
|
145
|
-
@settings.setdefaults :mysection, :one => ["whah", "yay"], :two => ["$one yay", "bah"]
|
146
|
-
@settings[:two].should == "whah yay"
|
147
|
-
@settings.handlearg("--one", "else")
|
148
|
-
@settings[:two].should == "else yay"
|
149
|
-
end
|
150
|
-
|
151
|
-
it "should not clear other values when setting getopt-specific values" do
|
152
|
-
@settings[:myval] = "yay"
|
153
|
-
@settings.handlearg("--no-bool", "")
|
154
|
-
@settings[:myval].should == "yay"
|
155
|
-
end
|
156
|
-
|
157
|
-
it "should clear the list of used sections" do
|
158
|
-
@settings.expects(:clearused)
|
159
|
-
@settings[:myval] = "yay"
|
160
|
-
end
|
161
|
-
|
162
|
-
it "should call passed blocks when values are set" do
|
163
|
-
values = []
|
164
|
-
@settings.setdefaults(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| values << v }})
|
165
|
-
values.should == []
|
166
|
-
|
167
|
-
@settings[:hooker] = "something"
|
168
|
-
values.should == %w{something}
|
169
|
-
end
|
170
|
-
|
171
|
-
it "should call passed blocks when values are set via the command line" do
|
172
|
-
values = []
|
173
|
-
@settings.setdefaults(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| values << v }})
|
174
|
-
values.should == []
|
175
|
-
|
176
|
-
@settings.handlearg("--hooker", "yay")
|
177
|
-
|
178
|
-
values.should == %w{yay}
|
179
|
-
end
|
180
|
-
|
181
|
-
it "should provide an option to call passed blocks during definition" do
|
182
|
-
values = []
|
183
|
-
@settings.setdefaults(:section, :hooker => {:default => "yay", :desc => "boo", :call_on_define => true, :hook => lambda { |v| values << v }})
|
184
|
-
values.should == %w{yay}
|
185
|
-
end
|
186
|
-
|
187
|
-
it "should pass the fully interpolated value to the hook when called on definition" do
|
188
|
-
values = []
|
189
|
-
@settings.setdefaults(:section, :one => ["test", "a"])
|
190
|
-
@settings.setdefaults(:section, :hooker => {:default => "$one/yay", :desc => "boo", :call_on_define => true, :hook => lambda { |v| values << v }})
|
191
|
-
values.should == %w{test/yay}
|
192
|
-
end
|
193
|
-
|
194
|
-
it "should munge values using the setting-specific methods" do
|
195
|
-
@settings[:bool] = "false"
|
196
|
-
@settings[:bool].should == false
|
197
|
-
end
|
198
|
-
|
199
|
-
it "should prefer cli values to values set in Ruby code" do
|
200
|
-
@settings.handlearg("--myval", "cliarg")
|
201
|
-
@settings[:myval] = "memarg"
|
202
|
-
@settings[:myval].should == "cliarg"
|
203
|
-
end
|
204
|
-
|
205
|
-
it "should clear the list of environments" do
|
206
|
-
Puppet::Node::Environment.expects(:clear).at_least(1)
|
207
|
-
@settings[:myval] = "memarg"
|
208
|
-
end
|
209
|
-
|
210
|
-
it "should raise an error if we try to set 'name'" do
|
211
|
-
lambda{ @settings[:name] = "foo" }.should raise_error(ArgumentError)
|
212
|
-
end
|
213
|
-
|
214
|
-
it "should raise an error if we try to set 'run_mode'" do
|
215
|
-
lambda{ @settings[:run_mode] = "foo" }.should raise_error(ArgumentError)
|
216
|
-
end
|
217
|
-
|
218
|
-
it "should warn and use [master] if we ask for [puppetmasterd]" do
|
219
|
-
Puppet.expects(:warning)
|
220
|
-
@settings.set_value(:myval, "foo", :puppetmasterd)
|
221
|
-
|
222
|
-
@settings.stubs(:run_mode).returns(:master)
|
223
|
-
@settings.value(:myval).should == "foo"
|
224
|
-
end
|
225
|
-
|
226
|
-
it "should warn and use [agent] if we ask for [puppetd]" do
|
227
|
-
Puppet.expects(:warning)
|
228
|
-
@settings.set_value(:myval, "foo", :puppetd)
|
229
|
-
|
230
|
-
@settings.stubs(:run_mode).returns(:agent)
|
231
|
-
@settings.value(:myval).should == "foo"
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
describe "when returning values" do
|
236
|
-
before do
|
237
|
-
@settings = Puppet::Util::Settings.new
|
238
|
-
@settings.setdefaults :section, :config => ["/my/file", "eh"], :one => ["ONE", "a"], :two => ["$one TWO", "b"], :three => ["$one $two THREE", "c"], :four => ["$two $three FOUR", "d"]
|
239
|
-
FileTest.stubs(:exist?).returns true
|
240
|
-
end
|
241
|
-
|
242
|
-
it "should provide a mechanism for returning set values" do
|
243
|
-
@settings[:one] = "other"
|
244
|
-
@settings[:one].should == "other"
|
245
|
-
end
|
246
|
-
|
247
|
-
it "should interpolate default values for other parameters into returned parameter values" do
|
248
|
-
@settings[:one].should == "ONE"
|
249
|
-
@settings[:two].should == "ONE TWO"
|
250
|
-
@settings[:three].should == "ONE ONE TWO THREE"
|
251
|
-
end
|
252
|
-
|
253
|
-
it "should interpolate default values that themselves need to be interpolated" do
|
254
|
-
@settings[:four].should == "ONE TWO ONE ONE TWO THREE FOUR"
|
255
|
-
end
|
256
|
-
|
257
|
-
it "should provide a method for returning uninterpolated values" do
|
258
|
-
@settings[:two] = "$one tw0"
|
259
|
-
@settings.uninterpolated_value(:two).should == "$one tw0"
|
260
|
-
@settings.uninterpolated_value(:four).should == "$two $three FOUR"
|
261
|
-
end
|
262
|
-
|
263
|
-
it "should interpolate set values for other parameters into returned parameter values" do
|
264
|
-
@settings[:one] = "on3"
|
265
|
-
@settings[:two] = "$one tw0"
|
266
|
-
@settings[:three] = "$one $two thr33"
|
267
|
-
@settings[:four] = "$one $two $three f0ur"
|
268
|
-
@settings[:one].should == "on3"
|
269
|
-
@settings[:two].should == "on3 tw0"
|
270
|
-
@settings[:three].should == "on3 on3 tw0 thr33"
|
271
|
-
@settings[:four].should == "on3 on3 tw0 on3 on3 tw0 thr33 f0ur"
|
272
|
-
end
|
273
|
-
|
274
|
-
it "should not cache interpolated values such that stale information is returned" do
|
275
|
-
@settings[:two].should == "ONE TWO"
|
276
|
-
@settings[:one] = "one"
|
277
|
-
@settings[:two].should == "one TWO"
|
278
|
-
end
|
279
|
-
|
280
|
-
it "should not cache values such that information from one environment is returned for another environment" do
|
281
|
-
text = "[env1]\none = oneval\n[env2]\none = twoval\n"
|
282
|
-
@settings.stubs(:read_file).returns(text)
|
283
|
-
@settings.parse
|
284
|
-
|
285
|
-
@settings.value(:one, "env1").should == "oneval"
|
286
|
-
@settings.value(:one, "env2").should == "twoval"
|
287
|
-
end
|
288
|
-
|
289
|
-
it "should have a run_mode that defaults to user" do
|
290
|
-
@settings.run_mode.should == :user
|
291
|
-
end
|
292
|
-
end
|
293
|
-
|
294
|
-
describe "when choosing which value to return" do
|
295
|
-
before do
|
296
|
-
@settings = Puppet::Util::Settings.new
|
297
|
-
@settings.setdefaults :section,
|
298
|
-
:config => ["/my/file", "a"],
|
299
|
-
:one => ["ONE", "a"],
|
300
|
-
:two => ["TWO", "b"]
|
301
|
-
FileTest.stubs(:exist?).returns true
|
302
|
-
Puppet.stubs(:run_mode).returns stub('run_mode', :name => :mymode)
|
303
|
-
end
|
304
|
-
|
305
|
-
it "should return default values if no values have been set" do
|
306
|
-
@settings[:one].should == "ONE"
|
307
|
-
end
|
308
|
-
|
309
|
-
it "should return values set on the cli before values set in the configuration file" do
|
310
|
-
text = "[main]\none = fileval\n"
|
311
|
-
@settings.stubs(:read_file).returns(text)
|
312
|
-
@settings.handlearg("--one", "clival")
|
313
|
-
@settings.parse
|
314
|
-
|
315
|
-
@settings[:one].should == "clival"
|
316
|
-
end
|
317
|
-
|
318
|
-
it "should return values set on the cli before values set in Ruby" do
|
319
|
-
@settings[:one] = "rubyval"
|
320
|
-
@settings.handlearg("--one", "clival")
|
321
|
-
@settings[:one].should == "clival"
|
322
|
-
end
|
323
|
-
|
324
|
-
it "should return values set in the mode-specific section before values set in the main section" do
|
325
|
-
text = "[main]\none = mainval\n[mymode]\none = modeval\n"
|
326
|
-
@settings.stubs(:read_file).returns(text)
|
327
|
-
@settings.parse
|
328
|
-
|
329
|
-
@settings[:one].should == "modeval"
|
330
|
-
end
|
331
|
-
|
332
|
-
it "should not return values outside of its search path" do
|
333
|
-
text = "[other]\none = oval\n"
|
334
|
-
file = "/some/file"
|
335
|
-
@settings.stubs(:read_file).returns(text)
|
336
|
-
@settings.parse
|
337
|
-
@settings[:one].should == "ONE"
|
338
|
-
end
|
339
|
-
|
340
|
-
it "should return values in a specified environment" do
|
341
|
-
text = "[env]\none = envval\n"
|
342
|
-
@settings.stubs(:read_file).returns(text)
|
343
|
-
@settings.parse
|
344
|
-
@settings.value(:one, "env").should == "envval"
|
345
|
-
end
|
346
|
-
|
347
|
-
it 'should use the current environment for $environment' do
|
348
|
-
@settings.setdefaults :main, :myval => ["$environment/foo", "mydocs"]
|
349
|
-
|
350
|
-
@settings.value(:myval, "myenv").should == "myenv/foo"
|
351
|
-
end
|
352
|
-
|
353
|
-
it "should interpolate found values using the current environment" do
|
354
|
-
text = "[main]\none = mainval\n[myname]\none = nameval\ntwo = $one/two\n"
|
355
|
-
@settings.stubs(:read_file).returns(text)
|
356
|
-
@settings.parse
|
357
|
-
|
358
|
-
@settings.value(:two, "myname").should == "nameval/two"
|
359
|
-
end
|
360
|
-
|
361
|
-
it "should return values in a specified environment before values in the main or name sections" do
|
362
|
-
text = "[env]\none = envval\n[main]\none = mainval\n[myname]\none = nameval\n"
|
363
|
-
@settings.stubs(:read_file).returns(text)
|
364
|
-
@settings.parse
|
365
|
-
@settings.value(:one, "env").should == "envval"
|
366
|
-
end
|
367
|
-
end
|
368
|
-
|
369
|
-
describe "when parsing its configuration" do
|
370
|
-
before do
|
371
|
-
@settings = Puppet::Util::Settings.new
|
372
|
-
@settings.stubs(:service_user_available?).returns true
|
373
|
-
@file = "/some/file"
|
374
|
-
@settings.setdefaults :section, :user => ["suser", "doc"], :group => ["sgroup", "doc"]
|
375
|
-
@settings.setdefaults :section, :config => ["/some/file", "eh"], :one => ["ONE", "a"], :two => ["$one TWO", "b"], :three => ["$one $two THREE", "c"]
|
376
|
-
FileTest.stubs(:exist?).returns true
|
377
|
-
end
|
378
|
-
|
379
|
-
it "should not ignore the report setting" do
|
380
|
-
@settings.setdefaults :section, :report => ["false", "a"]
|
381
|
-
myfile = stub "myfile"
|
382
|
-
@settings[:config] = myfile
|
383
|
-
text = <<-CONF
|
384
|
-
[puppetd]
|
385
|
-
report=true
|
386
|
-
CONF
|
387
|
-
@settings.expects(:read_file).returns(text)
|
388
|
-
@settings.parse
|
389
|
-
@settings[:report].should be_true
|
390
|
-
end
|
391
|
-
|
392
|
-
it "should use its current ':config' value for the file to parse" do
|
393
|
-
myfile = make_absolute("/my/file") # do not stub expand_path here, as this leads to a stack overflow, when mocha tries to use it
|
394
|
-
@settings[:config] = myfile
|
395
|
-
|
396
|
-
File.expects(:read).with(myfile).returns "[main]"
|
397
|
-
|
398
|
-
@settings.parse
|
399
|
-
end
|
400
|
-
|
401
|
-
it "should fail if no configuration setting is defined" do
|
402
|
-
@settings = Puppet::Util::Settings.new
|
403
|
-
lambda { @settings.parse }.should raise_error(RuntimeError)
|
404
|
-
end
|
405
|
-
|
406
|
-
it "should not try to parse non-existent files" do
|
407
|
-
FileTest.expects(:exist?).with("/some/file").returns false
|
408
|
-
|
409
|
-
File.expects(:read).with("/some/file").never
|
410
|
-
|
411
|
-
@settings.parse
|
412
|
-
end
|
413
|
-
|
414
|
-
it "should return values set in the configuration file" do
|
415
|
-
text = "[main]
|
416
|
-
one = fileval
|
417
|
-
"
|
418
|
-
@settings.expects(:read_file).returns(text)
|
419
|
-
@settings.parse
|
420
|
-
@settings[:one].should == "fileval"
|
421
|
-
end
|
422
|
-
|
423
|
-
#484 - this should probably be in the regression area
|
424
|
-
it "should not throw an exception on unknown parameters" do
|
425
|
-
text = "[main]\nnosuchparam = mval\n"
|
426
|
-
@settings.expects(:read_file).returns(text)
|
427
|
-
lambda { @settings.parse }.should_not raise_error
|
428
|
-
end
|
429
|
-
|
430
|
-
it "should convert booleans in the configuration file into Ruby booleans" do
|
431
|
-
text = "[main]
|
432
|
-
one = true
|
433
|
-
two = false
|
434
|
-
"
|
435
|
-
@settings.expects(:read_file).returns(text)
|
436
|
-
@settings.parse
|
437
|
-
@settings[:one].should == true
|
438
|
-
@settings[:two].should == false
|
439
|
-
end
|
440
|
-
|
441
|
-
it "should convert integers in the configuration file into Ruby Integers" do
|
442
|
-
text = "[main]
|
443
|
-
one = 65
|
444
|
-
"
|
445
|
-
@settings.expects(:read_file).returns(text)
|
446
|
-
@settings.parse
|
447
|
-
@settings[:one].should == 65
|
448
|
-
end
|
449
|
-
|
450
|
-
it "should support specifying all metadata (owner, group, mode) in the configuration file" do
|
451
|
-
@settings.setdefaults :section, :myfile => ["/myfile", "a"]
|
452
|
-
|
453
|
-
otherfile = make_absolute("/other/file")
|
454
|
-
text = "[main]
|
455
|
-
myfile = #{otherfile} {owner = service, group = service, mode = 644}
|
456
|
-
"
|
457
|
-
@settings.expects(:read_file).returns(text)
|
458
|
-
@settings.parse
|
459
|
-
@settings[:myfile].should == otherfile
|
460
|
-
@settings.metadata(:myfile).should == {:owner => "suser", :group => "sgroup", :mode => "644"}
|
461
|
-
end
|
462
|
-
|
463
|
-
it "should support specifying a single piece of metadata (owner, group, or mode) in the configuration file" do
|
464
|
-
@settings.setdefaults :section, :myfile => ["/myfile", "a"]
|
465
|
-
|
466
|
-
otherfile = make_absolute("/other/file")
|
467
|
-
text = "[main]
|
468
|
-
myfile = #{otherfile} {owner = service}
|
469
|
-
"
|
470
|
-
file = "/some/file"
|
471
|
-
@settings.expects(:read_file).returns(text)
|
472
|
-
@settings.parse
|
473
|
-
@settings[:myfile].should == otherfile
|
474
|
-
@settings.metadata(:myfile).should == {:owner => "suser"}
|
475
|
-
end
|
476
|
-
|
477
|
-
it "should call hooks associated with values set in the configuration file" do
|
478
|
-
values = []
|
479
|
-
@settings.setdefaults :section, :mysetting => {:default => "defval", :desc => "a", :hook => proc { |v| values << v }}
|
480
|
-
|
481
|
-
text = "[main]
|
482
|
-
mysetting = setval
|
483
|
-
"
|
484
|
-
@settings.expects(:read_file).returns(text)
|
485
|
-
@settings.parse
|
486
|
-
values.should == ["setval"]
|
487
|
-
end
|
488
|
-
|
489
|
-
it "should not call the same hook for values set multiple times in the configuration file" do
|
490
|
-
values = []
|
491
|
-
@settings.setdefaults :section, :mysetting => {:default => "defval", :desc => "a", :hook => proc { |v| values << v }}
|
492
|
-
|
493
|
-
text = "[user]
|
494
|
-
mysetting = setval
|
495
|
-
[main]
|
496
|
-
mysetting = other
|
497
|
-
"
|
498
|
-
@settings.expects(:read_file).returns(text)
|
499
|
-
@settings.parse
|
500
|
-
values.should == ["setval"]
|
501
|
-
end
|
502
|
-
|
503
|
-
it "should pass the environment-specific value to the hook when one is available" do
|
504
|
-
values = []
|
505
|
-
@settings.setdefaults :section, :mysetting => {:default => "defval", :desc => "a", :hook => proc { |v| values << v }}
|
506
|
-
@settings.setdefaults :section, :environment => ["yay", "a"]
|
507
|
-
@settings.setdefaults :section, :environments => ["yay,foo", "a"]
|
508
|
-
|
509
|
-
text = "[main]
|
510
|
-
mysetting = setval
|
511
|
-
[yay]
|
512
|
-
mysetting = other
|
513
|
-
"
|
514
|
-
@settings.expects(:read_file).returns(text)
|
515
|
-
@settings.parse
|
516
|
-
values.should == ["other"]
|
517
|
-
end
|
518
|
-
|
519
|
-
it "should pass the interpolated value to the hook when one is available" do
|
520
|
-
values = []
|
521
|
-
@settings.setdefaults :section, :base => {:default => "yay", :desc => "a", :hook => proc { |v| values << v }}
|
522
|
-
@settings.setdefaults :section, :mysetting => {:default => "defval", :desc => "a", :hook => proc { |v| values << v }}
|
523
|
-
|
524
|
-
text = "[main]
|
525
|
-
mysetting = $base/setval
|
526
|
-
"
|
527
|
-
@settings.expects(:read_file).returns(text)
|
528
|
-
@settings.parse
|
529
|
-
values.should == ["yay/setval"]
|
530
|
-
end
|
531
|
-
|
532
|
-
it "should allow empty values" do
|
533
|
-
@settings.setdefaults :section, :myarg => ["myfile", "a"]
|
534
|
-
|
535
|
-
text = "[main]
|
536
|
-
myarg =
|
537
|
-
"
|
538
|
-
@settings.stubs(:read_file).returns(text)
|
539
|
-
@settings.parse
|
540
|
-
@settings[:myarg].should == ""
|
541
|
-
end
|
542
|
-
|
543
|
-
describe "and when reading a non-positive filetimeout value from the config file" do
|
544
|
-
before do
|
545
|
-
@settings.setdefaults :foo, :filetimeout => [5, "eh"]
|
546
|
-
|
547
|
-
somefile = "/some/file"
|
548
|
-
text = "[main]
|
549
|
-
filetimeout = -1
|
550
|
-
"
|
551
|
-
File.expects(:read).with(somefile).returns(text)
|
552
|
-
File.expects(:expand_path).with(somefile).returns somefile
|
553
|
-
@settings[:config] = somefile
|
554
|
-
end
|
555
|
-
end
|
556
|
-
end
|
557
|
-
|
558
|
-
describe "when reparsing its configuration" do
|
559
|
-
before do
|
560
|
-
@settings = Puppet::Util::Settings.new
|
561
|
-
@settings.setdefaults :section, :config => ["/test/file", "a"], :one => ["ONE", "a"], :two => ["$one TWO", "b"], :three => ["$one $two THREE", "c"]
|
562
|
-
FileTest.stubs(:exist?).returns true
|
563
|
-
end
|
564
|
-
|
565
|
-
it "should use a LoadedFile instance to determine if the file has changed" do
|
566
|
-
file = mock 'file'
|
567
|
-
Puppet::Util::LoadedFile.expects(:new).with("/test/file").returns file
|
568
|
-
|
569
|
-
file.expects(:changed?)
|
570
|
-
|
571
|
-
@settings.stubs(:parse)
|
572
|
-
@settings.reparse
|
573
|
-
end
|
574
|
-
|
575
|
-
it "should not create the LoadedFile instance and should not parse if the file does not exist" do
|
576
|
-
FileTest.expects(:exist?).with("/test/file").returns false
|
577
|
-
Puppet::Util::LoadedFile.expects(:new).never
|
578
|
-
|
579
|
-
@settings.expects(:parse).never
|
580
|
-
|
581
|
-
@settings.reparse
|
582
|
-
end
|
583
|
-
|
584
|
-
it "should not reparse if the file has not changed" do
|
585
|
-
file = mock 'file'
|
586
|
-
Puppet::Util::LoadedFile.expects(:new).with("/test/file").returns file
|
587
|
-
|
588
|
-
file.expects(:changed?).returns false
|
589
|
-
|
590
|
-
@settings.expects(:parse).never
|
591
|
-
|
592
|
-
@settings.reparse
|
593
|
-
end
|
594
|
-
|
595
|
-
it "should reparse if the file has changed" do
|
596
|
-
file = stub 'file', :file => "/test/file"
|
597
|
-
Puppet::Util::LoadedFile.expects(:new).with("/test/file").returns file
|
598
|
-
|
599
|
-
file.expects(:changed?).returns true
|
600
|
-
|
601
|
-
@settings.expects(:parse)
|
602
|
-
|
603
|
-
@settings.reparse
|
604
|
-
end
|
605
|
-
|
606
|
-
it "should replace in-memory values with on-file values" do
|
607
|
-
# Init the value
|
608
|
-
text = "[main]\none = disk-init\n"
|
609
|
-
file = mock 'file'
|
610
|
-
file.stubs(:changed?).returns(true)
|
611
|
-
file.stubs(:file).returns("/test/file")
|
612
|
-
@settings[:one] = "init"
|
613
|
-
@settings.file = file
|
614
|
-
|
615
|
-
# Now replace the value
|
616
|
-
text = "[main]\none = disk-replace\n"
|
617
|
-
|
618
|
-
# This is kinda ridiculous - the reason it parses twice is that
|
619
|
-
# it goes to parse again when we ask for the value, because the
|
620
|
-
# mock always says it should get reparsed.
|
621
|
-
@settings.stubs(:read_file).returns(text)
|
622
|
-
@settings.reparse
|
623
|
-
@settings[:one].should == "disk-replace"
|
624
|
-
end
|
625
|
-
|
626
|
-
it "should retain parameters set by cli when configuration files are reparsed" do
|
627
|
-
@settings.handlearg("--one", "clival")
|
628
|
-
|
629
|
-
text = "[main]\none = on-disk\n"
|
630
|
-
@settings.stubs(:read_file).returns(text)
|
631
|
-
@settings.parse
|
632
|
-
|
633
|
-
@settings[:one].should == "clival"
|
634
|
-
end
|
635
|
-
|
636
|
-
it "should remove in-memory values that are no longer set in the file" do
|
637
|
-
# Init the value
|
638
|
-
text = "[main]\none = disk-init\n"
|
639
|
-
@settings.expects(:read_file).returns(text)
|
640
|
-
@settings.parse
|
641
|
-
@settings[:one].should == "disk-init"
|
642
|
-
|
643
|
-
# Now replace the value
|
644
|
-
text = "[main]\ntwo = disk-replace\n"
|
645
|
-
@settings.expects(:read_file).returns(text)
|
646
|
-
@settings.parse
|
647
|
-
#@settings.reparse
|
648
|
-
|
649
|
-
# The originally-overridden value should be replaced with the default
|
650
|
-
@settings[:one].should == "ONE"
|
651
|
-
|
652
|
-
# and we should now have the new value in memory
|
653
|
-
@settings[:two].should == "disk-replace"
|
654
|
-
end
|
655
|
-
|
656
|
-
it "should retain in-memory values if the file has a syntax error" do
|
657
|
-
# Init the value
|
658
|
-
text = "[main]\none = initial-value\n"
|
659
|
-
@settings.expects(:read_file).returns(text)
|
660
|
-
@settings.parse
|
661
|
-
@settings[:one].should == "initial-value"
|
662
|
-
|
663
|
-
# Now replace the value with something bogus
|
664
|
-
text = "[main]\nkenny = killed-by-what-follows\n1 is 2, blah blah florp\n"
|
665
|
-
@settings.expects(:read_file).returns(text)
|
666
|
-
@settings.parse
|
667
|
-
|
668
|
-
# The originally-overridden value should not be replaced with the default
|
669
|
-
@settings[:one].should == "initial-value"
|
670
|
-
|
671
|
-
# and we should not have the new value in memory
|
672
|
-
@settings[:kenny].should be_nil
|
673
|
-
end
|
674
|
-
end
|
675
|
-
|
676
|
-
it "should provide a method for creating a catalog of resources from its configuration" do
|
677
|
-
Puppet::Util::Settings.new.should respond_to(:to_catalog)
|
678
|
-
end
|
679
|
-
|
680
|
-
describe "when creating a catalog" do
|
681
|
-
before do
|
682
|
-
@settings = Puppet::Util::Settings.new
|
683
|
-
@settings.stubs(:service_user_available?).returns true
|
684
|
-
@prefix = Puppet.features.posix? ? "" : "C:"
|
685
|
-
end
|
686
|
-
|
687
|
-
it "should add all file resources to the catalog if no sections have been specified" do
|
688
|
-
@settings.setdefaults :main, :maindir => [@prefix+"/maindir", "a"], :seconddir => [@prefix+"/seconddir", "a"]
|
689
|
-
@settings.setdefaults :other, :otherdir => [@prefix+"/otherdir", "a"]
|
690
|
-
|
691
|
-
catalog = @settings.to_catalog
|
692
|
-
|
693
|
-
[@prefix+"/maindir", @prefix+"/seconddir", @prefix+"/otherdir"].each do |path|
|
694
|
-
catalog.resource(:file, path).should be_instance_of(Puppet::Resource)
|
695
|
-
end
|
696
|
-
end
|
697
|
-
|
698
|
-
it "should add only files in the specified sections if section names are provided" do
|
699
|
-
@settings.setdefaults :main, :maindir => [@prefix+"/maindir", "a"]
|
700
|
-
@settings.setdefaults :other, :otherdir => [@prefix+"/otherdir", "a"]
|
701
|
-
catalog = @settings.to_catalog(:main)
|
702
|
-
catalog.resource(:file, @prefix+"/otherdir").should be_nil
|
703
|
-
catalog.resource(:file, @prefix+"/maindir").should be_instance_of(Puppet::Resource)
|
704
|
-
end
|
705
|
-
|
706
|
-
it "should not try to add the same file twice" do
|
707
|
-
@settings.setdefaults :main, :maindir => [@prefix+"/maindir", "a"]
|
708
|
-
@settings.setdefaults :other, :otherdir => [@prefix+"/maindir", "a"]
|
709
|
-
lambda { @settings.to_catalog }.should_not raise_error
|
710
|
-
end
|
711
|
-
|
712
|
-
it "should ignore files whose :to_resource method returns nil" do
|
713
|
-
@settings.setdefaults :main, :maindir => [@prefix+"/maindir", "a"]
|
714
|
-
@settings.setting(:maindir).expects(:to_resource).returns nil
|
715
|
-
|
716
|
-
Puppet::Resource::Catalog.any_instance.expects(:add_resource).never
|
717
|
-
@settings.to_catalog
|
718
|
-
end
|
719
|
-
|
720
|
-
describe "on Microsoft Windows" do
|
721
|
-
before :each do
|
722
|
-
Puppet.features.stubs(:root?).returns true
|
723
|
-
Puppet.features.stubs(:microsoft_windows?).returns true
|
724
|
-
|
725
|
-
@settings.setdefaults :foo, :mkusers => [true, "e"], :user => ["suser", "doc"], :group => ["sgroup", "doc"]
|
726
|
-
@settings.setdefaults :other, :otherdir => {:default => "/otherdir", :desc => "a", :owner => "service", :group => "service"}
|
727
|
-
|
728
|
-
@catalog = @settings.to_catalog
|
729
|
-
end
|
730
|
-
|
731
|
-
it "it should not add users and groups to the catalog" do
|
732
|
-
@catalog.resource(:user, "suser").should be_nil
|
733
|
-
@catalog.resource(:group, "sgroup").should be_nil
|
734
|
-
end
|
735
|
-
end
|
736
|
-
|
737
|
-
describe "when adding users and groups to the catalog" do
|
738
|
-
before do
|
739
|
-
Puppet.features.stubs(:root?).returns true
|
740
|
-
Puppet.features.stubs(:microsoft_windows?).returns false
|
741
|
-
|
742
|
-
@settings.setdefaults :foo, :mkusers => [true, "e"], :user => ["suser", "doc"], :group => ["sgroup", "doc"]
|
743
|
-
@settings.setdefaults :other, :otherdir => {:default => "/otherdir", :desc => "a", :owner => "service", :group => "service"}
|
744
|
-
|
745
|
-
@catalog = @settings.to_catalog
|
746
|
-
end
|
747
|
-
|
748
|
-
it "should add each specified user and group to the catalog if :mkusers is a valid setting, is enabled, and we're running as root" do
|
749
|
-
@catalog.resource(:user, "suser").should be_instance_of(Puppet::Resource)
|
750
|
-
@catalog.resource(:group, "sgroup").should be_instance_of(Puppet::Resource)
|
751
|
-
end
|
752
|
-
|
753
|
-
it "should only add users and groups to the catalog from specified sections" do
|
754
|
-
@settings.setdefaults :yay, :yaydir => {:default => "/yaydir", :desc => "a", :owner => "service", :group => "service"}
|
755
|
-
catalog = @settings.to_catalog(:other)
|
756
|
-
catalog.resource(:user, "jane").should be_nil
|
757
|
-
catalog.resource(:group, "billy").should be_nil
|
758
|
-
end
|
759
|
-
|
760
|
-
it "should not add users or groups to the catalog if :mkusers not running as root" do
|
761
|
-
Puppet.features.stubs(:root?).returns false
|
762
|
-
|
763
|
-
catalog = @settings.to_catalog
|
764
|
-
catalog.resource(:user, "suser").should be_nil
|
765
|
-
catalog.resource(:group, "sgroup").should be_nil
|
766
|
-
end
|
767
|
-
|
768
|
-
it "should not add users or groups to the catalog if :mkusers is not a valid setting" do
|
769
|
-
Puppet.features.stubs(:root?).returns true
|
770
|
-
settings = Puppet::Util::Settings.new
|
771
|
-
settings.setdefaults :other, :otherdir => {:default => "/otherdir", :desc => "a", :owner => "service", :group => "service"}
|
772
|
-
|
773
|
-
catalog = settings.to_catalog
|
774
|
-
catalog.resource(:user, "suser").should be_nil
|
775
|
-
catalog.resource(:group, "sgroup").should be_nil
|
776
|
-
end
|
777
|
-
|
778
|
-
it "should not add users or groups to the catalog if :mkusers is a valid setting but is disabled" do
|
779
|
-
@settings[:mkusers] = false
|
780
|
-
|
781
|
-
catalog = @settings.to_catalog
|
782
|
-
catalog.resource(:user, "suser").should be_nil
|
783
|
-
catalog.resource(:group, "sgroup").should be_nil
|
784
|
-
end
|
785
|
-
|
786
|
-
it "should not try to add users or groups to the catalog twice" do
|
787
|
-
@settings.setdefaults :yay, :yaydir => {:default => "/yaydir", :desc => "a", :owner => "service", :group => "service"}
|
788
|
-
|
789
|
-
# This would fail if users/groups were added twice
|
790
|
-
lambda { @settings.to_catalog }.should_not raise_error
|
791
|
-
end
|
792
|
-
|
793
|
-
it "should set :ensure to :present on each created user and group" do
|
794
|
-
@catalog.resource(:user, "suser")[:ensure].should == :present
|
795
|
-
@catalog.resource(:group, "sgroup")[:ensure].should == :present
|
796
|
-
end
|
797
|
-
|
798
|
-
it "should set each created user's :gid to the service group" do
|
799
|
-
@settings.to_catalog.resource(:user, "suser")[:gid].should == "sgroup"
|
800
|
-
end
|
801
|
-
|
802
|
-
it "should not attempt to manage the root user" do
|
803
|
-
Puppet.features.stubs(:root?).returns true
|
804
|
-
@settings.setdefaults :foo, :foodir => {:default => "/foodir", :desc => "a", :owner => "root", :group => "service"}
|
805
|
-
|
806
|
-
@settings.to_catalog.resource(:user, "root").should be_nil
|
807
|
-
end
|
808
|
-
end
|
809
|
-
end
|
810
|
-
|
811
|
-
it "should be able to be converted to a manifest" do
|
812
|
-
Puppet::Util::Settings.new.should respond_to(:to_manifest)
|
813
|
-
end
|
814
|
-
|
815
|
-
describe "when being converted to a manifest" do
|
816
|
-
it "should produce a string with the code for each resource joined by two carriage returns" do
|
817
|
-
@settings = Puppet::Util::Settings.new
|
818
|
-
@settings.setdefaults :main, :maindir => ["/maindir", "a"], :seconddir => ["/seconddir", "a"]
|
819
|
-
|
820
|
-
main = stub 'main_resource', :ref => "File[/maindir]"
|
821
|
-
main.expects(:to_manifest).returns "maindir"
|
822
|
-
second = stub 'second_resource', :ref => "File[/seconddir]"
|
823
|
-
second.expects(:to_manifest).returns "seconddir"
|
824
|
-
@settings.setting(:maindir).expects(:to_resource).returns main
|
825
|
-
@settings.setting(:seconddir).expects(:to_resource).returns second
|
826
|
-
|
827
|
-
@settings.to_manifest.split("\n\n").sort.should == %w{maindir seconddir}
|
828
|
-
end
|
829
|
-
end
|
830
|
-
|
831
|
-
describe "when using sections of the configuration to manage the local host" do
|
832
|
-
before do
|
833
|
-
@settings = Puppet::Util::Settings.new
|
834
|
-
@settings.stubs(:service_user_available?).returns true
|
835
|
-
@settings.setdefaults :main, :noop => [false, ""]
|
836
|
-
@settings.setdefaults :main, :maindir => ["/maindir", "a"], :seconddir => ["/seconddir", "a"]
|
837
|
-
@settings.setdefaults :main, :user => ["suser", "doc"], :group => ["sgroup", "doc"]
|
838
|
-
@settings.setdefaults :other, :otherdir => {:default => "/otherdir", :desc => "a", :owner => "service", :group => "service", :mode => 0755}
|
839
|
-
@settings.setdefaults :third, :thirddir => ["/thirddir", "b"]
|
840
|
-
@settings.setdefaults :files, :myfile => {:default => "/myfile", :desc => "a", :mode => 0755}
|
841
|
-
end
|
842
|
-
|
843
|
-
it "should provide a method that writes files with the correct modes" do
|
844
|
-
@settings.should respond_to(:write)
|
845
|
-
end
|
846
|
-
|
847
|
-
it "should provide a method that creates directories with the correct modes" do
|
848
|
-
Puppet::Util::SUIDManager.expects(:asuser).with("suser", "sgroup").yields
|
849
|
-
Dir.expects(:mkdir).with("/otherdir", 0755)
|
850
|
-
@settings.mkdir(:otherdir)
|
851
|
-
end
|
852
|
-
|
853
|
-
it "should create a catalog with the specified sections" do
|
854
|
-
@settings.expects(:to_catalog).with(:main, :other).returns Puppet::Resource::Catalog.new("foo")
|
855
|
-
@settings.use(:main, :other)
|
856
|
-
end
|
857
|
-
|
858
|
-
it "should canonicalize the sections" do
|
859
|
-
@settings.expects(:to_catalog).with(:main, :other).returns Puppet::Resource::Catalog.new("foo")
|
860
|
-
@settings.use("main", "other")
|
861
|
-
end
|
862
|
-
|
863
|
-
it "should ignore sections that have already been used" do
|
864
|
-
@settings.expects(:to_catalog).with(:main).returns Puppet::Resource::Catalog.new("foo")
|
865
|
-
@settings.use(:main)
|
866
|
-
@settings.expects(:to_catalog).with(:other).returns Puppet::Resource::Catalog.new("foo")
|
867
|
-
@settings.use(:main, :other)
|
868
|
-
end
|
869
|
-
|
870
|
-
it "should ignore tags and schedules when creating files and directories"
|
871
|
-
|
872
|
-
it "should be able to provide all of its parameters in a format compatible with GetOpt::Long" do
|
873
|
-
pending "Not converted from test/unit yet"
|
874
|
-
end
|
875
|
-
|
876
|
-
it "should convert the created catalog to a RAL catalog" do
|
877
|
-
@catalog = Puppet::Resource::Catalog.new("foo")
|
878
|
-
@settings.expects(:to_catalog).with(:main).returns @catalog
|
879
|
-
|
880
|
-
@catalog.expects(:to_ral).returns @catalog
|
881
|
-
@settings.use(:main)
|
882
|
-
end
|
883
|
-
|
884
|
-
it "should specify that it is not managing a host catalog" do
|
885
|
-
catalog = Puppet::Resource::Catalog.new("foo")
|
886
|
-
catalog.expects(:apply)
|
887
|
-
@settings.expects(:to_catalog).returns catalog
|
888
|
-
|
889
|
-
catalog.stubs(:to_ral).returns catalog
|
890
|
-
|
891
|
-
catalog.expects(:host_config=).with false
|
892
|
-
|
893
|
-
@settings.use(:main)
|
894
|
-
end
|
895
|
-
|
896
|
-
it "should support a method for re-using all currently used sections" do
|
897
|
-
@settings.expects(:to_catalog).with(:main, :third).times(2).returns Puppet::Resource::Catalog.new("foo")
|
898
|
-
|
899
|
-
@settings.use(:main, :third)
|
900
|
-
@settings.reuse
|
901
|
-
end
|
902
|
-
|
903
|
-
it "should fail with an appropriate message if any resources fail" do
|
904
|
-
@catalog = Puppet::Resource::Catalog.new("foo")
|
905
|
-
@catalog.stubs(:to_ral).returns @catalog
|
906
|
-
@settings.expects(:to_catalog).returns @catalog
|
907
|
-
|
908
|
-
@trans = mock("transaction")
|
909
|
-
@catalog.expects(:apply).yields(@trans)
|
910
|
-
|
911
|
-
@trans.expects(:any_failed?).returns(true)
|
912
|
-
|
913
|
-
report = mock 'report'
|
914
|
-
@trans.expects(:report).returns report
|
915
|
-
|
916
|
-
log = mock 'log', :to_s => "My failure", :level => :err
|
917
|
-
report.expects(:logs).returns [log]
|
918
|
-
|
919
|
-
@settings.expects(:raise).with { |msg| msg.include?("My failure") }
|
920
|
-
@settings.use(:whatever)
|
921
|
-
end
|
922
|
-
end
|
923
|
-
|
924
|
-
describe "when dealing with printing configs" do
|
925
|
-
before do
|
926
|
-
@settings = Puppet::Util::Settings.new
|
927
|
-
#these are the magic default values
|
928
|
-
@settings.stubs(:value).with(:configprint).returns("")
|
929
|
-
@settings.stubs(:value).with(:genconfig).returns(false)
|
930
|
-
@settings.stubs(:value).with(:genmanifest).returns(false)
|
931
|
-
@settings.stubs(:value).with(:environment).returns(nil)
|
932
|
-
end
|
933
|
-
|
934
|
-
describe "when checking print_config?" do
|
935
|
-
it "should return false when the :configprint, :genconfig and :genmanifest are not set" do
|
936
|
-
@settings.print_configs?.should be_false
|
937
|
-
end
|
938
|
-
|
939
|
-
it "should return true when :configprint has a value" do
|
940
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
941
|
-
@settings.print_configs?.should be_true
|
942
|
-
end
|
943
|
-
|
944
|
-
it "should return true when :genconfig has a value" do
|
945
|
-
@settings.stubs(:value).with(:genconfig).returns(true)
|
946
|
-
@settings.print_configs?.should be_true
|
947
|
-
end
|
948
|
-
|
949
|
-
it "should return true when :genmanifest has a value" do
|
950
|
-
@settings.stubs(:value).with(:genmanifest).returns(true)
|
951
|
-
@settings.print_configs?.should be_true
|
952
|
-
end
|
953
|
-
end
|
954
|
-
|
955
|
-
describe "when printing configs" do
|
956
|
-
describe "when :configprint has a value" do
|
957
|
-
it "should call print_config_options" do
|
958
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
959
|
-
@settings.expects(:print_config_options)
|
960
|
-
@settings.print_configs
|
961
|
-
end
|
962
|
-
|
963
|
-
it "should get the value of the option using the environment" do
|
964
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
965
|
-
@settings.stubs(:include?).with("something").returns(true)
|
966
|
-
@settings.expects(:value).with(:environment).returns("env")
|
967
|
-
@settings.expects(:value).with("something", "env").returns("foo")
|
968
|
-
@settings.stubs(:puts).with("foo")
|
969
|
-
@settings.print_configs
|
970
|
-
end
|
971
|
-
|
972
|
-
it "should print the value of the option" do
|
973
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
974
|
-
@settings.stubs(:include?).with("something").returns(true)
|
975
|
-
@settings.stubs(:value).with("something", nil).returns("foo")
|
976
|
-
@settings.expects(:puts).with("foo")
|
977
|
-
@settings.print_configs
|
978
|
-
end
|
979
|
-
|
980
|
-
it "should print the value pairs if there are multiple options" do
|
981
|
-
@settings.stubs(:value).with(:configprint).returns("bar,baz")
|
982
|
-
@settings.stubs(:include?).with("bar").returns(true)
|
983
|
-
@settings.stubs(:include?).with("baz").returns(true)
|
984
|
-
@settings.stubs(:value).with("bar", nil).returns("foo")
|
985
|
-
@settings.stubs(:value).with("baz", nil).returns("fud")
|
986
|
-
@settings.expects(:puts).with("bar = foo")
|
987
|
-
@settings.expects(:puts).with("baz = fud")
|
988
|
-
@settings.print_configs
|
989
|
-
end
|
990
|
-
|
991
|
-
it "should print a whole bunch of stuff if :configprint = all"
|
992
|
-
|
993
|
-
it "should return true after printing" do
|
994
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
995
|
-
@settings.stubs(:include?).with("something").returns(true)
|
996
|
-
@settings.stubs(:value).with("something", nil).returns("foo")
|
997
|
-
@settings.stubs(:puts).with("foo")
|
998
|
-
@settings.print_configs.should be_true
|
999
|
-
end
|
1000
|
-
|
1001
|
-
it "should return false if a config param is not found" do
|
1002
|
-
@settings.stubs :puts
|
1003
|
-
@settings.stubs(:value).with(:configprint).returns("something")
|
1004
|
-
@settings.stubs(:include?).with("something").returns(false)
|
1005
|
-
@settings.print_configs.should be_false
|
1006
|
-
end
|
1007
|
-
end
|
1008
|
-
|
1009
|
-
describe "when genconfig is true" do
|
1010
|
-
before do
|
1011
|
-
@settings.stubs :puts
|
1012
|
-
end
|
1013
|
-
|
1014
|
-
it "should call to_config" do
|
1015
|
-
@settings.stubs(:value).with(:genconfig).returns(true)
|
1016
|
-
@settings.expects(:to_config)
|
1017
|
-
@settings.print_configs
|
1018
|
-
end
|
1019
|
-
|
1020
|
-
it "should return true from print_configs" do
|
1021
|
-
@settings.stubs(:value).with(:genconfig).returns(true)
|
1022
|
-
@settings.stubs(:to_config)
|
1023
|
-
@settings.print_configs.should be_true
|
1024
|
-
end
|
1025
|
-
end
|
1026
|
-
|
1027
|
-
describe "when genmanifest is true" do
|
1028
|
-
before do
|
1029
|
-
@settings.stubs :puts
|
1030
|
-
end
|
1031
|
-
|
1032
|
-
it "should call to_config" do
|
1033
|
-
@settings.stubs(:value).with(:genmanifest).returns(true)
|
1034
|
-
@settings.expects(:to_manifest)
|
1035
|
-
@settings.print_configs
|
1036
|
-
end
|
1037
|
-
|
1038
|
-
it "should return true from print_configs" do
|
1039
|
-
@settings.stubs(:value).with(:genmanifest).returns(true)
|
1040
|
-
@settings.stubs(:to_manifest)
|
1041
|
-
@settings.print_configs.should be_true
|
1042
|
-
end
|
1043
|
-
end
|
1044
|
-
end
|
1045
|
-
end
|
1046
|
-
|
1047
|
-
describe "when determining if the service user is available" do
|
1048
|
-
it "should return false if there is no user setting" do
|
1049
|
-
Puppet::Util::Settings.new.should_not be_service_user_available
|
1050
|
-
end
|
1051
|
-
|
1052
|
-
it "should return false if the user provider says the user is missing" do
|
1053
|
-
settings = Puppet::Util::Settings.new
|
1054
|
-
settings.setdefaults :main, :user => ["foo", "doc"]
|
1055
|
-
|
1056
|
-
user = mock 'user'
|
1057
|
-
user.expects(:exists?).returns false
|
1058
|
-
|
1059
|
-
Puppet::Type.type(:user).expects(:new).with { |args| args[:name] == "foo" }.returns user
|
1060
|
-
|
1061
|
-
settings.should_not be_service_user_available
|
1062
|
-
end
|
1063
|
-
|
1064
|
-
it "should return true if the user provider says the user is present" do
|
1065
|
-
settings = Puppet::Util::Settings.new
|
1066
|
-
settings.setdefaults :main, :user => ["foo", "doc"]
|
1067
|
-
|
1068
|
-
user = mock 'user'
|
1069
|
-
user.expects(:exists?).returns true
|
1070
|
-
|
1071
|
-
Puppet::Type.type(:user).expects(:new).with { |args| args[:name] == "foo" }.returns user
|
1072
|
-
|
1073
|
-
settings.should be_service_user_available
|
1074
|
-
end
|
1075
|
-
|
1076
|
-
it "should cache the result"
|
1077
|
-
end
|
1078
|
-
|
1079
|
-
describe "#writesub" do
|
1080
|
-
it "should only pass valid arguments to File.open" do
|
1081
|
-
settings = Puppet::Util::Settings.new
|
1082
|
-
settings.stubs(:get_config_file_default).with(:privatekeydir).returns(OpenStruct.new(:mode => "750"))
|
1083
|
-
|
1084
|
-
File.expects(:open).with("/path/to/keydir", "w", 750).returns true
|
1085
|
-
settings.writesub(:privatekeydir, "/path/to/keydir")
|
1086
|
-
end
|
1087
|
-
end
|
1088
|
-
end
|