puppet 0.24.7 → 0.24.8
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 +72 -0
- data/README.rst +38 -0
- data/Rakefile +3 -1
- data/bin/filebucket +0 -0
- data/bin/puppet +0 -0
- data/bin/puppetca +0 -0
- data/bin/puppetd +0 -0
- data/bin/puppetdoc +0 -0
- data/bin/puppetmasterd +0 -0
- data/bin/puppetrun +0 -0
- data/bin/ralsh +4 -0
- data/conf/gentoo/init.d/puppetmaster +0 -0
- data/conf/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +0 -0
- data/conf/redhat/puppet.spec +20 -3
- data/conf/solaris/smf/svc-puppetd +0 -0
- data/conf/solaris/smf/svc-puppetmasterd +0 -0
- data/examples/etc/init.d/sleeper +0 -0
- data/examples/mac_dscl.pp +0 -0
- data/examples/mac_dscl_revert.pp +0 -0
- data/examples/mac_netinfo.pp +0 -0
- data/examples/mac_pkgdmg.pp +0 -0
- data/ext/bin/sleeper +0 -0
- data/ext/dbfix.sql +132 -0
- data/ext/logcheck/puppet +2 -1
- data/ext/module_puppet +0 -0
- data/ext/nagios/check_puppet.rb +0 -0
- data/ext/puppet-test +0 -0
- data/ext/puppetlast +0 -0
- data/ext/vim/syntax/puppet.vim +2 -1
- data/install.rb +2 -2
- data/lib/puppet.rb +1 -1
- data/lib/puppet/daemon.rb +0 -0
- data/lib/puppet/defaults.rb +9 -0
- data/lib/puppet/executables/client/certhandler.rb +6 -1
- data/lib/puppet/external/base64.rb +0 -0
- data/lib/puppet/external/nagios.rb +0 -0
- data/lib/puppet/external/nagios/base.rb +0 -0
- data/lib/puppet/external/nagios/parser.rb +39 -57
- data/lib/puppet/file_collection.rb +30 -0
- data/lib/puppet/file_collection/lookup.rb +20 -0
- data/lib/puppet/indirector/facts/facter.rb +6 -2
- data/lib/puppet/indirector/node/ldap.rb +75 -39
- data/lib/puppet/network/authstore.rb +0 -0
- data/lib/puppet/network/handler/filebucket.rb +0 -0
- data/lib/puppet/network/handler/fileserver.rb +0 -0
- data/lib/puppet/network/handler/report.rb +0 -0
- data/lib/puppet/network/handler/resource.rb +0 -0
- data/lib/puppet/network/handler/runner.rb +0 -0
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/network/xmlrpc/client.rb +113 -53
- data/lib/puppet/node/facts.rb +0 -0
- data/lib/puppet/parser/ast.rb +4 -3
- data/lib/puppet/parser/ast/astarray.rb +2 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/resource.rb +20 -20
- data/lib/puppet/parser/ast/resource_override.rb +2 -2
- data/lib/puppet/parser/collector.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +93 -0
- data/lib/puppet/parser/functions/sprintf.rb +17 -0
- data/lib/puppet/parser/functions/versioncmp.rb +10 -0
- data/lib/puppet/parser/resource.rb +10 -6
- data/lib/puppet/parser/resource/param.rb +17 -14
- data/lib/puppet/parser/resource/reference.rb +2 -0
- data/lib/puppet/parser/scope.rb +3 -3
- data/lib/puppet/property/list.rb +5 -1
- data/lib/puppet/provider/augeas/augeas.rb +146 -44
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/mailalias/aliases.rb +0 -0
- data/lib/puppet/provider/maillist/mailman.rb +0 -0
- data/lib/puppet/provider/mount/parsed.rb +0 -0
- data/lib/puppet/provider/naginator.rb +7 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +128 -44
- data/lib/puppet/provider/package/apple.rb +0 -0
- data/lib/puppet/provider/package/apt.rb +0 -0
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +0 -0
- data/lib/puppet/provider/package/darwinport.rb +0 -0
- data/lib/puppet/provider/package/dpkg.rb +0 -0
- data/lib/puppet/provider/package/fink.rb +0 -0
- data/lib/puppet/provider/package/freebsd.rb +0 -0
- data/lib/puppet/provider/package/gem.rb +0 -0
- data/lib/puppet/provider/package/openbsd.rb +0 -0
- data/lib/puppet/provider/package/ports.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +0 -0
- data/lib/puppet/provider/package/sun.rb +0 -0
- data/lib/puppet/provider/package/sunfreeware.rb +0 -0
- data/lib/puppet/provider/package/up2date.rb +4 -2
- data/lib/puppet/provider/package/yum.rb +0 -0
- data/lib/puppet/provider/parsedfile.rb +47 -22
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/debian.rb +0 -0
- data/lib/puppet/provider/service/gentoo.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -0
- data/lib/puppet/provider/service/launchd.rb +13 -4
- data/lib/puppet/provider/service/redhat.rb +5 -5
- data/lib/puppet/provider/service/smf.rb +0 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +43 -16
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +6 -2
- data/lib/puppet/rails/host.rb +70 -19
- data/lib/puppet/rails/param_value.rb +31 -12
- data/lib/puppet/rails/resource.rb +36 -9
- data/lib/puppet/rails/resource_tag.rb +18 -0
- data/lib/puppet/reference/report.rb +1 -0
- data/lib/puppet/reports.rb +0 -0
- data/lib/puppet/sslcertificates.rb +0 -0
- data/lib/puppet/transaction.rb +1 -1
- data/lib/puppet/type.rb +2 -6
- data/lib/puppet/type/augeas.rb +23 -15
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +0 -0
- data/lib/puppet/type/file/checksum.rb +7 -35
- data/lib/puppet/type/file/content.rb +11 -8
- data/lib/puppet/type/file/ensure.rb +0 -0
- data/lib/puppet/type/file/group.rb +0 -0
- data/lib/puppet/type/file/mode.rb +0 -0
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/selcontext.rb +8 -0
- data/lib/puppet/type/file/source.rb +0 -0
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +0 -0
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +0 -0
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +0 -0
- data/lib/puppet/type/ssh_authorized_key.rb +14 -0
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +0 -0
- data/lib/puppet/type/user.rb +6 -0
- data/lib/puppet/type/yumrepo.rb +4 -1
- data/lib/puppet/type/zfs.rb +0 -0
- data/lib/puppet/type/zpool.rb +0 -0
- data/lib/puppet/util/autoload.rb +2 -2
- data/lib/puppet/util/filetype.rb +7 -96
- data/lib/puppet/util/inifile.rb +1 -0
- data/lib/puppet/util/instance_loader.rb +0 -0
- data/lib/puppet/util/loadedfile.rb +0 -0
- data/lib/puppet/util/nagios_maker.rb +4 -0
- data/lib/puppet/util/package.rb +2 -0
- data/lib/puppet/util/posix.rb +0 -0
- data/lib/puppet/util/rails/reference_serializer.rb +18 -0
- data/lib/puppet/util/selinux.rb +3 -1
- data/spec/integration/checksum.rb +1 -0
- data/spec/integration/defaults.rb +9 -0
- data/spec/integration/file_serving/configuration.rb +0 -0
- data/spec/integration/file_serving/content.rb +0 -0
- data/spec/integration/file_serving/metadata.rb +0 -0
- data/spec/integration/indirector/direct_file_server.rb +0 -0
- data/spec/integration/indirector/file_content/file_server.rb +0 -0
- data/spec/integration/indirector/file_metadata/file_server.rb +0 -0
- data/spec/integration/indirector/module_files.rb +0 -0
- data/spec/integration/indirector/node/ldap.rb +0 -0
- data/spec/integration/indirector/rest.rb +0 -0
- data/spec/integration/network/server/mongrel.rb +0 -0
- data/spec/integration/network/server/webrick.rb +0 -0
- data/spec/integration/node.rb +0 -0
- data/spec/integration/node/catalog.rb +0 -0
- data/spec/integration/node/facts.rb +0 -0
- data/spec/integration/provider/package.rb +0 -0
- data/spec/integration/provider/service/init.rb +0 -0
- data/spec/integration/reference/providers.rb +0 -0
- data/spec/integration/reports.rb +4 -0
- data/spec/integration/transaction/report.rb +7 -1
- data/spec/integration/type/package.rb +5 -2
- data/spec/integration/util/file_locking.rb +0 -0
- data/spec/unit/executables/client/certhandler.rb +13 -0
- data/spec/unit/file_collection.rb +53 -0
- data/spec/unit/file_collection/lookup.rb +46 -0
- data/spec/unit/file_serving/configuration.rb +0 -0
- data/spec/unit/file_serving/configuration/parser.rb +0 -0
- data/spec/unit/file_serving/content.rb +0 -0
- data/spec/unit/file_serving/file_base.rb +0 -0
- data/spec/unit/file_serving/fileset.rb +0 -0
- data/spec/unit/file_serving/indirection_hooks.rb +0 -0
- data/spec/unit/file_serving/metadata.rb +0 -0
- data/spec/unit/file_serving/mount.rb +0 -0
- data/spec/unit/file_serving/terminus_helper.rb +0 -0
- data/spec/unit/indirector.rb +0 -0
- data/spec/unit/indirector/catalog/compiler.rb +0 -0
- data/spec/unit/indirector/catalog/yaml.rb +0 -0
- data/spec/unit/indirector/checksum/file.rb +0 -0
- data/spec/unit/indirector/code.rb +0 -0
- data/spec/unit/indirector/direct_file_server.rb +0 -0
- data/spec/unit/indirector/envelope.rb +0 -0
- data/spec/unit/indirector/exec.rb +0 -0
- data/spec/unit/indirector/facts/facter.rb +27 -2
- data/spec/unit/indirector/facts/yaml.rb +0 -0
- data/spec/unit/indirector/file.rb +0 -0
- data/spec/unit/indirector/file_content/file.rb +0 -0
- data/spec/unit/indirector/file_content/file_server.rb +0 -0
- data/spec/unit/indirector/file_content/modules.rb +0 -0
- data/spec/unit/indirector/file_content/rest.rb +0 -0
- data/spec/unit/indirector/file_metadata/file.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_server.rb +0 -0
- data/spec/unit/indirector/file_metadata/modules.rb +0 -0
- data/spec/unit/indirector/file_metadata/rest.rb +0 -0
- data/spec/unit/indirector/file_server.rb +0 -0
- data/spec/unit/indirector/indirection.rb +0 -0
- data/spec/unit/indirector/ldap.rb +0 -0
- data/spec/unit/indirector/memory.rb +0 -0
- data/spec/unit/indirector/module_files.rb +0 -0
- data/spec/unit/indirector/node/exec.rb +0 -0
- data/spec/unit/indirector/node/ldap.rb +20 -0
- data/spec/unit/indirector/node/memory.rb +0 -0
- data/spec/unit/indirector/node/plain.rb +0 -0
- data/spec/unit/indirector/node/rest.rb +0 -0
- data/spec/unit/indirector/node/yaml.rb +0 -0
- data/spec/unit/indirector/plain.rb +0 -0
- data/spec/unit/indirector/report/processor.rb +0 -0
- data/spec/unit/indirector/request.rb +0 -0
- data/spec/unit/indirector/rest.rb +0 -0
- data/spec/unit/indirector/ssl_rsa/file.rb +5 -0
- data/spec/unit/indirector/terminus.rb +0 -0
- data/spec/unit/indirector/yaml.rb +0 -0
- data/spec/unit/module.rb +0 -0
- data/spec/unit/network/client.rb +0 -0
- data/spec/unit/network/client/master.rb +0 -0
- data/spec/unit/network/http.rb +0 -0
- data/spec/unit/network/http/mongrel.rb +0 -0
- data/spec/unit/network/http/mongrel/rest.rb +0 -0
- data/spec/unit/network/http/mongrel/xmlrpc.rb +0 -0
- data/spec/unit/network/http/webrick.rb +0 -0
- data/spec/unit/network/http/webrick/rest.rb +0 -0
- data/spec/unit/network/http/webrick/xmlrpc.rb +0 -0
- data/spec/unit/network/http_pool.rb +0 -0
- data/spec/unit/network/server.rb +0 -0
- data/spec/unit/network/xmlrpc/client.rb +165 -7
- data/spec/unit/node.rb +0 -0
- data/spec/unit/node/catalog.rb +1 -0
- data/spec/unit/node/environment.rb +0 -0
- data/spec/unit/node/facts.rb +0 -0
- data/spec/unit/other/checksum.rb +0 -0
- data/spec/unit/other/pgraph.rb +0 -0
- data/spec/unit/other/transbucket.rb +4 -4
- data/spec/unit/other/transobject.rb +0 -0
- data/spec/unit/parameter.rb +0 -0
- data/spec/unit/parser/ast.rb +5 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +0 -0
- data/spec/unit/parser/ast/astarray.rb +2 -2
- data/spec/unit/parser/ast/boolean_operator.rb +0 -0
- data/spec/unit/parser/ast/collexpr.rb +0 -0
- data/spec/unit/parser/ast/comparison_operator.rb +0 -0
- data/spec/unit/parser/ast/definition.rb +0 -0
- data/spec/unit/parser/ast/hostclass.rb +0 -0
- data/spec/unit/parser/ast/minus.rb +0 -0
- data/spec/unit/parser/ast/node.rb +0 -0
- data/spec/unit/parser/ast/nop.rb +0 -0
- data/spec/unit/parser/ast/not.rb +0 -0
- data/spec/unit/parser/ast/resource.rb +103 -0
- data/spec/unit/parser/ast/resource_override.rb +0 -0
- data/spec/unit/parser/ast/resource_reference.rb +0 -0
- data/spec/unit/parser/ast/vardef.rb +0 -0
- data/spec/unit/parser/collector.rb +4 -4
- data/spec/unit/parser/compiler.rb +0 -0
- data/spec/unit/parser/functions/realize.rb +51 -0
- data/spec/unit/parser/functions/regsubst.rb +88 -0
- data/spec/unit/parser/functions/sprintf.rb +42 -0
- data/spec/unit/parser/functions/versioncmp.rb +29 -0
- data/spec/unit/parser/interpreter.rb +0 -0
- data/spec/unit/parser/lexer.rb +0 -0
- data/spec/unit/parser/parser.rb +0 -0
- data/spec/unit/parser/resource.rb +4 -0
- data/spec/unit/parser/resource/reference.rb +4 -0
- data/spec/unit/parser/scope.rb +14 -0
- data/spec/unit/parser/templatewrapper.rb +0 -0
- data/spec/unit/property.rb +0 -0
- data/spec/unit/property/list.rb +4 -0
- data/spec/unit/provider/augeas/augeas.rb +219 -92
- data/spec/unit/provider/confine.rb +0 -0
- data/spec/unit/provider/confine/exists.rb +0 -0
- data/spec/unit/provider/confine/false.rb +0 -0
- data/spec/unit/provider/confine/feature.rb +0 -0
- data/spec/unit/provider/confine/true.rb +0 -0
- data/spec/unit/provider/confine/variable.rb +0 -0
- data/spec/unit/provider/confine_collection.rb +0 -0
- data/spec/unit/provider/confiner.rb +0 -0
- data/spec/unit/provider/group/groupadd.rb +0 -0
- data/spec/unit/provider/group/ldap.rb +0 -0
- data/spec/unit/provider/ldap.rb +0 -0
- data/spec/unit/provider/macauthorization.rb +0 -0
- data/spec/unit/provider/mcx/mcxcontent.rb +0 -0
- data/spec/unit/provider/mount.rb +0 -0
- data/spec/unit/provider/mount/parsed.rb +1 -0
- data/spec/unit/provider/naginator.rb +58 -0
- data/spec/unit/provider/package/apt.rb +0 -0
- data/spec/unit/provider/package/dpkg.rb +0 -0
- data/spec/unit/provider/parsedfile.rb +95 -0
- data/spec/unit/provider/selboolean.rb +0 -0
- data/spec/unit/provider/selmodule.rb +0 -0
- data/spec/unit/provider/service/launchd.rb +9 -1
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +63 -19
- data/spec/unit/provider/user/hpux.rb +0 -0
- data/spec/unit/provider/user/ldap.rb +0 -0
- data/spec/unit/provider/user/useradd.rb +0 -0
- data/spec/unit/provider/zfs/solaris.rb +0 -0
- data/spec/unit/provider/zone/solaris.rb +0 -0
- data/spec/unit/provider/zpool/solaris.rb +0 -0
- data/spec/unit/rails.rb +1 -0
- data/spec/unit/relationship.rb +0 -0
- data/spec/unit/reports.rb +0 -0
- data/spec/unit/resource_reference.rb +0 -0
- data/spec/unit/simple_graph.rb +0 -0
- data/spec/unit/{other/transaction.rb → transaction.rb} +16 -1
- data/spec/unit/transaction/change.rb +0 -0
- data/spec/unit/transaction/event.rb +0 -0
- data/spec/unit/transaction/report.rb +0 -0
- data/spec/unit/type.rb +0 -0
- data/spec/unit/type/computer.rb +0 -0
- data/spec/unit/type/exec.rb +0 -0
- data/spec/unit/type/file.rb +2 -0
- data/spec/unit/type/file/content.rb +30 -0
- data/spec/unit/type/file/ensure.rb +0 -0
- data/spec/unit/type/file/group.rb +0 -0
- data/spec/unit/type/file/owner.rb +0 -0
- data/spec/unit/type/file/selinux.rb +6 -0
- data/spec/unit/type/group.rb +3 -0
- data/spec/unit/type/macauthorization.rb +0 -0
- data/spec/unit/type/mcx.rb +0 -0
- data/spec/unit/type/mount.rb +0 -0
- data/spec/unit/type/nagios.rb +0 -0
- data/spec/unit/type/noop_metaparam.rb +1 -0
- data/spec/unit/type/package.rb +0 -0
- data/spec/unit/type/schedule.rb +0 -0
- data/spec/unit/type/selboolean.rb +0 -0
- data/spec/unit/type/selmodule.rb +0 -0
- data/spec/unit/type/service.rb +0 -0
- data/spec/unit/type/ssh_authorized_key.rb +31 -8
- data/spec/unit/type/tidy.rb +4 -0
- data/spec/unit/type/user.rb +17 -0
- data/spec/unit/type/zfs.rb +0 -0
- data/spec/unit/type/zone.rb +0 -0
- data/spec/unit/type/zpool.rb +0 -0
- data/spec/unit/util/autoload.rb +39 -0
- data/spec/unit/util/checksums.rb +0 -0
- data/spec/unit/util/constant_inflector.rb +0 -0
- data/spec/unit/util/file_locking.rb +0 -0
- data/spec/unit/util/filetype.rb +110 -0
- data/spec/unit/util/ldap/connection.rb +0 -0
- data/spec/unit/util/ldap/generator.rb +0 -0
- data/spec/unit/util/ldap/manager.rb +0 -0
- data/spec/unit/util/loadedfile.rb +0 -0
- data/spec/unit/util/log.rb +0 -0
- data/spec/unit/util/metric.rb +0 -0
- data/spec/unit/util/nagios_maker.rb +32 -34
- data/spec/unit/util/package.rb +21 -0
- data/spec/unit/util/posix.rb +0 -0
- data/spec/unit/util/resource_template.rb +0 -0
- data/spec/unit/util/settings.rb +0 -0
- data/spec/unit/util/storage.rb +0 -0
- data/spec/unit/util/tagging.rb +0 -0
- data/spec/unit/util/uri_helper.rb +0 -0
- data/spec/unit/util/warnings.rb +0 -0
- data/test/certmgr/ca.rb +0 -0
- data/test/certmgr/certmgr.rb +0 -0
- data/test/certmgr/inventory.rb +0 -0
- data/test/certmgr/support.rb +0 -0
- data/test/data/snippets/subclass_name_duplication.pp +0 -0
- data/test/executables/filebucket.rb +6 -3
- data/test/executables/puppetbin.rb +1 -1
- data/test/executables/puppetca.rb +0 -0
- data/test/executables/puppetd.rb +0 -0
- data/test/executables/puppetmasterd.rb +0 -0
- data/test/executables/puppetmodule.rb +0 -0
- data/test/language/ast.rb +0 -0
- data/test/language/ast/casestatement.rb +0 -0
- data/test/language/ast/resource.rb +0 -0
- data/test/language/ast/resource_reference.rb +0 -0
- data/test/language/ast/selector.rb +0 -0
- data/test/language/ast/variable.rb +0 -0
- data/test/language/functions.rb +0 -0
- data/test/language/parser.rb +0 -0
- data/test/language/resource.rb +0 -40
- data/test/language/scope.rb +0 -0
- data/test/language/snippets.rb +0 -0
- data/test/language/transportable.rb +0 -0
- data/test/lib/puppettest.rb +3 -0
- data/test/lib/puppettest/support/resources.rb +0 -0
- data/test/network/authconfig.rb +0 -0
- data/test/network/authorization.rb +0 -0
- data/test/network/authstore.rb +0 -0
- data/test/network/client/ca.rb +0 -0
- data/test/network/client/client.rb +0 -0
- data/test/network/client/dipper.rb +0 -0
- data/test/network/client/master.rb +0 -0
- data/test/network/client/resource.rb +0 -0
- data/test/network/client_request.rb +0 -0
- data/test/network/daemon.rb +0 -0
- data/test/network/handler/bucket.rb +0 -0
- data/test/network/handler/ca.rb +0 -0
- data/test/network/handler/fileserver.rb +0 -0
- data/test/network/handler/handler.rb +0 -0
- data/test/network/handler/master.rb +0 -0
- data/test/network/handler/report.rb +0 -0
- data/test/network/handler/resource.rb +0 -0
- data/test/network/handler/runner.rb +0 -0
- data/test/network/rights.rb +0 -0
- data/test/network/server/mongrel_test.rb +0 -0
- data/test/network/server/webrick.rb +0 -0
- data/test/network/xmlrpc/client.rb +0 -0
- data/test/network/xmlrpc/processor.rb +0 -0
- data/test/network/xmlrpc/server.rb +0 -0
- data/test/network/xmlrpc/webrick_servlet.rb +0 -0
- data/test/other/dsl.rb +0 -0
- data/test/other/events.rb +0 -0
- data/test/other/overrides.rb +0 -0
- data/test/other/provider.rb +0 -0
- data/test/other/puppet.rb +0 -0
- data/test/other/relationships.rb +0 -0
- data/test/other/report.rb +0 -0
- data/test/other/transactions.rb +0 -0
- data/test/puppet/conffiles.rb +0 -0
- data/test/puppet/defaults.rb +0 -0
- data/test/puppet/errortest.rb +0 -0
- data/test/puppet/tc_suidmanager.rb +0 -0
- data/test/rails/ast.rb +0 -0
- data/test/rails/configuration.rb +0 -0
- data/test/rails/host.rb +0 -0
- data/test/rails/rails.rb +0 -0
- data/test/rails/railsparameter.rb +0 -0
- data/test/rails/railsresource.rb +0 -0
- data/test/ral/manager/attributes.rb +0 -0
- data/test/ral/manager/instances.rb +0 -0
- data/test/ral/manager/manager.rb +0 -0
- data/test/ral/manager/provider.rb +0 -0
- data/test/ral/manager/type.rb +0 -3
- data/test/ral/providers/cron/crontab.rb +0 -0
- data/test/ral/providers/group.rb +0 -0
- data/test/ral/providers/host/netinfo.rb +0 -0
- data/test/ral/providers/host/parsed.rb +0 -0
- data/test/ral/providers/mailalias/aliases.rb +0 -0
- data/test/ral/providers/mount/netinfo.rb +0 -0
- data/test/ral/providers/nameservice.rb +0 -0
- data/test/ral/providers/package.rb +0 -0
- data/test/ral/providers/package/aptitude.rb +0 -0
- data/test/ral/providers/package/aptrpm.rb +0 -0
- data/test/ral/providers/parsedfile.rb +0 -0
- data/test/ral/providers/port/parsed.rb +0 -0
- data/test/ral/providers/provider.rb +0 -0
- data/test/ral/providers/service/base.rb +0 -0
- data/test/ral/providers/service/debian.rb +0 -0
- data/test/ral/providers/sshkey/parsed.rb +0 -0
- data/test/ral/providers/user.rb +0 -0
- data/test/ral/providers/user/useradd.rb +0 -0
- data/test/ral/type/basic.rb +0 -0
- data/test/ral/type/cron.rb +0 -0
- data/test/ral/type/exec.rb +0 -0
- data/test/ral/type/file.rb +0 -0
- data/test/ral/type/file/target.rb +0 -0
- data/test/ral/type/filebucket.rb +0 -0
- data/test/ral/type/fileignoresource.rb +0 -0
- data/test/ral/type/filesources.rb +0 -0
- data/test/ral/type/group.rb +0 -0
- data/test/ral/type/host.rb +0 -0
- data/test/ral/type/mailalias.rb +0 -0
- data/test/ral/type/parameter.rb +0 -0
- data/test/ral/type/port.rb +0 -0
- data/test/ral/type/property.rb +0 -0
- data/test/ral/type/resources.rb +0 -0
- data/test/ral/type/service.rb +0 -0
- data/test/ral/type/sshkey.rb +0 -0
- data/test/ral/type/tidy.rb +0 -0
- data/test/ral/type/user.rb +0 -0
- data/test/ral/type/yumrepo.rb +0 -0
- data/test/ral/type/zone.rb +0 -0
- data/test/test +0 -0
- data/test/util/autoload.rb +0 -0
- data/test/util/classgen.rb +0 -0
- data/test/util/execution.rb +0 -0
- data/test/util/features.rb +0 -0
- data/test/util/fileparsing.rb +0 -0
- data/test/util/inifile.rb +0 -0
- data/test/util/instance_loader.rb +0 -0
- data/test/util/log.rb +0 -0
- data/test/util/metrics.rb +0 -0
- data/test/util/package.rb +0 -0
- data/test/util/pidlock.rb +0 -0
- data/test/util/settings.rb +0 -0
- data/test/util/storage.rb +0 -0
- data/test/util/subclass_loader.rb +0 -0
- data/test/util/utiltest.rb +0 -0
- metadata +981 -968
- data/test/util/filetype.rb +0 -137
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -22,6 +22,7 @@ end
|
|
22
22
|
|
23
23
|
describe Puppet::Indirector::SslRsa::File, " when choosing a path for a ca key" do
|
24
24
|
before do
|
25
|
+
Puppet.settings.stubs(:use)
|
25
26
|
@file = Puppet::Indirector::SslRsa::File.new
|
26
27
|
@name = :ca
|
27
28
|
end
|
@@ -38,6 +39,7 @@ end
|
|
38
39
|
|
39
40
|
describe Puppet::Indirector::SslRsa::File, " when choosing a path for a non-ca key" do
|
40
41
|
before do
|
42
|
+
Puppet.settings.stubs(:use)
|
41
43
|
@file = Puppet::Indirector::SslRsa::File.new
|
42
44
|
@name = :publickey
|
43
45
|
end
|
@@ -54,6 +56,7 @@ end
|
|
54
56
|
|
55
57
|
describe Puppet::Indirector::SslRsa::File, " when saving" do
|
56
58
|
before do
|
59
|
+
Puppet.settings.stubs(:use)
|
57
60
|
@file = Puppet::Indirector::SslRsa::File.new
|
58
61
|
|
59
62
|
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
@@ -72,6 +75,7 @@ end
|
|
72
75
|
|
73
76
|
describe Puppet::Indirector::SslRsa::File, " when finding a key by name" do
|
74
77
|
before do
|
78
|
+
Puppet.settings.stubs(:use)
|
75
79
|
@file = Puppet::Indirector::SslRsa::File.new
|
76
80
|
|
77
81
|
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
@@ -95,6 +99,7 @@ end
|
|
95
99
|
|
96
100
|
describe Puppet::Indirector::SslRsa::File, " when removing a key" do
|
97
101
|
before do
|
102
|
+
Puppet.settings.stubs(:use)
|
98
103
|
@file = Puppet::Indirector::SslRsa::File.new
|
99
104
|
|
100
105
|
Puppet.settings.stubs(:value).with(:publickeydir).returns("/dir")
|
File without changes
|
File without changes
|
data/spec/unit/module.rb
CHANGED
File without changes
|
data/spec/unit/network/client.rb
CHANGED
File without changes
|
File without changes
|
data/spec/unit/network/http.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/unit/network/server.rb
CHANGED
File without changes
|
@@ -2,12 +2,170 @@
|
|
2
2
|
|
3
3
|
Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }
|
4
4
|
|
5
|
-
describe Puppet::Network do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
describe Puppet::Network::XMLRPCClient do
|
6
|
+
describe "when performing the rpc call" do
|
7
|
+
before do
|
8
|
+
@client = Puppet::Network::Client.report.xmlrpc_client.new
|
9
|
+
@client.stubs(:call).returns "foo"
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should call the specified namespace and method, with the specified arguments" do
|
14
|
+
@client.expects(:call).with("puppetreports.report", "eh").returns "foo"
|
15
|
+
@client.report("eh")
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should return the results from the call" do
|
19
|
+
@client.expects(:call).returns "foo"
|
20
|
+
@client.report("eh").should == "foo"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should always close the http connection if it is still open after the call" do
|
24
|
+
http = mock 'http'
|
25
|
+
@client.stubs(:http).returns http
|
26
|
+
|
27
|
+
http.expects(:started?).returns true
|
28
|
+
http.expects(:finish)
|
29
|
+
|
30
|
+
@client.report("eh").should == "foo"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should always close the http connection if it is still open after a call that raises an exception" do
|
34
|
+
http = mock 'http'
|
35
|
+
@client.stubs(:http).returns http
|
36
|
+
|
37
|
+
@client.expects(:call).raises RuntimeError
|
38
|
+
|
39
|
+
http.expects(:started?).returns true
|
40
|
+
http.expects(:finish)
|
41
|
+
|
42
|
+
lambda { @client.report("eh") }.should raise_error
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "when returning the http instance" do
|
46
|
+
it "should use the http pool to create the instance" do
|
47
|
+
@client.instance_variable_set("@http", nil)
|
48
|
+
@client.expects(:host).returns "myhost"
|
49
|
+
@client.expects(:port).returns "myport"
|
50
|
+
Puppet::Network::HttpPool.expects(:http_instance).with("myhost", "myport", true).returns "http"
|
51
|
+
|
52
|
+
@client.http.should == "http"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should reuse existing instances" do
|
56
|
+
@client.http.should equal(@client.http)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe "when recycling the connection" do
|
61
|
+
it "should close the existing instance if it's open" do
|
62
|
+
http = mock 'http'
|
63
|
+
@client.stubs(:http).returns http
|
64
|
+
|
65
|
+
http.expects(:started?).returns true
|
66
|
+
http.expects(:finish)
|
67
|
+
|
68
|
+
@client.recycle_connection
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should force creation of a new instance" do
|
72
|
+
Puppet::Network::HttpPool.expects(:http_instance).returns "second_http"
|
73
|
+
|
74
|
+
@client.recycle_connection
|
75
|
+
|
76
|
+
@client.http.should == "second_http"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "and an exception is raised" do
|
81
|
+
it "should raise XMLRPCClientError if XMLRPC::FaultException is raised" do
|
82
|
+
error = XMLRPC::FaultException.new("foo", "bar")
|
83
|
+
|
84
|
+
@client.expects(:call).raises(error)
|
85
|
+
|
86
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "should raise XMLRPCClientError if Errno::ECONNREFUSED is raised" do
|
90
|
+
@client.expects(:call).raises(Errno::ECONNREFUSED)
|
91
|
+
|
92
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should log and raise XMLRPCClientError if Timeout::Error is raised" do
|
96
|
+
Puppet.expects(:err)
|
97
|
+
@client.expects(:call).raises(Timeout::Error)
|
98
|
+
|
99
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should log and raise XMLRPCClientError if SocketError is raised" do
|
103
|
+
Puppet.expects(:err)
|
104
|
+
@client.expects(:call).raises(SocketError)
|
105
|
+
|
106
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should log, recycle the connection, and retry if Errno::EPIPE is raised" do
|
110
|
+
@client.expects(:call).times(2).raises(Errno::EPIPE).then.returns "eh"
|
111
|
+
|
112
|
+
Puppet.expects(:info)
|
113
|
+
@client.expects(:recycle_connection)
|
114
|
+
|
115
|
+
@client.report("eh")
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should log, recycle the connection, and retry if EOFError is raised" do
|
119
|
+
@client.expects(:call).times(2).raises(EOFError).then.returns "eh"
|
120
|
+
|
121
|
+
Puppet.expects(:info)
|
122
|
+
@client.expects(:recycle_connection)
|
123
|
+
|
124
|
+
@client.report("eh")
|
125
|
+
end
|
126
|
+
|
127
|
+
it "should log and retry if an exception containing 'Wrong size' is raised" do
|
128
|
+
error = RuntimeError.new("Wrong size. Was 15, should be 30")
|
129
|
+
@client.expects(:call).times(2).raises(error).then.returns "eh"
|
130
|
+
|
131
|
+
Puppet.expects(:warning)
|
132
|
+
|
133
|
+
@client.report("eh")
|
134
|
+
end
|
135
|
+
|
136
|
+
it "should raise XMLRPCClientError if OpenSSL::SSL::SSLError is raised" do
|
137
|
+
@client.expects(:call).raises(OpenSSL::SSL::SSLError)
|
138
|
+
|
139
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
140
|
+
end
|
141
|
+
|
142
|
+
it "should log and raise XMLRPCClientError if OpenSSL::SSL::SSLError is raised with certificate issues" do
|
143
|
+
error = OpenSSL::SSL::SSLError.new("hostname was not match")
|
144
|
+
@client.expects(:call).raises(error)
|
145
|
+
|
146
|
+
Puppet.expects(:warning)
|
147
|
+
|
148
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "should log, recycle the connection, and retry if OpenSSL::SSL::SSLError is raised containing 'bad write retry'" do
|
152
|
+
error = OpenSSL::SSL::SSLError.new("bad write retry")
|
153
|
+
@client.expects(:call).times(2).raises(error).then.returns "eh"
|
154
|
+
|
155
|
+
@client.expects(:recycle_connection)
|
156
|
+
|
157
|
+
Puppet.expects(:warning)
|
158
|
+
|
159
|
+
@client.report("eh")
|
160
|
+
end
|
161
|
+
|
162
|
+
it "should log and raise XMLRPCClientError if any other exception is raised" do
|
163
|
+
@client.expects(:call).raises(RuntimeError)
|
164
|
+
|
165
|
+
Puppet.expects(:err)
|
166
|
+
|
167
|
+
lambda { @client.report("eh") }.should raise_error(Puppet::Network::XMLRPCClientError)
|
168
|
+
end
|
169
|
+
end
|
12
170
|
end
|
13
171
|
end
|
data/spec/unit/node.rb
CHANGED
File without changes
|
data/spec/unit/node/catalog.rb
CHANGED
@@ -794,6 +794,7 @@ describe Puppet::Node::Catalog, " when writing dot files" do
|
|
794
794
|
end
|
795
795
|
|
796
796
|
it "should write a dot file based on the passed name" do
|
797
|
+
Puppet.settings.stubs(:use)
|
797
798
|
File.expects(:open).with(@file, "w").yields(stub("file", :puts => nil))
|
798
799
|
@catalog.expects(:to_dot).with("name" => @name.to_s.capitalize)
|
799
800
|
@catalog.host_config = true
|
File without changes
|
data/spec/unit/node/facts.rb
CHANGED
File without changes
|
data/spec/unit/other/checksum.rb
CHANGED
File without changes
|
data/spec/unit/other/pgraph.rb
CHANGED
File without changes
|
@@ -70,20 +70,20 @@ describe Puppet::TransBucket, " when generating a catalog" do
|
|
70
70
|
@bottom = Puppet::TransBucket.new
|
71
71
|
@bottom.type = "fake"
|
72
72
|
@bottom.name = "bottom"
|
73
|
-
@bottomobj = Puppet::TransObject.new("bottom", "
|
73
|
+
@bottomobj = Puppet::TransObject.new("bottom", "notify")
|
74
74
|
@bottom.push @bottomobj
|
75
75
|
|
76
76
|
@middle = Puppet::TransBucket.new
|
77
77
|
@middle.type = "fake"
|
78
78
|
@middle.name = "middle"
|
79
|
-
@middleobj = Puppet::TransObject.new("middle", "
|
79
|
+
@middleobj = Puppet::TransObject.new("middle", "notify")
|
80
80
|
@middle.push(@middleobj)
|
81
81
|
@middle.push(@bottom)
|
82
82
|
|
83
83
|
@top = Puppet::TransBucket.new
|
84
84
|
@top.type = "fake"
|
85
85
|
@top.name = "top"
|
86
|
-
@topobj = Puppet::TransObject.new("top", "
|
86
|
+
@topobj = Puppet::TransObject.new("top", "notify")
|
87
87
|
@top.push(@topobj)
|
88
88
|
@top.push(@middle)
|
89
89
|
|
@@ -98,7 +98,7 @@ describe Puppet::TransBucket, " when generating a catalog" do
|
|
98
98
|
it "should convert all transportable objects to RAL resources" do
|
99
99
|
@catalog = @top.to_catalog
|
100
100
|
@users.each do |name|
|
101
|
-
@catalog.vertices.find { |r| r.class.name == :
|
101
|
+
@catalog.vertices.find { |r| r.class.name == :notify and r.title == name }.should be_instance_of(Puppet::Type.type(:notify))
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
File without changes
|
data/spec/unit/parameter.rb
CHANGED
File without changes
|
data/spec/unit/parser/ast.rb
CHANGED
@@ -5,6 +5,10 @@ require File.dirname(__FILE__) + '/../../spec_helper'
|
|
5
5
|
require 'puppet/parser/ast'
|
6
6
|
|
7
7
|
describe Puppet::Parser::AST do
|
8
|
+
|
9
|
+
it "should use the file lookup module" do
|
10
|
+
Puppet::Parser::AST.ancestors.should be_include(Puppet::FileCollection::Lookup)
|
11
|
+
end
|
8
12
|
|
9
13
|
it "should have a doc accessor" do
|
10
14
|
ast = Puppet::Parser::AST.new({})
|
@@ -34,4 +38,4 @@ describe Puppet::Parser::AST do
|
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
37
|
-
end
|
41
|
+
end
|
File without changes
|
@@ -49,7 +49,7 @@ describe Puppet::Parser::AST::ASTArray do
|
|
49
49
|
operator.evaluate(@scope).should == [123]
|
50
50
|
end
|
51
51
|
|
52
|
-
it "should flatten the results of children evaluation" do
|
52
|
+
it "should not flatten the results of children evaluation" do
|
53
53
|
item1 = stub "item1", :is_a? => true
|
54
54
|
item2 = stub "item2"
|
55
55
|
item2.stubs(:is_a?).with(Puppet::Parser::AST).returns(true)
|
@@ -59,7 +59,7 @@ describe Puppet::Parser::AST::ASTArray do
|
|
59
59
|
item1.expects(:safeevaluate).with(@scope).returns([123])
|
60
60
|
|
61
61
|
operator = Puppet::Parser::AST::ASTArray.new :children => [item2]
|
62
|
-
operator.evaluate(@scope).should == [123]
|
62
|
+
operator.evaluate(@scope).should == [[123]]
|
63
63
|
end
|
64
64
|
|
65
65
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/unit/parser/ast/nop.rb
CHANGED
File without changes
|
data/spec/unit/parser/ast/not.rb
CHANGED
File without changes
|
@@ -0,0 +1,103 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
4
|
+
|
5
|
+
describe Puppet::Parser::AST::Resource do
|
6
|
+
ast = Puppet::Parser::AST
|
7
|
+
|
8
|
+
before :each do
|
9
|
+
@title = stub_everything 'title'
|
10
|
+
@compiler = stub_everything 'compiler'
|
11
|
+
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
|
12
|
+
@param1 = stub_everything 'parameter', :is_a? => true
|
13
|
+
@scope.stubs(:resource).returns(stub_everything)
|
14
|
+
@params = ast::ASTArray.new( :children => [@param1])
|
15
|
+
@resource = ast::Resource.new(:title => @title, :type => "Resource", :params => @params )
|
16
|
+
@resource.stubs(:qualified_type).returns("Resource")
|
17
|
+
Puppet::Parser::Resource.stubs(:new).returns(stub_everything)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should evaluate all its parameters" do
|
21
|
+
@param1.expects(:safeevaluate).with(@scope)
|
22
|
+
|
23
|
+
@resource.evaluate(@scope)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should evaluate its title" do
|
27
|
+
|
28
|
+
@title.expects(:safeevaluate).with(@scope)
|
29
|
+
|
30
|
+
@resource.evaluate(@scope)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should flatten the titles array" do
|
34
|
+
titles = stub 'titles'
|
35
|
+
title_array = stub 'title_array', :is_a? => true
|
36
|
+
|
37
|
+
titles.stubs(:safeevaluate).with(@scope).returns(title_array)
|
38
|
+
|
39
|
+
title_array.expects(:flatten).returns([])
|
40
|
+
|
41
|
+
@resource.title = titles
|
42
|
+
@resource.evaluate(@scope)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should create one resource objects per title" do
|
46
|
+
titles = stub 'titles'
|
47
|
+
title_array = stub 'title_array', :is_a? => true
|
48
|
+
|
49
|
+
title_array.stubs(:flatten).returns([@title])
|
50
|
+
titles.stubs(:safeevaluate).with(@scope).returns(title_array)
|
51
|
+
|
52
|
+
Puppet::Parser::Resource.expects(:new).with { |hash| hash[:title] == @title }
|
53
|
+
|
54
|
+
@resource.title = titles
|
55
|
+
@resource.evaluate(@scope)
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should handover resources to the compiler" do
|
59
|
+
resource = stub 'resource'
|
60
|
+
titles = stub 'titles'
|
61
|
+
title_array = stub 'title_array', :is_a? => true
|
62
|
+
|
63
|
+
title_array.stubs(:flatten).returns([@title])
|
64
|
+
titles.stubs(:safeevaluate).with(@scope).returns(title_array)
|
65
|
+
Puppet::Parser::Resource.stubs(:new).returns(resource)
|
66
|
+
|
67
|
+
@compiler.expects(:add_resource).with(@scope, resource)
|
68
|
+
|
69
|
+
@resource.title = titles
|
70
|
+
@resource.evaluate(@scope)
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should return the newly created resources" do
|
74
|
+
resource = stub 'resource'
|
75
|
+
titles = stub 'titles'
|
76
|
+
title_array = stub 'title_array', :is_a? => true
|
77
|
+
|
78
|
+
title_array.stubs(:flatten).returns([@title])
|
79
|
+
titles.stubs(:safeevaluate).with(@scope).returns(title_array)
|
80
|
+
Puppet::Parser::Resource.stubs(:new).returns(resource)
|
81
|
+
|
82
|
+
@compiler.stubs(:add_resource).with(resource)
|
83
|
+
|
84
|
+
@resource.title = titles
|
85
|
+
@resource.evaluate(@scope).should == [resource]
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should generate virtual resources if it is virtual" do
|
89
|
+
@resource.virtual = true
|
90
|
+
|
91
|
+
Puppet::Parser::Resource.expects(:new).with { |hash| hash[:virtual] == true }
|
92
|
+
|
93
|
+
@resource.evaluate(@scope)
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should generate virtual and exported resources if it is exported" do
|
97
|
+
@resource.exported = true
|
98
|
+
|
99
|
+
Puppet::Parser::Resource.expects(:new).with { |hash| hash[:virtual] == true and hash[:exported] == true }
|
100
|
+
|
101
|
+
@resource.evaluate(@scope)
|
102
|
+
end
|
103
|
+
end
|