puppet 2.6.18 → 2.7.1
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 +733 -187
- data/LICENSE +13 -13
- data/README.md +5 -9
- data/Rakefile +1 -1
- data/conf/auth.conf +8 -3
- data/conf/redhat/puppet.spec +21 -110
- data/conf/solaris/pkginfo +3 -4
- data/conf/suse/puppet.spec +1 -1
- data/ext/cert_inspector +140 -0
- data/ext/nagios/naggen +12 -5
- data/ext/puppet-test +11 -5
- data/ext/vim/README +1 -2
- data/ext/yaml_nodes.rb +11 -5
- data/install.rb +1 -54
- data/lib/puppet.rb +6 -10
- data/lib/puppet/application.rb +23 -32
- data/lib/puppet/application/agent.rb +228 -7
- data/lib/puppet/application/apply.rb +108 -36
- data/lib/puppet/application/catalog.rb +4 -0
- data/lib/puppet/application/cert.rb +128 -17
- data/lib/puppet/application/certificate.rb +18 -0
- data/lib/puppet/application/certificate_request.rb +4 -0
- data/lib/puppet/application/certificate_revocation_list.rb +4 -0
- data/lib/puppet/application/config.rb +4 -0
- data/lib/puppet/application/describe.rb +53 -0
- data/lib/puppet/application/device.rb +255 -0
- data/lib/puppet/application/doc.rb +92 -6
- data/lib/puppet/application/face_base.rb +246 -0
- data/lib/puppet/application/facts.rb +4 -0
- data/lib/puppet/application/file.rb +4 -0
- data/lib/puppet/application/filebucket.rb +102 -0
- data/lib/puppet/application/help.rb +4 -0
- data/lib/puppet/application/indirection_base.rb +4 -0
- data/lib/puppet/application/inspect.rb +21 -23
- data/lib/puppet/application/key.rb +4 -0
- data/lib/puppet/application/kick.rb +131 -4
- data/lib/puppet/application/man.rb +4 -0
- data/lib/puppet/application/master.rb +108 -40
- data/lib/puppet/application/node.rb +4 -0
- data/lib/puppet/application/parser.rb +5 -0
- data/lib/puppet/application/plugin.rb +3 -0
- data/lib/puppet/application/queue.rb +75 -13
- data/lib/puppet/application/report.rb +4 -0
- data/lib/puppet/application/resource.rb +115 -23
- data/lib/puppet/application/resource_type.rb +4 -0
- data/lib/puppet/application/secret_agent.rb +6 -0
- data/lib/puppet/application/status.rb +4 -0
- data/lib/puppet/configurer.rb +57 -61
- data/lib/puppet/configurer/fact_handler.rb +1 -6
- data/lib/puppet/daemon.rb +2 -2
- data/lib/puppet/defaults.rb +30 -88
- data/lib/puppet/dsl/resource_type_api.rb +19 -31
- data/lib/puppet/external/nagios/parser.rb +1 -1
- data/lib/puppet/face.rb +12 -0
- data/lib/puppet/face/catalog.rb +130 -0
- data/lib/puppet/face/catalog/select.rb +49 -0
- data/lib/puppet/face/certificate.rb +115 -0
- data/lib/puppet/face/certificate_request.rb +55 -0
- data/lib/puppet/face/certificate_revocation_list.rb +60 -0
- data/lib/puppet/face/config.rb +45 -0
- data/lib/puppet/face/facts.rb +81 -0
- data/lib/puppet/face/file.rb +47 -0
- data/lib/puppet/face/file/download.rb +54 -0
- data/lib/puppet/face/file/store.rb +21 -0
- data/lib/puppet/face/help.rb +131 -0
- data/lib/puppet/face/help/action.erb +53 -0
- data/lib/puppet/face/help/face.erb +79 -0
- data/lib/puppet/face/help/global.erb +19 -0
- data/lib/puppet/face/help/man.erb +136 -0
- data/lib/puppet/face/key.rb +15 -0
- data/lib/puppet/face/man.rb +93 -0
- data/lib/puppet/face/node.rb +43 -0
- data/lib/puppet/face/parser.rb +42 -0
- data/lib/puppet/face/plugin.rb +55 -0
- data/lib/puppet/face/report.rb +56 -0
- data/lib/puppet/face/resource.rb +53 -0
- data/lib/puppet/face/resource_type.rb +81 -0
- data/lib/puppet/face/secret_agent.rb +54 -0
- data/lib/puppet/face/status.rb +52 -0
- data/lib/puppet/feature/ssh.rb +4 -0
- data/lib/puppet/file_bucket/dipper.rb +3 -3
- data/lib/puppet/file_bucket/file.rb +6 -5
- data/lib/puppet/file_bucket/file/indirection_hooks.rb +9 -0
- data/lib/puppet/file_serving/configuration.rb +1 -2
- data/lib/puppet/file_serving/content.rb +2 -1
- data/lib/puppet/file_serving/{terminus_selector.rb → indirection_hooks.rb} +3 -2
- data/lib/puppet/file_serving/metadata.rb +2 -1
- data/lib/puppet/file_serving/mount/modules.rb +5 -4
- data/lib/puppet/indirector.rb +16 -43
- data/lib/puppet/indirector/catalog/active_record.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +5 -15
- data/lib/puppet/indirector/catalog/static_compiler.rb +137 -0
- data/lib/puppet/indirector/certificate_request/ca.rb +8 -0
- data/lib/puppet/indirector/certificate_status.rb +4 -0
- data/lib/puppet/indirector/certificate_status/file.rb +82 -0
- data/lib/puppet/indirector/certificate_status/rest.rb +10 -0
- data/lib/puppet/indirector/couch.rb +5 -3
- data/lib/puppet/indirector/exec.rb +3 -3
- data/lib/puppet/indirector/face.rb +127 -0
- data/lib/puppet/indirector/facts/network_device.rb +25 -0
- data/lib/puppet/indirector/file.rb +79 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +0 -4
- data/lib/puppet/indirector/indirection.rb +1 -2
- data/lib/puppet/indirector/inventory/yaml.rb +81 -0
- data/lib/puppet/indirector/report/processor.rb +0 -2
- data/lib/puppet/indirector/request.rb +0 -4
- data/lib/puppet/indirector/resource/ral.rb +0 -4
- data/lib/puppet/indirector/resource_type/parser.rb +19 -3
- data/lib/puppet/indirector/rest.rb +11 -5
- data/lib/puppet/indirector/run/local.rb +0 -4
- data/lib/puppet/indirector/ssl_file.rb +1 -5
- data/lib/puppet/indirector/terminus.rb +3 -26
- data/lib/puppet/indirector/yaml.rb +0 -5
- data/lib/puppet/interface.rb +156 -0
- data/lib/puppet/interface/action.rb +284 -0
- data/lib/puppet/interface/action_builder.rb +74 -0
- data/lib/puppet/interface/action_manager.rb +70 -0
- data/lib/puppet/interface/documentation.rb +230 -0
- data/lib/puppet/interface/face_collection.rb +137 -0
- data/lib/puppet/interface/option.rb +108 -0
- data/lib/puppet/interface/option_builder.rb +54 -0
- data/lib/puppet/interface/option_manager.rb +67 -0
- data/lib/puppet/metatype/manager.rb +20 -7
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/network/client.rb +179 -0
- data/lib/puppet/network/client/ca.rb +56 -0
- data/lib/puppet/network/client/file.rb +6 -0
- data/lib/puppet/network/client/proxy.rb +27 -0
- data/lib/puppet/network/client/report.rb +26 -0
- data/lib/puppet/network/client/runner.rb +10 -0
- data/lib/puppet/network/client/status.rb +4 -0
- data/lib/puppet/network/format.rb +1 -1
- data/lib/puppet/network/formats.rb +63 -0
- data/lib/puppet/network/handler/ca.rb +106 -16
- data/lib/puppet/network/handler/filebucket.rb +2 -4
- data/lib/puppet/network/handler/fileserver.rb +3 -2
- data/lib/puppet/network/handler/master.rb +5 -3
- data/lib/puppet/network/handler/report.rb +0 -2
- data/lib/puppet/network/handler/runner.rb +0 -2
- data/lib/puppet/network/handler/status.rb +0 -2
- data/lib/puppet/network/http/api/v1.rb +11 -3
- data/lib/puppet/network/http/handler.rb +26 -35
- data/lib/puppet/network/http/rack/rest.rb +2 -7
- data/lib/puppet/network/http/webrick.rb +1 -2
- data/lib/puppet/network/http_pool.rb +8 -17
- data/lib/puppet/network/http_server/mongrel.rb +1 -0
- data/lib/puppet/network/http_server/webrick.rb +155 -0
- data/lib/puppet/network/rest_authconfig.rb +4 -3
- data/lib/puppet/network/rest_authorization.rb +2 -2
- data/lib/puppet/network/rights.rb +4 -9
- data/lib/puppet/network/server.rb +1 -1
- data/lib/puppet/network/xmlrpc/client.rb +211 -0
- data/lib/puppet/node.rb +2 -1
- data/lib/puppet/node/environment.rb +30 -3
- data/lib/puppet/node/facts.rb +15 -15
- data/lib/puppet/node/inventory.rb +7 -0
- data/lib/puppet/parser/ast.rb +6 -2
- data/lib/puppet/parser/ast/astarray.rb +12 -23
- data/lib/puppet/parser/ast/caseopt.rb +12 -24
- data/lib/puppet/parser/ast/definition.rb +17 -0
- data/lib/puppet/parser/ast/hostclass.rb +29 -0
- data/lib/puppet/parser/ast/leaf.rb +2 -2
- data/lib/puppet/parser/ast/node.rb +20 -0
- data/lib/puppet/parser/ast/resource.rb +42 -50
- data/lib/puppet/parser/ast/resource_instance.rb +9 -0
- data/lib/puppet/parser/ast/resource_override.rb +2 -3
- data/lib/puppet/parser/ast/resource_reference.rb +1 -1
- data/lib/puppet/parser/ast/top_level_construct.rb +4 -0
- data/lib/puppet/parser/ast/vardef.rb +1 -1
- data/lib/puppet/parser/compiler.rb +16 -17
- data/lib/puppet/parser/functions/create_resources.rb +47 -0
- data/lib/puppet/parser/functions/extlookup.rb +2 -7
- data/lib/puppet/parser/functions/fqdn_rand.rb +2 -2
- data/lib/puppet/parser/functions/sha1.rb +1 -1
- data/lib/puppet/parser/grammar.ra +67 -144
- data/lib/puppet/parser/lexer.rb +1 -1
- data/lib/puppet/parser/parser.rb +1190 -1262
- data/lib/puppet/parser/parser_support.rb +48 -73
- data/lib/puppet/parser/resource.rb +2 -19
- data/lib/puppet/parser/scope.rb +33 -103
- data/lib/puppet/parser/templatewrapper.rb +21 -22
- data/lib/puppet/parser/type_loader.rb +60 -35
- data/lib/puppet/provider/aixobject.rb +393 -0
- data/lib/puppet/provider/augeas/augeas.rb +37 -15
- data/lib/puppet/provider/cisco.rb +9 -0
- data/lib/puppet/provider/cron/crontab.rb +1 -7
- data/lib/puppet/provider/exec/posix.rb +3 -6
- data/lib/puppet/provider/exec/shell.rb +2 -11
- data/lib/puppet/provider/file/posix.rb +1 -1
- data/lib/puppet/provider/file/win32.rb +1 -1
- data/lib/puppet/provider/group/aix.rb +141 -0
- data/lib/puppet/provider/group/directoryservice.rb +0 -14
- data/lib/puppet/provider/host/parsed.rb +23 -55
- data/lib/puppet/provider/interface/base.rb +0 -0
- data/lib/puppet/provider/interface/cisco.rb +27 -0
- data/lib/puppet/provider/mcx/mcxcontent.rb +57 -96
- data/lib/puppet/provider/mount/parsed.rb +1 -1
- data/lib/puppet/provider/naginator.rb +1 -9
- data/lib/puppet/provider/nameservice/directoryservice.rb +41 -26
- data/lib/puppet/provider/network_device.rb +68 -0
- data/lib/puppet/provider/package/appdmg.rb +13 -13
- data/lib/puppet/provider/package/aptitude.rb +0 -1
- data/lib/puppet/provider/package/pip.rb +109 -0
- data/lib/puppet/provider/package/pkgdmg.rb +24 -32
- data/lib/puppet/provider/package/pkgutil.rb +175 -0
- data/lib/puppet/provider/package/yum.rb +8 -1
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +3 -3
- data/lib/puppet/provider/service/upstart.rb +73 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +9 -10
- data/lib/puppet/provider/user/aix.rb +353 -0
- data/lib/puppet/provider/user/directoryservice.rb +0 -14
- data/lib/puppet/provider/user/user_role_add.rb +17 -32
- data/lib/puppet/provider/vlan/cisco.rb +28 -0
- data/lib/puppet/provider/zfs/solaris.rb +1 -1
- data/lib/puppet/provider/zone/solaris.rb +3 -0
- data/lib/puppet/provider/zpool/solaris.rb +7 -5
- data/lib/puppet/rails.rb +1 -1
- data/lib/puppet/rails/benchmark.rb +1 -1
- data/lib/puppet/rails/fact_name.rb +1 -0
- data/lib/puppet/rails/host.rb +0 -7
- data/lib/puppet/reference/configuration.rb +26 -101
- data/lib/puppet/reports/store.rb +3 -7
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +86 -36
- data/lib/puppet/resource/type.rb +10 -15
- data/lib/puppet/resource/type_collection.rb +55 -63
- data/lib/puppet/simple_graph.rb +370 -269
- data/lib/puppet/ssl/base.rb +0 -8
- data/lib/puppet/ssl/certificate.rb +0 -6
- data/lib/puppet/ssl/certificate_authority.rb +24 -109
- data/lib/puppet/ssl/certificate_authority/interface.rb +19 -66
- data/lib/puppet/ssl/certificate_factory.rb +91 -112
- data/lib/puppet/ssl/certificate_request.rb +15 -98
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -1
- data/lib/puppet/ssl/host.rb +85 -51
- data/lib/puppet/ssl/inventory.rb +1 -1
- data/lib/puppet/sslcertificates.rb +146 -0
- data/lib/puppet/sslcertificates/ca.rb +375 -0
- data/lib/puppet/sslcertificates/certificate.rb +255 -0
- data/lib/puppet/sslcertificates/inventory.rb +38 -0
- data/lib/puppet/sslcertificates/support.rb +146 -0
- data/lib/puppet/status.rb +1 -1
- data/lib/puppet/transaction.rb +163 -94
- data/lib/puppet/transaction/event.rb +1 -1
- data/lib/puppet/transaction/event_manager.rb +19 -3
- data/lib/puppet/transaction/report.rb +9 -3
- data/lib/puppet/type.rb +107 -62
- data/lib/puppet/type/augeas.rb +10 -14
- data/lib/puppet/type/cron.rb +13 -14
- data/lib/puppet/type/exec.rb +0 -9
- data/lib/puppet/type/file.rb +20 -29
- data/lib/puppet/type/file/ctime.rb +1 -1
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/group.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/mtime.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +1 -1
- data/lib/puppet/type/file/source.rb +3 -3
- data/lib/puppet/type/file/type.rb +1 -1
- data/lib/puppet/type/group.rb +36 -0
- data/lib/puppet/type/host.rb +18 -43
- data/lib/puppet/type/interface.rb +109 -0
- data/lib/puppet/type/k5login.rb +1 -4
- data/lib/puppet/type/macauthorization.rb +3 -3
- data/lib/puppet/type/mcx.rb +2 -21
- data/lib/puppet/type/router.rb +14 -0
- data/lib/puppet/type/schedule.rb +2 -0
- data/lib/puppet/type/service.rb +2 -0
- data/lib/puppet/type/sshkey.rb +6 -1
- data/lib/puppet/type/tidy.rb +12 -12
- data/lib/puppet/type/user.rb +36 -9
- data/lib/puppet/type/vlan.rb +26 -0
- data/lib/puppet/type/whit.rb +13 -1
- data/lib/puppet/type/zfs.rb +100 -8
- data/lib/puppet/type/zone.rb +45 -1
- data/lib/puppet/type/zpool.rb +1 -0
- data/lib/puppet/util.rb +63 -91
- data/lib/puppet/util/autoload.rb +16 -14
- data/lib/puppet/util/classgen.rb +13 -1
- data/lib/puppet/util/command_line.rb +109 -22
- data/lib/puppet/util/log.rb +1 -0
- data/lib/puppet/util/log/destinations.rb +16 -4
- data/lib/puppet/util/logging.rb +11 -0
- data/lib/puppet/util/monkey_patches.rb +7 -77
- data/lib/puppet/util/network_device.rb +17 -0
- data/lib/puppet/util/network_device/base.rb +27 -0
- data/lib/puppet/util/network_device/cisco.rb +4 -0
- data/lib/puppet/util/network_device/cisco/device.rb +256 -0
- data/lib/puppet/util/network_device/cisco/facts.rb +72 -0
- data/lib/puppet/util/network_device/cisco/interface.rb +82 -0
- data/lib/puppet/util/network_device/config.rb +93 -0
- data/lib/puppet/util/network_device/ipcalc.rb +68 -0
- data/lib/puppet/util/network_device/transport.rb +3 -0
- data/lib/puppet/util/network_device/transport/base.rb +26 -0
- data/lib/puppet/util/network_device/transport/ssh.rb +121 -0
- data/lib/puppet/util/network_device/transport/telnet.rb +42 -0
- data/lib/puppet/util/rdoc.rb +4 -10
- data/lib/puppet/util/rdoc/parser.rb +34 -23
- data/lib/puppet/util/reference.rb +7 -8
- data/lib/puppet/util/selinux.rb +2 -2
- data/lib/puppet/util/settings.rb +1 -6
- data/lib/puppet/util/settings/file_setting.rb +0 -1
- data/lib/puppet/util/suidmanager.rb +30 -79
- data/lib/puppet/util/zaml.rb +41 -40
- data/man/man5/puppet.conf.5 +291 -873
- data/man/man8/filebucket.8 +47 -71
- data/man/man8/pi.8 +44 -10
- data/man/man8/puppet-agent.8 +154 -0
- data/man/man8/puppet-apply.8 +75 -0
- data/man/man8/puppet-catalog.8 +286 -0
- data/man/man8/puppet-cert.8 +97 -0
- data/man/man8/puppet-certificate.8 +229 -0
- data/man/man8/puppet-certificate_request.8 +168 -0
- data/man/man8/puppet-certificate_revocation_list.8 +165 -0
- data/man/man8/puppet-config.8 +80 -0
- data/man/man8/puppet-describe.8 +51 -0
- data/man/man8/puppet-device.8 +86 -0
- data/man/man8/puppet-doc.8 +101 -0
- data/man/man8/puppet-facts.8 +217 -0
- data/man/man8/puppet-file.8 +225 -0
- data/man/man8/puppet-filebucket.8 +81 -0
- data/man/man8/puppet-help.8 +71 -0
- data/man/man8/puppet-inspect.8 +28 -0
- data/man/man8/puppet-key.8 +126 -0
- data/man/man8/puppet-kick.8 +95 -0
- data/man/man8/puppet-man.8 +74 -0
- data/man/man8/puppet-master.8 +74 -0
- data/man/man8/puppet-node.8 +171 -0
- data/man/man8/puppet-parser.8 +71 -0
- data/man/man8/puppet-plugin.8 +77 -0
- data/man/man8/puppet-queue.8 +55 -0
- data/man/man8/puppet-report.8 +187 -0
- data/man/man8/puppet-resource.8 +84 -0
- data/man/man8/puppet-resource_type.8 +214 -0
- data/man/man8/puppet-secret_agent.8 +74 -0
- data/man/man8/puppet-status.8 +150 -0
- data/man/man8/puppet.8 +2 -2
- data/man/man8/puppetca.8 +64 -136
- data/man/man8/puppetd.8 +99 -228
- data/man/man8/puppetdoc.8 +41 -48
- data/man/man8/puppetmasterd.8 +54 -32
- data/man/man8/puppetqd.8 +45 -10
- data/man/man8/puppetrun.8 +56 -134
- data/man/man8/ralsh.8 +48 -49
- data/spec/fixtures/faulty_face/puppet/face/syntax.rb +8 -0
- data/spec/fixtures/integration/provider/mailalias/aliases/test1 +28 -0
- data/spec/fixtures/unit/parser/lexer/aliastest.pp +16 -0
- data/spec/fixtures/unit/parser/lexer/append.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/argumentdefaults.pp +14 -0
- data/spec/fixtures/unit/parser/lexer/arithmetic_expression.pp +8 -0
- data/spec/fixtures/unit/parser/lexer/arraytrailingcomma.pp +3 -0
- data/spec/fixtures/unit/parser/lexer/casestatement.pp +65 -0
- data/spec/fixtures/unit/parser/lexer/classheirarchy.pp +15 -0
- data/spec/fixtures/unit/parser/lexer/classincludes.pp +17 -0
- data/spec/fixtures/unit/parser/lexer/classpathtest.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/collection.pp +10 -0
- data/spec/fixtures/unit/parser/lexer/collection_override.pp +8 -0
- data/spec/fixtures/unit/parser/lexer/collection_within_virtual_definitions.pp +20 -0
- data/spec/fixtures/unit/parser/lexer/componentmetaparams.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/componentrequire.pp +8 -0
- data/spec/fixtures/unit/parser/lexer/deepclassheirarchy.pp +23 -0
- data/spec/fixtures/unit/parser/lexer/defineoverrides.pp +17 -0
- data/spec/fixtures/unit/parser/lexer/emptyclass.pp +9 -0
- data/spec/fixtures/unit/parser/lexer/emptyexec.pp +3 -0
- data/spec/fixtures/unit/parser/lexer/emptyifelse.pp +9 -0
- data/spec/fixtures/unit/parser/lexer/falsevalues.pp +3 -0
- data/spec/fixtures/unit/parser/lexer/filecreate.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/fqdefinition.pp +5 -0
- data/spec/fixtures/unit/parser/lexer/fqparents.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/funccomma.pp +5 -0
- data/spec/fixtures/unit/parser/lexer/hash.pp +33 -0
- data/spec/fixtures/unit/parser/lexer/ifexpression.pp +12 -0
- data/spec/fixtures/unit/parser/lexer/implicititeration.pp +15 -0
- data/spec/fixtures/unit/parser/lexer/multilinecomments.pp +10 -0
- data/spec/fixtures/unit/parser/lexer/multipleclass.pp +9 -0
- data/spec/fixtures/unit/parser/lexer/multipleinstances.pp +7 -0
- data/spec/fixtures/unit/parser/lexer/multisubs.pp +13 -0
- data/spec/fixtures/unit/parser/lexer/namevartest.pp +9 -0
- data/spec/fixtures/unit/parser/lexer/scopetest.pp +13 -0
- data/spec/fixtures/unit/parser/lexer/selectorvalues.pp +49 -0
- data/spec/fixtures/unit/parser/lexer/simpledefaults.pp +5 -0
- data/spec/fixtures/unit/parser/lexer/simpleselector.pp +38 -0
- data/spec/fixtures/unit/parser/lexer/singleary.pp +19 -0
- data/spec/fixtures/unit/parser/lexer/singlequote.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/singleselector.pp +22 -0
- data/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp +11 -0
- data/spec/fixtures/unit/parser/lexer/tag.pp +9 -0
- data/spec/fixtures/unit/parser/lexer/tagged.pp +35 -0
- data/spec/fixtures/unit/parser/lexer/virtualresources.pp +14 -0
- data/spec/fixtures/unit/provider/host/parsed/valid_hosts +19 -0
- data/spec/fixtures/unit/provider/mount/parsed/aix.filesystems +144 -0
- data/spec/fixtures/unit/provider/mount/parsed/aix.mount +7 -0
- data/spec/fixtures/unit/provider/mount/parsed/darwin.mount +6 -0
- data/spec/fixtures/unit/provider/mount/parsed/freebsd.fstab +8 -0
- data/spec/fixtures/unit/provider/mount/parsed/freebsd.mount +3 -0
- data/spec/fixtures/unit/provider/mount/parsed/hpux.mount +17 -0
- data/spec/fixtures/unit/provider/mount/parsed/linux.fstab +11 -0
- data/spec/fixtures/unit/provider/mount/parsed/linux.mount +5 -0
- data/spec/fixtures/unit/provider/mount/parsed/netbsd.fstab +9 -0
- data/spec/fixtures/unit/provider/mount/parsed/netbsd.mount +8 -0
- data/spec/fixtures/unit/provider/mount/parsed/openbsd.fstab +4 -0
- data/spec/fixtures/unit/provider/mount/parsed/openbsd.mount +4 -0
- data/spec/fixtures/unit/provider/mount/parsed/solaris.fstab +11 -0
- data/spec/fixtures/unit/provider/mount/parsed/solaris.mount +6 -0
- data/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys +7 -0
- data/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys1 +3 -0
- data/spec/fixtures/unit/provider/ssh_authorized_key/parsed/authorized_keys2 +1 -0
- data/spec/fixtures/unit/reports/tagmail/tagmail_failers.conf +3 -0
- data/spec/fixtures/unit/reports/tagmail/tagmail_passers.conf +30 -0
- data/spec/fixtures/unit/util/rdoc/basic.pp +16 -0
- data/spec/integration/application/apply_spec.rb +2 -5
- data/spec/integration/application/doc_spec.rb +5 -6
- data/spec/integration/configurer_spec.rb +10 -6
- data/spec/integration/defaults_spec.rb +18 -52
- data/spec/integration/faces/documentation_spec.rb +55 -0
- data/spec/integration/file_serving/content_spec.rb +10 -3
- data/spec/integration/file_serving/fileset_spec.rb +2 -3
- data/spec/integration/file_serving/metadata_spec.rb +10 -3
- data/spec/integration/file_serving/terminus_helper_spec.rb +2 -3
- data/spec/integration/indirector/catalog/compiler_spec.rb +7 -12
- data/spec/integration/indirector/catalog/queue_spec.rb +3 -4
- data/spec/integration/indirector/direct_file_server_spec.rb +2 -2
- data/spec/integration/indirector/file_content/file_server_spec.rb +7 -7
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +2 -2
- data/spec/integration/indirector/node/ldap_spec.rb +3 -4
- data/spec/integration/network/client_spec.rb +18 -0
- data/spec/integration/network/formats_spec.rb +3 -4
- data/spec/integration/network/handler_spec.rb +3 -4
- data/spec/integration/network/server/mongrel_spec.rb +3 -4
- data/spec/integration/network/server/webrick_spec.rb +4 -4
- data/spec/integration/node/environment_spec.rb +2 -3
- data/spec/integration/node/facts_spec.rb +6 -6
- data/spec/integration/node_spec.rb +16 -16
- data/spec/integration/parser/collector_spec.rb +3 -4
- data/spec/integration/parser/compiler_spec.rb +43 -3
- data/spec/integration/parser/functions/require_spec.rb +2 -3
- data/spec/integration/parser/functions_spec.rb +3 -4
- data/spec/integration/parser/parser_spec.rb +7 -6
- data/spec/integration/parser/ruby_manifest_spec.rb +2 -3
- data/spec/integration/provider/mailalias/aliases_spec.rb +5 -19
- data/spec/integration/provider/mount_spec.rb +2 -2
- data/spec/integration/provider/package_spec.rb +3 -4
- data/spec/integration/provider/service/init_spec.rb +4 -6
- data/spec/integration/reference/providers_spec.rb +2 -3
- data/spec/integration/reports_spec.rb +2 -2
- data/spec/integration/resource/catalog_spec.rb +6 -7
- data/spec/integration/resource/type_collection_spec.rb +2 -3
- data/spec/integration/ssl/certificate_authority_spec.rb +7 -7
- data/spec/integration/ssl/certificate_request_spec.rb +7 -7
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +2 -2
- data/spec/integration/ssl/host_spec.rb +4 -4
- data/spec/integration/transaction/report_spec.rb +3 -3
- data/spec/integration/transaction_spec.rb +61 -6
- data/spec/integration/type/file_spec.rb +10 -8
- data/spec/integration/type/package_spec.rb +2 -3
- data/spec/integration/type/tidy_spec.rb +2 -3
- data/spec/integration/type_spec.rb +2 -14
- data/spec/integration/util/autoload_spec.rb +2 -3
- data/spec/integration/util/feature_spec.rb +2 -3
- data/spec/integration/util/file_locking_spec.rb +3 -4
- data/spec/integration/util/rdoc/parser_spec.rb +3 -4
- data/spec/integration/util/settings_spec.rb +2 -3
- data/spec/lib/matchers/json.rb +111 -0
- data/spec/lib/puppet/face/basetest.rb +46 -0
- data/spec/lib/puppet/face/huzzah.rb +7 -0
- data/spec/lib/puppet/face/version_matching.rb +12 -0
- data/spec/lib/puppet_spec/files.rb +38 -5
- data/spec/lib/puppet_spec/fixtures.rb +28 -0
- data/spec/lib/puppet_spec/matchers.rb +87 -0
- data/spec/lib/puppet_spec/verbose.rb +0 -0
- data/spec/monkey_patches/alias_should_to_must.rb +0 -0
- data/spec/monkey_patches/publicize_methods.rb +0 -0
- data/spec/shared_behaviours/all_parsedfile_providers.rb +21 -0
- data/spec/shared_behaviours/an_indirector_face.rb +6 -0
- data/spec/shared_behaviours/documentation_on_faces.rb +263 -0
- data/spec/shared_behaviours/file_server_terminus.rb +1 -1
- data/spec/shared_behaviours/file_serving.rb +61 -70
- data/spec/shared_behaviours/memory_terminus.rb +0 -0
- data/spec/shared_behaviours/path_parameters.rb +0 -0
- data/spec/shared_behaviours/things_that_declare_options.rb +150 -0
- data/spec/spec.opts +0 -2
- data/spec/spec_helper.rb +33 -75
- data/spec/unit/agent/locker_spec.rb +2 -3
- data/spec/unit/agent_spec.rb +2 -2
- data/spec/unit/application/agent_spec.rb +51 -76
- data/spec/unit/application/apply_spec.rb +86 -150
- data/spec/unit/application/cert_spec.rb +8 -30
- data/spec/unit/application/certificate_spec.rb +20 -0
- data/spec/unit/application/config_spec.rb +9 -0
- data/spec/unit/application/describe_spec.rb +2 -3
- data/spec/unit/application/device_spec.rb +342 -0
- data/spec/unit/application/doc_spec.rb +11 -18
- data/spec/unit/application/face_base_spec.rb +360 -0
- data/spec/unit/application/facts_spec.rb +27 -0
- data/spec/unit/application/filebucket_spec.rb +7 -18
- data/spec/unit/application/indirection_base_spec.rb +42 -0
- data/spec/unit/application/inspect_spec.rb +7 -13
- data/spec/unit/application/kick_spec.rb +15 -38
- data/spec/unit/application/master_spec.rb +25 -81
- data/spec/unit/application/queue_spec.rb +12 -22
- data/spec/unit/application/resource_spec.rb +19 -53
- data/spec/unit/application/secret_agent_spec.rb +32 -0
- data/spec/unit/application_spec.rb +65 -34
- data/spec/unit/configurer/downloader_spec.rb +2 -3
- data/spec/unit/configurer/fact_handler_spec.rb +39 -46
- data/spec/unit/configurer/plugin_handler_spec.rb +2 -3
- data/spec/unit/configurer_spec.rb +329 -411
- data/spec/unit/daemon_spec.rb +7 -14
- data/spec/unit/dsl/resource_api_spec.rb +2 -3
- data/spec/unit/dsl/resource_type_api_spec.rb +24 -37
- data/spec/unit/face/catalog_spec.rb +7 -0
- data/spec/unit/face/certificate_request_spec.rb +7 -0
- data/spec/unit/face/certificate_revocation_list_spec.rb +7 -0
- data/spec/unit/face/certificate_spec.rb +23 -0
- data/spec/unit/face/config_spec.rb +24 -0
- data/spec/unit/face/facts_spec.rb +23 -0
- data/spec/unit/face/file_spec.rb +12 -0
- data/spec/unit/face/help_spec.rb +129 -0
- data/spec/unit/face/key_spec.rb +7 -0
- data/spec/unit/face/node_spec.rb +7 -0
- data/spec/unit/face/plugin_spec.rb +10 -0
- data/spec/unit/face/report_spec.rb +7 -0
- data/spec/unit/face/resource_spec.rb +7 -0
- data/spec/unit/face/resource_type_spec.rb +7 -0
- data/spec/unit/face/secret_agent_spec.rb +25 -0
- data/spec/unit/face_spec.rb +1 -0
- data/spec/unit/file_bucket/dipper_spec.rb +7 -8
- data/spec/unit/file_bucket/file_spec.rb +7 -16
- data/spec/unit/file_collection/lookup_spec.rb +2 -3
- data/spec/unit/file_collection_spec.rb +2 -3
- data/spec/unit/file_serving/base_spec.rb +2 -3
- data/spec/unit/file_serving/configuration/parser_spec.rb +2 -3
- data/spec/unit/file_serving/configuration_spec.rb +31 -40
- data/spec/unit/file_serving/content_spec.rb +6 -3
- data/spec/unit/file_serving/fileset_spec.rb +2 -3
- data/spec/unit/file_serving/{terminus_selector_spec.rb → indirection_hooks_spec.rb} +14 -13
- data/spec/unit/file_serving/metadata_spec.rb +6 -3
- data/spec/unit/file_serving/mount/file_spec.rb +2 -3
- data/spec/unit/file_serving/mount/modules_spec.rb +2 -11
- data/spec/unit/file_serving/mount/plugins_spec.rb +2 -3
- data/spec/unit/file_serving/mount_spec.rb +2 -3
- data/spec/unit/file_serving/terminus_helper_spec.rb +2 -2
- data/spec/unit/indirector/active_record_spec.rb +5 -7
- data/spec/unit/indirector/catalog/active_record_spec.rb +2 -3
- data/spec/unit/indirector/catalog/compiler_spec.rb +30 -50
- data/spec/unit/indirector/catalog/queue_spec.rb +2 -3
- data/spec/unit/indirector/catalog/rest_spec.rb +2 -3
- data/spec/unit/indirector/catalog/yaml_spec.rb +2 -3
- data/spec/unit/indirector/certificate/ca_spec.rb +2 -2
- data/spec/unit/indirector/certificate/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate/rest_spec.rb +2 -3
- data/spec/unit/indirector/certificate_request/ca_spec.rb +47 -2
- data/spec/unit/indirector/certificate_request/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_request/rest_spec.rb +2 -3
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +2 -3
- data/spec/unit/indirector/certificate_status/file_spec.rb +187 -0
- data/spec/unit/indirector/certificate_status/rest_spec.rb +14 -0
- data/spec/unit/indirector/code_spec.rb +6 -8
- data/spec/unit/indirector/direct_file_server_spec.rb +6 -7
- data/spec/unit/indirector/envelope_spec.rb +2 -3
- data/spec/unit/indirector/exec_spec.rb +12 -13
- data/spec/unit/indirector/face_spec.rb +68 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +2 -3
- data/spec/unit/indirector/facts/couch_spec.rb +71 -66
- data/spec/unit/indirector/facts/facter_spec.rb +2 -2
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +20 -20
- data/spec/unit/indirector/facts/network_device_spec.rb +89 -0
- data/spec/unit/indirector/facts/rest_spec.rb +2 -3
- data/spec/unit/indirector/facts/yaml_spec.rb +2 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +17 -18
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +2 -3
- data/spec/unit/indirector/file_content/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_content/file_spec.rb +2 -2
- data/spec/unit/indirector/file_content/rest_spec.rb +2 -3
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_metadata/file_spec.rb +2 -2
- data/spec/unit/indirector/file_metadata/rest_spec.rb +2 -3
- data/spec/unit/indirector/file_server_spec.rb +8 -7
- data/spec/unit/indirector/file_spec.rb +179 -0
- data/spec/unit/indirector/indirection_spec.rb +3 -24
- data/spec/unit/indirector/inventory/yaml_spec.rb +220 -0
- data/spec/unit/indirector/key/ca_spec.rb +2 -2
- data/spec/unit/indirector/key/file_spec.rb +2 -2
- data/spec/unit/indirector/ldap_spec.rb +6 -8
- data/spec/unit/indirector/memory_spec.rb +5 -7
- data/spec/unit/indirector/node/active_record_spec.rb +2 -3
- data/spec/unit/indirector/node/exec_spec.rb +3 -4
- data/spec/unit/indirector/node/ldap_spec.rb +3 -4
- data/spec/unit/indirector/node/memory_spec.rb +2 -3
- data/spec/unit/indirector/node/plain_spec.rb +2 -3
- data/spec/unit/indirector/node/rest_spec.rb +2 -3
- data/spec/unit/indirector/node/yaml_spec.rb +2 -3
- data/spec/unit/indirector/plain_spec.rb +5 -7
- data/spec/unit/indirector/queue_spec.rb +11 -14
- data/spec/unit/indirector/report/processor_spec.rb +7 -9
- data/spec/unit/indirector/report/rest_spec.rb +2 -3
- data/spec/unit/indirector/report/yaml_spec.rb +3 -4
- data/spec/unit/indirector/request_spec.rb +3 -25
- data/spec/unit/indirector/resource/ral_spec.rb +3 -4
- data/spec/unit/indirector/resource/rest_spec.rb +2 -3
- data/spec/unit/indirector/resource_type/parser_spec.rb +87 -13
- data/spec/unit/indirector/resource_type/rest_spec.rb +2 -3
- data/spec/unit/indirector/rest_spec.rb +45 -16
- data/spec/unit/indirector/run/local_spec.rb +2 -3
- data/spec/unit/indirector/run/rest_spec.rb +2 -3
- data/spec/unit/indirector/ssl_file_spec.rb +9 -27
- data/spec/unit/indirector/status/rest_spec.rb +2 -3
- data/spec/unit/indirector/terminus_spec.rb +180 -187
- data/spec/unit/indirector/yaml_spec.rb +9 -23
- data/spec/unit/indirector_spec.rb +61 -79
- data/spec/unit/interface/action_builder_spec.rb +214 -0
- data/spec/unit/interface/action_manager_spec.rb +282 -0
- data/spec/unit/interface/action_spec.rb +545 -0
- data/spec/unit/interface/documentation_spec.rb +34 -0
- data/spec/unit/interface/face_collection_spec.rb +180 -0
- data/spec/unit/interface/option_builder_spec.rb +77 -0
- data/spec/unit/interface/option_spec.rb +100 -0
- data/spec/unit/interface_spec.rb +228 -0
- data/spec/unit/module_spec.rb +34 -10
- data/spec/unit/network/authconfig_spec.rb +3 -4
- data/spec/unit/network/authstore_spec.rb +3 -4
- data/spec/unit/network/client_spec.rb +45 -0
- data/spec/unit/network/format_handler_spec.rb +2 -3
- data/spec/unit/network/format_spec.rb +2 -3
- data/spec/unit/network/formats_spec.rb +107 -3
- data/spec/unit/network/handler/fileserver_spec.rb +3 -4
- data/spec/unit/network/http/api/v1_spec.rb +61 -27
- data/spec/unit/network/http/compression_spec.rb +2 -3
- data/spec/unit/network/http/handler_spec.rb +78 -109
- data/spec/unit/network/http/mongrel/rest_spec.rb +3 -4
- data/spec/unit/network/http/mongrel_spec.rb +6 -6
- data/spec/unit/network/http/rack/rest_spec.rb +2 -20
- data/spec/unit/network/http/rack/xmlrpc_spec.rb +2 -3
- data/spec/unit/network/http/rack_spec.rb +2 -3
- data/spec/unit/network/http/webrick/rest_spec.rb +3 -4
- data/spec/unit/network/http/webrick_spec.rb +4 -8
- data/spec/unit/network/http_pool_spec.rb +82 -95
- data/spec/unit/network/http_spec.rb +2 -2
- data/spec/unit/network/rest_authconfig_spec.rb +9 -42
- data/spec/unit/network/rights_spec.rb +6 -7
- data/spec/unit/network/server_spec.rb +2 -2
- data/spec/unit/network/xmlrpc/client_spec.rb +172 -0
- data/spec/unit/node/environment_spec.rb +63 -7
- data/spec/unit/node/facts_spec.rb +9 -13
- data/spec/unit/node_spec.rb +5 -13
- data/spec/unit/other/selinux_spec.rb +2 -3
- data/spec/unit/other/transbucket_spec.rb +2 -3
- data/spec/unit/other/transobject_spec.rb +2 -3
- data/spec/unit/parameter/path_spec.rb +2 -2
- data/spec/unit/parameter/value_collection_spec.rb +2 -3
- data/spec/unit/parameter/value_spec.rb +2 -3
- data/spec/unit/parameter_spec.rb +2 -3
- data/spec/unit/parser/ast/arithmetic_operator_spec.rb +2 -13
- data/spec/unit/parser/ast/astarray_spec.rb +18 -36
- data/spec/unit/parser/ast/asthash_spec.rb +4 -4
- data/spec/unit/parser/ast/boolean_operator_spec.rb +2 -3
- data/spec/unit/parser/ast/casestatement_spec.rb +17 -14
- data/spec/unit/parser/ast/collection_spec.rb +2 -3
- data/spec/unit/parser/ast/collexpr_spec.rb +2 -3
- data/spec/unit/parser/ast/comparison_operator_spec.rb +4 -5
- data/spec/unit/parser/ast/definition_spec.rb +21 -0
- data/spec/unit/parser/ast/function_spec.rb +3 -4
- data/spec/unit/parser/ast/hostclass_spec.rb +72 -0
- data/spec/unit/parser/ast/ifstatement_spec.rb +2 -3
- data/spec/unit/parser/ast/in_operator_spec.rb +2 -3
- data/spec/unit/parser/ast/leaf_spec.rb +23 -19
- data/spec/unit/parser/ast/match_operator_spec.rb +2 -3
- data/spec/unit/parser/ast/minus_spec.rb +2 -3
- data/spec/unit/parser/ast/node_spec.rb +30 -0
- data/spec/unit/parser/ast/nop_spec.rb +2 -3
- data/spec/unit/parser/ast/not_spec.rb +2 -3
- data/spec/unit/parser/ast/relationship_spec.rb +2 -3
- data/spec/unit/parser/ast/resource_defaults_spec.rb +2 -3
- data/spec/unit/parser/ast/resource_override_spec.rb +2 -3
- data/spec/unit/parser/ast/resource_reference_spec.rb +21 -8
- data/spec/unit/parser/ast/resource_spec.rb +24 -13
- data/spec/unit/parser/ast/selector_spec.rb +3 -4
- data/spec/unit/parser/ast/vardef_spec.rb +15 -9
- data/spec/unit/parser/ast_spec.rb +2 -3
- data/spec/unit/parser/collector_spec.rb +2 -3
- data/spec/unit/parser/compiler_spec.rb +62 -35
- data/spec/unit/parser/files_spec.rb +2 -3
- data/spec/unit/parser/functions/create_resources_spec.rb +137 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -3
- data/spec/unit/parser/functions/extlookup_spec.rb +10 -10
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +15 -13
- data/spec/unit/parser/functions/generate_spec.rb +5 -3
- data/spec/unit/parser/functions/include_spec.rb +5 -3
- data/spec/unit/parser/functions/inline_template_spec.rb +6 -17
- data/spec/unit/parser/functions/realize_spec.rb +5 -3
- data/spec/unit/parser/functions/regsubst_spec.rb +5 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -3
- data/spec/unit/parser/functions/shellquote_spec.rb +8 -6
- data/spec/unit/parser/functions/split_spec.rb +5 -3
- data/spec/unit/parser/functions/sprintf_spec.rb +5 -3
- data/spec/unit/parser/functions/tag_spec.rb +5 -3
- data/spec/unit/parser/functions/template_spec.rb +6 -21
- data/spec/unit/parser/functions/versioncmp_spec.rb +5 -3
- data/spec/unit/parser/functions_spec.rb +2 -3
- data/spec/unit/parser/lexer_spec.rb +3 -7
- data/spec/unit/parser/parser_spec.rb +71 -90
- data/spec/unit/parser/relationship_spec.rb +2 -3
- data/spec/unit/parser/resource_spec.rb +6 -65
- data/spec/unit/parser/scope_spec.rb +28 -179
- data/spec/unit/parser/templatewrapper_spec.rb +25 -43
- data/spec/unit/parser/type_loader_spec.rb +120 -78
- data/spec/unit/property/ensure_spec.rb +2 -3
- data/spec/unit/property/keyvalue_spec.rb +4 -8
- data/spec/unit/property/list_spec.rb +2 -3
- data/spec/unit/property/ordered_list_spec.rb +2 -3
- data/spec/unit/property_spec.rb +2 -3
- data/spec/unit/provider/augeas/augeas_spec.rb +80 -3
- data/spec/unit/provider/cisco_spec.rb +16 -0
- data/spec/unit/provider/confine/exists_spec.rb +2 -3
- data/spec/unit/provider/confine/false_spec.rb +2 -3
- data/spec/unit/provider/confine/feature_spec.rb +2 -3
- data/spec/unit/provider/confine/true_spec.rb +2 -3
- data/spec/unit/provider/confine/variable_spec.rb +2 -3
- data/spec/unit/provider/confine_collection_spec.rb +2 -3
- data/spec/unit/provider/confine_spec.rb +2 -3
- data/spec/unit/provider/confiner_spec.rb +2 -3
- data/spec/unit/provider/exec/posix_spec.rb +2 -2
- data/spec/unit/provider/exec/shell_spec.rb +2 -2
- data/spec/unit/provider/group/groupadd_spec.rb +2 -3
- data/spec/unit/provider/group/ldap_spec.rb +2 -2
- data/spec/unit/provider/host/parsed_spec.rb +197 -0
- data/spec/unit/provider/interface/cisco_spec.rb +58 -0
- data/spec/unit/provider/ldap_spec.rb +2 -2
- data/spec/unit/provider/macauthorization_spec.rb +2 -2
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +2 -21
- data/spec/unit/provider/mount/parsed_spec.rb +61 -86
- data/spec/unit/provider/mount_spec.rb +2 -3
- data/spec/unit/provider/naginator_spec.rb +2 -3
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +2 -63
- data/spec/unit/provider/network_device_spec.rb +153 -0
- data/spec/unit/provider/package/aix_spec.rb +2 -3
- data/spec/unit/provider/package/apt_spec.rb +2 -3
- data/spec/unit/provider/package/dpkg_spec.rb +2 -3
- data/spec/unit/provider/package/freebsd_spec.rb +2 -3
- data/spec/unit/provider/package/gem_spec.rb +2 -3
- data/spec/unit/provider/package/hpux_spec.rb +2 -3
- data/spec/unit/provider/package/macports_spec.rb +2 -2
- data/spec/unit/provider/package/nim_spec.rb +2 -3
- data/spec/unit/provider/package/pip_spec.rb +180 -0
- data/spec/unit/provider/package/pkg_spec.rb +2 -3
- data/spec/unit/provider/package/pkgdmg_spec.rb +49 -56
- data/spec/unit/provider/package/pkgutil_spec.rb +182 -0
- data/spec/unit/provider/package/yum_spec.rb +66 -0
- data/spec/unit/provider/package/zypper_spec.rb +2 -3
- data/spec/unit/provider/parsedfile_spec.rb +2 -3
- data/spec/unit/provider/selboolean_spec.rb +2 -3
- data/spec/unit/provider/selmodule_spec.rb +2 -2
- data/spec/unit/provider/service/daemontools_spec.rb +2 -2
- data/spec/unit/provider/service/debian_spec.rb +2 -2
- data/spec/unit/provider/service/freebsd_spec.rb +2 -3
- data/spec/unit/provider/service/init_spec.rb +3 -3
- data/spec/unit/provider/service/launchd_spec.rb +2 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/service/runit_spec.rb +2 -2
- data/spec/unit/provider/service/smf_spec.rb +137 -0
- data/spec/unit/provider/service/src_spec.rb +7 -7
- data/spec/unit/provider/service/upstart.rb +48 -0
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +28 -47
- data/spec/unit/provider/sshkey/parsed_spec.rb +2 -3
- data/spec/unit/provider/user/hpux_spec.rb +2 -3
- data/spec/unit/provider/user/ldap_spec.rb +2 -2
- data/spec/unit/provider/user/user_role_add_spec.rb +15 -53
- data/spec/unit/provider/user/useradd_spec.rb +2 -3
- data/spec/unit/provider/vlan/cisco_spec.rb +56 -0
- data/spec/unit/provider/zfs/solaris_spec.rb +4 -4
- data/spec/unit/provider/zone/solaris_spec.rb +2 -3
- data/spec/unit/provider/zpool/solaris_spec.rb +33 -4
- data/spec/unit/provider_spec.rb +2 -3
- data/spec/unit/puppet/provider/README.markdown +4 -0
- data/spec/unit/puppet/type/README.markdown +4 -0
- data/spec/unit/puppet_spec.rb +2 -2
- data/spec/unit/rails/host_spec.rb +2 -11
- data/spec/unit/rails/param_value_spec.rb +2 -3
- data/spec/unit/rails/resource_spec.rb +2 -3
- data/spec/unit/rails_spec.rb +2 -3
- data/spec/unit/relationship_spec.rb +2 -2
- data/spec/unit/reports/http_spec.rb +2 -3
- data/spec/unit/reports/rrdgraph_spec.rb +2 -3
- data/spec/unit/reports/store_spec.rb +2 -17
- data/spec/unit/reports/tagmail_spec.rb +4 -8
- data/spec/unit/reports_spec.rb +2 -3
- data/spec/unit/resource/catalog_spec.rb +15 -74
- data/spec/unit/resource/status_spec.rb +3 -4
- data/spec/unit/resource/type_collection_helper_spec.rb +2 -3
- data/spec/unit/resource/type_collection_spec.rb +69 -81
- data/spec/unit/resource/type_spec.rb +26 -44
- data/spec/unit/resource_spec.rb +3 -4
- data/spec/unit/run_spec.rb +2 -3
- data/spec/unit/simple_graph_spec.rb +434 -80
- data/spec/unit/ssl/base_spec.rb +3 -4
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +56 -96
- data/spec/unit/ssl/certificate_authority_spec.rb +71 -246
- data/spec/unit/ssl/certificate_factory_spec.rb +72 -93
- data/spec/unit/ssl/certificate_request_spec.rb +11 -76
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +4 -5
- data/spec/unit/ssl/certificate_spec.rb +2 -34
- data/spec/unit/ssl/host_spec.rb +202 -207
- data/spec/unit/ssl/inventory_spec.rb +4 -5
- data/spec/unit/ssl/key_spec.rb +2 -3
- data/spec/unit/sslcertificates/ca_spec.rb +110 -0
- data/spec/unit/status_spec.rb +8 -5
- data/spec/unit/transaction/event_manager_spec.rb +2 -3
- data/spec/unit/transaction/event_spec.rb +7 -8
- data/spec/unit/transaction/report_spec.rb +25 -14
- data/spec/unit/transaction/resource_harness_spec.rb +2 -4
- data/spec/unit/transaction_spec.rb +31 -28
- data/spec/unit/transportable_spec.rb +0 -0
- data/spec/unit/type/augeas_spec.rb +3 -4
- data/spec/unit/type/component_spec.rb +2 -3
- data/spec/unit/type/computer_spec.rb +2 -3
- data/spec/unit/type/cron_spec.rb +12 -3
- data/spec/unit/type/exec_spec.rb +2 -32
- data/spec/unit/type/file/checksum_spec.rb +2 -3
- data/spec/unit/type/file/content_spec.rb +2 -3
- data/spec/unit/type/file/ctime.rb +2 -3
- data/spec/unit/type/file/ensure_spec.rb +2 -3
- data/spec/unit/type/file/group_spec.rb +2 -3
- data/spec/unit/type/file/mtime.rb +2 -3
- data/spec/unit/type/file/owner_spec.rb +2 -3
- data/spec/unit/type/file/selinux_spec.rb +2 -3
- data/spec/unit/type/file/source_spec.rb +9 -10
- data/spec/unit/type/file/type.rb +2 -3
- data/spec/unit/type/file_spec.rb +15 -30
- data/spec/unit/type/filebucket_spec.rb +2 -3
- data/spec/unit/type/group_spec.rb +4 -5
- data/spec/unit/type/host_spec.rb +129 -0
- data/spec/unit/type/interface_spec.rb +98 -0
- data/spec/unit/type/macauthorization_spec.rb +2 -3
- data/spec/unit/type/maillist_spec.rb +2 -3
- data/spec/unit/type/mcx_spec.rb +2 -23
- data/spec/unit/type/mount_spec.rb +41 -18
- data/spec/unit/type/nagios_spec.rb +2 -3
- data/spec/unit/type/noop_metaparam_spec.rb +2 -3
- data/spec/unit/type/package_spec.rb +2 -3
- data/spec/unit/type/resources_spec.rb +3 -4
- data/spec/unit/type/schedule_spec.rb +19 -12
- data/spec/unit/type/selboolean_spec.rb +2 -3
- data/spec/unit/type/selmodule_spec.rb +2 -3
- data/spec/unit/type/service_spec.rb +6 -3
- data/spec/unit/type/ssh_authorized_key_spec.rb +2 -3
- data/spec/unit/type/sshkey_spec.rb +70 -0
- data/spec/unit/type/stage_spec.rb +2 -3
- data/spec/unit/type/tidy_spec.rb +4 -4
- data/spec/unit/type/user_spec.rb +2 -11
- data/spec/unit/type/vlan_spec.rb +45 -0
- data/spec/unit/type/whit_spec.rb +4 -5
- data/spec/unit/type/zfs_spec.rb +2 -3
- data/spec/unit/type/zone_spec.rb +22 -3
- data/spec/unit/type/zpool_spec.rb +2 -3
- data/spec/unit/type_spec.rb +2 -69
- data/spec/unit/util/autoload/file_cache_spec.rb +2 -3
- data/spec/unit/util/autoload_spec.rb +6 -7
- data/spec/unit/util/backups_spec.rb +2 -3
- data/spec/unit/util/cache_accumulator_spec.rb +2 -3
- data/spec/unit/util/cacher_spec.rb +3 -4
- data/spec/unit/util/checksums_spec.rb +2 -2
- data/spec/unit/util/command_line_spec.rb +11 -8
- data/spec/unit/util/constant_inflector_spec.rb +2 -2
- data/spec/unit/util/errors_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +2 -3
- data/spec/unit/util/execution_stub_spec.rb +2 -3
- data/spec/unit/util/feature_spec.rb +2 -3
- data/spec/unit/util/file_locking_spec.rb +4 -5
- data/spec/unit/util/filetype_spec.rb +2 -3
- data/spec/unit/util/inline_docs_spec.rb +2 -3
- data/spec/unit/util/ldap/connection_spec.rb +2 -2
- data/spec/unit/util/ldap/generator_spec.rb +2 -2
- data/spec/unit/util/ldap/manager_spec.rb +2 -2
- data/spec/unit/util/loadedfile_spec.rb +2 -3
- data/spec/unit/util/log/destinations_spec.rb +2 -3
- data/spec/unit/util/log_spec.rb +6 -7
- data/spec/unit/util/logging_spec.rb +27 -3
- data/spec/unit/util/metric_spec.rb +2 -3
- data/spec/unit/util/monkey_patches_spec.rb +48 -10
- data/spec/unit/util/nagios_maker_spec.rb +2 -2
- data/spec/unit/util/network_device/cisco/device_spec.rb +408 -0
- data/spec/unit/util/network_device/cisco/facts_spec.rb +63 -0
- data/spec/unit/util/network_device/cisco/interface_spec.rb +89 -0
- data/spec/unit/util/network_device/config_spec.rb +102 -0
- data/spec/unit/util/network_device/ipcalc_spec.rb +63 -0
- data/spec/unit/util/network_device/transport/base_spec.rb +42 -0
- data/spec/unit/util/network_device/transport/ssh_spec.rb +219 -0
- data/spec/unit/util/network_device/transport/telnet_spec.rb +76 -0
- data/spec/unit/util/network_device_spec.rb +50 -0
- data/spec/unit/util/package_spec.rb +2 -3
- data/spec/unit/util/posix_spec.rb +2 -3
- data/spec/unit/util/pson_spec.rb +3 -4
- data/spec/unit/util/queue/stomp_spec.rb +4 -5
- data/spec/unit/util/queue_spec.rb +2 -3
- data/spec/unit/util/rdoc/parser_spec.rb +17 -12
- data/spec/unit/util/rdoc_spec.rb +19 -58
- data/spec/unit/util/reference_serializer_spec.rb +2 -3
- data/spec/unit/util/resource_template_spec.rb +2 -3
- data/spec/unit/util/run_mode_spec.rb +2 -3
- data/spec/unit/util/selinux_spec.rb +4 -5
- data/spec/unit/util/settings/file_setting_spec.rb +2 -7
- data/spec/unit/util/settings_spec.rb +2 -24
- data/spec/unit/util/storage_spec.rb +2 -3
- data/spec/unit/util/tagging_spec.rb +2 -2
- data/spec/unit/util/user_attr_spec.rb +2 -3
- data/spec/unit/util/warnings_spec.rb +2 -3
- data/spec/unit/util/zaml_spec.rb +23 -53
- data/spec/watchr.rb +146 -0
- data/tasks/rake/gem.rake +5 -4
- data/tasks/rake/git_workflow.rake +62 -51
- data/tasks/rake/manpages.rake +69 -0
- data/test/certmgr/certmgr.rb +308 -0
- data/test/certmgr/inventory.rb +69 -0
- data/test/certmgr/support.rb +105 -0
- data/test/data/providers/host/parsed/valid_hosts +19 -0
- data/test/language/ast.rb +1 -1
- data/test/language/ast/variable.rb +1 -1
- data/test/language/functions.rb +8 -9
- data/test/language/parser.rb +44 -52
- data/test/language/scope.rb +13 -24
- data/test/language/snippets.rb +11 -2
- data/test/language/transportable.rb +1 -1
- data/test/lib/puppettest.rb +2 -2
- data/test/lib/puppettest/exetest.rb +1 -1
- data/test/lib/puppettest/parsertesting.rb +5 -8
- data/test/lib/puppettest/servertest.rb +1 -0
- data/test/lib/puppettest/support/assertions.rb +6 -1
- data/test/lib/puppettest/support/utils.rb +0 -19
- data/test/network/authconfig.rb +1 -1
- data/test/network/authorization.rb +1 -1
- data/test/network/authstore.rb +1 -1
- data/test/network/client/ca.rb +69 -0
- data/test/network/client/dipper.rb +34 -0
- data/test/network/client_request.rb +1 -1
- data/test/network/handler/ca.rb +273 -0
- data/test/network/handler/fileserver.rb +1 -1
- data/test/network/handler/master.rb +13 -9
- data/test/network/handler/report.rb +1 -1
- data/test/network/handler/runner.rb +1 -1
- data/test/network/rights.rb +1 -1
- data/test/network/server/mongrel_test.rb +99 -0
- data/test/network/server/webrick.rb +128 -0
- data/test/network/xmlrpc/client.rb +45 -0
- data/test/network/xmlrpc/processor.rb +1 -1
- data/test/network/xmlrpc/server.rb +1 -1
- data/test/network/xmlrpc/webrick_servlet.rb +1 -1
- data/test/other/provider.rb +1 -1
- data/test/other/puppet.rb +1 -1
- data/test/other/relationships.rb +11 -18
- data/test/other/report.rb +1 -1
- data/test/other/transactions.rb +2 -35
- data/test/puppet/defaults.rb +1 -1
- data/test/puppet/errortest.rb +1 -1
- data/test/puppet/tc_suidmanager.rb +120 -0
- data/test/rails/rails.rb +2 -1
- data/test/rails/railsparameter.rb +2 -2
- data/test/ral/manager/attributes.rb +1 -1
- data/test/ral/manager/instances.rb +1 -1
- data/test/ral/manager/manager.rb +1 -1
- data/test/ral/manager/provider.rb +1 -1
- data/test/ral/manager/type.rb +1 -1
- data/test/ral/providers/cron/crontab.rb +1 -1
- data/test/ral/providers/group.rb +1 -1
- data/test/ral/providers/host/parsed.rb +1 -203
- data/test/ral/providers/mailalias/aliases.rb +1 -1
- data/test/ral/providers/nameservice.rb +1 -1
- data/test/ral/providers/package.rb +1 -1
- data/test/ral/providers/package/aptitude.rb +1 -1
- data/test/ral/providers/package/aptrpm.rb +1 -1
- data/test/ral/providers/parsedfile.rb +1 -1
- data/test/ral/providers/port/parsed.rb +1 -1
- data/test/ral/providers/provider.rb +1 -1
- data/test/ral/providers/service/base.rb +1 -1
- data/test/ral/providers/sshkey/parsed.rb +1 -1
- data/test/ral/providers/user.rb +1 -1
- data/test/ral/providers/user/useradd.rb +1 -1
- data/test/ral/type/cron.rb +1 -1
- data/test/ral/type/exec.rb +1 -42
- data/test/ral/type/file.rb +1 -1
- data/test/ral/type/file/target.rb +6 -19
- data/test/ral/type/fileignoresource.rb +1 -1
- data/test/ral/type/filesources.rb +61 -1
- data/test/ral/type/host.rb +1 -1
- data/test/ral/type/mailalias.rb +1 -1
- data/test/ral/type/port.rb +1 -1
- data/test/ral/type/resources.rb +1 -1
- data/test/ral/type/service.rb +1 -1
- data/test/ral/type/sshkey.rb +1 -1
- data/test/ral/type/user.rb +1 -1
- data/test/ral/type/yumrepo.rb +1 -1
- data/test/ral/type/zone.rb +1 -1
- data/test/test +2 -2
- data/test/util/classgen.rb +1 -1
- data/test/util/execution.rb +1 -1
- data/test/util/fileparsing.rb +1 -1
- data/test/util/inifile.rb +1 -1
- data/test/util/instance_loader.rb +1 -1
- data/test/util/log.rb +1 -1
- data/test/util/metrics.rb +1 -1
- data/test/util/package.rb +1 -1
- data/test/util/pidlock.rb +1 -1
- data/test/util/settings.rb +1 -1
- data/test/util/storage.rb +1 -1
- data/test/util/subclass_loader.rb +1 -1
- data/test/util/utiltest.rb +1 -1
- metadata +312 -48
- data/CHANGELOG.old +0 -1705
- data/CONTRIBUTING.md +0 -299
- data/COPYING +0 -340
- data/README.queueing +0 -126
- data/ext/upload_facts.rb +0 -120
- data/ext/vim/ftplugin/puppet.vim +0 -94
- data/ext/vim/indent/puppet.vim +0 -76
- data/lib/puppet/indirector/errors.rb +0 -5
- data/lib/puppet/indirector/facts/inventory_service.rb +0 -20
- data/lib/puppet/indirector/file_bucket_file/selector.rb +0 -53
- data/lib/puppet/indirector/file_content/selector.rb +0 -30
- data/lib/puppet/indirector/file_metadata/selector.rb +0 -30
- data/lib/puppet/indirector/resource/validator.rb +0 -8
- data/lib/puppet/util/command_line/filebucket +0 -97
- data/lib/puppet/util/command_line/pi +0 -48
- data/lib/puppet/util/command_line/puppet +0 -73
- data/lib/puppet/util/command_line/puppetca +0 -131
- data/lib/puppet/util/command_line/puppetd +0 -188
- data/lib/puppet/util/command_line/puppetdoc +0 -67
- data/lib/puppet/util/command_line/puppetmasterd +0 -70
- data/lib/puppet/util/command_line/puppetqd +0 -53
- data/lib/puppet/util/command_line/puppetrun +0 -125
- data/lib/puppet/util/command_line/ralsh +0 -89
- data/spec/integration/file_bucket/file_spec.rb +0 -44
- data/spec/integration/indirector/bucket_file/rest_spec.rb +0 -77
- data/spec/integration/indirector/certificate/rest_spec.rb +0 -69
- data/spec/integration/indirector/certificate_request/rest_spec.rb +0 -89
- data/spec/integration/indirector/certificate_revocation_list/rest_spec.rb +0 -85
- data/spec/integration/indirector/report/rest_spec.rb +0 -93
- data/spec/shared_behaviours/file_serving_model.rb +0 -73
- data/spec/unit/indirector/facts/inventory_service_spec.rb +0 -22
- data/spec/unit/indirector/file_bucket_file/selector_spec.rb +0 -29
- data/spec/unit/indirector/file_content/selector_spec.rb +0 -10
- data/spec/unit/indirector/file_metadata/selector_spec.rb +0 -11
- data/spec/unit/network/handler/ca_spec.rb +0 -87
- data/spec/unit/network/rest_authorization_spec.rb +0 -43
- data/spec/unit/provider/package/appdmg_spec.rb +0 -42
- data/spec/unit/type/k5login_spec.rb +0 -115
- data/spec/unit/util/suidmanager_spec.rb +0 -220
- data/spec/unit/util_spec.rb +0 -104
@@ -1,6 +1,5 @@
|
|
1
|
-
#!/usr/bin/env
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
1
|
+
#!/usr/bin/env rspec
|
2
|
+
require 'spec_helper'
|
4
3
|
require 'puppet/configurer'
|
5
4
|
require 'puppet/configurer/fact_handler'
|
6
5
|
|
@@ -13,6 +12,14 @@ describe Puppet::Configurer::FactHandler do
|
|
13
12
|
@facthandler = FactHandlerTester.new
|
14
13
|
end
|
15
14
|
|
15
|
+
it "should have a method for downloading fact plugins" do
|
16
|
+
@facthandler.should respond_to(:download_fact_plugins)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should have a boolean method for determining whether fact plugins should be downloaded" do
|
20
|
+
@facthandler.should respond_to(:download_fact_plugins?)
|
21
|
+
end
|
22
|
+
|
16
23
|
it "should download fact plugins when :factsync is true" do
|
17
24
|
Puppet.settings.expects(:value).with(:factsync).returns true
|
18
25
|
@facthandler.should be_download_fact_plugins
|
@@ -44,60 +51,46 @@ describe Puppet::Configurer::FactHandler do
|
|
44
51
|
@facthandler.download_fact_plugins
|
45
52
|
end
|
46
53
|
|
47
|
-
|
48
|
-
|
49
|
-
@facthandler.stubs(:reload_facter)
|
50
|
-
Puppet::Node::Facts.terminus_class = :memory
|
51
|
-
end
|
52
|
-
|
53
|
-
it "should use the node name value to retrieve the facts" do
|
54
|
-
foo_facts = Puppet::Node::Facts.new('foo')
|
55
|
-
bar_facts = Puppet::Node::Facts.new('bar')
|
56
|
-
foo_facts.save
|
57
|
-
bar_facts.save
|
58
|
-
Puppet[:certname] = 'foo'
|
59
|
-
Puppet[:node_name_value] = 'bar'
|
60
|
-
|
61
|
-
@facthandler.find_facts.should == bar_facts
|
62
|
-
end
|
54
|
+
it "should warn about factsync deprecation when factsync is enabled" do
|
55
|
+
Puppet::Configurer::Downloader.stubs(:new).returns mock("downloader", :evaluate => nil)
|
63
56
|
|
64
|
-
|
65
|
-
|
66
|
-
|
57
|
+
@facthandler.expects(:download_fact_plugins?).returns true
|
58
|
+
Puppet.expects(:warning)
|
59
|
+
@facthandler.download_fact_plugins
|
60
|
+
end
|
67
61
|
|
68
|
-
|
69
|
-
|
62
|
+
it "should have a method for retrieving facts" do
|
63
|
+
@facthandler.should respond_to(:find_facts)
|
64
|
+
end
|
70
65
|
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
it "should use the Facts class with the :certname to find the facts" do
|
67
|
+
Puppet.settings.expects(:value).with(:certname).returns "foo"
|
68
|
+
Puppet::Node::Facts.indirection.expects(:find).with("foo").returns "myfacts"
|
69
|
+
@facthandler.stubs(:reload_facter)
|
70
|
+
@facthandler.find_facts.should == "myfacts"
|
71
|
+
end
|
74
72
|
|
75
|
-
|
73
|
+
it "should reload Facter and find local facts when asked to find facts" do
|
74
|
+
@facthandler.expects(:reload_facter)
|
76
75
|
|
77
|
-
|
78
|
-
|
76
|
+
Puppet.settings.expects(:value).with(:certname).returns "myhost"
|
77
|
+
Puppet::Node::Facts.indirection.expects(:find).with("myhost")
|
79
78
|
|
80
|
-
|
81
|
-
|
79
|
+
@facthandler.find_facts
|
80
|
+
end
|
82
81
|
|
83
|
-
|
84
|
-
|
82
|
+
it "should fail if finding facts fails" do
|
83
|
+
@facthandler.stubs(:reload_facter)
|
85
84
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
Puppet::Node::Facts.expects(:find).raises RuntimeError
|
85
|
+
Puppet.settings.stubs(:value).with(:trace).returns false
|
86
|
+
Puppet.settings.stubs(:value).with(:certname).returns "myhost"
|
87
|
+
Puppet::Node::Facts.indirection.expects(:find).raises RuntimeError
|
90
88
|
|
91
|
-
|
92
|
-
end
|
89
|
+
lambda { @facthandler.find_facts }.should raise_error(Puppet::Error)
|
93
90
|
end
|
94
91
|
|
95
|
-
it "should
|
96
|
-
|
97
|
-
|
98
|
-
@facthandler.expects(:download_fact_plugins?).returns true
|
99
|
-
Puppet.expects(:warning)
|
100
|
-
@facthandler.download_fact_plugins
|
92
|
+
it "should have a method to prepare the facts for uploading" do
|
93
|
+
@facthandler.should respond_to(:facts_for_uploading)
|
101
94
|
end
|
102
95
|
|
103
96
|
# I couldn't get marshal to work for this, only yaml, so we hard-code yaml.
|
@@ -1,16 +1,15 @@
|
|
1
|
-
#!/usr/bin/env
|
1
|
+
#!/usr/bin/env rspec
|
2
2
|
#
|
3
3
|
# Created by Luke Kanies on 2007-11-12.
|
4
4
|
# Copyright (c) 2007. All rights reserved.
|
5
5
|
|
6
|
-
require
|
6
|
+
require 'spec_helper'
|
7
7
|
require 'puppet/configurer'
|
8
8
|
|
9
9
|
describe Puppet::Configurer do
|
10
10
|
before do
|
11
11
|
Puppet.settings.stubs(:use).returns(true)
|
12
12
|
@agent = Puppet::Configurer.new
|
13
|
-
Puppet::Util::Storage.stubs(:store)
|
14
13
|
end
|
15
14
|
|
16
15
|
it "should include the Plugin Handler module" do
|
@@ -36,16 +35,16 @@ describe Puppet::Configurer do
|
|
36
35
|
|
37
36
|
it "should execute any pre-run command provided via the 'prerun_command' setting" do
|
38
37
|
Puppet.settings[:prerun_command] = "/my/command"
|
39
|
-
Puppet::Util.expects(:execute).with
|
38
|
+
Puppet::Util.expects(:execute).with { |args| args[0] == "/my/command" }
|
40
39
|
|
41
40
|
@agent.execute_prerun_command
|
42
41
|
end
|
43
42
|
|
44
43
|
it "should fail if the command fails" do
|
45
44
|
Puppet.settings[:prerun_command] = "/my/command"
|
46
|
-
Puppet::Util.expects(:execute).
|
45
|
+
Puppet::Util.expects(:execute).raises Puppet::ExecutionFailure
|
47
46
|
|
48
|
-
@agent.execute_prerun_command.should
|
47
|
+
lambda { @agent.execute_prerun_command }.should raise_error(Puppet::Configurer::CommandHookError)
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
@@ -59,550 +58,469 @@ describe Puppet::Configurer do
|
|
59
58
|
|
60
59
|
it "should execute any post-run command provided via the 'postrun_command' setting" do
|
61
60
|
Puppet.settings[:postrun_command] = "/my/command"
|
62
|
-
Puppet::Util.expects(:execute).with
|
61
|
+
Puppet::Util.expects(:execute).with { |args| args[0] == "/my/command" }
|
63
62
|
|
64
63
|
@agent.execute_postrun_command
|
65
64
|
end
|
66
65
|
|
67
66
|
it "should fail if the command fails" do
|
68
67
|
Puppet.settings[:postrun_command] = "/my/command"
|
69
|
-
Puppet::Util.expects(:execute).
|
68
|
+
Puppet::Util.expects(:execute).raises Puppet::ExecutionFailure
|
70
69
|
|
71
|
-
@agent.execute_postrun_command.should
|
70
|
+
lambda { @agent.execute_postrun_command }.should raise_error(Puppet::Configurer::CommandHookError)
|
72
71
|
end
|
73
72
|
end
|
73
|
+
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
@agent.stubs(:send_report)
|
88
|
-
@agent.stubs(:save_last_run_summary)
|
89
|
-
|
90
|
-
Puppet::Util::Log.stubs(:close)
|
91
|
-
end
|
92
|
-
|
93
|
-
after :all do
|
94
|
-
Puppet::Node::Facts.indirection.reset_terminus_class
|
95
|
-
Puppet::Resource::Catalog.indirection.reset_terminus_class
|
96
|
-
end
|
97
|
-
|
98
|
-
it "should prepare for the run" do
|
99
|
-
@agent.expects(:prepare)
|
100
|
-
|
101
|
-
@agent.run
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should initialize a transaction report if one is not provided" do
|
105
|
-
report = Puppet::Transaction::Report.new("apply")
|
106
|
-
Puppet::Transaction::Report.expects(:new).returns report
|
107
|
-
|
108
|
-
@agent.run
|
109
|
-
end
|
110
|
-
|
111
|
-
it "should respect node_name_fact when setting the host on a report" do
|
112
|
-
Puppet[:node_name_fact] = 'my_name_fact'
|
113
|
-
@facts.values = {'my_name_fact' => 'node_name_from_fact'}
|
114
|
-
|
115
|
-
@agent.run.host.should == 'node_name_from_fact'
|
116
|
-
end
|
117
|
-
|
118
|
-
it "should pass the new report to the catalog" do
|
119
|
-
report = Puppet::Transaction::Report.new("apply")
|
120
|
-
Puppet::Transaction::Report.stubs(:new).returns report
|
121
|
-
@catalog.expects(:apply).with{|options| options[:report] == report}
|
122
|
-
|
123
|
-
@agent.run
|
124
|
-
end
|
125
|
-
|
126
|
-
it "should use the provided report if it was passed one" do
|
127
|
-
report = Puppet::Transaction::Report.new("apply")
|
128
|
-
Puppet::Transaction::Report.expects(:new).never
|
129
|
-
@catalog.expects(:apply).with{|options| options[:report] == report}
|
130
|
-
|
131
|
-
@agent.run(:report => report)
|
132
|
-
end
|
133
|
-
|
134
|
-
it "should set the report as a log destination" do
|
135
|
-
report = Puppet::Transaction::Report.new("apply")
|
136
|
-
Puppet::Transaction::Report.expects(:new).returns report
|
75
|
+
describe Puppet::Configurer, "when executing a catalog run" do
|
76
|
+
before do
|
77
|
+
Puppet.settings.stubs(:use).returns(true)
|
78
|
+
@agent = Puppet::Configurer.new
|
79
|
+
@agent.stubs(:prepare)
|
80
|
+
@agent.stubs(:facts_for_uploading).returns({})
|
81
|
+
@catalog = Puppet::Resource::Catalog.new
|
82
|
+
@catalog.stubs(:apply)
|
83
|
+
@agent.stubs(:retrieve_catalog).returns @catalog
|
84
|
+
@agent.stubs(:save_last_run_summary)
|
85
|
+
Puppet::Transaction::Report.indirection.stubs(:save)
|
86
|
+
end
|
137
87
|
|
138
|
-
|
139
|
-
|
140
|
-
Puppet::Util::Log.expects(:close).with([])
|
88
|
+
it "should prepare for the run" do
|
89
|
+
@agent.expects(:prepare)
|
141
90
|
|
142
|
-
|
143
|
-
|
91
|
+
@agent.run
|
92
|
+
end
|
144
93
|
|
145
|
-
|
146
|
-
|
94
|
+
it "should initialize a transaction report if one is not provided" do
|
95
|
+
report = Puppet::Transaction::Report.new("apply")
|
96
|
+
Puppet::Transaction::Report.expects(:new).at_least_once.returns report
|
147
97
|
|
148
|
-
|
149
|
-
|
98
|
+
@agent.run
|
99
|
+
end
|
150
100
|
|
151
|
-
|
152
|
-
|
101
|
+
it "should pass the new report to the catalog" do
|
102
|
+
report = Puppet::Transaction::Report.new("apply")
|
103
|
+
Puppet::Transaction::Report.stubs(:new).returns report
|
104
|
+
@catalog.expects(:apply).with{|options| options[:report] == report}
|
153
105
|
|
154
|
-
|
106
|
+
@agent.run
|
107
|
+
end
|
155
108
|
|
156
|
-
|
157
|
-
|
109
|
+
it "should use the provided report if it was passed one" do
|
110
|
+
report = Puppet::Transaction::Report.new("apply")
|
111
|
+
Puppet::Transaction::Report.expects(:new).never
|
112
|
+
@catalog.expects(:apply).with{|options| options[:report] == report}
|
158
113
|
|
159
|
-
|
160
|
-
|
114
|
+
@agent.run(:report => report)
|
115
|
+
end
|
161
116
|
|
162
|
-
|
163
|
-
|
164
|
-
|
117
|
+
it "should set the report as a log destination" do
|
118
|
+
report = Puppet::Transaction::Report.new("apply")
|
119
|
+
Puppet::Transaction::Report.expects(:new).returns report
|
165
120
|
|
166
|
-
|
167
|
-
|
121
|
+
@agent.stubs(:send_report)
|
122
|
+
Puppet::Util::Log.expects(:newdestination).with(report)
|
168
123
|
|
169
|
-
|
170
|
-
|
171
|
-
end
|
124
|
+
@agent.run
|
125
|
+
end
|
172
126
|
|
173
|
-
|
174
|
-
|
127
|
+
it "should retrieve the catalog" do
|
128
|
+
@agent.expects(:retrieve_catalog)
|
175
129
|
|
176
|
-
|
130
|
+
@agent.run
|
131
|
+
end
|
177
132
|
|
178
|
-
|
179
|
-
|
180
|
-
end
|
133
|
+
it "should log a failure and do nothing if no catalog can be retrieved" do
|
134
|
+
@agent.expects(:retrieve_catalog).returns nil
|
181
135
|
|
182
|
-
|
183
|
-
@agent.expects(:execute_postrun_command)
|
136
|
+
Puppet.expects(:err).with "Could not retrieve catalog; skipping run"
|
184
137
|
|
185
|
-
|
186
|
-
|
138
|
+
@agent.run
|
139
|
+
end
|
187
140
|
|
188
|
-
|
189
|
-
|
190
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
191
|
-
@agent.expects(:send_report).with(report)
|
141
|
+
it "should apply the catalog with all options to :run" do
|
142
|
+
@agent.expects(:retrieve_catalog).returns @catalog
|
192
143
|
|
193
|
-
|
194
|
-
|
144
|
+
@catalog.expects(:apply).with { |args| args[:one] == true }
|
145
|
+
@agent.run :one => true
|
146
|
+
end
|
195
147
|
|
196
|
-
|
197
|
-
|
148
|
+
it "should accept a catalog and use it instead of retrieving a different one" do
|
149
|
+
@agent.expects(:retrieve_catalog).never
|
198
150
|
|
199
|
-
|
200
|
-
|
201
|
-
|
151
|
+
@catalog.expects(:apply)
|
152
|
+
@agent.run :one => true, :catalog => @catalog
|
153
|
+
end
|
202
154
|
|
203
|
-
|
204
|
-
|
155
|
+
it "should benchmark how long it takes to apply the catalog" do
|
156
|
+
@agent.expects(:benchmark).with(:notice, "Finished catalog run")
|
205
157
|
|
206
|
-
|
207
|
-
@agent.expects(:retrieve_catalog).raises "whatever"
|
158
|
+
@agent.expects(:retrieve_catalog).returns @catalog
|
208
159
|
|
209
|
-
|
210
|
-
|
211
|
-
|
160
|
+
@catalog.expects(:apply).never # because we're not yielding
|
161
|
+
@agent.run
|
162
|
+
end
|
212
163
|
|
213
|
-
|
214
|
-
|
164
|
+
it "should execute post-run hooks after the run" do
|
165
|
+
@agent.expects(:execute_postrun_command)
|
215
166
|
|
216
|
-
|
217
|
-
|
218
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
167
|
+
@agent.run
|
168
|
+
end
|
219
169
|
|
220
|
-
|
170
|
+
it "should send the report" do
|
171
|
+
report = Puppet::Transaction::Report.new("apply")
|
172
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
173
|
+
@agent.expects(:send_report).with { |r, trans| r == report }
|
221
174
|
|
222
|
-
|
223
|
-
|
175
|
+
@agent.run
|
176
|
+
end
|
224
177
|
|
225
|
-
|
226
|
-
|
227
|
-
|
178
|
+
it "should send the transaction report with a reference to the transaction if a run was actually made" do
|
179
|
+
report = Puppet::Transaction::Report.new("apply")
|
180
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
228
181
|
|
229
|
-
|
230
|
-
|
182
|
+
trans = stub 'transaction'
|
183
|
+
@catalog.expects(:apply).returns trans
|
231
184
|
|
232
|
-
|
233
|
-
report = Puppet::Transaction::Report.new("apply")
|
234
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
185
|
+
@agent.expects(:send_report).with { |r, t| t == trans }
|
235
186
|
|
236
|
-
|
237
|
-
|
238
|
-
@agent.expects(:send_report)
|
187
|
+
@agent.run :catalog => @catalog
|
188
|
+
end
|
239
189
|
|
240
|
-
|
241
|
-
|
190
|
+
it "should send the transaction report even if the catalog could not be retrieved" do
|
191
|
+
@agent.expects(:retrieve_catalog).returns nil
|
242
192
|
|
243
|
-
|
244
|
-
|
245
|
-
|
193
|
+
report = Puppet::Transaction::Report.new("apply")
|
194
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
195
|
+
@agent.expects(:send_report)
|
246
196
|
|
247
|
-
|
248
|
-
|
197
|
+
@agent.run
|
198
|
+
end
|
249
199
|
|
250
|
-
|
200
|
+
it "should send the transaction report even if there is a failure" do
|
201
|
+
@agent.expects(:retrieve_catalog).raises "whatever"
|
251
202
|
|
252
|
-
|
253
|
-
|
203
|
+
report = Puppet::Transaction::Report.new("apply")
|
204
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
205
|
+
@agent.expects(:send_report)
|
254
206
|
|
255
|
-
|
256
|
-
|
257
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
207
|
+
lambda { @agent.run }.should raise_error
|
208
|
+
end
|
258
209
|
|
259
|
-
|
260
|
-
|
261
|
-
|
210
|
+
it "should remove the report as a log destination when the run is finished" do
|
211
|
+
report = Puppet::Transaction::Report.new("apply")
|
212
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
262
213
|
|
263
|
-
|
264
|
-
end
|
214
|
+
report.expects(:<<).at_least_once
|
265
215
|
|
266
|
-
|
267
|
-
|
268
|
-
|
216
|
+
@agent.run
|
217
|
+
Puppet::Util::Log.destinations.should_not include(report)
|
218
|
+
end
|
269
219
|
|
270
|
-
|
271
|
-
|
220
|
+
it "should return the report as the result of the run" do
|
221
|
+
report = Puppet::Transaction::Report.new("apply")
|
222
|
+
Puppet::Transaction::Report.expects(:new).returns(report)
|
272
223
|
|
273
|
-
|
224
|
+
@agent.run.should equal(report)
|
225
|
+
end
|
226
|
+
end
|
274
227
|
|
275
|
-
|
276
|
-
|
228
|
+
describe Puppet::Configurer, "when sending a report" do
|
229
|
+
include PuppetSpec::Files
|
277
230
|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
Puppet::Util.expects(:execute).with(["/my/postcommand"])
|
231
|
+
before do
|
232
|
+
Puppet.settings.stubs(:use).returns(true)
|
233
|
+
@configurer = Puppet::Configurer.new
|
234
|
+
Puppet[:lastrunfile] = tmpfile('last_run_file')
|
283
235
|
|
284
|
-
|
285
|
-
|
236
|
+
@report = Puppet::Transaction::Report.new("apply")
|
237
|
+
@trans = stub 'transaction'
|
238
|
+
end
|
286
239
|
|
287
|
-
|
288
|
-
|
289
|
-
|
240
|
+
it "should finalize the report" do
|
241
|
+
@report.expects(:finalize_report)
|
242
|
+
@configurer.send_report(@report, @trans)
|
243
|
+
end
|
290
244
|
|
291
|
-
|
292
|
-
|
293
|
-
end
|
245
|
+
it "should print a report summary if configured to do so" do
|
246
|
+
Puppet.settings[:summarize] = true
|
294
247
|
|
295
|
-
|
296
|
-
report = Puppet::Transaction::Report.new("apply")
|
297
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
248
|
+
@report.expects(:summary).returns "stuff"
|
298
249
|
|
299
|
-
|
300
|
-
|
250
|
+
@configurer.expects(:puts).with("stuff")
|
251
|
+
@configurer.send_report(@report, nil)
|
252
|
+
end
|
301
253
|
|
302
|
-
|
303
|
-
|
254
|
+
it "should not print a report summary if not configured to do so" do
|
255
|
+
Puppet.settings[:summarize] = false
|
304
256
|
|
305
|
-
|
306
|
-
|
257
|
+
@configurer.expects(:puts).never
|
258
|
+
@configurer.send_report(@report, nil)
|
259
|
+
end
|
307
260
|
|
308
|
-
|
309
|
-
|
310
|
-
Puppet::Transaction::Report.expects(:new).returns(report)
|
261
|
+
it "should save the report if reporting is enabled" do
|
262
|
+
Puppet.settings[:report] = true
|
311
263
|
|
312
|
-
|
313
|
-
|
264
|
+
Puppet::Transaction::Report.indirection.expects(:save).with(@report)
|
265
|
+
@configurer.send_report(@report, nil)
|
266
|
+
end
|
314
267
|
|
315
|
-
|
316
|
-
|
268
|
+
it "should not save the report if reporting is disabled" do
|
269
|
+
Puppet.settings[:report] = false
|
317
270
|
|
318
|
-
|
319
|
-
|
271
|
+
Puppet::Transaction::Report.indirection.expects(:save).never
|
272
|
+
@configurer.send_report(@report, nil)
|
273
|
+
end
|
320
274
|
|
321
|
-
|
322
|
-
|
323
|
-
Puppet::Resource::Catalog.terminus_class = :compiler
|
324
|
-
@agent.expects(:facts_for_uploading).never
|
325
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options|
|
326
|
-
options[:facts].nil?
|
327
|
-
}.returns @catalog
|
275
|
+
it "should save the last run summary if reporting is enabled" do
|
276
|
+
Puppet.settings[:report] = true
|
328
277
|
|
329
|
-
|
330
|
-
|
331
|
-
|
278
|
+
@configurer.expects(:save_last_run_summary).with(@report)
|
279
|
+
@configurer.send_report(@report, nil)
|
280
|
+
end
|
332
281
|
|
333
|
-
|
334
|
-
|
335
|
-
Puppet::Resource::Catalog.terminus_class = :rest
|
336
|
-
@agent.expects(:facts_for_uploading).returns(:facts => "myfacts", :facts_format => :foo)
|
337
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options|
|
338
|
-
options[:facts] == "myfacts" and options[:facts_format] == :foo
|
339
|
-
}.returns @catalog
|
282
|
+
it "should save the last run summary if reporting is disabled" do
|
283
|
+
Puppet.settings[:report] = false
|
340
284
|
|
341
|
-
|
342
|
-
|
343
|
-
end
|
285
|
+
@configurer.expects(:save_last_run_summary).with(@report)
|
286
|
+
@configurer.send_report(@report, nil)
|
344
287
|
end
|
345
288
|
|
346
|
-
|
347
|
-
|
289
|
+
it "should log but not fail if saving the report fails" do
|
290
|
+
Puppet.settings[:report] = true
|
348
291
|
|
349
|
-
|
350
|
-
Puppet.settings.stubs(:use).returns(true)
|
351
|
-
@configurer = Puppet::Configurer.new
|
352
|
-
Puppet[:lastrunfile] = tmpfile('last_run_file')
|
292
|
+
Puppet::Transaction::Report.indirection.expects(:save).with(@report).raises "whatever"
|
353
293
|
|
354
|
-
|
355
|
-
|
294
|
+
Puppet.expects(:err)
|
295
|
+
lambda { @configurer.send_report(@report, nil) }.should_not raise_error
|
296
|
+
end
|
297
|
+
end
|
356
298
|
|
357
|
-
|
358
|
-
|
299
|
+
describe Puppet::Configurer, "when saving the summary report file" do
|
300
|
+
before do
|
301
|
+
Puppet.settings.stubs(:use).returns(true)
|
302
|
+
@configurer = Puppet::Configurer.new
|
359
303
|
|
360
|
-
|
304
|
+
@report = stub 'report'
|
305
|
+
@trans = stub 'transaction'
|
306
|
+
@lastrunfd = stub 'lastrunfd'
|
307
|
+
Puppet::Util::FileLocking.stubs(:writelock).yields(@lastrunfd)
|
308
|
+
end
|
361
309
|
|
362
|
-
|
363
|
-
|
364
|
-
|
310
|
+
it "should write the raw summary to the lastrunfile setting value" do
|
311
|
+
Puppet::Util::FileLocking.expects(:writelock).with(Puppet[:lastrunfile], 0660)
|
312
|
+
@configurer.save_last_run_summary(@report)
|
313
|
+
end
|
365
314
|
|
366
|
-
|
367
|
-
|
315
|
+
it "should write the raw summary as yaml" do
|
316
|
+
@report.expects(:raw_summary).returns("summary")
|
317
|
+
@lastrunfd.expects(:print).with(YAML.dump("summary"))
|
318
|
+
@configurer.save_last_run_summary(@report)
|
319
|
+
end
|
368
320
|
|
369
|
-
|
370
|
-
|
371
|
-
|
321
|
+
it "should log but not fail if saving the last run summary fails" do
|
322
|
+
Puppet::Util::FileLocking.expects(:writelock).raises "exception"
|
323
|
+
Puppet.expects(:err)
|
324
|
+
lambda { @configurer.save_last_run_summary(@report) }.should_not raise_error
|
325
|
+
end
|
372
326
|
|
373
|
-
|
374
|
-
Puppet.settings[:report] = true
|
327
|
+
end
|
375
328
|
|
376
|
-
|
377
|
-
|
378
|
-
|
329
|
+
describe Puppet::Configurer, "when retrieving a catalog" do
|
330
|
+
before do
|
331
|
+
Puppet.settings.stubs(:use).returns(true)
|
332
|
+
@agent = Puppet::Configurer.new
|
333
|
+
@agent.stubs(:facts_for_uploading).returns({})
|
379
334
|
|
380
|
-
|
381
|
-
Puppet.settings[:report] = false
|
335
|
+
@catalog = Puppet::Resource::Catalog.new
|
382
336
|
|
383
|
-
|
384
|
-
|
385
|
-
end
|
337
|
+
# this is the default when using a Configurer instance
|
338
|
+
Puppet::Resource::Catalog.indirection.stubs(:terminus_class).returns :rest
|
386
339
|
|
387
|
-
|
388
|
-
|
340
|
+
@agent.stubs(:convert_catalog).returns @catalog
|
341
|
+
end
|
389
342
|
|
390
|
-
|
391
|
-
|
343
|
+
describe "and configured to only retrieve a catalog from the cache" do
|
344
|
+
before do
|
345
|
+
Puppet.settings[:use_cached_catalog] = true
|
392
346
|
end
|
393
347
|
|
394
|
-
it "should
|
395
|
-
Puppet.
|
348
|
+
it "should first look in the cache for a catalog" do
|
349
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog
|
350
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.never
|
396
351
|
|
397
|
-
@
|
398
|
-
@configurer.send_report(@report)
|
352
|
+
@agent.retrieve_catalog.should == @catalog
|
399
353
|
end
|
400
354
|
|
401
|
-
it "should
|
402
|
-
Puppet.
|
403
|
-
|
404
|
-
@report.expects(:save).raises "whatever"
|
355
|
+
it "should compile a new catalog if none is found in the cache" do
|
356
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns nil
|
357
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns @catalog
|
405
358
|
|
406
|
-
|
407
|
-
lambda { @configurer.send_report(@report) }.should_not raise_error
|
359
|
+
@agent.retrieve_catalog.should == @catalog
|
408
360
|
end
|
409
361
|
end
|
410
362
|
|
411
|
-
describe "when
|
412
|
-
|
413
|
-
|
414
|
-
|
363
|
+
describe "when not using a REST terminus for catalogs" do
|
364
|
+
it "should not pass any facts when retrieving the catalog" do
|
365
|
+
@agent.expects(:facts_for_uploading).never
|
366
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options|
|
367
|
+
options[:facts].nil?
|
368
|
+
}.returns @catalog
|
415
369
|
|
416
|
-
@
|
417
|
-
@trans = stub 'transaction'
|
418
|
-
@lastrunfd = stub 'lastrunfd'
|
419
|
-
Puppet::Util::FileLocking.stubs(:writelock).yields(@lastrunfd)
|
370
|
+
@agent.retrieve_catalog
|
420
371
|
end
|
421
|
-
|
422
|
-
it "should write the raw summary to the lastrunfile setting value" do
|
423
|
-
Puppet::Util::FileLocking.expects(:writelock).with(Puppet[:lastrunfile], 0660)
|
424
|
-
@configurer.save_last_run_summary(@report)
|
425
|
-
end
|
426
|
-
|
427
|
-
it "should write the raw summary as yaml" do
|
428
|
-
@report.expects(:raw_summary).returns("summary")
|
429
|
-
@lastrunfd.expects(:print).with(YAML.dump("summary"))
|
430
|
-
@configurer.save_last_run_summary(@report)
|
431
|
-
end
|
432
|
-
|
433
|
-
it "should log but not fail if saving the last run summary fails" do
|
434
|
-
Puppet::Util::FileLocking.expects(:writelock).raises "exception"
|
435
|
-
Puppet.expects(:err)
|
436
|
-
lambda { @configurer.save_last_run_summary(@report) }.should_not raise_error
|
437
|
-
end
|
438
|
-
|
439
372
|
end
|
440
373
|
|
441
|
-
describe "when
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
@catalog
|
374
|
+
describe "when using a REST terminus for catalogs" do
|
375
|
+
it "should pass the prepared facts and the facts format as arguments when retrieving the catalog" do
|
376
|
+
@agent.expects(:facts_for_uploading).returns(:facts => "myfacts", :facts_format => :foo)
|
377
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options|
|
378
|
+
options[:facts] == "myfacts" and options[:facts_format] == :foo
|
379
|
+
}.returns @catalog
|
447
380
|
|
448
|
-
|
449
|
-
Puppet::Resource::Catalog.indirection.stubs(:terminus_class).returns :rest
|
450
|
-
|
451
|
-
@agent.stubs(:convert_catalog).returns @catalog
|
381
|
+
@agent.retrieve_catalog
|
452
382
|
end
|
383
|
+
end
|
453
384
|
|
454
|
-
|
455
|
-
|
456
|
-
Puppet.settings[:use_cached_catalog] = true
|
457
|
-
end
|
458
|
-
|
459
|
-
it "should first look in the cache for a catalog" do
|
460
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog
|
461
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_cache] == true }.never
|
462
|
-
|
463
|
-
@agent.retrieve_catalog({}).should == @catalog
|
464
|
-
end
|
465
|
-
|
466
|
-
it "should compile a new catalog if none is found in the cache" do
|
467
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns nil
|
468
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns @catalog
|
385
|
+
it "should use the Catalog class to get its catalog" do
|
386
|
+
Puppet::Resource::Catalog.indirection.expects(:find).returns @catalog
|
469
387
|
|
470
|
-
|
471
|
-
|
472
|
-
end
|
388
|
+
@agent.retrieve_catalog
|
389
|
+
end
|
473
390
|
|
474
|
-
|
475
|
-
|
391
|
+
it "should use its certname to retrieve the catalog" do
|
392
|
+
Facter.stubs(:value).returns "eh"
|
393
|
+
Puppet.settings[:certname] = "myhost.domain.com"
|
394
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| name == "myhost.domain.com" }.returns @catalog
|
476
395
|
|
477
|
-
|
478
|
-
|
396
|
+
@agent.retrieve_catalog
|
397
|
+
end
|
479
398
|
|
480
|
-
|
481
|
-
|
482
|
-
Puppet.settings[:node_name_value] = "myhost.domain.com"
|
483
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| name == "myhost.domain.com" }.returns @catalog
|
399
|
+
it "should default to returning a catalog retrieved directly from the server, skipping the cache" do
|
400
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns @catalog
|
484
401
|
|
485
|
-
|
486
|
-
|
402
|
+
@agent.retrieve_catalog.should == @catalog
|
403
|
+
end
|
487
404
|
|
488
|
-
|
489
|
-
|
405
|
+
it "should log and return the cached catalog when no catalog can be retrieved from the server" do
|
406
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns nil
|
407
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog
|
490
408
|
|
491
|
-
|
492
|
-
end
|
409
|
+
Puppet.expects(:notice)
|
493
410
|
|
494
|
-
|
495
|
-
|
496
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog
|
411
|
+
@agent.retrieve_catalog.should == @catalog
|
412
|
+
end
|
497
413
|
|
498
|
-
|
414
|
+
it "should not look in the cache for a catalog if one is returned from the server" do
|
415
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns @catalog
|
416
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.never
|
499
417
|
|
500
|
-
|
501
|
-
|
418
|
+
@agent.retrieve_catalog.should == @catalog
|
419
|
+
end
|
502
420
|
|
503
|
-
|
504
|
-
|
505
|
-
|
421
|
+
it "should return the cached catalog when retrieving the remote catalog throws an exception" do
|
422
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.raises "eh"
|
423
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns @catalog
|
506
424
|
|
507
|
-
|
508
|
-
|
425
|
+
@agent.retrieve_catalog.should == @catalog
|
426
|
+
end
|
509
427
|
|
510
|
-
|
511
|
-
|
512
|
-
|
428
|
+
it "should log and return nil if no catalog can be retrieved from the server and :usecacheonfailure is disabled" do
|
429
|
+
Puppet.stubs(:[])
|
430
|
+
Puppet.expects(:[]).with(:usecacheonfailure).returns false
|
431
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns nil
|
513
432
|
|
514
|
-
|
515
|
-
end
|
433
|
+
Puppet.expects(:warning)
|
516
434
|
|
517
|
-
|
518
|
-
|
519
|
-
Puppet.expects(:[]).with(:usecacheonfailure).returns false
|
520
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns nil
|
435
|
+
@agent.retrieve_catalog.should be_nil
|
436
|
+
end
|
521
437
|
|
522
|
-
|
438
|
+
it "should return nil if no cached catalog is available and no catalog can be retrieved from the server" do
|
439
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_cache] == true }.returns nil
|
440
|
+
Puppet::Resource::Catalog.indirection.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns nil
|
523
441
|
|
524
|
-
|
525
|
-
|
442
|
+
@agent.retrieve_catalog.should be_nil
|
443
|
+
end
|
526
444
|
|
527
|
-
|
528
|
-
|
529
|
-
Puppet::Resource::Catalog.expects(:find).with { |name, options| options[:ignore_terminus] == true }.returns nil
|
445
|
+
it "should convert the catalog before returning" do
|
446
|
+
Puppet::Resource::Catalog.indirection.stubs(:find).returns @catalog
|
530
447
|
|
531
|
-
|
532
|
-
|
448
|
+
@agent.expects(:convert_catalog).with { |cat, dur| cat == @catalog }.returns "converted catalog"
|
449
|
+
@agent.retrieve_catalog.should == "converted catalog"
|
450
|
+
end
|
533
451
|
|
534
|
-
|
535
|
-
|
452
|
+
it "should return nil if there is an error while retrieving the catalog" do
|
453
|
+
Puppet::Resource::Catalog.indirection.expects(:find).at_least_once.raises "eh"
|
536
454
|
|
537
|
-
|
538
|
-
|
539
|
-
|
455
|
+
@agent.retrieve_catalog.should be_nil
|
456
|
+
end
|
457
|
+
end
|
540
458
|
|
541
|
-
|
542
|
-
|
459
|
+
describe Puppet::Configurer, "when converting the catalog" do
|
460
|
+
before do
|
461
|
+
Puppet.settings.stubs(:use).returns(true)
|
462
|
+
@agent = Puppet::Configurer.new
|
543
463
|
|
544
|
-
|
545
|
-
|
464
|
+
@catalog = Puppet::Resource::Catalog.new
|
465
|
+
@oldcatalog = stub 'old_catalog', :to_ral => @catalog
|
546
466
|
end
|
547
467
|
|
548
|
-
|
549
|
-
|
550
|
-
Puppet.settings.stubs(:use).returns(true)
|
551
|
-
|
552
|
-
@catalog = Puppet::Resource::Catalog.new
|
553
|
-
@oldcatalog = stub 'old_catalog', :to_ral => @catalog
|
554
|
-
end
|
468
|
+
it "should convert the catalog to a RAL-formed catalog" do
|
469
|
+
@oldcatalog.expects(:to_ral).returns @catalog
|
555
470
|
|
556
|
-
|
557
|
-
|
471
|
+
@agent.convert_catalog(@oldcatalog, 10).should equal(@catalog)
|
472
|
+
end
|
558
473
|
|
559
|
-
|
560
|
-
|
474
|
+
it "should finalize the catalog" do
|
475
|
+
@catalog.expects(:finalize)
|
561
476
|
|
562
|
-
|
563
|
-
|
477
|
+
@agent.convert_catalog(@oldcatalog, 10)
|
478
|
+
end
|
564
479
|
|
565
|
-
|
566
|
-
|
480
|
+
it "should record the passed retrieval time with the RAL catalog" do
|
481
|
+
@catalog.expects(:retrieval_duration=).with 10
|
567
482
|
|
568
|
-
|
569
|
-
|
483
|
+
@agent.convert_catalog(@oldcatalog, 10)
|
484
|
+
end
|
570
485
|
|
571
|
-
|
572
|
-
|
486
|
+
it "should write the RAL catalog's class file" do
|
487
|
+
@catalog.expects(:write_class_file)
|
573
488
|
|
574
|
-
|
575
|
-
|
489
|
+
@agent.convert_catalog(@oldcatalog, 10)
|
490
|
+
end
|
491
|
+
end
|
576
492
|
|
577
|
-
|
578
|
-
|
493
|
+
describe Puppet::Configurer, "when preparing for a run" do
|
494
|
+
before do
|
495
|
+
Puppet.settings.stubs(:use).returns(true)
|
496
|
+
@agent = Puppet::Configurer.new
|
497
|
+
@agent.stubs(:dostorage)
|
498
|
+
@agent.stubs(:download_fact_plugins)
|
499
|
+
@agent.stubs(:download_plugins)
|
500
|
+
@agent.stubs(:execute_prerun_command)
|
501
|
+
@facts = {"one" => "two", "three" => "four"}
|
579
502
|
end
|
580
503
|
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
@agent.stubs(:download_plugins)
|
587
|
-
@facts = {"one" => "two", "three" => "four"}
|
588
|
-
end
|
504
|
+
it "should initialize the metadata store" do
|
505
|
+
@agent.class.stubs(:facts).returns(@facts)
|
506
|
+
@agent.expects(:dostorage)
|
507
|
+
@agent.prepare({})
|
508
|
+
end
|
589
509
|
|
590
|
-
|
591
|
-
|
592
|
-
@agent.expects(:dostorage)
|
593
|
-
@agent.prepare({})
|
594
|
-
end
|
510
|
+
it "should download fact plugins" do
|
511
|
+
@agent.expects(:download_fact_plugins)
|
595
512
|
|
596
|
-
|
597
|
-
|
513
|
+
@agent.prepare({})
|
514
|
+
end
|
598
515
|
|
599
|
-
|
600
|
-
|
516
|
+
it "should download plugins" do
|
517
|
+
@agent.expects(:download_plugins)
|
601
518
|
|
602
|
-
|
603
|
-
|
519
|
+
@agent.prepare({})
|
520
|
+
end
|
604
521
|
|
605
|
-
|
606
|
-
|
522
|
+
it "should perform the pre-run commands" do
|
523
|
+
@agent.expects(:execute_prerun_command)
|
524
|
+
@agent.prepare({})
|
607
525
|
end
|
608
526
|
end
|