summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing #2181 - Using Sets instead of Arrays in SimpleGraphLuke Kanies2009-04-221-0/+1
| | | | | | This can cause a huge speedup for large numbers of edges. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing some rails tests that sometimes failedLuke Kanies2009-04-221-0/+1
| | | | | | At least, I think they're fixed; it's hard to test. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding time debugging for catalog storage to active_recordLuke Kanies2009-04-221-0/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Using a setting for configuring queueingLuke Kanies2009-04-222-12/+5
| | | | | | | Removing class methods and such, and switching to relying solely on a setting for the queue configuration. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unnecessary parser variables when yaml-dumpingLuke Kanies2009-04-223-11/+13
| | | | | | | | | Also working around a YAML bug in Ruby. And fixing tests that were broken in a previous commit in this rebase but not caught earlier. Signed-off-by: Luke Kanies <luke@madstop.com>
* Add queue indirection as an option for catalog storage.Ethan Rowe2009-04-221-0/+20
| | | | | | This eventually will allow catalog storage ("storeconfigs") to be taken out of the critical request-handling path of puppetmasterd, such that: * Puppet::Node::Catalog can be serialized to a message queue via the indirector's "save" method * a separate process can use Puppet::Node::Catalog::Queue.subscribe to pick up these catalog objects as they come in and can save them to the database through the :active_record terminus
* Introduce abstract queue terminus within the indirection system.Ethan Rowe2009-04-221-0/+87
| | | | The queue abstract terminus allows the standard indirector behaviors to interact with a message queue broker, such that the indirector's "save" method writes the relevant model object out to a queue on the message broker. While the indirector's "find" method does not map to a message queue, the queue terminus class offers a "subscribe" method that allows for easy implementation of an event loop, receiving indirected objects saved to a queue as they come in.
* Introduce queue client "plugin" namespace and interface, with a Stomp client ↵Ethan Rowe2009-04-222-0/+157
| | | | | | | | | | | implementation. Puppet::Util::Queue provides queue client mix-in behaviors that enable easy queue client management for consumer classes. Some relevant behaviors include: * standard Puppet instance loader behavior for loading queue client modules on-demand based on the client module specified by symbolic name * singleton registry of known queue client types (based on symbol-to-class mappings from the instance loading behavior) * simple interface for working with an actual queue client instance Puppet::Util::Queue::Stomp wraps the Stomp::Client class to provide an initial queue client option supporting the Stomp messaging protocol. This defines the interface for all Puppet queue client plugins going forward.
* Initial implementation of a "cache accumulator" behavior.Ethan Rowe2009-04-221-0/+69
| | | | | | | | | | | | | Mix Puppet::Util::CacheAccumulator into an ActiveRecord-like class, and then for any attribute in that class on which you are likely to call find_or_create_by_*, specify: accumulates :foo and instead of :find_or_create_by_foo use :accumulate_by_foo. The class will cache known results keyed by values of :foo. Do an initial bulk-lookup: class.accumulate_by_foo('foo1', 'foo2', 'foo3', 'foo4')
* Changing rails value serialization to deal with booleansLuke Kanies2009-04-221-0/+52
| | | | | | | | The database was automatically converting booleans to strings, and value comparison was not working correctly as a result. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Rails integrationLuke Kanies2009-04-222-4/+4
| | | | | | | | This moves all code from the Parser class into the ActiveRecord classes, and gets rid of 'ar_hash_merge'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a common Settings method for setting valuesLuke Kanies2009-04-221-3/+13
| | | | | | | | We were previously missing some hooks for settings set via the command-line, because different code paths were being used. Signed-off-by: Luke Kanies <luke@madstop.com>
* Switching to Indirected ActiveRecordLuke Kanies2009-04-221-21/+0
| | | | | | | | | | | This is mostly a configuration change, with some code getting removed. Also adding an extra require in Format; Puppet::Provider requires Puppet::Provider::Confiner, so the constant lookup is weird. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for CatalogLuke Kanies2009-04-221-0/+119
| | | | | | | | This provides the last piece of ActiveRecord integration. It's pretty much just pass-through and *only* works if you're storing Parser resources to the db. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding ActiveRecord terminus classes for Node and Facts.Luke Kanies2009-04-224-0/+287
| | | | | | | | | This is most of the way to replacing standard StoreConfigs integration with the Indirector. We still need to convert the Catalog and then change all of the integraiton points (which is mostly the 'store' call in the Compiler). Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2180 - Catalogs yaml dump the resource table firstLuke Kanies2009-04-211-0/+4
| | | | | | | | This fixes a ruby bug (http://rubyforge.org/tracker/?group_id=426&atid=1698&func=detail&aid=8886) that otherwise results in yaml producing text it can't read back in. Signed-off-by: Luke Kanies <luke@madstop.com>
* Partially fixing #1765 - node searching supports strict hostname checkingLuke Kanies2009-04-221-0/+9
| | | | | | | | With the new 'strict_hostname_checking' option enabled, the compiler will only search for the literal certificate name in its list of nodes. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1885 - Relationships metaparams do not cascadeLuke Kanies2009-04-221-27/+8
| | | | | | | | | | | | | | | Because we now pass catalogs around, rather than a tree of resources, we no longer lose the metaparam information in definitions and classes. Thus, we no longer need to pass them down to contained resources. Ideally we'd remove cascading of all metaparams (which is ticket #1903) but 'schedule' and 'noop' are inherently recursive but not in a way that the graph support can currently easily solve, so that's going to have to wait for a later release. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2142 - Convert pkgdmg provider to use plists instead of string scanning ↵Nigel Kersten2009-04-221-0/+73
| | | | | | | | | | | | | | for future proofing update pkgdmg patch with feedback from dev-list initial checking of pkgdmg package provider tests clean up fail conditions to raise Puppet::Error instead Finalized tests for pkgdmg provider remove duplicate facter/util/plist require
* Fixing #2171 - All certificate files are written with default permsLuke Kanies2009-04-222-4/+4
| | | | | | | | | | We were already writing all specific files with appropriate permissions; this change makes all of the files that are part of a group (which largely means files saved by puppetmasterd and puppetca) are also written using the correct permissions. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2112 - Transactions handle conflicting generated resourcesLuke Kanies2009-04-175-52/+38
| | | | | | | | | | This commit rips out all of the 'implicit resource' crap, replacing it with a simple system that just skips resources that the catalog says are in conflict. Removes a bunch of code, and fixes the bug to boot. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing puppet -e; it got broken in the move to ApplicationLuke Kanies2009-04-171-1/+6
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Partially fixing #2029 - failed caches doesn't throw an exceptionLuke Kanies2009-04-171-0/+15
| | | | | | | If the main terminus fails you get an exception, but not if a cache terminus fails. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2111 - SimpleGraph only creates valid adjacenciesLuke Kanies2009-04-121-0/+9
| | | | | | | | | | | The way this class was testing edges was causing them to appear adjacencies to appear magically, because it was only testing that a hash had a key, not that the value had any edges. This fixes the infinite recursion mentioned in #2111. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing all tests that were apparently broken in the 0.24.x merge.Luke Kanies2009-04-024-11/+8
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-04-0219-54/+332
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/ralsh lib/puppet/executables/client/certhandler.rb lib/puppet/parser/functions/versioncmp.rb lib/puppet/parser/resource/reference.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/provider/nameservice/directoryservice.rb lib/puppet/provider/ssh_authorized_key/parsed.rb lib/puppet/type.rb lib/puppet/type/file/checksum.rb spec/integration/defaults.rb spec/integration/transaction/report.rb spec/unit/executables/client/certhandler.rb spec/unit/indirector/ssl_rsa/file.rb spec/unit/node/catalog.rb spec/unit/provider/augeas/augeas.rb spec/unit/rails.rb spec/unit/type/ssh_authorized_key.rb spec/unit/type/tidy.rb test/executables/filebucket.rb test/executables/puppetbin.rb
| * Fixed #2004 - ssh_authorized_key fails if no target is definedFrancois Deppierraz2009-03-242-30/+33
| | | | | | | | | | | | | | This commit depends on 7f291afdacf59f762c3b78481f5420ec8919e46d (fixing #1629) which was cherry-picked from master. Signed-off-by: Francois Deppierraz <francois@ctrlaltdel.ch>
| * Fix Bug #1629Francois Deppierraz2009-03-241-0/+64
| | | | | | | | | | A refactoring of ssh_authorized_key parsed provider was needed and tests were improved. flush method has been split for clarity.
| * Fix #1807 - make Puppet::Util::Package.versioncmp a module functionBrice Figureau2009-03-241-0/+21
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fix #1829 - Add puppet function versioncmp to compare versionsBrice Figureau2009-03-241-0/+29
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fix #1828 - Scope.number? wasn't strict enough and could produce wrong resultsBrice Figureau2009-03-141-0/+14
| | | | | | | | | | | | | | Some invalid numbers were treated as numbers and conversion to Integer was failing returning 0 (for instance 0.24.7). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixing change printing when list properties are absentLuke Kanies2009-03-071-0/+4
| | | | | | | | | | | | | | They were throwing an exception when the 'is' value was 'absent'. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Added a force option to ensure the change is always applied, and call augeas ↵Bryan Kearney2009-03-041-91/+121
| | | | | | | | twice to reduce the chance that data is lost
| * Backport the fix for #1835Bryan Kearney2009-03-041-0/+80
| |
| * First cut at the not running if augeas does not change any of the ↵Bryan Kearney2009-03-041-9/+16
| | | | | | | | underlieing files
| * Fixing #1991 - ldap booleans get converted to booleansLuke Kanies2009-03-051-0/+20
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #2013 - prefetching had a mismatch between type and titleLuke Kanies2009-03-041-0/+15
| | | | | | | | | | | | | | | | | | The ParsedFile types seem to be the main one that suffers from this, but the transactions were using the resource titles, not names, so resources were often not getting prefetched correctly. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing every failing test I can find on the build server.Luke Kanies2009-02-2810-4/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All but one of these tests is fixed by: * Stubbing Puppet.settings.use * Adding /usr/sbin to PATH The only other one was the package integration test, which stupidly assumed a default was specified in the test. The fix here is twofold: Remove that assumption (the test is now 'pending' if no default is available), and add a default for Ubuntu. (The default is in the test, not the default package provider - that is, it's testing the default package provider, thus it can't rely on that information.) Signed-off-by: Luke Kanies <luke@madstop.com>
| * Make puppetd --waitforcert option behave as documented:Paul Lathrop2009-02-281-0/+13
| | | | | | | | | | | | | | | | "You can turn off waiting for certificates by specifying a time of 0." Also add a test to ensure we catch any future regression of this behavior. Signed-off-by: Paul Lathrop <paul@tertiusfamily.net>
| * Using the FileCollection where appropriate.Luke Kanies2009-02-285-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit just replaces the :file and :line accessors with the use of the new FileCollection Lookup module. This should mean that we've normalized all file names in a given process, which *might* have drastic RAM improvements. For initial simplicity, I've gone with a single global collection of file names, but it's built so it's easy to use individual file collections instead. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Adding a FileCollection and a lookup module for it.Luke Kanies2009-02-282-0/+86
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #2107 - flatten resource references arrays properlyBrice Figureau2009-03-271-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resource parameters of the form [Res[a], Res[a,b]] ends being evaluated as [Res[a], [ Res[a], Res[b] ] This last form was not flattened when transfomed into RAL type, which in turn prevented the sub array to be converted in regular resource references. Thus the type was choking when encountering those native parser references instead of usual resource reference. The fix consists in flattening array of references before transformation to trans objects for RAL. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fix #2101 - fix recurselimit == 0 bad behaviourBrice Figureau2009-03-271-3/+3
| | | | | | | | | | | | | | After the fix for #1469, recurselimit = 0 was considered as an infinite recursion which is the reverse of what it was before. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fix #1469 - Add an option to recurse only on remote sideBrice Figureau2009-03-202-22/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using recurse and a source, if the client side has many files it can take a lot of CPU/memory to checksum the whole client hierarchy. The idea is that it is not necessary to recurse on the client side if all we want is to manage the files that are sourced from the server. This changeset adds the "remote" recurse value which prevents recursing on the client side when a source is present. Since it also is necessary to limit the remote side recursion a new File{} parameter has been added called "recurselimit". Moreover, the Filetset API is changing to allow the new recurselimit parameter, and passing the recursion depth limit in the recurse parameter as an integer is now deprecated and not supported anymore. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Forbidding REST clients to set the node or IPLuke Kanies2009-03-202-0/+20
| | | | | | | | | | | | | | | | This is done for security reasons - if a client is unauthenticated, we don't want them to be able to just configure their own authentication information. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1557 - Environments are now in REST URIsLuke Kanies2009-03-209-115/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes multiple, related changes, all in one commit because the whole thing was necessary to reach a functional tree again: * The URI starts with the environment, so: /production/certificate/foo /development/file_content/path/to/your/file * All REST handling is done by a single instance mounted at / for webrick and Mongrel, rather than having individual instances mounted at, say, /certificate. * All REST URI translation is done by an API module. Currently only the 'v1' module exists with no support for additional modules, but it's well-separated and will be easy to expand as we need it. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding explicit optional attribute to indirection requestsLuke Kanies2009-03-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, any option that had a setter was treated as an attribute, but now we're specifying the list of attributes settable via options. We also have a to_hash method that will take all of the options and all of those attributes and join them back into a hash. This method is used by the REST Handler module, since it uses the indirection request internally. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a model accessor to the Request classLuke Kanies2009-03-201-0/+17
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Requests now use default environment when none is specifiedLuke Kanies2009-03-201-0/+4
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving the REST API functions into a moduleLuke Kanies2009-03-203-107/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | This module is now used by the client and server side, rather than having a Handler module that's 90% server functionality but also used by the client. While we don't automatically get api choice from this, it at least provides a pattern for how we'll handle API development over time. Signed-off-by: Luke Kanies <luke@madstop.com>