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
data/spec/unit/ssl/base_spec.rb
CHANGED
@@ -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
|
|
5
4
|
require 'puppet/ssl/certificate'
|
6
5
|
|
@@ -40,4 +39,4 @@ describe Puppet::SSL::Certificate do
|
|
40
39
|
@base.fingerprint(:digest).should == "DI:GE:ST"
|
41
40
|
end
|
42
41
|
end
|
43
|
-
end
|
42
|
+
end
|
@@ -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
|
|
5
4
|
require 'puppet/ssl/certificate_authority'
|
6
5
|
|
@@ -32,13 +31,13 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
32
31
|
end
|
33
32
|
describe "when initializing" do
|
34
33
|
it "should set its method using its settor" do
|
35
|
-
|
36
|
-
|
34
|
+
@class.any_instance.expects(:method=).with(:generate)
|
35
|
+
@class.new(:generate, :to => :all)
|
37
36
|
end
|
38
37
|
|
39
38
|
it "should set its subjects using the settor" do
|
40
|
-
|
41
|
-
|
39
|
+
@class.any_instance.expects(:subjects=).with(:all)
|
40
|
+
@class.new(:generate, :to => :all)
|
42
41
|
end
|
43
42
|
|
44
43
|
it "should set the digest if given" do
|
@@ -54,27 +53,23 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
54
53
|
|
55
54
|
describe "when setting the method" do
|
56
55
|
it "should set the method" do
|
57
|
-
|
58
|
-
instance.method = :list
|
59
|
-
|
60
|
-
instance.method.should == :list
|
56
|
+
@class.new(:generate, :to => :all).method.should == :generate
|
61
57
|
end
|
62
58
|
|
63
59
|
it "should fail if the method isn't a member of the INTERFACE_METHODS array" do
|
64
|
-
|
60
|
+
Puppet::SSL::CertificateAuthority::Interface::INTERFACE_METHODS.expects(:include?).with(:thing).returns false
|
61
|
+
|
62
|
+
lambda { @class.new(:thing, :to => :all) }.should raise_error(ArgumentError)
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
68
66
|
describe "when setting the subjects" do
|
69
67
|
it "should set the subjects" do
|
70
|
-
|
71
|
-
instance.subjects = :signed
|
72
|
-
|
73
|
-
instance.subjects.should == :signed
|
68
|
+
@class.new(:generate, :to => :all).subjects.should == :all
|
74
69
|
end
|
75
70
|
|
76
|
-
it "should fail if the subjects setting isn't :all or an array" do
|
77
|
-
lambda { @class.new(:generate,
|
71
|
+
it "should fail if the subjects setting isn't :all or an array", :'fails_on_ruby_1.9.2' => true do
|
72
|
+
lambda { @class.new(:generate, "other") }.should raise_error(ArgumentError)
|
78
73
|
end
|
79
74
|
end
|
80
75
|
|
@@ -122,8 +117,8 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
122
117
|
it "should call :generate on the CA for each host specified" do
|
123
118
|
@applier = @class.new(:generate, :to => %w{host1 host2})
|
124
119
|
|
125
|
-
@ca.expects(:generate).with("host1"
|
126
|
-
@ca.expects(:generate).with("host2"
|
120
|
+
@ca.expects(:generate).with("host1")
|
121
|
+
@ca.expects(:generate).with("host2")
|
127
122
|
|
128
123
|
@applier.apply(@ca)
|
129
124
|
end
|
@@ -154,24 +149,15 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
154
149
|
|
155
150
|
describe ":sign" do
|
156
151
|
describe "and an array of names was provided" do
|
157
|
-
|
158
|
-
|
159
|
-
it "should sign the specified waiting certificate requests" do
|
160
|
-
@options = {:allow_dns_alt_names => false}
|
161
|
-
|
162
|
-
@ca.expects(:sign).with("host1", false)
|
163
|
-
@ca.expects(:sign).with("host2", false)
|
164
|
-
|
165
|
-
applier.apply(@ca)
|
152
|
+
before do
|
153
|
+
@applier = @class.new(:sign, :to => %w{host1 host2})
|
166
154
|
end
|
167
155
|
|
168
|
-
it "should sign the certificate requests
|
169
|
-
@
|
170
|
-
|
171
|
-
@ca.expects(:sign).with("host1", true)
|
172
|
-
@ca.expects(:sign).with("host2", true)
|
156
|
+
it "should sign the specified waiting certificate requests" do
|
157
|
+
@ca.expects(:sign).with("host1")
|
158
|
+
@ca.expects(:sign).with("host2")
|
173
159
|
|
174
|
-
applier.apply(@ca)
|
160
|
+
@applier.apply(@ca)
|
175
161
|
end
|
176
162
|
end
|
177
163
|
|
@@ -179,8 +165,8 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
179
165
|
it "should sign all waiting certificate requests" do
|
180
166
|
@ca.stubs(:waiting?).returns(%w{cert1 cert2})
|
181
167
|
|
182
|
-
@ca.expects(:sign).with("cert1"
|
183
|
-
@ca.expects(:sign).with("cert2"
|
168
|
+
@ca.expects(:sign).with("cert1")
|
169
|
+
@ca.expects(:sign).with("cert2")
|
184
170
|
|
185
171
|
@applier = @class.new(:sign, :to => :all)
|
186
172
|
@applier.apply(@ca)
|
@@ -196,89 +182,63 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
196
182
|
end
|
197
183
|
|
198
184
|
describe ":list" do
|
199
|
-
before :each do
|
200
|
-
certish = stub('certish', :subject_alt_names => [])
|
201
|
-
Puppet::SSL::Certificate.indirection.stubs(:find).returns certish
|
202
|
-
Puppet::SSL::CertificateRequest.indirection.stubs(:find).returns certish
|
203
|
-
|
204
|
-
@ca.expects(:waiting?).returns %w{host1 host2 host3}
|
205
|
-
@ca.expects(:list).returns %w{host4 host5 host6}
|
206
|
-
@ca.stubs(:fingerprint).returns "fingerprint"
|
207
|
-
@ca.stubs(:verify)
|
208
|
-
end
|
209
|
-
|
210
185
|
describe "and an empty array was provided" do
|
211
|
-
it "should print all certificate requests" do
|
212
|
-
|
186
|
+
it "should print a string containing all certificate requests" do
|
187
|
+
@ca.expects(:waiting?).returns %w{host1 host2}
|
188
|
+
@ca.stubs(:verify)
|
213
189
|
|
214
|
-
applier.
|
215
|
-
"host1" (fingerprint)
|
216
|
-
"host2" (fingerprint)
|
217
|
-
"host3" (fingerprint)
|
218
|
-
OUTPUT
|
190
|
+
@applier = @class.new(:list, :to => [])
|
219
191
|
|
220
|
-
applier.
|
192
|
+
@applier.expects(:puts).with "host1\nhost2"
|
193
|
+
|
194
|
+
@applier.apply(@ca)
|
221
195
|
end
|
222
196
|
end
|
223
197
|
|
224
198
|
describe "and :all was provided" do
|
225
199
|
it "should print a string containing all certificate requests and certificates" do
|
226
|
-
@ca.
|
200
|
+
@ca.expects(:waiting?).returns %w{host1 host2}
|
201
|
+
@ca.expects(:list).returns %w{host3 host4}
|
202
|
+
@ca.stubs(:verify)
|
203
|
+
@ca.stubs(:fingerprint).returns "fingerprint"
|
204
|
+
@ca.expects(:verify).with("host3").raises(Puppet::SSL::CertificateAuthority::CertificateVerificationError.new(23), "certificate revoked")
|
227
205
|
|
228
|
-
applier = @class.new(:list, :to => :all)
|
206
|
+
@applier = @class.new(:list, :to => :all)
|
229
207
|
|
230
|
-
applier.expects(:puts).with(
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
+ "host5" (fingerprint)
|
235
|
-
+ "host6" (fingerprint)
|
236
|
-
- "host4" (fingerprint) (certificate revoked)
|
237
|
-
OUTPUT
|
208
|
+
@applier.expects(:puts).with "host1 (fingerprint)"
|
209
|
+
@applier.expects(:puts).with "host2 (fingerprint)"
|
210
|
+
@applier.expects(:puts).with "- host3 (fingerprint) (certificate revoked)"
|
211
|
+
@applier.expects(:puts).with "+ host4 (fingerprint)"
|
238
212
|
|
239
|
-
applier.apply(@ca)
|
213
|
+
@applier.apply(@ca)
|
240
214
|
end
|
241
215
|
end
|
242
216
|
|
243
217
|
describe "and :signed was provided" do
|
244
218
|
it "should print a string containing all signed certificate requests and certificates" do
|
245
|
-
|
246
|
-
|
247
|
-
applier.expects(:puts).with(<<-OUTPUT.chomp)
|
248
|
-
+ "host4" (fingerprint)
|
249
|
-
+ "host5" (fingerprint)
|
250
|
-
+ "host6" (fingerprint)
|
251
|
-
OUTPUT
|
252
|
-
|
253
|
-
applier.apply(@ca)
|
254
|
-
end
|
255
|
-
|
256
|
-
it "should include subject alt names if they are on the certificate request" do
|
257
|
-
request = stub 'request', :subject_alt_names => ["DNS:foo", "DNS:bar"]
|
258
|
-
Puppet::SSL::CertificateRequest.indirection.stubs(:find).returns(request)
|
259
|
-
|
260
|
-
applier = @class.new(:list, :to => ['host1'])
|
219
|
+
@ca.expects(:list).returns %w{host1 host2}
|
261
220
|
|
262
|
-
applier.
|
263
|
-
"host1" (fingerprint) (alt names: "DNS:foo", "DNS:bar")
|
264
|
-
OUTPUT
|
221
|
+
@applier = @class.new(:list, :to => :signed)
|
265
222
|
|
266
|
-
applier.apply(@ca)
|
223
|
+
@applier.apply(@ca)
|
267
224
|
end
|
268
225
|
end
|
269
226
|
|
270
227
|
describe "and an array of names was provided" do
|
271
|
-
it "should print all named hosts" do
|
272
|
-
|
228
|
+
it "should print a string of all named hosts that have a waiting request" do
|
229
|
+
@ca.expects(:waiting?).returns %w{host1 host2}
|
230
|
+
@ca.expects(:list).returns %w{host3 host4}
|
231
|
+
@ca.stubs(:fingerprint).returns "fingerprint"
|
232
|
+
@ca.stubs(:verify)
|
233
|
+
|
234
|
+
@applier = @class.new(:list, :to => %w{host1 host2 host3 host4})
|
273
235
|
|
274
|
-
applier.expects(:puts).with(
|
275
|
-
|
276
|
-
|
277
|
-
+
|
278
|
-
+ "host5" (fingerprint)
|
279
|
-
OUTPUT
|
236
|
+
@applier.expects(:puts).with "host1 (fingerprint)"
|
237
|
+
@applier.expects(:puts).with "host2 (fingerprint)"
|
238
|
+
@applier.expects(:puts).with "+ host3 (fingerprint)"
|
239
|
+
@applier.expects(:puts).with "+ host4 (fingerprint)"
|
280
240
|
|
281
|
-
applier.apply(@ca)
|
241
|
+
@applier.apply(@ca)
|
282
242
|
end
|
283
243
|
end
|
284
244
|
end
|
@@ -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
|
|
5
4
|
require 'puppet/ssl/certificate_authority'
|
6
5
|
|
@@ -138,18 +137,18 @@ describe Puppet::SSL::CertificateAuthority do
|
|
138
137
|
|
139
138
|
it "should return any found CRL instance" do
|
140
139
|
crl = mock 'crl'
|
141
|
-
Puppet::SSL::CertificateRevocationList.expects(:find).returns crl
|
140
|
+
Puppet::SSL::CertificateRevocationList.indirection.expects(:find).returns crl
|
142
141
|
@ca.crl.should equal(crl)
|
143
142
|
end
|
144
143
|
|
145
144
|
it "should create, generate, and save a new CRL instance of no CRL can be found" do
|
146
|
-
crl =
|
147
|
-
Puppet::SSL::CertificateRevocationList.expects(:find).returns nil
|
145
|
+
crl = Puppet::SSL::CertificateRevocationList.new("fakename")
|
146
|
+
Puppet::SSL::CertificateRevocationList.indirection.expects(:find).returns nil
|
148
147
|
|
149
148
|
Puppet::SSL::CertificateRevocationList.expects(:new).returns crl
|
150
149
|
|
151
150
|
crl.expects(:generate).with(@ca.host.certificate.content, @ca.host.key.content)
|
152
|
-
|
151
|
+
Puppet::SSL::CertificateRevocationList.indirection.expects(:save).with(crl)
|
153
152
|
|
154
153
|
@ca.crl.should equal(crl)
|
155
154
|
end
|
@@ -200,9 +199,8 @@ describe Puppet::SSL::CertificateAuthority do
|
|
200
199
|
request = mock 'request'
|
201
200
|
Puppet::SSL::CertificateRequest.expects(:new).with(@ca.host.name).returns request
|
202
201
|
request.expects(:generate).with(@ca.host.key)
|
203
|
-
request.stubs(:request_extensions => [])
|
204
202
|
|
205
|
-
@ca.expects(:sign).with(@host.name,
|
203
|
+
@ca.expects(:sign).with(@host.name, :ca, request)
|
206
204
|
|
207
205
|
@ca.stubs :generate_password
|
208
206
|
|
@@ -236,24 +234,25 @@ describe Puppet::SSL::CertificateAuthority do
|
|
236
234
|
|
237
235
|
@name = "myhost"
|
238
236
|
@real_cert = stub 'realcert', :sign => nil
|
239
|
-
@cert =
|
237
|
+
@cert = Puppet::SSL::Certificate.new(@name)
|
238
|
+
@cert.content = @real_cert
|
240
239
|
|
241
240
|
Puppet::SSL::Certificate.stubs(:new).returns @cert
|
242
241
|
|
243
242
|
@cert.stubs(:content=)
|
244
|
-
|
243
|
+
Puppet::SSL::Certificate.indirection.stubs(:save)
|
245
244
|
|
246
245
|
# Stub out the factory
|
247
|
-
|
246
|
+
@factory = stub 'factory', :result => "my real cert"
|
247
|
+
Puppet::SSL::CertificateFactory.stubs(:new).returns @factory
|
248
248
|
|
249
|
-
@
|
250
|
-
@request = stub 'request', :name => @name, :request_extensions => [], :subject_alt_names => [], :content => @request_content
|
249
|
+
@request = stub 'request', :content => "myrequest", :name => @name
|
251
250
|
|
252
251
|
# And the inventory
|
253
252
|
@inventory = stub 'inventory', :add => nil
|
254
253
|
@ca.stubs(:inventory).returns @inventory
|
255
254
|
|
256
|
-
Puppet::SSL::CertificateRequest.stubs(:destroy)
|
255
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:destroy)
|
257
256
|
end
|
258
257
|
|
259
258
|
describe "and calculating the next certificate serial number" do
|
@@ -296,49 +295,41 @@ describe Puppet::SSL::CertificateAuthority do
|
|
296
295
|
end
|
297
296
|
|
298
297
|
it "should not look up a certificate request for the host" do
|
299
|
-
Puppet::SSL::CertificateRequest.expects(:find).never
|
298
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:find).never
|
300
299
|
|
301
|
-
@ca.sign(@name,
|
300
|
+
@ca.sign(@name, :ca, @request)
|
302
301
|
end
|
303
302
|
|
304
303
|
it "should use a certificate type of :ca" do
|
305
|
-
Puppet::SSL::CertificateFactory.expects(:
|
306
|
-
args[0]
|
307
|
-
end.returns
|
304
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
305
|
+
args[0] == :ca
|
306
|
+
end.returns @factory
|
308
307
|
@ca.sign(@name, :ca, @request)
|
309
308
|
end
|
310
309
|
|
311
310
|
it "should pass the provided CSR as the CSR" do
|
312
|
-
Puppet::SSL::CertificateFactory.expects(:
|
313
|
-
args[1]
|
314
|
-
end.returns
|
311
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
312
|
+
args[1] == "myrequest"
|
313
|
+
end.returns @factory
|
315
314
|
@ca.sign(@name, :ca, @request)
|
316
315
|
end
|
317
316
|
|
318
317
|
it "should use the provided CSR's content as the issuer" do
|
319
|
-
Puppet::SSL::CertificateFactory.expects(:
|
320
|
-
args[2]
|
321
|
-
end.returns
|
318
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
319
|
+
args[2] == "myrequest"
|
320
|
+
end.returns @factory
|
322
321
|
@ca.sign(@name, :ca, @request)
|
323
322
|
end
|
324
323
|
|
325
324
|
it "should pass the next serial as the serial number" do
|
326
|
-
Puppet::SSL::CertificateFactory.expects(:
|
327
|
-
args[3]
|
328
|
-
end.returns
|
325
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
326
|
+
args[3] == @serial
|
327
|
+
end.returns @factory
|
329
328
|
@ca.sign(@name, :ca, @request)
|
330
329
|
end
|
331
330
|
|
332
|
-
it "should sign the certificate request even if it contains alt names" do
|
333
|
-
@request.stubs(:subject_alt_names).returns %w[DNS:foo DNS:bar DNS:baz]
|
334
|
-
|
335
|
-
expect do
|
336
|
-
@ca.sign(@name, false, @request)
|
337
|
-
end.should_not raise_error(Puppet::SSL::CertificateAuthority::CertificateSigningError)
|
338
|
-
end
|
339
|
-
|
340
331
|
it "should save the resulting certificate" do
|
341
|
-
|
332
|
+
Puppet::SSL::Certificate.indirection.expects(:save).with(@cert)
|
342
333
|
|
343
334
|
@ca.sign(@name, :ca, @request)
|
344
335
|
end
|
@@ -349,69 +340,41 @@ describe Puppet::SSL::CertificateAuthority do
|
|
349
340
|
@serial = 10
|
350
341
|
@ca.stubs(:next_serial).returns @serial
|
351
342
|
|
352
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with(@name).returns @request
|
353
|
-
|
343
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with(@name).returns @request
|
344
|
+
Puppet::SSL::CertificateRequest.indirection.stubs :save
|
354
345
|
end
|
355
346
|
|
356
347
|
it "should use a certificate type of :server" do
|
357
|
-
Puppet::SSL::CertificateFactory.expects(:
|
348
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
358
349
|
args[0] == :server
|
359
|
-
end.returns
|
350
|
+
end.returns @factory
|
360
351
|
|
361
352
|
@ca.sign(@name)
|
362
353
|
end
|
363
354
|
|
364
355
|
it "should use look up a CSR for the host in the :ca_file terminus" do
|
365
|
-
Puppet::SSL::CertificateRequest.expects(:find).with(@name).returns @request
|
356
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:find).with(@name).returns @request
|
366
357
|
|
367
358
|
@ca.sign(@name)
|
368
359
|
end
|
369
360
|
|
370
361
|
it "should fail if no CSR can be found for the host" do
|
371
|
-
Puppet::SSL::CertificateRequest.expects(:find).with(@name).returns nil
|
362
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:find).with(@name).returns nil
|
372
363
|
|
373
364
|
lambda { @ca.sign(@name) }.should raise_error(ArgumentError)
|
374
365
|
end
|
375
366
|
|
376
|
-
it "should fail if an unknown request extension is present" do
|
377
|
-
@request.stubs :request_extensions => [{ "oid" => "bananas",
|
378
|
-
"value" => "delicious" }]
|
379
|
-
expect { @ca.sign(@name) }.
|
380
|
-
should raise_error(/CSR has request extensions that are not permitted/)
|
381
|
-
end
|
382
|
-
|
383
|
-
it "should fail if the CSR contains alt names and they are not expected" do
|
384
|
-
@request.stubs(:subject_alt_names).returns %w[DNS:foo DNS:bar DNS:baz]
|
385
|
-
|
386
|
-
expect do
|
387
|
-
@ca.sign(@name, false)
|
388
|
-
end.to raise_error(Puppet::SSL::CertificateAuthority::CertificateSigningError, /CSR '#{@name}' contains subject alternative names \(.*?\), which are disallowed. Use `puppet cert --allow-dns-alt-names sign #{@name}` to sign this request./)
|
389
|
-
end
|
390
|
-
|
391
|
-
it "should not fail if the CSR does not contain alt names and they are expected" do
|
392
|
-
@request.stubs(:subject_alt_names).returns []
|
393
|
-
expect { @ca.sign(@name, true) }.should_not raise_error
|
394
|
-
end
|
395
|
-
|
396
|
-
it "should reject alt names by default" do
|
397
|
-
@request.stubs(:subject_alt_names).returns %w[DNS:foo DNS:bar DNS:baz]
|
398
|
-
|
399
|
-
expect do
|
400
|
-
@ca.sign(@name)
|
401
|
-
end.to raise_error(Puppet::SSL::CertificateAuthority::CertificateSigningError, /CSR '#{@name}' contains subject alternative names \(.*?\), which are disallowed. Use `puppet cert --allow-dns-alt-names sign #{@name}` to sign this request./)
|
402
|
-
end
|
403
|
-
|
404
367
|
it "should use the CA certificate as the issuer" do
|
405
|
-
Puppet::SSL::CertificateFactory.expects(:
|
368
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
406
369
|
args[2] == @cacert.content
|
407
|
-
end.returns
|
370
|
+
end.returns @factory
|
408
371
|
@ca.sign(@name)
|
409
372
|
end
|
410
373
|
|
411
374
|
it "should pass the next serial as the serial number" do
|
412
|
-
Puppet::SSL::CertificateFactory.expects(:
|
375
|
+
Puppet::SSL::CertificateFactory.expects(:new).with do |*args|
|
413
376
|
args[3] == @serial
|
414
|
-
end.returns
|
377
|
+
end.returns @factory
|
415
378
|
@ca.sign(@name)
|
416
379
|
end
|
417
380
|
|
@@ -427,162 +390,23 @@ describe Puppet::SSL::CertificateAuthority do
|
|
427
390
|
end
|
428
391
|
|
429
392
|
it "should save the resulting certificate" do
|
430
|
-
|
393
|
+
Puppet::SSL::Certificate.indirection.stubs(:save).with(@cert)
|
431
394
|
@ca.sign(@name)
|
432
395
|
end
|
433
396
|
|
434
397
|
it "should remove the host's certificate request" do
|
435
|
-
Puppet::SSL::CertificateRequest.expects(:destroy).with(@name)
|
398
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:destroy).with(@name)
|
436
399
|
|
437
400
|
@ca.sign(@name)
|
438
401
|
end
|
439
|
-
|
440
|
-
it "should check the internal signing policies" do
|
441
|
-
@ca.expects(:check_internal_signing_policies).returns true
|
442
|
-
@ca.sign(@name)
|
443
|
-
end
|
444
|
-
end
|
445
|
-
|
446
|
-
context "#check_internal_signing_policies" do
|
447
|
-
before do
|
448
|
-
@serial = 10
|
449
|
-
@ca.stubs(:next_serial).returns @serial
|
450
|
-
|
451
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with(@name).returns @request
|
452
|
-
@cert.stubs :save
|
453
|
-
end
|
454
|
-
|
455
|
-
it "should reject CSRs whose CN doesn't match the name for which we're signing them" do
|
456
|
-
# Shorten this so the test doesn't take too long
|
457
|
-
Puppet[:keylength] = 1024
|
458
|
-
key = Puppet::SSL::Key.new('the_certname')
|
459
|
-
key.generate
|
460
|
-
|
461
|
-
csr = Puppet::SSL::CertificateRequest.new('the_certname')
|
462
|
-
csr.generate(key)
|
463
|
-
|
464
|
-
expect do
|
465
|
-
@ca.check_internal_signing_policies('not_the_certname', csr, false)
|
466
|
-
end.to raise_error(
|
467
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
468
|
-
/common name "the_certname" does not match expected certname "not_the_certname"/
|
469
|
-
)
|
470
|
-
end
|
471
|
-
|
472
|
-
describe "when validating the CN" do
|
473
|
-
before :all do
|
474
|
-
Puppet[:keylength] = 1024
|
475
|
-
@signing_key = Puppet::SSL::Key.new('my_signing_key')
|
476
|
-
@signing_key.generate
|
477
|
-
end
|
478
|
-
|
479
|
-
[
|
480
|
-
'completely_okay',
|
481
|
-
'sure, why not? :)',
|
482
|
-
'so+many(things)-are=allowed.',
|
483
|
-
'this"is#just&madness%you[see]',
|
484
|
-
'and even a (an?) \\!',
|
485
|
-
'waltz, nymph, for quick jigs vex bud.',
|
486
|
-
'{552c04ca-bb1b-11e1-874b-60334b04494e}'
|
487
|
-
].each do |name|
|
488
|
-
it "should accept #{name.inspect}" do
|
489
|
-
csr = Puppet::SSL::CertificateRequest.new(name)
|
490
|
-
csr.generate(@signing_key)
|
491
|
-
|
492
|
-
@ca.check_internal_signing_policies(name, csr, false)
|
493
|
-
end
|
494
|
-
end
|
495
|
-
|
496
|
-
[
|
497
|
-
'super/bad',
|
498
|
-
"not\neven\tkind\rof",
|
499
|
-
"ding\adong\a",
|
500
|
-
"hidden\b\b\b\b\b\bmessage",
|
501
|
-
"☃ :("
|
502
|
-
].each do |name|
|
503
|
-
it "should reject #{name.inspect}" do
|
504
|
-
# We aren't even allowed to make objects with these names, so let's
|
505
|
-
# stub that to simulate an invalid one coming from outside Puppet
|
506
|
-
Puppet::SSL::CertificateRequest.stubs(:validate_certname)
|
507
|
-
csr = Puppet::SSL::CertificateRequest.new(name)
|
508
|
-
csr.generate(@signing_key)
|
509
|
-
|
510
|
-
expect do
|
511
|
-
@ca.check_internal_signing_policies(name, csr, false)
|
512
|
-
end.to raise_error(
|
513
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
514
|
-
/subject contains unprintable or non-ASCII characters/
|
515
|
-
)
|
516
|
-
end
|
517
|
-
end
|
518
|
-
end
|
519
|
-
|
520
|
-
it "should reject a critical extension that isn't on the whitelist" do
|
521
|
-
@request.stubs(:request_extensions).returns [{ "oid" => "banana",
|
522
|
-
"value" => "yumm",
|
523
|
-
"critical" => true }]
|
524
|
-
expect { @ca.check_internal_signing_policies(@name, @request, false) }.to raise_error(
|
525
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
526
|
-
/request extensions that are not permitted/
|
527
|
-
)
|
528
|
-
end
|
529
|
-
|
530
|
-
it "should reject a non-critical extension that isn't on the whitelist" do
|
531
|
-
@request.stubs(:request_extensions).returns [{ "oid" => "peach",
|
532
|
-
"value" => "meh",
|
533
|
-
"critical" => false }]
|
534
|
-
expect { @ca.check_internal_signing_policies(@name, @request, false) }.to raise_error(
|
535
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
536
|
-
/request extensions that are not permitted/
|
537
|
-
)
|
538
|
-
end
|
539
|
-
|
540
|
-
it "should reject non-whitelist extensions even if a valid extension is present" do
|
541
|
-
@request.stubs(:request_extensions).returns [{ "oid" => "peach",
|
542
|
-
"value" => "meh",
|
543
|
-
"critical" => false },
|
544
|
-
{ "oid" => "subjectAltName",
|
545
|
-
"value" => "DNS:foo",
|
546
|
-
"critical" => true }]
|
547
|
-
expect { @ca.check_internal_signing_policies(@name, @request, false) }.to raise_error(
|
548
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
549
|
-
/request extensions that are not permitted/
|
550
|
-
)
|
551
|
-
end
|
552
|
-
|
553
|
-
it "should reject a subjectAltName for a non-DNS value" do
|
554
|
-
@request.stubs(:subject_alt_names).returns ['DNS:foo', 'email:bar@example.com']
|
555
|
-
expect { @ca.check_internal_signing_policies(@name, @request, true) }.to raise_error(
|
556
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
557
|
-
/subjectAltName outside the DNS label space/
|
558
|
-
)
|
559
|
-
end
|
560
|
-
|
561
|
-
it "should reject a wildcard subject" do
|
562
|
-
@request.content.stubs(:subject).
|
563
|
-
returns(OpenSSL::X509::Name.new([["CN", "*.local"]]))
|
564
|
-
|
565
|
-
expect { @ca.check_internal_signing_policies('*.local', @request, false) }.to raise_error(
|
566
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
567
|
-
/subject contains a wildcard/
|
568
|
-
)
|
569
|
-
end
|
570
|
-
|
571
|
-
it "should reject a wildcard subjectAltName" do
|
572
|
-
@request.stubs(:subject_alt_names).returns ['DNS:foo', 'DNS:*.bar']
|
573
|
-
expect { @ca.check_internal_signing_policies(@name, @request, true) }.to raise_error(
|
574
|
-
Puppet::SSL::CertificateAuthority::CertificateSigningError,
|
575
|
-
/subjectAltName contains a wildcard/
|
576
|
-
)
|
577
|
-
end
|
578
402
|
end
|
579
403
|
|
580
404
|
it "should create a certificate instance with the content set to the newly signed x509 certificate" do
|
581
405
|
@serial = 10
|
582
406
|
@ca.stubs(:next_serial).returns @serial
|
583
407
|
|
584
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with(@name).returns @request
|
585
|
-
|
408
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with(@name).returns @request
|
409
|
+
Puppet::SSL::Certificate.indirection.stubs :save
|
586
410
|
Puppet::SSL::Certificate.expects(:new).with(@name).returns @cert
|
587
411
|
|
588
412
|
@ca.sign(@name)
|
@@ -590,8 +414,8 @@ describe Puppet::SSL::CertificateAuthority do
|
|
590
414
|
|
591
415
|
it "should return the certificate instance" do
|
592
416
|
@ca.stubs(:next_serial).returns @serial
|
593
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with(@name).returns @request
|
594
|
-
|
417
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with(@name).returns @request
|
418
|
+
Puppet::SSL::Certificate.indirection.stubs :save
|
595
419
|
@ca.sign(@name).should equal(@cert)
|
596
420
|
end
|
597
421
|
|
@@ -599,8 +423,8 @@ describe Puppet::SSL::CertificateAuthority do
|
|
599
423
|
@ca.stubs(:next_serial).returns @serial
|
600
424
|
@inventory.expects(:add).with(@cert)
|
601
425
|
|
602
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with(@name).returns @request
|
603
|
-
|
426
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with(@name).returns @request
|
427
|
+
Puppet::SSL::Certificate.indirection.stubs :save
|
604
428
|
@ca.sign(@name)
|
605
429
|
end
|
606
430
|
|
@@ -612,7 +436,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
612
436
|
it "should do nothing if autosign is disabled" do
|
613
437
|
Puppet.settings.expects(:value).with(:autosign).returns 'false'
|
614
438
|
|
615
|
-
Puppet::SSL::CertificateRequest.expects(:search).never
|
439
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:search).never
|
616
440
|
@ca.autosign
|
617
441
|
end
|
618
442
|
|
@@ -620,7 +444,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
620
444
|
Puppet.settings.expects(:value).with(:autosign).returns '/auto/sign'
|
621
445
|
FileTest.expects(:exist?).with("/auto/sign").returns false
|
622
446
|
|
623
|
-
Puppet::SSL::CertificateRequest.expects(:search).never
|
447
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:search).never
|
624
448
|
@ca.autosign
|
625
449
|
end
|
626
450
|
|
@@ -630,7 +454,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
630
454
|
FileTest.stubs(:exist?).with("/auto/sign").returns true
|
631
455
|
File.stubs(:readlines).with("/auto/sign").returns ["one\n", "two\n"]
|
632
456
|
|
633
|
-
Puppet::SSL::CertificateRequest.stubs(:search).returns []
|
457
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:search).returns []
|
634
458
|
|
635
459
|
@store = stub 'store', :allow => nil
|
636
460
|
Puppet::Network::AuthStore.stubs(:new).returns @store
|
@@ -671,13 +495,13 @@ describe Puppet::SSL::CertificateAuthority do
|
|
671
495
|
it "should sign all CSRs whose hostname matches the autosign configuration" do
|
672
496
|
csr1 = mock 'csr1'
|
673
497
|
csr2 = mock 'csr2'
|
674
|
-
Puppet::SSL::CertificateRequest.stubs(:search).returns [csr1, csr2]
|
498
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:search).returns [csr1, csr2]
|
675
499
|
end
|
676
500
|
|
677
501
|
it "should not sign CSRs whose hostname does not match the autosign configuration" do
|
678
502
|
csr1 = mock 'csr1'
|
679
503
|
csr2 = mock 'csr2'
|
680
|
-
Puppet::SSL::CertificateRequest.stubs(:search).returns [csr1, csr2]
|
504
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:search).returns [csr1, csr2]
|
681
505
|
end
|
682
506
|
end
|
683
507
|
end
|
@@ -724,7 +548,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
724
548
|
it "should be able to list waiting certificate requests" do
|
725
549
|
req1 = stub 'req1', :name => "one"
|
726
550
|
req2 = stub 'req2', :name => "two"
|
727
|
-
Puppet::SSL::CertificateRequest.expects(:search).with("*").returns [req1, req2]
|
551
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:search).with("*").returns [req1, req2]
|
728
552
|
|
729
553
|
@ca.waiting?.should == %w{one two}
|
730
554
|
end
|
@@ -742,19 +566,19 @@ describe Puppet::SSL::CertificateAuthority do
|
|
742
566
|
it "should list certificates as the sorted list of all existing signed certificates" do
|
743
567
|
cert1 = stub 'cert1', :name => "cert1"
|
744
568
|
cert2 = stub 'cert2', :name => "cert2"
|
745
|
-
Puppet::SSL::Certificate.expects(:search).with("*").returns [cert1, cert2]
|
569
|
+
Puppet::SSL::Certificate.indirection.expects(:search).with("*").returns [cert1, cert2]
|
746
570
|
@ca.list.should == %w{cert1 cert2}
|
747
571
|
end
|
748
572
|
|
749
573
|
describe "and printing certificates" do
|
750
574
|
it "should return nil if the certificate cannot be found" do
|
751
|
-
Puppet::SSL::Certificate.expects(:find).with("myhost").returns nil
|
575
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("myhost").returns nil
|
752
576
|
@ca.print("myhost").should be_nil
|
753
577
|
end
|
754
578
|
|
755
579
|
it "should print certificates by calling :to_text on the host's certificate" do
|
756
580
|
cert1 = stub 'cert1', :name => "cert1", :to_text => "mytext"
|
757
|
-
Puppet::SSL::Certificate.expects(:find).with("myhost").returns cert1
|
581
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("myhost").returns cert1
|
758
582
|
@ca.print("myhost").should == "mytext"
|
759
583
|
end
|
760
584
|
end
|
@@ -762,19 +586,19 @@ describe Puppet::SSL::CertificateAuthority do
|
|
762
586
|
describe "and fingerprinting certificates" do
|
763
587
|
before :each do
|
764
588
|
@cert = stub 'cert', :name => "cert", :fingerprint => "DIGEST"
|
765
|
-
Puppet::SSL::Certificate.stubs(:find).with("myhost").returns @cert
|
766
|
-
Puppet::SSL::CertificateRequest.stubs(:find).with("myhost")
|
589
|
+
Puppet::SSL::Certificate.indirection.stubs(:find).with("myhost").returns @cert
|
590
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with("myhost")
|
767
591
|
end
|
768
592
|
|
769
593
|
it "should raise an error if the certificate or CSR cannot be found" do
|
770
|
-
Puppet::SSL::Certificate.expects(:find).with("myhost").returns nil
|
771
|
-
Puppet::SSL::CertificateRequest.expects(:find).with("myhost").returns nil
|
594
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("myhost").returns nil
|
595
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:find).with("myhost").returns nil
|
772
596
|
lambda { @ca.fingerprint("myhost") }.should raise_error
|
773
597
|
end
|
774
598
|
|
775
599
|
it "should try to find a CSR if no certificate can be found" do
|
776
|
-
Puppet::SSL::Certificate.expects(:find).with("myhost").returns nil
|
777
|
-
Puppet::SSL::CertificateRequest.expects(:find).with("myhost").returns @cert
|
600
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("myhost").returns nil
|
601
|
+
Puppet::SSL::CertificateRequest.indirection.expects(:find).with("myhost").returns @cert
|
778
602
|
@cert.expects(:fingerprint)
|
779
603
|
@ca.fingerprint("myhost")
|
780
604
|
end
|
@@ -799,7 +623,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
799
623
|
Puppet.settings.stubs(:value).returns "crtstuff"
|
800
624
|
|
801
625
|
@cert = stub 'cert', :content => "mycert"
|
802
|
-
Puppet::SSL::Certificate.stubs(:find).returns @cert
|
626
|
+
Puppet::SSL::Certificate.indirection.stubs(:find).returns @cert
|
803
627
|
|
804
628
|
@crl = stub('crl', :content => "mycrl")
|
805
629
|
|
@@ -807,7 +631,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
807
631
|
end
|
808
632
|
|
809
633
|
it "should fail if the host's certificate cannot be found" do
|
810
|
-
Puppet::SSL::Certificate.expects(:find).with("me").returns(nil)
|
634
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("me").returns(nil)
|
811
635
|
|
812
636
|
lambda { @ca.verify("me") }.should raise_error(ArgumentError)
|
813
637
|
end
|
@@ -870,7 +694,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
870
694
|
|
871
695
|
@real_cert = stub 'real_cert', :serial => 15
|
872
696
|
@cert = stub 'cert', :content => @real_cert
|
873
|
-
Puppet::SSL::Certificate.stubs(:find).returns @cert
|
697
|
+
Puppet::SSL::Certificate.indirection.stubs(:find).returns @cert
|
874
698
|
|
875
699
|
end
|
876
700
|
|
@@ -890,7 +714,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
890
714
|
it "should get the serial number from the local certificate if it exists" do
|
891
715
|
@ca.crl.expects(:revoke).with { |serial, key| serial == 15 }
|
892
716
|
|
893
|
-
Puppet::SSL::Certificate.expects(:find).with("host").returns @cert
|
717
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("host").returns @cert
|
894
718
|
|
895
719
|
@ca.revoke('host')
|
896
720
|
end
|
@@ -898,7 +722,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
898
722
|
it "should get the serial number from inventory if no local certificate exists" do
|
899
723
|
real_cert = stub 'real_cert', :serial => 15
|
900
724
|
cert = stub 'cert', :content => real_cert
|
901
|
-
Puppet::SSL::Certificate.expects(:find).with("host").returns nil
|
725
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("host").returns nil
|
902
726
|
|
903
727
|
@ca.inventory.expects(:serial).with("host").returns 16
|
904
728
|
|
@@ -915,13 +739,13 @@ describe Puppet::SSL::CertificateAuthority do
|
|
915
739
|
before do
|
916
740
|
@host = stub 'host', :generate_certificate_request => nil
|
917
741
|
Puppet::SSL::Host.stubs(:new).returns @host
|
918
|
-
Puppet::SSL::Certificate.stubs(:find).returns nil
|
742
|
+
Puppet::SSL::Certificate.indirection.stubs(:find).returns nil
|
919
743
|
|
920
744
|
@ca.stubs(:sign)
|
921
745
|
end
|
922
746
|
|
923
747
|
it "should fail if a certificate already exists for the host" do
|
924
|
-
Puppet::SSL::Certificate.expects(:find).with("him").returns "something"
|
748
|
+
Puppet::SSL::Certificate.indirection.expects(:find).with("him").returns "something"
|
925
749
|
|
926
750
|
lambda { @ca.generate("him") }.should raise_error(ArgumentError)
|
927
751
|
end
|
@@ -939,7 +763,8 @@ describe Puppet::SSL::CertificateAuthority do
|
|
939
763
|
end
|
940
764
|
|
941
765
|
it "should sign the generated request" do
|
942
|
-
@ca.expects(:sign).with("him"
|
766
|
+
@ca.expects(:sign).with("him")
|
767
|
+
|
943
768
|
@ca.generate("him")
|
944
769
|
end
|
945
770
|
end
|