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
|
@@ -240,10 +240,10 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
|
|
240
240
|
one = stub 'one', :type => "Mytype", :virtual? => true, :exported? => true
|
241
241
|
two = stub 'two', :type => "Mytype", :virtual? => true, :exported? => true
|
242
242
|
|
243
|
-
one.
|
244
|
-
one.
|
245
|
-
two.
|
246
|
-
two.
|
243
|
+
one.stubs(:exported=)
|
244
|
+
one.stubs(:virtual=)
|
245
|
+
two.stubs(:exported=)
|
246
|
+
two.stubs(:virtual=)
|
247
247
|
|
248
248
|
@compiler.expects(:resources).returns([one, two])
|
249
249
|
|
File without changes
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
4
|
+
|
5
|
+
describe "the realize function" do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@collector = stub_everything 'collector'
|
9
|
+
@scope = Puppet::Parser::Scope.new()
|
10
|
+
@compiler = stub 'compiler'
|
11
|
+
@compiler.stubs(:add_collection).with(@collector)
|
12
|
+
@scope.stubs(:compiler).returns(@compiler)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should exist" do
|
16
|
+
Puppet::Parser::Functions.function("realize").should == "function_realize"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should create a Collector when called" do
|
20
|
+
|
21
|
+
Puppet::Parser::Collector.expects(:new).returns(@collector)
|
22
|
+
|
23
|
+
@scope.function_realize("test")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should assign the passed-in resources to the collector" do
|
27
|
+
Puppet::Parser::Collector.stubs(:new).returns(@collector)
|
28
|
+
|
29
|
+
@collector.expects(:resources=).with(["test"])
|
30
|
+
|
31
|
+
@scope.function_realize("test")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should flatten the resources assigned to the collector" do
|
35
|
+
Puppet::Parser::Collector.stubs(:new).returns(@collector)
|
36
|
+
|
37
|
+
@collector.expects(:resources=).with(["test"])
|
38
|
+
|
39
|
+
@scope.function_realize([["test"]])
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should let the compiler know this collector" do
|
43
|
+
Puppet::Parser::Collector.stubs(:new).returns(@collector)
|
44
|
+
@collector.stubs(:resources=).with(["test"])
|
45
|
+
|
46
|
+
@compiler.expects(:add_collection).with(@collector)
|
47
|
+
|
48
|
+
@scope.function_realize("test")
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
4
|
+
|
5
|
+
describe "the regsubst function" do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@scope = Puppet::Parser::Scope.new()
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should exist" do
|
12
|
+
Puppet::Parser::Functions.function("regsubst").should == "function_regsubst"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should raise a ParseError if there is less than 3 arguments" do
|
16
|
+
lambda { @scope.function_regsubst(["foo", "bar"]) }.should(
|
17
|
+
raise_error(Puppet::ParseError))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should raise a ParseError if there is more than 5 arguments" do
|
21
|
+
lambda { @scope.function_regsubst(["foo", "bar", "gazonk", "del", "x", "y"]) }.should(
|
22
|
+
raise_error(Puppet::ParseError))
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
it "should raise a ParseError when given a bad flag" do
|
27
|
+
lambda { @scope.function_regsubst(["foo", "bar", "gazonk", "X"]) }.should(
|
28
|
+
raise_error(Puppet::ParseError))
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should handle groups" do
|
32
|
+
result = @scope.function_regsubst(
|
33
|
+
[ '130.236.254.10',
|
34
|
+
'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$',
|
35
|
+
'\4-\3-\2-\1'
|
36
|
+
])
|
37
|
+
result.should(eql("10-254-236-130"))
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should handle simple regexps" do
|
41
|
+
result = @scope.function_regsubst(
|
42
|
+
[ "the monkey breaks banana trees",
|
43
|
+
"b[an]*a",
|
44
|
+
"coconut"
|
45
|
+
])
|
46
|
+
result.should(eql("the monkey breaks coconut trees"))
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should handle case-sensitive regexps" do
|
50
|
+
result = @scope.function_regsubst(
|
51
|
+
[ "the monkey breaks baNAna trees",
|
52
|
+
"b[an]+a",
|
53
|
+
"coconut"
|
54
|
+
])
|
55
|
+
result.should(eql("the monkey breaks baNAna trees"))
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should handle case-insensitive regexps" do
|
59
|
+
result = @scope.function_regsubst(
|
60
|
+
[ "the monkey breaks baNAna trees",
|
61
|
+
"b[an]+a",
|
62
|
+
"coconut",
|
63
|
+
"I"
|
64
|
+
])
|
65
|
+
result.should(eql("the monkey breaks coconut trees"))
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should handle global substitutions" do
|
69
|
+
result = @scope.function_regsubst(
|
70
|
+
[ "the monkey breaks\tbanana trees",
|
71
|
+
"[ \t]",
|
72
|
+
"--",
|
73
|
+
"G"
|
74
|
+
])
|
75
|
+
result.should(eql("the--monkey--breaks--banana--trees"))
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should handle global substitutions with groups" do
|
79
|
+
result = @scope.function_regsubst(
|
80
|
+
[ '130.236.254.10',
|
81
|
+
'([0-9]+)',
|
82
|
+
'<\1>',
|
83
|
+
'G'
|
84
|
+
])
|
85
|
+
result.should(eql('<130>.<236>.<254>.<10>'))
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
4
|
+
|
5
|
+
describe "the sprintf function" do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@scope = Puppet::Parser::Scope.new()
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should exist" do
|
12
|
+
Puppet::Parser::Functions.function("sprintf").should == "function_sprintf"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should raise a ParseError if there is less than 1 argument" do
|
16
|
+
lambda { @scope.function_sprintf([]) }.should(
|
17
|
+
raise_error(Puppet::ParseError))
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should format integers" do
|
21
|
+
result = @scope.function_sprintf(["%+05d", "23"])
|
22
|
+
result.should(eql("+0023"))
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should format floats" do
|
26
|
+
result = @scope.function_sprintf(["%+.2f", "2.7182818284590451"])
|
27
|
+
result.should(eql("+2.72"))
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should format large floats" do
|
31
|
+
result = @scope.function_sprintf(["%+.2e", "27182818284590451"])
|
32
|
+
result.should(eql("+2.72e+16"))
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should perform more complex formatting" do
|
36
|
+
result = @scope.function_sprintf(
|
37
|
+
[ "<%.8s:%#5o %#8X (%-8s)>",
|
38
|
+
"overlongstring", "23", "48879", "foo" ])
|
39
|
+
result.should(eql("<overlong: 027 0XBEEF (foo )>"))
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
4
|
+
|
5
|
+
describe "the versioncmp function" do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@scope = Puppet::Parser::Scope.new()
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should exist" do
|
12
|
+
Puppet::Parser::Functions.function("versioncmp").should == "function_versioncmp"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should raise a ParseError if there is less than 2 arguments" do
|
16
|
+
lambda { @scope.function_versioncmp(["1.2"]) }.should raise_error(Puppet::ParseError)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should raise a ParseError if there is more than 2 arguments" do
|
20
|
+
lambda { @scope.function_versioncmp(["1.2", "2.4.5", "3.5.6"]) }.should raise_error(Puppet::ParseError)
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should call Puppet::Util::Package.versioncmp (included in scope)" do
|
24
|
+
Puppet::Util::Package.expects(:versioncmp).with("1.2", "1.3").returns(-1)
|
25
|
+
|
26
|
+
@scope.function_versioncmp(["1.2", "1.3"])
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
File without changes
|
data/spec/unit/parser/lexer.rb
CHANGED
File without changes
|
data/spec/unit/parser/parser.rb
CHANGED
File without changes
|
@@ -44,6 +44,10 @@ describe Puppet::Parser::Resource do
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
it "should use the file lookup module" do
|
48
|
+
Puppet::Parser::Resource.ancestors.should be_include(Puppet::FileCollection::Lookup)
|
49
|
+
end
|
50
|
+
|
47
51
|
it "should be isomorphic if it is builtin and models an isomorphic type" do
|
48
52
|
Puppet::Type.type(:file).expects(:isomorphic?).returns(true)
|
49
53
|
@resource = Puppet::Parser::Resource.new(:type => "file", :title => "whatever", :scope => @scope, :source => @source).isomorphic?.should be_true
|
@@ -7,6 +7,10 @@ describe Puppet::Parser::Resource::Reference do
|
|
7
7
|
@type = Puppet::Parser::Resource::Reference
|
8
8
|
end
|
9
9
|
|
10
|
+
it "should use the file lookup module" do
|
11
|
+
Puppet::Parser::Resource::Reference.ancestors.should be_include(Puppet::FileCollection::Lookup)
|
12
|
+
end
|
13
|
+
|
10
14
|
it "should require a type" do
|
11
15
|
proc { @type.new(:title => "yay") }.should raise_error(Puppet::DevError)
|
12
16
|
end
|
data/spec/unit/parser/scope.rb
CHANGED
@@ -81,7 +81,21 @@ describe Puppet::Parser::Scope do
|
|
81
81
|
Puppet::Parser::Scope.number?("0755").should == 0755
|
82
82
|
end
|
83
83
|
|
84
|
+
it "should return nil on malformed integers" do
|
85
|
+
Puppet::Parser::Scope.number?("0.24.5").should be_nil
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should convert strings with leading 0 to integer if they are not octal" do
|
89
|
+
Puppet::Parser::Scope.number?("0788").should == 788
|
90
|
+
end
|
84
91
|
|
92
|
+
it "should convert strings of negative integers" do
|
93
|
+
Puppet::Parser::Scope.number?("-0788").should == -788
|
94
|
+
end
|
95
|
+
|
96
|
+
it "should return nil on malformed hexadecimal numbers" do
|
97
|
+
Puppet::Parser::Scope.number?("0x89g").should be_nil
|
98
|
+
end
|
85
99
|
end
|
86
100
|
|
87
101
|
end
|
File without changes
|
data/spec/unit/property.rb
CHANGED
File without changes
|
data/spec/unit/property/list.rb
CHANGED
@@ -36,6 +36,10 @@ describe list_class do
|
|
36
36
|
@property.is_to_s(["foo","bar"]).should == "foo,bar"
|
37
37
|
end
|
38
38
|
|
39
|
+
it "should be able to correctly convert ':absent' to a string" do
|
40
|
+
@property.is_to_s(:absent).should == "absent"
|
41
|
+
end
|
42
|
+
|
39
43
|
describe "when adding should to current" do
|
40
44
|
it "should add the arrays when current is an array" do
|
41
45
|
@property.add_should_with_current(["foo"], ["bar"]).should == ["foo", "bar"]
|
@@ -10,229 +10,356 @@ describe provider_class do
|
|
10
10
|
provider = provider_class.new()
|
11
11
|
tokens = provider.parse_commands("set /Jar/Jar Binks")
|
12
12
|
tokens.size.should == 1
|
13
|
-
tokens[0].size.should == 3
|
13
|
+
tokens[0].size.should == 3
|
14
14
|
tokens[0][0].should == "set"
|
15
15
|
tokens[0][1].should == "/Jar/Jar"
|
16
|
-
tokens[0][2].should == "Binks"
|
16
|
+
tokens[0][2].should == "Binks"
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
it "should break apart a multiple line into six tokens" do
|
20
20
|
provider = provider_class.new()
|
21
21
|
tokens = provider.parse_commands("set /Jar/Jar Binks\nrm anakin skywalker")
|
22
22
|
tokens.size.should == 2
|
23
|
-
tokens[0].size.should == 3
|
24
|
-
tokens[1].size.should == 3
|
23
|
+
tokens[0].size.should == 3
|
24
|
+
tokens[1].size.should == 3
|
25
25
|
tokens[0][0].should == "set"
|
26
26
|
tokens[0][1].should == "/Jar/Jar"
|
27
|
-
tokens[0][2].should == "Binks"
|
27
|
+
tokens[0][2].should == "Binks"
|
28
28
|
tokens[1][0].should == "rm"
|
29
29
|
tokens[1][1].should == "anakin"
|
30
|
-
tokens[1][2].should == "skywalker"
|
31
|
-
end
|
32
|
-
|
30
|
+
tokens[1][2].should == "skywalker"
|
31
|
+
end
|
32
|
+
|
33
33
|
it "should handle arrays" do
|
34
34
|
provider = provider_class.new()
|
35
35
|
commands = ["set /Jar/Jar Binks", "rm anakin skywalker"]
|
36
36
|
tokens = provider.parse_commands(commands)
|
37
37
|
tokens.size.should == 2
|
38
|
-
tokens[0].size.should == 3
|
39
|
-
tokens[1].size.should == 3
|
38
|
+
tokens[0].size.should == 3
|
39
|
+
tokens[1].size.should == 3
|
40
40
|
tokens[0][0].should == "set"
|
41
41
|
tokens[0][1].should == "/Jar/Jar"
|
42
|
-
tokens[0][2].should == "Binks"
|
42
|
+
tokens[0][2].should == "Binks"
|
43
43
|
tokens[1][0].should == "rm"
|
44
44
|
tokens[1][1].should == "anakin"
|
45
|
-
tokens[1][2].should == "skywalker"
|
46
|
-
end
|
47
|
-
|
45
|
+
tokens[1][2].should == "skywalker"
|
46
|
+
end
|
47
|
+
|
48
48
|
it "should concat the last values" do
|
49
49
|
provider = provider_class.new()
|
50
50
|
tokens = provider.parse_commands("set /Jar/Jar Binks is my copilot")
|
51
51
|
tokens.size.should == 1
|
52
|
-
tokens[0].size.should == 3
|
52
|
+
tokens[0].size.should == 3
|
53
53
|
tokens[0][0].should == "set"
|
54
54
|
tokens[0][1].should == "/Jar/Jar"
|
55
|
-
tokens[0][2].should == "Binks is my copilot"
|
55
|
+
tokens[0][2].should == "Binks is my copilot"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should accept spaces and and single ticks" do
|
59
|
+
provider = provider_class.new()
|
60
|
+
tokens = provider.parse_commands("set 'Jar Jar' Binks")
|
61
|
+
tokens.size.should == 1
|
62
|
+
tokens[0].size.should == 3
|
63
|
+
tokens[0][0].should == "set"
|
64
|
+
tokens[0][1].should == "Jar Jar"
|
65
|
+
tokens[0][2].should == "Binks"
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should accept spaces in the value and and single ticks" do
|
69
|
+
provider = provider_class.new()
|
70
|
+
tokens = provider.parse_commands("set 'Jar Jar' 'Binks is my copilot'")
|
71
|
+
tokens.size.should == 1
|
72
|
+
tokens[0].size.should == 3
|
73
|
+
tokens[0][0].should == "set"
|
74
|
+
tokens[0][1].should == "Jar Jar"
|
75
|
+
tokens[0][2].should == "Binks is my copilot"
|
76
|
+
end
|
77
|
+
|
78
|
+
it "should accept spaces and and double ticks" do
|
79
|
+
provider = provider_class.new()
|
80
|
+
tokens = provider.parse_commands('set "Jar Jar" Binks')
|
81
|
+
tokens.size.should == 1
|
82
|
+
tokens[0].size.should == 3
|
83
|
+
tokens[0][0].should == "set"
|
84
|
+
tokens[0][1].should == 'Jar Jar'
|
85
|
+
tokens[0][2].should == 'Binks'
|
86
|
+
end
|
87
|
+
|
88
|
+
it "should accept spaces in the value and and double ticks" do
|
89
|
+
provider = provider_class.new()
|
90
|
+
tokens = provider.parse_commands('set "Jar Jar" "Binks is my copilot"')
|
91
|
+
tokens.size.should == 1
|
92
|
+
tokens[0].size.should == 3
|
93
|
+
tokens[0][0].should == "set"
|
94
|
+
tokens[0][1].should == 'Jar Jar'
|
95
|
+
tokens[0][2].should == 'Binks is my copilot'
|
96
|
+
end
|
97
|
+
|
98
|
+
it "should accept mixed ticks" do
|
99
|
+
provider = provider_class.new()
|
100
|
+
tokens = provider.parse_commands('set "Jar Jar" "Some \'Test\'"')
|
101
|
+
tokens.size.should == 1
|
102
|
+
tokens[0].size.should == 3
|
103
|
+
tokens[0][0].should == "set"
|
104
|
+
tokens[0][1].should == 'Jar Jar'
|
105
|
+
tokens[0][2].should == "Some \'Test\'"
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should accept only the last value using ticks" do
|
109
|
+
provider = provider_class.new()
|
110
|
+
tokens = provider.parse_commands('set /Jar/Jar "Binks is my copilot"')
|
111
|
+
tokens.size.should == 1
|
112
|
+
tokens[0].size.should == 3
|
113
|
+
tokens[0][0].should == "set"
|
114
|
+
tokens[0][1].should == '/Jar/Jar'
|
115
|
+
tokens[0][2].should == "Binks is my copilot"
|
116
|
+
end
|
117
|
+
|
118
|
+
it "should accept only the first value using ticks" do
|
119
|
+
provider = provider_class.new()
|
120
|
+
tokens = provider.parse_commands('set "Jar Jar" copilot')
|
121
|
+
tokens.size.should == 1
|
122
|
+
tokens[0].size.should == 3
|
123
|
+
tokens[0][0].should == "set"
|
124
|
+
tokens[0][1].should == 'Jar Jar'
|
125
|
+
tokens[0][2].should == "copilot"
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should accept only the first value using ticks and the last values being concatenated" do
|
129
|
+
provider = provider_class.new()
|
130
|
+
tokens = provider.parse_commands('set "Jar Jar" Binks is my copilot')
|
131
|
+
tokens.size.should == 1
|
132
|
+
tokens[0].size.should == 3
|
133
|
+
tokens[0][0].should == "set"
|
134
|
+
tokens[0][1].should == 'Jar Jar'
|
135
|
+
tokens[0][2].should == "Binks is my copilot"
|
56
136
|
end
|
57
137
|
end
|
58
|
-
|
138
|
+
|
59
139
|
describe "get filters" do
|
60
140
|
before do
|
61
141
|
augeas_stub = stub("augeas", :get => "value")
|
62
|
-
@provider = provider_class.new()
|
63
|
-
@provider.
|
142
|
+
@provider = provider_class.new()
|
143
|
+
@provider.aug= augeas_stub
|
64
144
|
end
|
65
|
-
|
145
|
+
|
66
146
|
it "should return false for a = nonmatch" do
|
67
147
|
command = ["get", "fake value", "==", "value"]
|
68
148
|
@provider.process_get(command).should == true
|
69
149
|
end
|
70
|
-
|
150
|
+
|
71
151
|
it "should return true for a != match" do
|
72
152
|
command = ["get", "fake value", "!=", "value"]
|
73
153
|
@provider.process_get(command).should == false
|
74
|
-
end
|
75
|
-
|
154
|
+
end
|
155
|
+
|
76
156
|
it "should return true for a =~ match" do
|
77
157
|
command = ["get", "fake value", "=~", "val*"]
|
78
158
|
@provider.process_get(command).should == true
|
79
|
-
end
|
80
|
-
|
159
|
+
end
|
160
|
+
|
81
161
|
it "should return false for a == nonmatch" do
|
82
162
|
command = ["get", "fake value", "=~", "num*"]
|
83
163
|
@provider.process_get(command).should == false
|
84
|
-
end
|
164
|
+
end
|
85
165
|
end
|
86
|
-
|
166
|
+
|
87
167
|
describe "match filters" do
|
88
168
|
before do
|
89
169
|
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
|
90
|
-
@provider = provider_class.new()
|
91
|
-
@provider.
|
170
|
+
@provider = provider_class.new()
|
171
|
+
@provider.aug= augeas_stub
|
92
172
|
end
|
93
|
-
|
173
|
+
|
94
174
|
it "should return true for size match" do
|
95
175
|
command = ["match", "fake value", "size", "==", "3"]
|
96
176
|
@provider.process_match(command).should == true
|
97
177
|
end
|
98
|
-
|
178
|
+
|
99
179
|
it "should return false for a size non match" do
|
100
180
|
command = ["match", "fake value", "size", "<", "3"]
|
101
181
|
@provider.process_match(command).should == false
|
102
|
-
end
|
103
|
-
|
182
|
+
end
|
183
|
+
|
104
184
|
it "should return true for includes match" do
|
105
185
|
command = ["get", "fake value", "include", "values"]
|
106
186
|
@provider.process_match(command).should == true
|
107
|
-
end
|
108
|
-
|
187
|
+
end
|
188
|
+
|
109
189
|
it "should return false for includes non match" do
|
110
190
|
command = ["get", "fake value", "include", "JarJar"]
|
111
191
|
@provider.process_match(command).should == false
|
112
|
-
end
|
113
|
-
|
192
|
+
end
|
193
|
+
|
114
194
|
it "should return true for an array match" do
|
115
195
|
command = ["get", "fake value", "==", "['set', 'of', 'values']"]
|
116
196
|
@provider.process_match(command).should == true
|
117
|
-
end
|
118
|
-
|
197
|
+
end
|
198
|
+
|
119
199
|
it "should return false for an array non match" do
|
120
200
|
command = ["get", "fake value", "==", "['this', 'should', 'not', 'match']"]
|
121
201
|
@provider.process_match(command).should == false
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
describe "
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
describe "need to run" do
|
126
206
|
it "should handle no filters" do
|
127
|
-
resource = stub("resource"
|
207
|
+
resource = stub("resource")
|
208
|
+
resource.stubs(:[]).returns(false).then.returns("")
|
209
|
+
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
|
210
|
+
augeas_stub.stubs("close")
|
128
211
|
provider = provider_class.new(resource)
|
129
|
-
provider.
|
212
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
213
|
+
provider.need_to_run?.should == true
|
130
214
|
end
|
131
|
-
|
215
|
+
|
132
216
|
it "should return true when a get filter matches" do
|
133
|
-
resource = stub("resource"
|
217
|
+
resource = stub("resource")
|
218
|
+
resource.stubs(:[]).returns(false).then.returns("get path == value")
|
134
219
|
provider = provider_class.new(resource)
|
135
220
|
augeas_stub = stub("augeas", :get => "value")
|
136
|
-
|
137
|
-
provider.
|
138
|
-
|
139
|
-
|
221
|
+
augeas_stub.stubs("close")
|
222
|
+
provider.aug= augeas_stub
|
223
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
224
|
+
provider.need_to_run?.should == true
|
225
|
+
end
|
226
|
+
|
140
227
|
it "should return false when a get filter does not match" do
|
141
|
-
resource = stub("resource"
|
228
|
+
resource = stub("resource")
|
229
|
+
resource.stubs(:[]).returns(false).then.returns("get path == another value")
|
142
230
|
provider = provider_class.new(resource)
|
143
231
|
augeas_stub = stub("augeas", :get => "value")
|
144
|
-
|
145
|
-
provider.
|
146
|
-
|
147
|
-
|
232
|
+
augeas_stub.stubs("close")
|
233
|
+
provider.aug= augeas_stub
|
234
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
235
|
+
provider.need_to_run?.should == false
|
236
|
+
end
|
237
|
+
|
148
238
|
it "should return true when a match filter matches" do
|
149
|
-
resource = stub("resource"
|
239
|
+
resource = stub("resource")
|
240
|
+
resource.stubs(:[]).returns(false).then.returns("match path size == 3")
|
150
241
|
provider = provider_class.new(resource)
|
151
242
|
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
|
152
|
-
|
153
|
-
provider.
|
154
|
-
|
155
|
-
|
243
|
+
augeas_stub.stubs("close")
|
244
|
+
provider.aug= augeas_stub
|
245
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
246
|
+
provider.need_to_run?.should == true
|
247
|
+
end
|
248
|
+
|
156
249
|
it "should return false when a match filter does not match" do
|
157
|
-
resource = stub("resource"
|
250
|
+
resource = stub("resource")
|
251
|
+
resource.stubs(:[]).returns(false).then.returns("match path size == 2")
|
158
252
|
provider = provider_class.new(resource)
|
159
253
|
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
|
160
|
-
|
161
|
-
provider.
|
162
|
-
|
254
|
+
augeas_stub.stubs("close")
|
255
|
+
provider.aug= augeas_stub
|
256
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
257
|
+
provider.need_to_run?.should == false
|
258
|
+
end
|
259
|
+
|
260
|
+
#This is a copy of the last one, with setting the force to true
|
261
|
+
it "setting force should not change the above logic" do
|
262
|
+
resource = stub("resource")
|
263
|
+
resource.stubs(:[]).returns(true).then.returns("match path size == 2")
|
264
|
+
provider = provider_class.new(resource)
|
265
|
+
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
|
266
|
+
augeas_stub.stubs("close")
|
267
|
+
provider.aug= augeas_stub
|
268
|
+
provider.stubs(:get_augeas_version).returns("0.3.5")
|
269
|
+
provider.need_to_run?.should == false
|
270
|
+
end
|
163
271
|
end
|
164
|
-
|
165
|
-
describe "augeas integration" do
|
166
|
-
|
272
|
+
|
273
|
+
describe "augeas execution integration" do
|
274
|
+
|
167
275
|
before do
|
168
276
|
@resource = stub("resource")
|
169
277
|
@provider = provider_class.new(@resource)
|
170
278
|
@augeas = stub("augeas")
|
171
|
-
@provider.
|
279
|
+
@provider.aug= @augeas
|
280
|
+
@provider.stubs(:get_augeas_version).returns("0.3.5")
|
172
281
|
end
|
173
|
-
|
282
|
+
|
174
283
|
it "should handle set commands" do
|
175
284
|
command = [["set", "/Jar/Jar", "Binks"]]
|
176
285
|
context = "/some/path"
|
177
286
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
178
287
|
@augeas.expects(:set).with("/some/path/Jar/Jar", "Binks")
|
179
288
|
@augeas.expects(:save).returns(true)
|
289
|
+
@augeas.expects(:close)
|
180
290
|
@provider.execute_changes.should == :executed
|
181
291
|
end
|
182
|
-
|
292
|
+
|
183
293
|
it "should handle rm commands" do
|
184
294
|
command = [["rm", "/Jar/Jar"]]
|
185
295
|
context = ""
|
186
296
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
187
297
|
@augeas.expects(:rm).with("/Jar/Jar")
|
188
298
|
@augeas.expects(:save).returns(true)
|
299
|
+
@augeas.expects(:close)
|
189
300
|
@provider.execute_changes.should == :executed
|
190
|
-
end
|
191
|
-
|
301
|
+
end
|
302
|
+
|
192
303
|
it "should handle remove commands" do
|
193
304
|
command = [["remove", "Jar/Jar"]]
|
194
305
|
context = ""
|
195
306
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
196
307
|
@augeas.expects(:rm).with("/Jar/Jar")
|
197
308
|
@augeas.expects(:save).returns(true)
|
309
|
+
@augeas.expects(:close)
|
198
310
|
@provider.execute_changes.should == :executed
|
199
|
-
end
|
200
|
-
|
311
|
+
end
|
312
|
+
|
201
313
|
it "should handle clear commands" do
|
202
314
|
command = [["clear", "/Jar/Jar"]]
|
203
315
|
context = "/foo"
|
204
316
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
205
317
|
@augeas.expects(:clear).with("/foo/Jar/Jar")
|
206
318
|
@augeas.expects(:save).returns(true)
|
319
|
+
@augeas.expects(:close)
|
207
320
|
@provider.execute_changes.should == :executed
|
208
|
-
end
|
209
|
-
|
210
|
-
|
211
|
-
|
321
|
+
end
|
322
|
+
|
323
|
+
|
324
|
+
it "should handle ins commands with before" do
|
325
|
+
command = [["ins", "Binks", "before /Jar/Jar"]]
|
212
326
|
context = "/foo"
|
213
327
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
214
|
-
@augeas.expects(:insert).with("/foo/Jar/Jar")
|
328
|
+
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", true)
|
215
329
|
@augeas.expects(:save).returns(true)
|
330
|
+
@augeas.expects(:close)
|
216
331
|
@provider.execute_changes.should == :executed
|
217
|
-
end
|
218
|
-
|
219
|
-
it "should handle ins commands" do
|
220
|
-
command = [["ins", "/Jar/Jar"]]
|
332
|
+
end
|
333
|
+
|
334
|
+
it "should handle ins commands with before" do
|
335
|
+
command = [["ins", "Binks", "after /Jar/Jar"]]
|
221
336
|
context = "/foo"
|
222
337
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
223
|
-
@augeas.expects(:insert).with("/foo/Jar/Jar")
|
338
|
+
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false)
|
339
|
+
@augeas.expects(:save).returns(true)
|
340
|
+
@augeas.expects(:close)
|
341
|
+
@provider.execute_changes.should == :executed
|
342
|
+
end
|
343
|
+
|
344
|
+
it "should handle ins with no context" do
|
345
|
+
command = [["ins", "Binks", "after /Jar/Jar"]]
|
346
|
+
context = "" # this is the default
|
347
|
+
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
348
|
+
@augeas.expects(:insert).with("/Jar/Jar", "Binks", false)
|
224
349
|
@augeas.expects(:save).returns(true)
|
350
|
+
@augeas.expects(:close)
|
225
351
|
@provider.execute_changes.should == :executed
|
226
|
-
end
|
227
|
-
|
352
|
+
end
|
353
|
+
|
228
354
|
it "should handle multiple commands" do
|
229
|
-
command = [["ins", "/Jar/Jar"], ["clear", "/Jar/Jar"]]
|
355
|
+
command = [["ins", "Binks", "after /Jar/Jar"], ["clear", "/Jar/Jar"]]
|
230
356
|
context = "/foo"
|
231
357
|
@resource.expects(:[]).times(2).returns(command).then.returns(context)
|
232
|
-
@augeas.expects(:insert).with("/foo/Jar/Jar")
|
233
|
-
@augeas.expects(:clear).with("/foo/Jar/Jar")
|
358
|
+
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false)
|
359
|
+
@augeas.expects(:clear).with("/foo/Jar/Jar")
|
234
360
|
@augeas.expects(:save).returns(true)
|
361
|
+
@augeas.expects(:close)
|
235
362
|
@provider.execute_changes.should == :executed
|
236
|
-
end
|
363
|
+
end
|
237
364
|
end
|
238
365
|
end
|