puppet 0.24.9 → 0.25.0
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 +18680 -1241
- data/CHANGELOG.old +1705 -0
- data/LICENSE +2 -2
- data/README +1 -1
- data/README.queueing +126 -0
- data/README.rst +4 -4
- data/Rakefile +62 -216
- data/bin/filebucket +6 -117
- data/bin/pi +50 -0
- data/bin/puppet +7 -188
- data/bin/puppetdoc +7 -198
- data/bin/ralsh +4 -191
- data/conf/auth.conf +94 -0
- data/conf/gentoo/init.d/puppetmaster +30 -30
- data/conf/osx/PackageInfo.plist +30 -30
- data/conf/osx/createpackage.sh +23 -18
- data/conf/osx/preflight +8 -0
- data/conf/puppet-queue.conf +10 -0
- data/conf/redhat/client.init +52 -41
- data/conf/redhat/logrotate +1 -0
- data/conf/redhat/puppet.spec +74 -36
- data/conf/redhat/rundir-perms.patch +28 -0
- data/conf/redhat/server.init +48 -43
- data/conf/redhat/server.sysconfig +4 -4
- data/conf/solaris/smf/puppetd.xml +53 -53
- data/conf/solaris/smf/puppetmasterd.xml +53 -53
- data/conf/solaris/smf/svc-puppetd +4 -4
- data/conf/solaris/smf/svc-puppetmasterd +3 -3
- data/conf/suse/client.init +4 -4
- data/conf/suse/puppet.spec +14 -14
- data/conf/suse/server.init +17 -17
- data/examples/etc/init.d/sleeper +8 -8
- data/examples/mac_dscl.pp +2 -2
- data/examples/mac_dscl_revert.pp +1 -1
- data/examples/mcx_dock_default.pp +108 -108
- data/examples/mcx_dock_full.pp +108 -108
- data/examples/mcx_nogroup.pp +108 -108
- data/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +5 -5
- data/examples/modules/sample-module/manifests/init.pp +2 -2
- data/examples/relationships +1 -1
- data/ext/autotest/config +6 -6
- data/ext/bin/sleeper +12 -12
- data/ext/dbfix.sql +21 -21
- data/ext/emacs/puppet-mode.el +42 -41
- data/ext/extlookup.rb +183 -0
- data/ext/ldap/puppet.schema +2 -1
- data/ext/logcheck/puppet +1 -1
- data/ext/module_puppet +7 -7
- data/ext/nagios/check_puppet.rb +83 -83
- data/ext/nagios/naggen +302 -0
- data/ext/puppet-test +61 -18
- data/ext/puppetlisten/puppetlisten.rb +76 -0
- data/ext/puppetlisten/puppetrun.rb +39 -0
- data/ext/puppetstoredconfigclean.rb +29 -29
- data/ext/rack/README +73 -0
- data/ext/rack/files/apache2.conf +38 -0
- data/ext/rack/files/config.ru +18 -0
- data/ext/rack/manifest.pp +59 -0
- data/ext/vim/syntax/puppet.vim +54 -35
- data/install.rb +37 -26
- data/lib/puppet.rb +15 -227
- data/lib/puppet/agent.rb +134 -0
- data/lib/puppet/agent/locker.rb +42 -0
- data/lib/puppet/agent/runner.rb +65 -0
- data/lib/puppet/application.rb +313 -0
- data/lib/puppet/application/filebucket.rb +87 -0
- data/lib/puppet/application/pi.rb +214 -0
- data/lib/puppet/application/puppet.rb +177 -0
- data/lib/puppet/application/puppetca.rb +71 -0
- data/lib/puppet/application/puppetd.rb +256 -0
- data/lib/puppet/application/puppetdoc.rb +222 -0
- data/lib/puppet/application/puppetmasterd.rb +168 -0
- data/lib/puppet/application/puppetqd.rb +96 -0
- data/lib/puppet/application/puppetrun.rb +219 -0
- data/lib/puppet/application/ralsh.rb +168 -0
- data/lib/puppet/configurer.rb +177 -0
- data/lib/puppet/configurer/downloader.rb +79 -0
- data/lib/puppet/configurer/fact_handler.rb +68 -0
- data/lib/puppet/configurer/plugin_handler.rb +26 -0
- data/lib/puppet/daemon.rb +78 -28
- data/lib/puppet/defaults.rb +239 -166
- data/lib/puppet/dsl.rb +7 -7
- data/lib/puppet/external/dot.rb +271 -271
- data/lib/puppet/external/event-loop/better-definers.rb +298 -298
- data/lib/puppet/external/event-loop/event-loop.rb +274 -274
- data/lib/puppet/external/event-loop/signal-system.rb +163 -163
- data/lib/puppet/external/lock.rb +1 -1
- data/lib/puppet/external/nagios.rb +20 -20
- data/lib/puppet/external/nagios/base.rb +3 -3
- data/lib/puppet/external/nagios/grammar.ry +185 -0
- data/lib/puppet/external/nagios/makefile +9 -0
- data/lib/puppet/external/nagios/parser.rb +1 -1
- data/lib/puppet/feature/json.rb +2 -0
- data/lib/puppet/feature/rack.rb +24 -0
- data/lib/puppet/feature/rails.rb +23 -33
- data/lib/puppet/feature/rubygems.rb +6 -0
- data/lib/puppet/feature/stomp.rb +6 -0
- data/lib/puppet/file_serving/{file_base.rb → base.rb} +10 -9
- data/lib/puppet/file_serving/configuration.rb +61 -61
- data/lib/puppet/file_serving/configuration/parser.rb +24 -29
- data/lib/puppet/file_serving/content.rb +26 -11
- data/lib/puppet/file_serving/fileset.rb +54 -19
- data/lib/puppet/file_serving/indirection_hooks.rb +12 -24
- data/lib/puppet/file_serving/metadata.rb +8 -8
- data/lib/puppet/file_serving/mount.rb +9 -151
- data/lib/puppet/file_serving/mount/file.rb +126 -0
- data/lib/puppet/file_serving/mount/modules.rb +25 -0
- data/lib/puppet/file_serving/mount/plugins.rb +27 -0
- data/lib/puppet/file_serving/terminus_helper.rb +9 -4
- data/lib/puppet/indirector.rb +6 -4
- data/lib/puppet/indirector/active_record.rb +28 -0
- data/lib/puppet/indirector/catalog/active_record.rb +36 -0
- data/lib/puppet/indirector/catalog/compiler.rb +50 -24
- data/lib/puppet/indirector/catalog/queue.rb +5 -0
- data/lib/puppet/indirector/catalog/rest.rb +6 -0
- data/lib/puppet/indirector/catalog/yaml.rb +2 -4
- data/lib/puppet/indirector/certificate/ca.rb +9 -0
- data/lib/puppet/indirector/certificate/file.rb +9 -0
- data/lib/puppet/indirector/certificate/rest.rb +9 -0
- data/lib/puppet/indirector/certificate_request/ca.rb +14 -0
- data/lib/puppet/indirector/certificate_request/file.rb +8 -0
- data/lib/puppet/indirector/certificate_request/rest.rb +9 -0
- data/lib/puppet/indirector/certificate_revocation_list/ca.rb +8 -0
- data/lib/puppet/indirector/certificate_revocation_list/file.rb +8 -0
- data/lib/puppet/indirector/certificate_revocation_list/rest.rb +9 -0
- data/lib/puppet/indirector/direct_file_server.rb +4 -8
- data/lib/puppet/indirector/exec.rb +2 -6
- data/lib/puppet/indirector/facts/active_record.rb +36 -0
- data/lib/puppet/indirector/facts/facter.rb +30 -22
- data/lib/puppet/indirector/facts/rest.rb +6 -0
- data/lib/puppet/indirector/file.rb +1 -0
- data/lib/puppet/indirector/file_content/rest.rb +0 -1
- data/lib/puppet/indirector/file_metadata/file.rb +2 -2
- data/lib/puppet/indirector/file_metadata/rest.rb +0 -1
- data/lib/puppet/indirector/file_server.rb +31 -18
- data/lib/puppet/indirector/indirection.rb +46 -33
- data/lib/puppet/indirector/key/ca.rb +12 -0
- data/lib/puppet/indirector/key/file.rb +42 -0
- data/lib/puppet/indirector/node/active_record.rb +13 -0
- data/lib/puppet/indirector/node/ldap.rb +1 -1
- data/lib/puppet/indirector/queue.rb +83 -0
- data/lib/puppet/indirector/report/processor.rb +1 -1
- data/lib/puppet/indirector/report/rest.rb +7 -0
- data/lib/puppet/indirector/request.rb +158 -15
- data/lib/puppet/indirector/rest.rb +74 -36
- data/lib/puppet/indirector/runner/rest.rb +7 -0
- data/lib/puppet/indirector/ssl_file.rb +174 -0
- data/lib/puppet/indirector/terminus.rb +4 -4
- data/lib/puppet/indirector/yaml.rb +1 -1
- data/lib/puppet/metatype/manager.rb +3 -3
- data/lib/puppet/module.rb +99 -124
- data/lib/puppet/network/authconfig.rb +57 -42
- data/lib/puppet/network/authstore.rb +58 -10
- data/lib/puppet/network/client.rb +0 -2
- data/lib/puppet/network/client/ca.rb +1 -1
- data/lib/puppet/network/client/dipper.rb +7 -2
- data/lib/puppet/network/format.rb +123 -0
- data/lib/puppet/network/format_handler.rb +156 -0
- data/lib/puppet/network/formats.rb +123 -0
- data/lib/puppet/network/handler/filebucket.rb +1 -1
- data/lib/puppet/network/handler/fileserver.rb +43 -35
- data/lib/puppet/network/handler/master.rb +4 -4
- data/lib/puppet/network/handler/report.rb +1 -1
- data/lib/puppet/network/handler/resource.rb +16 -20
- data/lib/puppet/network/handler/runner.rb +9 -42
- data/lib/puppet/network/http.rb +4 -4
- data/lib/puppet/network/http/api.rb +4 -0
- data/lib/puppet/network/http/api/v1.rb +65 -0
- data/lib/puppet/network/http/handler.rb +163 -56
- data/lib/puppet/network/http/mongrel.rb +19 -15
- data/lib/puppet/network/http/mongrel/rest.rb +35 -17
- data/lib/puppet/network/http/rack.rb +62 -0
- data/lib/puppet/network/http/rack/httphandler.rb +34 -0
- data/lib/puppet/network/http/rack/rest.rb +79 -0
- data/lib/puppet/network/http/rack/xmlrpc.rb +65 -0
- data/lib/puppet/network/http/webrick.rb +89 -16
- data/lib/puppet/network/http/webrick/rest.rb +24 -11
- data/lib/puppet/network/http_pool.rb +28 -29
- data/lib/puppet/network/http_server/mongrel.rb +8 -10
- data/lib/puppet/network/http_server/webrick.rb +1 -3
- data/lib/puppet/network/rest_authconfig.rb +89 -0
- data/lib/puppet/network/rest_authorization.rb +25 -0
- data/lib/puppet/network/rights.rb +230 -27
- data/lib/puppet/network/server.rb +133 -31
- data/lib/puppet/network/xmlrpc/client.rb +5 -5
- data/lib/puppet/network/xmlrpc/webrick_servlet.rb +6 -6
- data/lib/puppet/node.rb +28 -21
- data/lib/puppet/node/environment.rb +48 -0
- data/lib/puppet/node/facts.rb +21 -0
- data/lib/puppet/parameter.rb +291 -219
- data/lib/puppet/parser/ast.rb +1 -0
- data/lib/puppet/parser/ast/astarray.rb +5 -1
- data/lib/puppet/parser/ast/boolean_operator.rb +3 -3
- data/lib/puppet/parser/ast/caseopt.rb +10 -0
- data/lib/puppet/parser/ast/casestatement.rb +12 -27
- data/lib/puppet/parser/ast/collection.rb +31 -0
- data/lib/puppet/parser/ast/collexpr.rb +18 -11
- data/lib/puppet/parser/ast/comparison_operator.rb +1 -1
- data/lib/puppet/parser/ast/definition.rb +6 -2
- data/lib/puppet/parser/ast/function.rb +7 -2
- data/lib/puppet/parser/ast/ifstatement.rb +11 -6
- data/lib/puppet/parser/ast/leaf.rb +106 -3
- data/lib/puppet/parser/ast/match_operator.rb +31 -0
- data/lib/puppet/parser/ast/node.rb +10 -6
- data/lib/puppet/parser/ast/resource_defaults.rb +2 -2
- data/lib/puppet/parser/ast/resource_override.rb +1 -1
- data/lib/puppet/parser/ast/resource_reference.rb +11 -3
- data/lib/puppet/parser/ast/selector.rb +14 -32
- data/lib/puppet/parser/ast/vardef.rb +1 -1
- data/lib/puppet/parser/collector.rb +67 -15
- data/lib/puppet/parser/compiler.rb +21 -53
- data/lib/puppet/parser/files.rb +92 -0
- data/lib/puppet/parser/functions.rb +3 -3
- data/lib/puppet/parser/functions/defined.rb +3 -3
- data/lib/puppet/parser/functions/fqdn_rand.rb +3 -3
- data/lib/puppet/parser/functions/inline_template.rb +4 -4
- data/lib/puppet/parser/functions/regsubst.rb +37 -35
- data/lib/puppet/parser/functions/require.rb +34 -0
- data/lib/puppet/parser/functions/shellquote.rb +41 -0
- data/lib/puppet/parser/functions/split.rb +29 -0
- data/lib/puppet/parser/functions/sprintf.rb +6 -6
- data/lib/puppet/parser/functions/template.rb +4 -4
- data/lib/puppet/parser/functions/versioncmp.rb +22 -1
- data/lib/puppet/parser/grammar.ra +812 -0
- data/lib/puppet/parser/interpreter.rb +4 -4
- data/lib/puppet/parser/lexer.rb +44 -15
- data/lib/puppet/parser/loaded_code.rb +115 -0
- data/lib/puppet/parser/makefile +8 -0
- data/lib/puppet/parser/parser.rb +1080 -928
- data/lib/puppet/parser/parser_support.rb +118 -96
- data/lib/puppet/parser/resource.rb +56 -126
- data/lib/puppet/parser/resource/param.rb +2 -76
- data/lib/puppet/parser/resource/reference.rb +15 -8
- data/lib/puppet/parser/scope.rb +68 -35
- data/lib/puppet/parser/templatewrapper.rb +8 -8
- data/lib/puppet/parser/yaml_trimmer.rb +11 -0
- data/lib/puppet/property.rb +69 -124
- data/lib/puppet/property/list.rb +3 -3
- data/lib/puppet/provider.rb +5 -5
- data/lib/puppet/provider/augeas/augeas.rb +119 -118
- data/lib/puppet/provider/computer/computer.rb +3 -3
- data/lib/puppet/provider/confine/variable.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +8 -7
- data/lib/puppet/provider/group/directoryservice.rb +2 -2
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +3 -3
- data/lib/puppet/provider/group/pw.rb +1 -1
- data/lib/puppet/provider/host/parsed.rb +3 -3
- data/lib/puppet/provider/ldap.rb +1 -3
- data/lib/puppet/provider/macauthorization/macauthorization.rb +62 -55
- data/lib/puppet/provider/mailalias/aliases.rb +9 -1
- data/lib/puppet/provider/maillist/mailman.rb +8 -4
- data/lib/puppet/provider/mcx/mcxcontent.rb +11 -11
- data/lib/puppet/provider/mount/parsed.rb +2 -2
- data/lib/puppet/provider/nameservice.rb +6 -6
- data/lib/puppet/provider/nameservice/directoryservice.rb +83 -87
- data/lib/puppet/provider/package/appdmg.rb +10 -9
- data/lib/puppet/provider/package/apple.rb +1 -3
- data/lib/puppet/provider/package/apt.rb +5 -5
- data/lib/puppet/provider/package/aptitude.rb +1 -1
- data/lib/puppet/provider/package/aptrpm.rb +1 -1
- data/lib/puppet/provider/package/darwinport.rb +1 -1
- data/lib/puppet/provider/package/dpkg.rb +2 -2
- data/lib/puppet/provider/package/fink.rb +6 -6
- data/lib/puppet/provider/package/freebsd.rb +1 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/hpux.rb +5 -5
- data/lib/puppet/provider/package/pkgdmg.rb +30 -22
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/ports.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +5 -5
- data/lib/puppet/provider/package/rug.rb +1 -1
- data/lib/puppet/provider/package/sun.rb +7 -7
- data/lib/puppet/provider/package/up2date.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +2 -2
- data/lib/puppet/provider/package/yumhelper.py +2 -2
- data/lib/puppet/provider/port/parsed.rb +1 -1
- data/lib/puppet/provider/selmodule/semodule.rb +3 -3
- data/lib/puppet/provider/service/base.rb +21 -12
- data/lib/puppet/provider/service/daemontools.rb +86 -49
- data/lib/puppet/provider/service/debian.rb +20 -12
- data/lib/puppet/provider/service/freebsd.rb +5 -5
- data/lib/puppet/provider/service/gentoo.rb +2 -2
- data/lib/puppet/provider/service/init.rb +21 -33
- data/lib/puppet/provider/service/launchd.rb +120 -48
- data/lib/puppet/provider/service/redhat.rb +12 -21
- data/lib/puppet/provider/service/runit.rb +19 -9
- data/lib/puppet/provider/service/smf.rb +49 -34
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +34 -0
- data/lib/puppet/provider/sshkey/parsed.rb +2 -2
- data/lib/puppet/provider/user/directoryservice.rb +12 -29
- data/lib/puppet/provider/user/hpux.rb +3 -3
- data/lib/puppet/provider/user/ldap.rb +2 -2
- data/lib/puppet/provider/zfs/solaris.rb +1 -1
- data/lib/puppet/provider/zone/solaris.rb +4 -4
- data/lib/puppet/provider/zpool/solaris.rb +3 -3
- data/lib/puppet/rails.rb +9 -9
- data/lib/puppet/rails/benchmark.rb +69 -0
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +5 -5
- data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +2 -2
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +1 -1
- data/lib/puppet/rails/database/schema.rb +8 -8
- data/lib/puppet/rails/fact_value.rb +1 -1
- data/lib/puppet/rails/host.rb +211 -93
- data/lib/puppet/rails/param_name.rb +5 -1
- data/lib/puppet/rails/param_value.rb +29 -2
- data/lib/puppet/rails/puppet_tag.rb +5 -0
- data/lib/puppet/rails/resource.rb +120 -20
- data/lib/puppet/rails/resource_tag.rb +1 -1
- data/lib/puppet/rails/source_file.rb +1 -1
- data/lib/puppet/reference/configuration.rb +14 -14
- data/lib/puppet/reference/function.rb +1 -1
- data/lib/puppet/reference/metaparameter.rb +48 -0
- data/lib/puppet/reference/providers.rb +6 -6
- data/lib/puppet/reference/type.rb +1 -37
- data/lib/puppet/relationship.rb +57 -30
- data/lib/puppet/reports/rrdgraph.rb +4 -4
- data/lib/puppet/reports/store.rb +3 -3
- data/lib/puppet/reports/tagmail.rb +15 -15
- data/lib/puppet/resource.rb +265 -0
- data/lib/puppet/{node → resource}/catalog.rb +188 -112
- data/lib/puppet/{resource_reference.rb → resource/reference.rb} +46 -24
- data/lib/puppet/simple_graph.rb +165 -27
- data/lib/puppet/ssl.rb +7 -0
- data/lib/puppet/ssl/base.rb +62 -0
- data/lib/puppet/ssl/certificate.rb +34 -0
- data/lib/puppet/ssl/certificate_authority.rb +298 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +118 -0
- data/lib/puppet/ssl/certificate_factory.rb +145 -0
- data/lib/puppet/ssl/certificate_request.rb +51 -0
- data/lib/puppet/ssl/certificate_revocation_list.rb +86 -0
- data/lib/puppet/ssl/host.rb +271 -0
- data/lib/puppet/ssl/inventory.rb +52 -0
- data/lib/puppet/ssl/key.rb +56 -0
- data/lib/puppet/sslcertificates.rb +6 -6
- data/lib/puppet/sslcertificates/ca.rb +15 -15
- data/lib/puppet/sslcertificates/certificate.rb +4 -4
- data/lib/puppet/sslcertificates/inventory.rb +3 -3
- data/lib/puppet/transaction.rb +113 -139
- data/lib/puppet/transaction/change.rb +6 -6
- data/lib/puppet/transaction/event.rb +1 -1
- data/lib/puppet/transaction/report.rb +7 -1
- data/lib/puppet/transportable.rb +28 -28
- data/lib/puppet/type.rb +263 -688
- data/lib/puppet/type/augeas.rb +3 -2
- data/lib/puppet/type/component.rb +28 -95
- data/lib/puppet/type/computer.rb +10 -10
- data/lib/puppet/type/cron.rb +19 -14
- data/lib/puppet/type/exec.rb +21 -20
- data/lib/puppet/type/file.rb +306 -633
- data/lib/puppet/type/file/checksum.rb +10 -11
- data/lib/puppet/type/file/content.rb +83 -22
- data/lib/puppet/type/file/ensure.rb +15 -9
- data/lib/puppet/type/file/group.rb +7 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/owner.rb +9 -3
- data/lib/puppet/type/file/selcontext.rb +4 -4
- data/lib/puppet/type/file/source.rb +78 -179
- data/lib/puppet/type/file/target.rb +3 -3
- data/lib/puppet/type/file/type.rb +2 -2
- data/lib/puppet/type/filebucket.rb +33 -54
- data/lib/puppet/type/group.rb +8 -8
- data/lib/puppet/type/host.rb +7 -7
- data/lib/puppet/type/k5login.rb +2 -2
- data/lib/puppet/type/macauthorization.rb +77 -52
- data/lib/puppet/type/mailalias.rb +2 -2
- data/lib/puppet/type/maillist.rb +2 -2
- data/lib/puppet/type/mcx.rb +3 -3
- data/lib/puppet/type/mount.rb +16 -11
- data/lib/puppet/type/notify.rb +4 -4
- data/lib/puppet/type/package.rb +6 -28
- data/lib/puppet/type/port.rb +1 -1
- data/lib/puppet/type/resources.rb +19 -19
- data/lib/puppet/type/schedule.rb +18 -20
- data/lib/puppet/type/selmodule.rb +1 -1
- data/lib/puppet/type/service.rb +11 -7
- data/lib/puppet/type/ssh_authorized_key.rb +26 -9
- data/lib/puppet/type/sshkey.rb +2 -2
- data/lib/puppet/type/tidy.rb +285 -289
- data/lib/puppet/type/user.rb +9 -7
- data/lib/puppet/type/yumrepo.rb +17 -16
- data/lib/puppet/type/zone.rb +8 -7
- data/lib/puppet/util.rb +11 -36
- data/lib/puppet/util/autoload.rb +31 -19
- data/lib/puppet/util/autoload/file_cache.rb +115 -0
- data/lib/puppet/util/backups.rb +86 -0
- data/lib/puppet/util/cacher.rb +135 -0
- data/lib/puppet/util/checksums.rb +11 -1
- data/lib/puppet/util/classgen.rb +1 -1
- data/lib/puppet/util/config_store.rb +2 -2
- data/lib/puppet/util/constant_inflector.rb +1 -1
- data/lib/puppet/util/diff.rb +2 -2
- data/lib/puppet/util/docs.rb +9 -3
- data/lib/puppet/util/execution.rb +1 -1
- data/lib/puppet/util/feature.rb +27 -20
- data/lib/puppet/util/fileparsing.rb +3 -3
- data/lib/puppet/util/filetype.rb +8 -6
- data/lib/puppet/util/graph.rb +5 -5
- data/lib/puppet/util/inifile.rb +5 -5
- data/lib/puppet/util/json.rb +13 -0
- data/lib/puppet/util/ldap/connection.rb +2 -2
- data/lib/puppet/util/log.rb +48 -31
- data/lib/puppet/util/metric.rb +4 -4
- data/lib/puppet/util/monkey_patches.rb +43 -0
- data/lib/puppet/util/nagios_maker.rb +1 -1
- data/lib/puppet/util/package.rb +4 -4
- data/lib/puppet/util/pidlock.rb +59 -59
- data/lib/puppet/util/posix.rb +13 -52
- data/lib/puppet/util/provider_features.rb +3 -3
- data/lib/puppet/util/queue.rb +96 -0
- data/lib/puppet/util/queue/stomp.rb +47 -0
- data/lib/puppet/util/rails/cache_accumulator.rb +65 -0
- data/lib/puppet/util/rails/collection_merger.rb +0 -39
- data/lib/puppet/util/rails/reference_serializer.rb +17 -3
- data/lib/puppet/util/rdoc.rb +1 -0
- data/lib/puppet/util/rdoc/code_objects.rb +5 -1
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +5 -5
- data/lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +13 -13
- data/lib/puppet/util/rdoc/parser.rb +28 -32
- data/lib/puppet/util/reference.rb +29 -8
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +12 -6
- data/lib/puppet/util/settings.rb +203 -578
- data/lib/puppet/util/settings/boolean_setting.rb +33 -0
- data/lib/puppet/util/settings/file_setting.rb +119 -0
- data/lib/puppet/util/settings/setting.rb +110 -0
- data/lib/puppet/util/subclass_loader.rb +1 -1
- data/lib/puppet/util/suidmanager.rb +2 -2
- data/lib/puppet/util/tagging.rb +1 -1
- data/lib/puppet/util/warnings.rb +17 -9
- data/man/man8/filebucket.8 +2 -2
- data/man/man8/pi.8 +2 -2
- data/man/man8/puppet.8 +3 -4
- data/man/man8/puppet.conf.8 +63 -63
- data/man/man8/puppetca.8 +2 -2
- data/man/man8/puppetd.8 +2 -2
- data/man/man8/puppetdoc.8 +2 -2
- data/man/man8/puppetmasterd.8 +2 -2
- data/man/man8/puppetrun.8 +2 -2
- data/man/man8/ralsh.8 +3 -3
- data/sbin/puppetca +102 -0
- data/sbin/puppetd +159 -0
- data/sbin/puppetmasterd +66 -0
- data/sbin/puppetqd +53 -0
- data/sbin/puppetrun +130 -0
- data/spec/Rakefile +2 -2
- data/spec/integration/application/puppet.rb +33 -0
- data/spec/integration/bin/puppetmasterd.rb +110 -0
- data/spec/integration/configurer.rb +18 -0
- data/spec/integration/defaults.rb +158 -7
- data/spec/integration/file_serving/content.rb +2 -0
- data/spec/integration/file_serving/fileset.rb +14 -0
- data/spec/integration/file_serving/metadata.rb +2 -0
- data/spec/integration/file_serving/terminus_helper.rb +22 -0
- data/spec/integration/indirector/catalog/compiler.rb +67 -0
- data/spec/integration/indirector/catalog/queue.rb +61 -0
- data/spec/integration/indirector/certificate/rest.rb +69 -0
- data/spec/integration/indirector/certificate_request/rest.rb +89 -0
- data/spec/integration/indirector/certificate_revocation_list/rest.rb +77 -0
- data/spec/integration/indirector/direct_file_server.rb +16 -23
- data/spec/integration/indirector/file_content/file_server.rb +75 -0
- data/spec/integration/indirector/report/rest.rb +95 -0
- data/spec/integration/indirector/rest.rb +207 -147
- data/spec/integration/network/client.rb +19 -0
- data/spec/integration/network/formats.rb +110 -0
- data/spec/integration/network/handler.rb +25 -0
- data/spec/integration/network/server/mongrel.rb +26 -8
- data/spec/integration/network/server/webrick.rb +49 -11
- data/spec/integration/node/environment.rb +58 -0
- data/spec/integration/node/facts.rb +4 -2
- data/spec/integration/parser/compiler.rb +29 -0
- data/spec/integration/parser/functions/require.rb +67 -0
- data/spec/integration/provider/mailalias/aliases.rb +25 -0
- data/spec/integration/{node → resource}/catalog.rb +17 -10
- data/spec/integration/ssl/certificate_authority.rb +135 -0
- data/spec/integration/ssl/certificate_request.rb +59 -0
- data/spec/integration/ssl/certificate_revocation_list.rb +42 -0
- data/spec/integration/ssl/host.rb +90 -0
- data/spec/integration/transaction.rb +66 -0
- data/spec/integration/transaction/report.rb +2 -5
- data/spec/integration/type.rb +22 -0
- data/spec/integration/type/file.rb +458 -0
- data/spec/integration/type/package.rb +1 -1
- data/spec/integration/type/tidy.rb +27 -0
- data/spec/integration/util/autoload.rb +114 -0
- data/spec/integration/util/feature.rb +54 -0
- data/spec/integration/util/file_locking.rb +2 -1
- data/spec/integration/util/settings.rb +27 -0
- data/spec/lib/puppet_spec/files.rb +9 -0
- data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +1 -0
- data/spec/monkey_patches/alias_should_to_must.rb +1 -0
- data/spec/shared_behaviours/file_server_terminus.rb +14 -11
- data/spec/shared_behaviours/file_serving.rb +13 -17
- data/spec/spec_helper.rb +22 -5
- data/spec/unit/agent.rb +259 -0
- data/spec/unit/agent/locker.rb +100 -0
- data/spec/unit/agent/runner.rb +118 -0
- data/spec/unit/application.rb +420 -0
- data/spec/unit/application/filebucket.rb +220 -0
- data/spec/unit/application/pi.rb +84 -0
- data/spec/unit/application/puppet.rb +404 -0
- data/spec/unit/application/puppetca.rb +142 -0
- data/spec/unit/application/puppetd.rb +502 -0
- data/spec/unit/application/puppetdoc.rb +345 -0
- data/spec/unit/application/puppetmasterd.rb +456 -0
- data/spec/unit/application/puppetqd.rb +186 -0
- data/spec/unit/application/puppetrun.rb +279 -0
- data/spec/unit/application/ralsh.rb +237 -0
- data/spec/unit/configurer.rb +232 -0
- data/spec/unit/configurer/downloader.rb +188 -0
- data/spec/unit/configurer/fact_handler.rb +150 -0
- data/spec/unit/configurer/plugin_handler.rb +112 -0
- data/spec/unit/daemon.rb +287 -0
- data/spec/unit/file_serving/{file_base.rb → base.rb} +39 -31
- data/spec/unit/file_serving/configuration.rb +104 -93
- data/spec/unit/file_serving/configuration/parser.rb +64 -18
- data/spec/unit/file_serving/content.rb +65 -26
- data/spec/unit/file_serving/fileset.rb +116 -14
- data/spec/unit/file_serving/indirection_hooks.rb +34 -95
- data/spec/unit/file_serving/metadata.rb +27 -40
- data/spec/unit/file_serving/mount.rb +7 -118
- data/spec/unit/file_serving/mount/file.rb +188 -0
- data/spec/unit/file_serving/mount/modules.rb +63 -0
- data/spec/unit/file_serving/mount/plugins.rb +61 -0
- data/spec/unit/file_serving/terminus_helper.rb +39 -27
- data/spec/unit/indirector.rb +6 -1
- data/spec/unit/indirector/active_record.rb +76 -0
- data/spec/unit/indirector/catalog/active_record.rb +122 -0
- data/spec/unit/indirector/catalog/compiler.rb +222 -118
- data/spec/unit/indirector/catalog/queue.rb +20 -0
- data/spec/unit/indirector/catalog/rest.rb +11 -0
- data/spec/unit/indirector/catalog/yaml.rb +6 -6
- data/spec/unit/indirector/certificate/ca.rb +28 -0
- data/spec/unit/indirector/certificate/file.rb +28 -0
- data/spec/unit/indirector/certificate/rest.rb +23 -0
- data/spec/unit/indirector/certificate_request/ca.rb +19 -0
- data/spec/unit/indirector/certificate_request/file.rb +19 -0
- data/spec/unit/indirector/certificate_request/rest.rb +23 -0
- data/spec/unit/indirector/certificate_revocation_list/ca.rb +21 -0
- data/spec/unit/indirector/certificate_revocation_list/file.rb +20 -0
- data/spec/unit/indirector/certificate_revocation_list/rest.rb +23 -0
- data/spec/unit/indirector/direct_file_server.rb +3 -8
- data/spec/unit/indirector/exec.rb +6 -1
- data/spec/unit/indirector/facts/active_record.rb +104 -0
- data/spec/unit/indirector/facts/facter.rb +53 -12
- data/spec/unit/indirector/facts/rest.rb +11 -0
- data/spec/unit/indirector/file.rb +8 -1
- data/spec/unit/indirector/file_metadata/file.rb +5 -5
- data/spec/unit/indirector/file_server.rb +181 -98
- data/spec/unit/indirector/indirection.rb +102 -38
- data/spec/unit/indirector/key/ca.rb +28 -0
- data/spec/unit/indirector/key/file.rb +104 -0
- data/spec/unit/indirector/node/active_record.rb +34 -0
- data/spec/unit/indirector/node/ldap.rb +1 -1
- data/spec/unit/indirector/node/rest.rb +2 -2
- data/spec/unit/indirector/queue.rb +123 -0
- data/spec/unit/indirector/report/rest.rb +28 -0
- data/spec/unit/indirector/request.rb +221 -0
- data/spec/unit/indirector/rest.rb +343 -334
- data/spec/unit/indirector/runner/rest.rb +11 -0
- data/spec/unit/indirector/ssl_file.rb +280 -0
- data/spec/unit/module.rb +180 -180
- data/spec/unit/network/authconfig.rb +292 -0
- data/spec/unit/network/authstore.rb +94 -0
- data/spec/unit/network/client.rb +2 -2
- data/spec/unit/network/client/dipper.rb +16 -0
- data/spec/unit/network/format.rb +191 -0
- data/spec/unit/network/format_handler.rb +306 -0
- data/spec/unit/network/formats.rb +249 -0
- data/spec/unit/network/handler/fileserver.rb +2 -5
- data/spec/unit/network/http.rb +3 -3
- data/spec/unit/network/http/api/v1.rb +122 -0
- data/spec/unit/network/http/handler.rb +448 -0
- data/spec/unit/network/http/mongrel.rb +46 -32
- data/spec/unit/network/http/mongrel/rest.rb +174 -319
- data/spec/unit/network/http/rack.rb +102 -0
- data/spec/unit/network/http/rack/rest.rb +199 -0
- data/spec/unit/network/http/rack/xmlrpc.rb +157 -0
- data/spec/unit/network/http/webrick.rb +249 -37
- data/spec/unit/network/http/webrick/rest.rb +113 -279
- data/spec/unit/network/http_pool.rb +86 -110
- data/spec/unit/network/rest_authconfig.rb +146 -0
- data/spec/unit/network/rest_authorization.rb +43 -0
- data/spec/unit/network/rights.rb +519 -0
- data/spec/unit/network/server.rb +475 -257
- data/spec/unit/node.rb +43 -10
- data/spec/unit/node/environment.rb +143 -9
- data/spec/unit/node/facts.rb +77 -24
- data/spec/unit/other/selinux.rb +85 -0
- data/spec/unit/other/transbucket.rb +29 -13
- data/spec/unit/other/transobject.rb +35 -15
- data/spec/unit/parameter.rb +378 -5
- data/spec/unit/parser/ast.rb +1 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +17 -17
- data/spec/unit/parser/ast/astarray.rb +16 -10
- data/spec/unit/parser/ast/boolean_operator.rb +2 -2
- data/spec/unit/parser/ast/casestatement.rb +143 -0
- data/spec/unit/parser/ast/collection.rb +63 -0
- data/spec/unit/parser/ast/collexpr.rb +31 -8
- data/spec/unit/parser/ast/comparison_operator.rb +9 -9
- data/spec/unit/parser/ast/definition.rb +18 -0
- data/spec/unit/parser/ast/function.rb +6 -0
- data/spec/unit/parser/ast/ifstatement.rb +75 -0
- data/spec/unit/parser/ast/leaf.rb +261 -0
- data/spec/unit/parser/ast/match_operator.rb +50 -0
- data/spec/unit/parser/ast/minus.rb +1 -1
- data/spec/unit/parser/ast/node.rb +20 -0
- data/spec/unit/parser/ast/not.rb +1 -1
- data/spec/unit/parser/ast/resource_override.rb +5 -5
- data/spec/unit/parser/ast/resource_reference.rb +11 -5
- data/spec/unit/parser/ast/selector.rb +156 -0
- data/spec/unit/parser/ast/vardef.rb +11 -11
- data/spec/unit/parser/collector.rb +167 -48
- data/spec/unit/parser/compiler.rb +128 -104
- data/spec/unit/parser/files.rb +190 -0
- data/spec/unit/parser/functions/inline_template.rb +0 -0
- data/spec/unit/parser/functions/regsubst.rb +42 -42
- data/spec/unit/parser/functions/require.rb +36 -0
- data/spec/unit/parser/functions/shellquote.rb +92 -0
- data/spec/unit/parser/functions/split.rb +51 -0
- data/spec/unit/parser/functions/sprintf.rb +11 -11
- data/spec/unit/parser/functions/template.rb +0 -0
- data/spec/unit/parser/functions/versioncmp.rb +2 -2
- data/spec/unit/parser/interpreter.rb +16 -7
- data/spec/unit/parser/lexer.rb +72 -12
- data/spec/unit/parser/loaded_code.rb +198 -0
- data/spec/unit/parser/parser.rb +215 -28
- data/spec/unit/parser/resource.rb +131 -22
- data/spec/unit/parser/scope.rb +207 -12
- data/spec/unit/parser/templatewrapper.rb +8 -3
- data/spec/unit/property.rb +270 -16
- data/spec/unit/property/list.rb +12 -6
- data/spec/unit/provider.rb +31 -0
- data/spec/unit/provider/augeas/augeas.rb +61 -33
- data/spec/unit/provider/macauthorization.rb +29 -29
- data/spec/unit/provider/mcx/mcxcontent.rb +4 -4
- data/spec/unit/provider/mount/parsed.rb +5 -8
- data/spec/unit/provider/naginator.rb +0 -0
- data/spec/unit/provider/package/apt.rb +6 -6
- data/spec/unit/provider/package/pkgdmg.rb +73 -0
- data/spec/unit/provider/selboolean.rb +1 -1
- data/spec/unit/provider/selmodule.rb +2 -2
- data/spec/unit/provider/service/daemontools.rb +40 -15
- data/spec/unit/provider/service/debian.rb +89 -0
- data/spec/unit/provider/service/init.rb +106 -0
- data/spec/unit/provider/service/launchd.rb +71 -13
- data/spec/unit/provider/service/redhat.rb +94 -0
- data/spec/unit/provider/service/runit.rb +14 -2
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +66 -2
- data/spec/unit/provider/user/ldap.rb +1 -1
- data/spec/unit/provider/user/user_role_add.rb +1 -1
- data/spec/unit/provider/zfs/solaris.rb +18 -6
- data/spec/unit/provider/zone/solaris.rb +1 -1
- data/spec/unit/rails.rb +16 -22
- data/spec/unit/rails/host.rb +163 -0
- data/spec/unit/rails/param_value.rb +49 -0
- data/spec/unit/rails/resource.rb +87 -0
- data/spec/unit/relationship.rb +141 -29
- data/spec/unit/resource.rb +504 -0
- data/spec/unit/resource/catalog.rb +1061 -0
- data/spec/unit/resource/reference.rb +111 -0
- data/spec/unit/simple_graph.rb +448 -191
- data/spec/unit/ssl/certificate.rb +124 -0
- data/spec/unit/ssl/certificate_authority.rb +741 -0
- data/spec/unit/ssl/certificate_authority/interface.rb +269 -0
- data/spec/unit/ssl/certificate_factory.rb +107 -0
- data/spec/unit/ssl/certificate_request.rb +193 -0
- data/spec/unit/ssl/certificate_revocation_list.rb +180 -0
- data/spec/unit/ssl/host.rb +704 -0
- data/spec/unit/ssl/inventory.rb +180 -0
- data/spec/unit/ssl/key.rb +198 -0
- data/spec/unit/transaction.rb +65 -2
- data/spec/unit/transaction/change.rb +1 -1
- data/spec/unit/transaction/report.rb +1 -1
- data/spec/unit/type.rb +361 -8
- data/spec/unit/type/augeas.rb +30 -37
- data/spec/unit/type/component.rb +63 -0
- data/spec/unit/type/computer.rb +17 -21
- data/spec/unit/type/exec.rb +27 -2
- data/spec/unit/type/file.rb +704 -83
- data/spec/unit/type/file/content.rb +253 -15
- data/spec/unit/type/file/ensure.rb +65 -2
- data/spec/unit/type/file/group.rb +5 -0
- data/spec/unit/type/file/owner.rb +5 -0
- data/spec/unit/type/file/selinux.rb +12 -16
- data/spec/unit/type/file/source.rb +264 -0
- data/spec/unit/type/filebucket.rb +74 -0
- data/spec/unit/type/group.rb +1 -5
- data/spec/unit/type/macauthorization.rb +59 -26
- data/spec/unit/type/mcx.rb +8 -16
- data/spec/unit/type/mount.rb +8 -16
- data/spec/unit/type/noop_metaparam.rb +0 -2
- data/spec/unit/type/package.rb +13 -23
- data/spec/unit/type/resources.rb +4 -7
- data/spec/unit/type/schedule.rb +1 -7
- data/spec/unit/type/selboolean.rb +4 -6
- data/spec/unit/type/service.rb +23 -33
- data/spec/unit/type/ssh_authorized_key.rb +25 -14
- data/spec/unit/type/tidy.rb +329 -21
- data/spec/unit/type/user.rb +18 -10
- data/spec/unit/type/zfs.rb +6 -6
- data/spec/unit/util/autoload.rb +94 -3
- data/spec/unit/util/autoload/file_cache.rb +183 -0
- data/spec/unit/util/backups.rb +159 -0
- data/spec/unit/util/cache_accumulator.rb +69 -0
- data/spec/unit/util/cacher.rb +185 -0
- data/spec/unit/util/checksums.rb +9 -1
- data/spec/unit/util/feature.rb +72 -0
- data/spec/unit/util/filetype.rb +1 -11
- data/spec/unit/util/json.rb +21 -0
- data/spec/unit/util/log.rb +45 -0
- data/spec/unit/util/package.rb +2 -2
- data/spec/unit/util/queue.rb +88 -0
- data/spec/unit/util/queue/stomp.rb +140 -0
- data/spec/unit/util/reference_serializer.rb +52 -0
- data/spec/unit/util/selinux.rb +5 -3
- data/spec/unit/util/settings.rb +413 -264
- data/spec/unit/util/settings/file_setting.rb +223 -0
- data/spec/unit/util/storage.rb +11 -11
- data/spec/unit/util/warnings.rb +21 -17
- data/test/Rakefile +6 -5
- data/test/certmgr/ca.rb +5 -5
- data/test/certmgr/certmgr.rb +4 -4
- data/test/data/providers/cron/crontab.allthree +2 -2
- data/test/data/providers/cron/crontab.envNcomment +1 -1
- data/test/data/providers/cron/crontab.envNname +1 -1
- data/test/data/providers/cron/crontab.multirecords +1 -1
- data/test/data/providers/cron/crontab_collections.yaml +14 -14
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +6 -6
- data/test/data/providers/cron/crontab_sample_records.yaml +102 -102
- data/test/data/providers/mailalias/aliases/test1 +28 -0
- data/test/data/providers/package/testpackages.yaml +6 -6
- data/test/data/reports/1.yaml +17 -17
- data/test/data/reports/tagmail_passers.conf +2 -2
- data/test/data/snippets/append.pp +5 -5
- data/test/data/snippets/casestatement.pp +9 -2
- data/test/data/snippets/classincludes.pp +1 -1
- data/test/data/snippets/collection_override.pp +8 -0
- data/test/data/snippets/fqparents.pp +2 -2
- data/test/data/snippets/ifexpression.pp +12 -0
- data/test/data/snippets/multilinecomments.pp +5 -1
- data/test/data/snippets/selectorvalues.pp +7 -0
- data/test/data/types/hosts/1 +1 -1
- data/test/data/types/hosts/2 +3 -3
- data/test/data/types/hosts/solaris +2 -2
- data/test/data/types/mount/freebsd.fstab +7 -7
- data/test/data/types/mount/solaris.fstab +10 -10
- data/test/data/types/port/1 +472 -472
- data/test/data/types/port/darwin +4347 -4347
- data/test/language/ast.rb +3 -2
- data/test/language/ast/casestatement.rb +12 -12
- data/test/language/ast/resource.rb +4 -4
- data/test/language/ast/resource_reference.rb +5 -5
- data/test/language/ast/selector.rb +11 -11
- data/test/language/ast/variable.rb +4 -4
- data/test/language/functions.rb +16 -16
- data/test/language/parser.rb +89 -111
- data/test/language/resource.rb +3 -88
- data/test/language/scope.rb +14 -55
- data/test/language/snippets.rb +31 -31
- data/test/lib/puppettest.rb +12 -12
- data/test/lib/puppettest/certificates.rb +2 -2
- data/test/lib/puppettest/exetest.rb +0 -1
- data/test/lib/puppettest/fakes.rb +1 -1
- data/test/lib/puppettest/parsertesting.rb +9 -4
- data/test/lib/puppettest/railstesting.rb +3 -3
- data/test/lib/puppettest/servertest.rb +1 -1
- data/test/lib/puppettest/support/assertions.rb +2 -2
- data/test/lib/puppettest/support/collection.rb +1 -1
- data/test/lib/puppettest/support/resources.rb +7 -7
- data/test/lib/puppettest/support/utils.rb +10 -16
- data/test/lib/puppettest/testcase.rb +2 -1
- data/test/network/authconfig.rb +1 -1
- data/test/network/authorization.rb +1 -1
- data/test/network/authstore.rb +57 -14
- data/test/network/client/ca.rb +1 -0
- data/test/network/client/resource.rb +12 -50
- data/test/network/client_request.rb +1 -1
- data/test/network/handler/bucket.rb +2 -2
- data/test/network/handler/fileserver.rb +17 -21
- data/test/network/handler/master.rb +5 -5
- data/test/network/handler/report.rb +3 -3
- data/test/network/handler/resource.rb +29 -75
- data/test/network/handler/runner.rb +8 -58
- data/test/network/rights.rb +1 -1
- data/test/network/server/mongrel_test.rb +15 -1
- data/test/network/server/webrick.rb +0 -36
- data/test/network/xmlrpc/webrick_servlet.rb +5 -5
- data/test/other/dsl.rb +3 -3
- data/test/other/events.rb +15 -15
- data/test/other/puppet.rb +2 -32
- data/test/other/relationships.rb +21 -148
- data/test/other/report.rb +20 -23
- data/test/other/transactions.rb +110 -298
- data/test/puppet/defaults.rb +1 -1
- data/test/puppet/tc_suidmanager.rb +1 -1
- data/test/rails/railsparameter.rb +4 -4
- data/test/ral/manager/attributes.rb +12 -68
- data/test/ral/manager/instances.rb +3 -19
- data/test/ral/manager/manager.rb +7 -7
- data/test/ral/manager/provider.rb +7 -7
- data/test/ral/manager/type.rb +54 -349
- data/test/ral/providers/cron/crontab.rb +14 -14
- data/test/ral/providers/group.rb +5 -6
- data/test/ral/providers/host/parsed.rb +3 -3
- data/test/ral/providers/mailalias/aliases.rb +4 -4
- data/test/ral/providers/package.rb +3 -3
- data/test/ral/providers/package/aptitude.rb +55 -55
- data/test/ral/providers/package/aptrpm.rb +7 -7
- data/test/ral/providers/parsedfile.rb +10 -14
- data/test/ral/providers/port/parsed.rb +6 -6
- data/test/ral/providers/provider.rb +10 -10
- data/test/ral/providers/service/base.rb +32 -32
- data/test/ral/providers/sshkey/parsed.rb +14 -14
- data/test/ral/providers/user.rb +16 -17
- data/test/ral/providers/user/useradd.rb +19 -22
- data/test/ral/type/cron.rb +21 -28
- data/test/ral/type/exec.rb +57 -60
- data/test/ral/type/file.rb +88 -862
- data/test/ral/type/file/target.rb +21 -70
- data/test/ral/type/fileignoresource.rb +37 -44
- data/test/ral/type/filesources.rb +43 -473
- data/test/ral/type/group.rb +6 -7
- data/test/ral/type/host.rb +14 -30
- data/test/ral/type/mailalias.rb +3 -3
- data/test/ral/type/port.rb +5 -5
- data/test/ral/type/resources.rb +37 -37
- data/test/ral/type/service.rb +3 -3
- data/test/ral/type/sshkey.rb +34 -39
- data/test/ral/type/user.rb +15 -14
- data/test/ral/type/yumrepo.rb +18 -17
- data/test/ral/type/zone.rb +4 -6
- data/test/test +9 -9
- data/test/util/fileparsing.rb +10 -10
- data/test/util/inifile.rb +6 -6
- data/test/util/instance_loader.rb +1 -1
- data/test/util/log.rb +2 -2
- data/test/util/metrics.rb +1 -6
- data/test/util/package.rb +1 -1
- data/test/util/pidlock.rb +116 -116
- data/test/util/settings.rb +40 -429
- data/test/util/storage.rb +5 -5
- data/test/util/subclass_loader.rb +0 -7
- data/test/util/utiltest.rb +10 -29
- metadata +1369 -941
- data/bin/puppetca +0 -363
- data/bin/puppetd +0 -439
- data/bin/puppetmasterd +0 -289
- data/bin/puppetrun +0 -369
- data/conf/redhat/lsb-config.patch +0 -51
- data/conf/redhat/no-chuser-0.15.1.patch +0 -38
- data/conf/redhat/no-lockdir.patch +0 -13
- data/examples/mac_netinfo.pp +0 -5
- data/ext/passenger/README +0 -63
- data/ext/passenger/apache2.conf +0 -29
- data/ext/passenger/config.ru +0 -40
- data/lib/puppet/config_stores/rest.rb +0 -60
- data/lib/puppet/executables/client/certhandler.rb +0 -82
- data/lib/puppet/indirector/file_content/modules.rb +0 -11
- data/lib/puppet/indirector/file_metadata/modules.rb +0 -17
- data/lib/puppet/indirector/module_files.rb +0 -82
- data/lib/puppet/indirector/ssl_rsa.rb +0 -5
- data/lib/puppet/indirector/ssl_rsa/file.rb +0 -33
- data/lib/puppet/network/client/master.rb +0 -524
- data/lib/puppet/network/http_server/rack.rb +0 -148
- data/lib/puppet/pgraph.rb +0 -121
- data/lib/puppet/provider/group/netinfo.rb +0 -15
- data/lib/puppet/provider/host/netinfo.rb +0 -19
- data/lib/puppet/provider/mount/netinfo.rb +0 -37
- data/lib/puppet/provider/nameservice/netinfo.rb +0 -224
- data/lib/puppet/provider/user/netinfo.rb +0 -111
- data/lib/puppet/util/fact_store.rb +0 -59
- data/lib/puppet/util/uri_helper.rb +0 -22
- data/spec/integration/file_serving/configuration.rb +0 -43
- data/spec/integration/indirector/module_files.rb +0 -57
- data/spec/unit/executables/client/certhandler.rb +0 -135
- data/spec/unit/indirector/file_content/modules.rb +0 -18
- data/spec/unit/indirector/file_metadata/modules.rb +0 -42
- data/spec/unit/indirector/module_files.rb +0 -259
- data/spec/unit/indirector/ssl_rsa/file.rb +0 -121
- data/spec/unit/network/client/master.rb +0 -442
- data/spec/unit/node/catalog.rb +0 -865
- data/spec/unit/other/pgraph.rb +0 -210
- data/spec/unit/resource_reference.rb +0 -73
- data/spec/unit/util/uri_helper.rb +0 -41
- data/test/data/snippets/ifexpression.rb +0 -6
- data/test/executables/filebucket.rb +0 -51
- data/test/executables/puppetbin.rb +0 -104
- data/test/executables/puppetca.rb +0 -115
- data/test/executables/puppetd.rb +0 -55
- data/test/executables/puppetmasterd.rb +0 -147
- data/test/network/client/client.rb +0 -195
- data/test/network/client/master.rb +0 -490
- data/test/network/daemon.rb +0 -70
- data/test/network/handler/handler.rb +0 -63
- data/test/other/overrides.rb +0 -107
- data/test/puppet/conffiles.rb +0 -107
- data/test/rails/ast.rb +0 -73
- data/test/rails/configuration.rb +0 -71
- data/test/rails/host.rb +0 -154
- data/test/rails/railsresource.rb +0 -251
- data/test/ral/providers/host/netinfo.rb +0 -56
- data/test/ral/providers/mount/netinfo.rb +0 -79
- data/test/ral/type/basic.rb +0 -85
- data/test/ral/type/filebucket.rb +0 -157
- data/test/ral/type/parameter.rb +0 -174
- data/test/ral/type/property.rb +0 -388
- data/test/ral/type/tidy.rb +0 -291
- data/test/util/autoload.rb +0 -145
- data/test/util/features.rb +0 -95
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-10-18.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
7
|
-
|
8
|
-
require 'puppet/indirector/file_metadata/modules'
|
9
|
-
|
10
|
-
describe Puppet::Indirector::FileMetadata::Modules do
|
11
|
-
it "should be registered with the file_metadata indirection" do
|
12
|
-
Puppet::Indirector::Terminus.terminus_class(:file_metadata, :modules).should equal(Puppet::Indirector::FileMetadata::Modules)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "should be a subclass of the ModuleFiles terminus" do
|
16
|
-
Puppet::Indirector::FileMetadata::Modules.superclass.should equal(Puppet::Indirector::ModuleFiles)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe Puppet::Indirector::FileMetadata::Modules, " when finding metadata" do
|
21
|
-
before do
|
22
|
-
@finder = Puppet::Indirector::FileMetadata::Modules.new
|
23
|
-
@finder.stubs(:environment).returns(nil)
|
24
|
-
@module = Puppet::Module.new("mymod", "/path/to")
|
25
|
-
@finder.stubs(:find_module).returns(@module)
|
26
|
-
|
27
|
-
@request = Puppet::Indirector::Request.new(:metadata, :find, "puppetmounts://hostname/modules/mymod/my/file")
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should return nil if the file is not found" do
|
31
|
-
FileTest.expects(:exists?).with("/path/to/files/my/file").returns false
|
32
|
-
@finder.find(@request).should be_nil
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should retrieve the instance's attributes if the file is found" do
|
36
|
-
FileTest.expects(:exists?).with("/path/to/files/my/file").returns true
|
37
|
-
instance = mock 'metadta'
|
38
|
-
Puppet::FileServing::Metadata.expects(:new).returns instance
|
39
|
-
instance.expects :collect_attributes
|
40
|
-
@finder.find(@request)
|
41
|
-
end
|
42
|
-
end
|
@@ -1,259 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-10-19.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
|
-
require File.dirname(__FILE__) + '/../../spec_helper'
|
7
|
-
|
8
|
-
require 'puppet/indirector/module_files'
|
9
|
-
|
10
|
-
|
11
|
-
describe Puppet::Indirector::ModuleFiles do
|
12
|
-
|
13
|
-
before :each do
|
14
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
15
|
-
Puppet::Indirector::Terminus.stubs(:register_terminus_class)
|
16
|
-
@model = mock 'model'
|
17
|
-
@indirection = stub 'indirection', :name => :mystuff, :register_terminus_type => nil, :model => @model
|
18
|
-
Puppet::Indirector::Indirection.stubs(:instance).returns(@indirection)
|
19
|
-
|
20
|
-
@module_files_class = Class.new(Puppet::Indirector::ModuleFiles) do
|
21
|
-
def self.to_s
|
22
|
-
"Testing::Mytype"
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
@module_files = @module_files_class.new
|
27
|
-
|
28
|
-
@uri = "puppetmounts://host/modules/my/local/file"
|
29
|
-
@module = Puppet::Module.new("mymod", "/module/path")
|
30
|
-
|
31
|
-
@request = stub 'request', :key => @uri, :options => {}, :node => nil, :ip => nil, :method => :find
|
32
|
-
end
|
33
|
-
|
34
|
-
describe Puppet::Indirector::ModuleFiles, " when finding files" do
|
35
|
-
|
36
|
-
it "should strip off the leading '/modules' mount name" do
|
37
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
38
|
-
@module_files.find(@request)
|
39
|
-
end
|
40
|
-
|
41
|
-
it "should not strip off leading terms that start with '/modules' but are longer words" do
|
42
|
-
@request.stubs(:key).returns "puppetmounts://host/modulestart/my/local/file"
|
43
|
-
Puppet::Module.expects(:find).with('modulestart', "myenv").returns nil
|
44
|
-
@module_files.find(@request)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should search for a module whose name is the first term in the remaining file path" do
|
48
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
49
|
-
@module_files.find(@request)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should search for a file relative to the module's files directory" do
|
53
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
54
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file")
|
55
|
-
@module_files.find(@request)
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should return nil if the module does not exist" do
|
59
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns nil
|
60
|
-
@module_files.find(@request).should be_nil
|
61
|
-
end
|
62
|
-
|
63
|
-
it "should return nil if the module exists but the file does not" do
|
64
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
65
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(false)
|
66
|
-
@module_files.find(@request).should be_nil
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should return an instance of the model if a module is found and the file exists" do
|
70
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
71
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(true)
|
72
|
-
@model.expects(:new).returns(:myinstance)
|
73
|
-
@module_files.find(@request).should == :myinstance
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should use the node's environment to look up the module if the node name is provided" do
|
77
|
-
node = stub "node", :environment => "testing"
|
78
|
-
Puppet::Node.expects(:find).with("mynode").returns(node)
|
79
|
-
Puppet::Module.expects(:find).with('my', "testing")
|
80
|
-
|
81
|
-
@request.stubs(:node).returns "mynode"
|
82
|
-
@module_files.find(@request)
|
83
|
-
end
|
84
|
-
|
85
|
-
it "should use the default environment setting to look up the module if the node name is not provided" do
|
86
|
-
env = stub "environment", :name => "testing"
|
87
|
-
Puppet::Node::Environment.stubs(:new).returns(env)
|
88
|
-
Puppet::Module.expects(:find).with('my', "testing")
|
89
|
-
@module_files.find(@request)
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe Puppet::Indirector::ModuleFiles, " when returning instances" do
|
94
|
-
|
95
|
-
before do
|
96
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
97
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(true)
|
98
|
-
@instance = mock 'instance'
|
99
|
-
end
|
100
|
-
|
101
|
-
it "should create the instance with the key used to find the instance" do
|
102
|
-
@model.expects(:new).with { |key, *options| key == @uri }
|
103
|
-
@module_files.find(@request)
|
104
|
-
end
|
105
|
-
|
106
|
-
it "should create the instance with the path at which the instance was found" do
|
107
|
-
@model.expects(:new).with { |key, options| options[:path] == "/module/path/files/local/file" }
|
108
|
-
@module_files.find(@request)
|
109
|
-
end
|
110
|
-
|
111
|
-
it "should set the provided :links setting on to the instance if one is provided" do
|
112
|
-
@model.expects(:new).returns(@instance)
|
113
|
-
@instance.expects(:links=).with(:mytest)
|
114
|
-
|
115
|
-
@request.options[:links] = :mytest
|
116
|
-
@module_files.find(@request)
|
117
|
-
end
|
118
|
-
|
119
|
-
it "should not set a :links value if no :links parameter is provided" do
|
120
|
-
@model.expects(:new).returns(@instance)
|
121
|
-
@module_files.find(@request)
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe Puppet::Indirector::ModuleFiles, " when authorizing" do
|
126
|
-
|
127
|
-
before do
|
128
|
-
@configuration = mock 'configuration'
|
129
|
-
Puppet::FileServing::Configuration.stubs(:create).returns(@configuration)
|
130
|
-
end
|
131
|
-
|
132
|
-
it "should have an authorization hook" do
|
133
|
-
@module_files.should respond_to(:authorized?)
|
134
|
-
end
|
135
|
-
|
136
|
-
it "should deny the :destroy method" do
|
137
|
-
@request.expects(:method).returns :destroy
|
138
|
-
@module_files.authorized?(@request).should be_false
|
139
|
-
end
|
140
|
-
|
141
|
-
it "should deny the :save method" do
|
142
|
-
@request.expects(:method).returns :save
|
143
|
-
@module_files.authorized?(@request).should be_false
|
144
|
-
end
|
145
|
-
|
146
|
-
it "should use the file server configuration to determine authorization" do
|
147
|
-
@configuration.expects(:authorized?)
|
148
|
-
@module_files.authorized?(@request)
|
149
|
-
end
|
150
|
-
|
151
|
-
it "should use the path directly from the URI if it already includes /modules" do
|
152
|
-
@request.expects(:key).returns "puppetmounts://host/modules/my/file"
|
153
|
-
@configuration.expects(:authorized?).with { |uri, *args| uri == "/modules/my/file" }
|
154
|
-
@module_files.authorized?(@request)
|
155
|
-
end
|
156
|
-
|
157
|
-
it "should add /modules to the file path if it's not included in the URI" do
|
158
|
-
@request.expects(:key).returns "puppetmounts://host/my/file"
|
159
|
-
@configuration.expects(:authorized?).with { |uri, *args| uri == "/modules/my/file" }
|
160
|
-
@module_files.authorized?(@request)
|
161
|
-
end
|
162
|
-
|
163
|
-
it "should pass the node name to the file server configuration" do
|
164
|
-
@request.expects(:key).returns "puppetmounts://host/my/file"
|
165
|
-
@configuration.expects(:authorized?).with { |key, options| options[:node] == "mynode" }
|
166
|
-
@request.stubs(:node).returns "mynode"
|
167
|
-
@module_files.authorized?(@request)
|
168
|
-
end
|
169
|
-
|
170
|
-
it "should pass the IP address to the file server configuration" do
|
171
|
-
@request.expects(:ip).returns "myip"
|
172
|
-
@configuration.expects(:authorized?).with { |key, options| options[:ipaddress] == "myip" }
|
173
|
-
@module_files.authorized?(@request)
|
174
|
-
end
|
175
|
-
|
176
|
-
it "should return false if the file server configuration denies authorization" do
|
177
|
-
@configuration.expects(:authorized?).returns(false)
|
178
|
-
@module_files.authorized?(@request).should be_false
|
179
|
-
end
|
180
|
-
|
181
|
-
it "should return true if the file server configuration approves authorization" do
|
182
|
-
@configuration.expects(:authorized?).returns(true)
|
183
|
-
@module_files.authorized?(@request).should be_true
|
184
|
-
end
|
185
|
-
end
|
186
|
-
|
187
|
-
describe Puppet::Indirector::ModuleFiles, " when searching for files" do
|
188
|
-
|
189
|
-
it "should strip off the leading '/modules' mount name" do
|
190
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
191
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
192
|
-
@module_files.search(@request)
|
193
|
-
end
|
194
|
-
|
195
|
-
it "should not strip off leading terms that start with '/modules' but are longer words" do
|
196
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
197
|
-
Puppet::Module.expects(:find).with('modulestart', "myenv").returns nil
|
198
|
-
@request.stubs(:key).returns "puppetmounts://host/modulestart/my/local/file"
|
199
|
-
@module_files.search @request
|
200
|
-
end
|
201
|
-
|
202
|
-
it "should search for a module whose name is the first term in the remaining file path" do
|
203
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
204
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
205
|
-
@module_files.search(@request)
|
206
|
-
end
|
207
|
-
|
208
|
-
it "should search for a file relative to the module's files directory" do
|
209
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
210
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
211
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file")
|
212
|
-
@module_files.search(@request)
|
213
|
-
end
|
214
|
-
|
215
|
-
it "should return nil if the module does not exist" do
|
216
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
217
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns nil
|
218
|
-
@module_files.search(@request).should be_nil
|
219
|
-
end
|
220
|
-
|
221
|
-
it "should return nil if the module exists but the file does not" do
|
222
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
223
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
224
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(false)
|
225
|
-
@module_files.search(@request).should be_nil
|
226
|
-
end
|
227
|
-
|
228
|
-
it "should use the node's environment to look up the module if the node name is provided" do
|
229
|
-
node = stub "node", :environment => "testing"
|
230
|
-
Puppet::Node.expects(:find).with("mynode").returns(node)
|
231
|
-
Puppet::Module.expects(:find).with('my', "testing")
|
232
|
-
@request.stubs(:node).returns "mynode"
|
233
|
-
@module_files.search(@request)
|
234
|
-
end
|
235
|
-
|
236
|
-
it "should use the default environment setting to look up the module if the node name is not provided and the environment is not set to ''" do
|
237
|
-
env = stub 'env', :name => "testing"
|
238
|
-
Puppet::Node::Environment.stubs(:new).returns(env)
|
239
|
-
Puppet::Module.expects(:find).with('my', "testing")
|
240
|
-
@module_files.search(@request)
|
241
|
-
end
|
242
|
-
|
243
|
-
it "should use :path2instances from the terminus_helper to return instances if a module is found and the file exists" do
|
244
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
245
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
246
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(true)
|
247
|
-
@module_files.expects(:path2instances).with(@request, "/module/path/files/local/file")
|
248
|
-
@module_files.search(@request)
|
249
|
-
end
|
250
|
-
|
251
|
-
it "should pass the request directly to :path2instances" do
|
252
|
-
Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv"))
|
253
|
-
Puppet::Module.expects(:find).with('my', "myenv").returns @module
|
254
|
-
FileTest.expects(:exists?).with("/module/path/files/local/file").returns(true)
|
255
|
-
@module_files.expects(:path2instances).with(@request, "/module/path/files/local/file")
|
256
|
-
@module_files.search(@request)
|
257
|
-
end
|
258
|
-
end
|
259
|
-
end
|
@@ -1,121 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-9-22.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
7
|
-
|
8
|
-
require 'puppet/sslcertificates/monkey_patch'
|
9
|
-
require 'puppet/indirector/ssl_rsa/file'
|
10
|
-
|
11
|
-
|
12
|
-
describe Puppet::Indirector::SslRsa::File do
|
13
|
-
|
14
|
-
it "should be a subclass of the File terminus class" do
|
15
|
-
Puppet::Indirector::SslRsa::File.superclass.should equal(Puppet::Indirector::File)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should have documentation" do
|
19
|
-
Puppet::Indirector::SslRsa::File.doc.should be_instance_of(String)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe Puppet::Indirector::SslRsa::File, " when choosing a path for a ca key" do
|
24
|
-
before do
|
25
|
-
Puppet.settings.stubs(:use)
|
26
|
-
@file = Puppet::Indirector::SslRsa::File.new
|
27
|
-
@name = :ca
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should use the cadir" do
|
31
|
-
Puppet.settings.stubs(:value).with(:cadir).returns("/dir")
|
32
|
-
@file.path(@name).should =~ /^\/dir/
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should use 'ca_key.pem' as the file name" do
|
36
|
-
@file.path(@name).should =~ /ca_key\.pem$/
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
describe Puppet::Indirector::SslRsa::File, " when choosing a path for a non-ca key" do
|
41
|
-
before do
|
42
|
-
Puppet.settings.stubs(:use)
|
43
|
-
@file = Puppet::Indirector::SslRsa::File.new
|
44
|
-
@name = :publickey
|
45
|
-
end
|
46
|
-
|
47
|
-
it "should use the publickeydir" do
|
48
|
-
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
49
|
-
@file.path(@name).should =~ /^\/dir/
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should use the key name with the pem file extension" do
|
53
|
-
@file.path(@name).should =~ /#{@name}\.pem$/
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
describe Puppet::Indirector::SslRsa::File, " when saving" do
|
58
|
-
before do
|
59
|
-
Puppet.settings.stubs(:use)
|
60
|
-
@file = Puppet::Indirector::SslRsa::File.new
|
61
|
-
|
62
|
-
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
63
|
-
@key = stub "key", :name => "foo"
|
64
|
-
end
|
65
|
-
|
66
|
-
it "should store the rsa key to disk in pem format" do
|
67
|
-
@key.expects(:to_pem).returns(:data)
|
68
|
-
@path = "/dir/foo.pem"
|
69
|
-
filehandle = mock "filehandle"
|
70
|
-
File.expects(:open).with(@path, "w").yields(filehandle)
|
71
|
-
filehandle.expects(:print).with(:data)
|
72
|
-
@file.save(@key)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
describe Puppet::Indirector::SslRsa::File, " when finding a key by name" do
|
77
|
-
before do
|
78
|
-
Puppet.settings.stubs(:use)
|
79
|
-
@file = Puppet::Indirector::SslRsa::File.new
|
80
|
-
|
81
|
-
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
82
|
-
@name = "foo"
|
83
|
-
end
|
84
|
-
|
85
|
-
it "should return the key as a key object on success" do
|
86
|
-
@path = "/dir/foo.pem"
|
87
|
-
FileTest.stubs(:exists?).with(@path).returns(true)
|
88
|
-
File.stubs(:read).with(@path).returns(:data)
|
89
|
-
OpenSSL::PKey::RSA.expects(:new).with(:data).returns(:mykey)
|
90
|
-
@file.find(@name).should == :mykey
|
91
|
-
end
|
92
|
-
|
93
|
-
it "should return 'nil' on failure" do
|
94
|
-
@path = "/dir/foo.pem"
|
95
|
-
FileTest.stubs(:exists?).with(@path).returns(false)
|
96
|
-
@file.find(@name).should == nil
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
describe Puppet::Indirector::SslRsa::File, " when removing a key" do
|
101
|
-
before do
|
102
|
-
Puppet.settings.stubs(:use)
|
103
|
-
@file = Puppet::Indirector::SslRsa::File.new
|
104
|
-
|
105
|
-
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
106
|
-
@name = "foo"
|
107
|
-
end
|
108
|
-
|
109
|
-
it "should remove the key from disk and return true" do
|
110
|
-
@path = "/dir/foo.pem"
|
111
|
-
FileTest.stubs(:exists?).with(@path).returns(true)
|
112
|
-
File.stubs(:unlink).with(@path).returns(true)
|
113
|
-
@file.destroy(@name).should == true
|
114
|
-
end
|
115
|
-
|
116
|
-
it "should return an exception on failure" do
|
117
|
-
@path = "/dir/foo.pem"
|
118
|
-
FileTest.stubs(:exists?).with(@path).returns(false)
|
119
|
-
@file.destroy(@name).should == nil
|
120
|
-
end
|
121
|
-
end
|
@@ -1,442 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# Created by Luke Kanies on 2007-11-12.
|
4
|
-
# Copyright (c) 2007. All rights reserved.
|
5
|
-
|
6
|
-
require File.dirname(__FILE__) + '/../../../spec_helper'
|
7
|
-
require 'puppet/network/client/master'
|
8
|
-
|
9
|
-
describe Puppet::Network::Client::Master, " when retrieving the catalog" do
|
10
|
-
before do
|
11
|
-
Puppet.settings.stubs(:use).returns(true)
|
12
|
-
@master = mock 'master'
|
13
|
-
@client = Puppet::Network::Client.master.new(
|
14
|
-
:Master => @master
|
15
|
-
)
|
16
|
-
@facts = {"one" => "two", "three" => "four"}
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should initialize the metadata store" do
|
20
|
-
@client.class.stubs(:facts).returns(@facts)
|
21
|
-
@client.expects(:dostorage)
|
22
|
-
@master.stubs(:getconfig).returns(nil)
|
23
|
-
@client.getconfig
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should collect facts to use for catalog retrieval" do
|
27
|
-
@client.stubs(:dostorage)
|
28
|
-
@client.class.expects(:facts).returns(@facts)
|
29
|
-
@master.stubs(:getconfig).returns(nil)
|
30
|
-
@client.getconfig
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should fail if no facts could be collected" do
|
34
|
-
@client.stubs(:dostorage)
|
35
|
-
@client.class.expects(:facts).returns({})
|
36
|
-
@master.stubs(:getconfig).returns(nil)
|
37
|
-
proc { @client.getconfig }.should raise_error(Puppet::Network::ClientError)
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should retrieve plugins if :pluginsync is enabled" do
|
41
|
-
file = "/path/to/cachefile"
|
42
|
-
@client.stubs(:cachefile).returns(file)
|
43
|
-
@client.stubs(:dostorage)
|
44
|
-
@client.class.stubs(:facts).returns(@facts)
|
45
|
-
Puppet.settings.expects(:value).with(:pluginsync).returns(true)
|
46
|
-
@client.expects(:getplugins)
|
47
|
-
@client.stubs(:get_actual_config).returns(nil)
|
48
|
-
FileTest.stubs(:exist?).with(file).returns(true)
|
49
|
-
@client.stubs(:use_cached_config).returns(true)
|
50
|
-
@client.class.stubs(:facts).returns(@facts)
|
51
|
-
@client.getconfig
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should use the cached catalog if no catalog could be retrieved" do
|
55
|
-
@client.stubs(:dostorage)
|
56
|
-
@client.class.stubs(:facts).returns(@facts)
|
57
|
-
@master.stubs(:getconfig).raises(ArgumentError.new("whev"))
|
58
|
-
@client.expects(:use_cached_config).with(true)
|
59
|
-
@client.getconfig
|
60
|
-
end
|
61
|
-
|
62
|
-
describe "when the catalog format is set to yaml" do
|
63
|
-
before do
|
64
|
-
Puppet.settings.stubs(:value).returns "foo"
|
65
|
-
Puppet.settings.stubs(:value).with(:pluginsync).returns false
|
66
|
-
Puppet.settings.stubs(:value).with(:configtimeout).returns 10
|
67
|
-
Puppet.settings.stubs(:value).with(:factsync).returns false
|
68
|
-
Puppet.settings.stubs(:value).with(:catalog_format).returns "yaml"
|
69
|
-
end
|
70
|
-
|
71
|
-
it "should request a yaml-encoded catalog" do
|
72
|
-
@client.stubs(:dostorage)
|
73
|
-
@client.class.stubs(:facts).returns(@facts)
|
74
|
-
@master.expects(:getconfig).with { |*args| args[1] == "yaml" }
|
75
|
-
|
76
|
-
@client.getconfig
|
77
|
-
end
|
78
|
-
|
79
|
-
it "should load the retrieved catalog using YAML" do
|
80
|
-
@client.stubs(:dostorage)
|
81
|
-
@client.class.stubs(:facts).returns(@facts)
|
82
|
-
@master.stubs(:getconfig).returns("myconfig")
|
83
|
-
|
84
|
-
config = mock 'config'
|
85
|
-
YAML.expects(:load).with("myconfig").returns(config)
|
86
|
-
|
87
|
-
@client.stubs(:setclasses)
|
88
|
-
|
89
|
-
config.stubs(:classes)
|
90
|
-
config.stubs(:to_catalog).returns(config)
|
91
|
-
config.stubs(:host_config=)
|
92
|
-
config.stubs(:from_cache).returns(true)
|
93
|
-
|
94
|
-
@client.getconfig
|
95
|
-
end
|
96
|
-
|
97
|
-
it "should use the cached catalog if the retrieved catalog cannot be converted from YAML" do
|
98
|
-
@client.stubs(:dostorage)
|
99
|
-
@client.class.stubs(:facts).returns(@facts)
|
100
|
-
@master.stubs(:getconfig).returns("myconfig")
|
101
|
-
|
102
|
-
YAML.expects(:load).with("myconfig").raises(ArgumentError)
|
103
|
-
|
104
|
-
@client.expects(:use_cached_config).with(true)
|
105
|
-
|
106
|
-
@client.getconfig
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
describe "from Marshal" do
|
111
|
-
before do
|
112
|
-
Puppet.settings.stubs(:value).returns "foo"
|
113
|
-
Puppet.settings.stubs(:value).with(:pluginsync).returns false
|
114
|
-
Puppet.settings.stubs(:value).with(:configtimeout).returns 10
|
115
|
-
Puppet.settings.stubs(:value).with(:factsync).returns false
|
116
|
-
Puppet.settings.stubs(:value).with(:catalog_format).returns "marshal"
|
117
|
-
end
|
118
|
-
|
119
|
-
it "should load the retrieved catalog using Marshal" do
|
120
|
-
@client.stubs(:dostorage)
|
121
|
-
@client.class.stubs(:facts).returns(@facts)
|
122
|
-
@master.stubs(:getconfig).returns("myconfig")
|
123
|
-
|
124
|
-
config = mock 'config'
|
125
|
-
Marshal.expects(:load).with("myconfig").returns(config)
|
126
|
-
|
127
|
-
@client.stubs(:setclasses)
|
128
|
-
|
129
|
-
config.stubs(:classes)
|
130
|
-
config.stubs(:to_catalog).returns(config)
|
131
|
-
config.stubs(:host_config=)
|
132
|
-
config.stubs(:from_cache).returns(true)
|
133
|
-
|
134
|
-
@client.getconfig
|
135
|
-
end
|
136
|
-
|
137
|
-
it "should use the cached catalog if the retrieved catalog cannot be converted from Marshal" do
|
138
|
-
@client.stubs(:dostorage)
|
139
|
-
@client.class.stubs(:facts).returns(@facts)
|
140
|
-
@master.stubs(:getconfig).returns("myconfig")
|
141
|
-
|
142
|
-
Marshal.expects(:load).with("myconfig").raises(ArgumentError)
|
143
|
-
|
144
|
-
@client.expects(:use_cached_config).with(true)
|
145
|
-
|
146
|
-
@client.getconfig
|
147
|
-
end
|
148
|
-
end
|
149
|
-
|
150
|
-
it "should set the classes.txt file with the classes listed in the retrieved catalog" do
|
151
|
-
@client.stubs(:dostorage)
|
152
|
-
@client.class.stubs(:facts).returns(@facts)
|
153
|
-
@master.stubs(:getconfig).returns("myconfig")
|
154
|
-
|
155
|
-
config = mock 'config'
|
156
|
-
YAML.expects(:load).with("myconfig").returns(config)
|
157
|
-
|
158
|
-
config.expects(:classes).returns(:myclasses)
|
159
|
-
@client.expects(:setclasses).with(:myclasses)
|
160
|
-
|
161
|
-
config.stubs(:to_catalog).returns(config)
|
162
|
-
config.stubs(:host_config=)
|
163
|
-
config.stubs(:from_cache).returns(true)
|
164
|
-
|
165
|
-
@client.getconfig
|
166
|
-
end
|
167
|
-
|
168
|
-
it "should convert the retrieved catalog to a RAL catalog" do
|
169
|
-
@client.stubs(:dostorage)
|
170
|
-
@client.class.stubs(:facts).returns(@facts)
|
171
|
-
@master.stubs(:getconfig).returns("myconfig")
|
172
|
-
|
173
|
-
yamlconfig = mock 'yaml config'
|
174
|
-
YAML.stubs(:load).returns(yamlconfig)
|
175
|
-
|
176
|
-
@client.stubs(:setclasses)
|
177
|
-
|
178
|
-
config = mock 'config'
|
179
|
-
|
180
|
-
yamlconfig.stubs(:classes)
|
181
|
-
yamlconfig.expects(:to_catalog).returns(config)
|
182
|
-
|
183
|
-
config.stubs(:host_config=)
|
184
|
-
config.stubs(:from_cache).returns(true)
|
185
|
-
|
186
|
-
@client.getconfig
|
187
|
-
end
|
188
|
-
|
189
|
-
it "should use the cached catalog if the retrieved catalog cannot be converted to a RAL catalog" do
|
190
|
-
@client.stubs(:dostorage)
|
191
|
-
@client.class.stubs(:facts).returns(@facts)
|
192
|
-
@master.stubs(:getconfig).returns("myconfig")
|
193
|
-
|
194
|
-
yamlconfig = mock 'yaml config'
|
195
|
-
YAML.stubs(:load).returns(yamlconfig)
|
196
|
-
|
197
|
-
@client.stubs(:setclasses)
|
198
|
-
|
199
|
-
config = mock 'config'
|
200
|
-
|
201
|
-
yamlconfig.stubs(:classes)
|
202
|
-
yamlconfig.expects(:to_catalog).raises(ArgumentError)
|
203
|
-
|
204
|
-
@client.expects(:use_cached_config).with(true)
|
205
|
-
|
206
|
-
@client.getconfig
|
207
|
-
end
|
208
|
-
|
209
|
-
it "should clear the failed catalog if using the cached catalog after failing to instantiate the retrieved catalog" do
|
210
|
-
@client.stubs(:dostorage)
|
211
|
-
@client.class.stubs(:facts).returns(@facts)
|
212
|
-
@master.stubs(:getconfig).returns("myconfig")
|
213
|
-
|
214
|
-
yamlconfig = mock 'yaml config'
|
215
|
-
YAML.stubs(:load).returns(yamlconfig)
|
216
|
-
|
217
|
-
@client.stubs(:setclasses)
|
218
|
-
|
219
|
-
config = mock 'config'
|
220
|
-
|
221
|
-
yamlconfig.stubs(:classes)
|
222
|
-
yamlconfig.stubs(:to_catalog).raises(ArgumentError)
|
223
|
-
|
224
|
-
@client.stubs(:use_cached_config).with(true)
|
225
|
-
|
226
|
-
@client.expects(:clear)
|
227
|
-
|
228
|
-
@client.getconfig
|
229
|
-
end
|
230
|
-
|
231
|
-
it "should cache the retrieved yaml catalog if it is not from the cache and is valid" do
|
232
|
-
@client.stubs(:dostorage)
|
233
|
-
@client.class.stubs(:facts).returns(@facts)
|
234
|
-
@master.stubs(:getconfig).returns("myconfig")
|
235
|
-
|
236
|
-
yamlconfig = mock 'yaml config'
|
237
|
-
YAML.stubs(:load).returns(yamlconfig)
|
238
|
-
|
239
|
-
@client.stubs(:setclasses)
|
240
|
-
|
241
|
-
config = mock 'config'
|
242
|
-
|
243
|
-
yamlconfig.stubs(:classes)
|
244
|
-
yamlconfig.expects(:to_catalog).returns(config)
|
245
|
-
|
246
|
-
config.stubs(:host_config=)
|
247
|
-
|
248
|
-
config.expects(:from_cache).returns(false)
|
249
|
-
|
250
|
-
@client.expects(:cache).with("myconfig")
|
251
|
-
|
252
|
-
@client.getconfig
|
253
|
-
end
|
254
|
-
|
255
|
-
it "should mark the catalog as a host catalog" do
|
256
|
-
@client.stubs(:dostorage)
|
257
|
-
@client.class.stubs(:facts).returns(@facts)
|
258
|
-
@master.stubs(:getconfig).returns("myconfig")
|
259
|
-
|
260
|
-
yamlconfig = mock 'yaml config'
|
261
|
-
YAML.stubs(:load).returns(yamlconfig)
|
262
|
-
|
263
|
-
@client.stubs(:setclasses)
|
264
|
-
|
265
|
-
config = mock 'config'
|
266
|
-
|
267
|
-
yamlconfig.stubs(:classes)
|
268
|
-
yamlconfig.expects(:to_catalog).returns(config)
|
269
|
-
|
270
|
-
config.stubs(:from_cache).returns(true)
|
271
|
-
|
272
|
-
config.expects(:host_config=).with(true)
|
273
|
-
|
274
|
-
@client.getconfig
|
275
|
-
end
|
276
|
-
end
|
277
|
-
|
278
|
-
describe Puppet::Network::Client::Master, " when using the cached catalog" do
|
279
|
-
before do
|
280
|
-
Puppet.settings.stubs(:use).returns(true)
|
281
|
-
@master = mock 'master'
|
282
|
-
@client = Puppet::Network::Client.master.new(
|
283
|
-
:Master => @master
|
284
|
-
)
|
285
|
-
@facts = {"one" => "two", "three" => "four"}
|
286
|
-
end
|
287
|
-
|
288
|
-
it "should return do nothing and true if there is already an in-memory catalog" do
|
289
|
-
@client.catalog = :whatever
|
290
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
291
|
-
@client.use_cached_config.should be_true
|
292
|
-
end
|
293
|
-
end
|
294
|
-
|
295
|
-
it "should return do nothing and false if it has been told there is a failure and :nocacheonfailure is enabled" do
|
296
|
-
Puppet.settings.expects(:value).with(:usecacheonfailure).returns(false)
|
297
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
298
|
-
@client.use_cached_config(true).should be_false
|
299
|
-
end
|
300
|
-
end
|
301
|
-
|
302
|
-
it "should return false if no cached catalog can be found" do
|
303
|
-
@client.expects(:retrievecache).returns(nil)
|
304
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
305
|
-
@client.use_cached_config().should be_false
|
306
|
-
end
|
307
|
-
end
|
308
|
-
|
309
|
-
it "should return false if the cached catalog cannot be instantiated" do
|
310
|
-
YAML.expects(:load).raises(ArgumentError)
|
311
|
-
@client.expects(:retrievecache).returns("whatever")
|
312
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
313
|
-
@client.use_cached_config().should be_false
|
314
|
-
end
|
315
|
-
end
|
316
|
-
|
317
|
-
it "should warn if the cached catalog cannot be instantiated" do
|
318
|
-
YAML.stubs(:load).raises(ArgumentError)
|
319
|
-
@client.stubs(:retrievecache).returns("whatever")
|
320
|
-
Puppet.expects(:warning).with { |m| m.include?("Could not load cache") }
|
321
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
322
|
-
@client.use_cached_config().should be_false
|
323
|
-
end
|
324
|
-
end
|
325
|
-
|
326
|
-
it "should clear the client if the cached catalog cannot be instantiated" do
|
327
|
-
YAML.stubs(:load).raises(ArgumentError)
|
328
|
-
@client.stubs(:retrievecache).returns("whatever")
|
329
|
-
@client.expects(:clear)
|
330
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
331
|
-
@client.use_cached_config().should be_false
|
332
|
-
end
|
333
|
-
end
|
334
|
-
|
335
|
-
it "should return true if the cached catalog can be instantiated" do
|
336
|
-
config = mock 'config'
|
337
|
-
YAML.stubs(:load).returns(config)
|
338
|
-
|
339
|
-
ral_config = mock 'ral config'
|
340
|
-
ral_config.stubs(:from_cache=)
|
341
|
-
ral_config.stubs(:host_config=)
|
342
|
-
config.expects(:to_catalog).returns(ral_config)
|
343
|
-
|
344
|
-
@client.stubs(:retrievecache).returns("whatever")
|
345
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
346
|
-
@client.use_cached_config().should be_true
|
347
|
-
end
|
348
|
-
end
|
349
|
-
|
350
|
-
it "should set the catalog instance variable if the cached catalog can be instantiated" do
|
351
|
-
config = mock 'config'
|
352
|
-
YAML.stubs(:load).returns(config)
|
353
|
-
|
354
|
-
ral_config = mock 'ral config'
|
355
|
-
ral_config.stubs(:from_cache=)
|
356
|
-
ral_config.stubs(:host_config=)
|
357
|
-
config.expects(:to_catalog).returns(ral_config)
|
358
|
-
|
359
|
-
@client.stubs(:retrievecache).returns("whatever")
|
360
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
361
|
-
@client.use_cached_config()
|
362
|
-
end
|
363
|
-
|
364
|
-
@client.catalog.should equal(ral_config)
|
365
|
-
end
|
366
|
-
|
367
|
-
it "should mark the catalog as a host_config if valid" do
|
368
|
-
config = mock 'config'
|
369
|
-
YAML.stubs(:load).returns(config)
|
370
|
-
|
371
|
-
ral_config = mock 'ral config'
|
372
|
-
ral_config.stubs(:from_cache=)
|
373
|
-
ral_config.expects(:host_config=).with(true)
|
374
|
-
config.expects(:to_catalog).returns(ral_config)
|
375
|
-
|
376
|
-
@client.stubs(:retrievecache).returns("whatever")
|
377
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
378
|
-
@client.use_cached_config()
|
379
|
-
end
|
380
|
-
|
381
|
-
@client.catalog.should equal(ral_config)
|
382
|
-
end
|
383
|
-
|
384
|
-
it "should mark the catalog as from the cache if valid" do
|
385
|
-
config = mock 'config'
|
386
|
-
YAML.stubs(:load).returns(config)
|
387
|
-
|
388
|
-
ral_config = mock 'ral config'
|
389
|
-
ral_config.expects(:from_cache=).with(true)
|
390
|
-
ral_config.stubs(:host_config=)
|
391
|
-
config.expects(:to_catalog).returns(ral_config)
|
392
|
-
|
393
|
-
@client.stubs(:retrievecache).returns("whatever")
|
394
|
-
Puppet::Network::Client::Master.publicize_methods :use_cached_config do
|
395
|
-
@client.use_cached_config()
|
396
|
-
end
|
397
|
-
|
398
|
-
@client.catalog.should equal(ral_config)
|
399
|
-
end
|
400
|
-
|
401
|
-
describe "when calling splay" do
|
402
|
-
it "should do nothing if splay is not enabled" do
|
403
|
-
Puppet.stubs(:[]).with(:splay).returns(false)
|
404
|
-
@client.expects(:rand).never
|
405
|
-
@client.send(:splay)
|
406
|
-
end
|
407
|
-
|
408
|
-
describe "when splay is enabled" do
|
409
|
-
before do
|
410
|
-
Puppet.stubs(:[]).with(:splay).returns(true)
|
411
|
-
Puppet.stubs(:[]).with(:splaylimit).returns(42)
|
412
|
-
end
|
413
|
-
|
414
|
-
it "should sleep for a random time plus 1" do
|
415
|
-
@client.expects(:rand).with(43).returns(43)
|
416
|
-
@client.expects(:sleep).with(43)
|
417
|
-
@client.send(:splay)
|
418
|
-
end
|
419
|
-
|
420
|
-
it "should inform that it is splayed" do
|
421
|
-
@client.stubs(:rand).with(43).returns(43)
|
422
|
-
@client.stubs(:sleep).with(43)
|
423
|
-
Puppet.expects(:info)
|
424
|
-
@client.send(:splay)
|
425
|
-
end
|
426
|
-
|
427
|
-
it "should set splay = true" do
|
428
|
-
@client.stubs(:rand).returns(43)
|
429
|
-
@client.stubs(:sleep)
|
430
|
-
@client.send(:splay)
|
431
|
-
@client.send(:splayed?).should == true
|
432
|
-
end
|
433
|
-
|
434
|
-
it "should do nothing if already splayed" do
|
435
|
-
@client.stubs(:rand).returns(43).at_most_once
|
436
|
-
@client.stubs(:sleep).at_most_once
|
437
|
-
@client.send(:splay)
|
438
|
-
@client.send(:splay)
|
439
|
-
end
|
440
|
-
end
|
441
|
-
end
|
442
|
-
end
|