summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* [#4055] Refactor of abstract Couch terminus, more specsRein Henrichs2010-02-171-6/+62
| | | | | * Cleaner implementation of abstract Couch terminus * More thoroughly tested facts Couch terminus
* [#4055] Add CouchDB terminus for factsRein Henrichs2010-02-172-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | Implements an abstract CouchDB terminus and a concrete CouchDB terminus used to store node facts. Node facts are stored in a "node" document as the "facts" attribute. This node document may also be used by other couchdb termini that store node-related information. It is recommended to use a separate document (or documents) to store large data structures like catalogs, linking them to their related node document using embedded ids. This implementation depends on the "couchrest" gem. * Add Puppet.features.couchdb? * Add Puppet[:couchdb_url] setting * Add Puppet::Node::Facts#== for testing * Add PuppetSpec::FIXTURE_DIR for easy access to fixture files * Add CouchDB Terminus * Add Facts::CouchDB terminus * Stores facts inside a "node" document * Use key (hostname) as _id for node document * #find returns nil if document cannot be found * #save finds and updates existing document OR creates new doc [1] * Store facts in "facts" attribute of node document
* [#3921] Fix typo "fact_terminus" -> "facts_terminus"Rein Henrichs2010-02-171-2/+2
| | | | Doh.
* [#3810] Add http reports processor and `reporturl` settingRein Henrichs2010-02-171-0/+42
| | | | | | | | | | | | Example puppet.conf: [puppetmasterd] reports = store, http reporturl = http://localhost:3000/reports * Group reporturl and reportdir in new reports section of Puppet::Settings * Add specs for both
* [#3804] Fixed one failing spec for RackRESTNick Lewis2010-02-171-2/+2
| | | | | | | | | | | A new version of Rack::MockRequest automatically uppercases the HTTP method, expecting that any method passed in should properly be uppercase. e.g. GET, PUT, POST This behavior is on line 81 of Rack::MockRequest: http://rack.rubyforge.org/doc/classes/Rack/MockRequest.src/M000230.html Reviewed by Matt Robinson
* [#3409] fix test failures from ldap environment patchJesse Wolfe2010-02-171-20/+18
|
* Fixing #3139 - all properties can now be auditedLuke Kanies2010-02-174-3/+131
| | | | | | | | | | | | | | | This provides a full audit trail for any parameter on any resource Puppet can manage. Just use: file { "/my/file": audit => [content, owner] } And Puppet will generate an event any time either of those properties change. This commit also deprecates the 'check' parameter in favor of a new 'audit' parameter. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - Catalogs default to host_configLuke Kanies2010-02-172-21/+15
| | | | | | | | | | | The whole host_config concept is a bit outdated now that Configurer exists, I think, (since any catalog it uses should be a host_config). However, fixing that is outside of the scope of this series. In the meantime, this does a better job of making sure every catalog except the Settings catalogs are host_configs. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - ResourceHarness does cachingLuke Kanies2010-02-172-7/+22
| | | | | | | | | | | | | | | | | | This is again about moving transactional behaviour out of Puppet::Type and into the transactional code. I initially moved this code into Resource::Status, but it seemed to make more sense in the Harness - the Status object should be thin and have no code that doesn't make sense on both sides of the pipe, it seemed. The interface gets a bit uglier as a result, but this is all about good design != good OO (because we're increasing the argument count of methods by moving them outside of the target class). Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - removing obsolete checking in StorageLuke Kanies2010-02-171-19/+5
| | | | | | | | | We were type-checking the use of Storage for no good reason. I've removed all of that, so we can use either resources or their Refs for caching. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Working #3139 - scheduling moved to resource harnessLuke Kanies2010-02-172-17/+123
| | | | | | | | | | We previously had the schedule checking code in Puppet::Type, but it's more of a transactional function, and in order to do proper auditing in the transactional area, we need the cache checking done there. Scheduling is one of the few functions that actually uses cached data currently. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Part 2 of fix for #1175 (functions in environments)Markus Roberts2010-02-173-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jesse and I are shooting for the minimal viable fix here, with the idea that a great deal of refactoring is needed but isn't appropriate at this time. The changes in this commit are: * Index the function-holding modules by environment * We need to know the "current environment" when we're defining a function so we can attach it to the proper module, and this information isn't dynamically available when user-defined functions are being created (we're being called by user written code that doesn't "know" about environments) so we cheat and stash the value in Puppet::Node::Environment * since we must do this anyway, it turns out to be cleaner & safer to do the same when we are evaluating a functon. This is the main change from the prior version of this patch. * Add a special *root* environment for the built in functions, and extend all scopes with it. * Index the function characteristics (name, type, docstring, etc.) by environment * Make the autoloader environment aware, so that it uses the modulepath for the specified environment rather than the default * Turn off caching of the modulepath since it potentially changes for each node * Tweak tests that weren't environment aware
* [#1621] Composite keys for resourcesJesse Wolfe2010-06-217-36/+34
| | | | | | | | | | | | | | | | This patch implements the fundamental pieces of the move to composite keys: * Instead of having a single namevar, we have a non-empty collection of them, and two resources are the same if and only if all of them match. Note that the present situation is a special case of this, where the collection always has exactly one member. * As currently, namevar is determined by the type. * Instead just of inferring the single namevar from the title we let types decompose the title into values for several (perhaps all) of the namevar components; note that the present situation is again a special case of this. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Use the 'root' feature rather than directly checking the uidMarkus Roberts2010-02-172-3/+3
| | | | Jesse fixed all these but David and others moved them and introduced some more so...
* fix tests to reflect methods moved from type/file/owner to provider/file/posixJesse Wolfe2010-02-171-14/+21
|
* Confine out tests that fail on unixJesse Wolfe2010-02-171-0/+2
|
* Adapt Util::Storage specs and avoid trying to lock on directoriesDavid Schmitt2010-02-171-5/+6
|
* Implement quoting on the exec commands and repair specsDavid Schmitt2010-02-171-69/+73
|
* Avoid trying to symlink() on windowsDavid Schmitt2010-02-171-118/+191
|
* Expand file type to be able to handle Win32 and UNC pathsDavid Schmitt2010-02-171-14/+120
| | | | | | | Win32 paths start with a drive letter, a colon and a slash; UNC paths start with two slashes, the name of the server and another slash. Signed-off-by: David Schmitt <david@dasz.at>
* Fixed RSpec deprecation notice in lexer testsJames Turnbull2010-06-101-1/+1
|
* Make specs work on win32David Schmitt2010-02-1711-121/+167
| | | | | | | | | | | | | | | | | | | | lib/: * Fix Puppet::Parser::Files * Fix Puppet::Util::Settings spec/: * unit/application/kick.rb: only run on posix * unit/application.rb * unit/parser/compiler.rb * unit/parser/files.rb * unit/resource.rb * unit/resource/catalog.rb * unit/resource/type_collection.rb * unit/transaction.rb * unit/type/tidy.rb * unit/util/settings.rb * unit/util/settings/file_setting.rb * unit/application.rb
* Fix ProviderDpkg specs to avoid any real executionsDavid Schmitt2010-02-171-0/+4
|
* Avoid setting the timeout before we know which timeout we should set.David Schmitt2010-02-171-0/+20
| | | | Signed-off-by: David Schmitt <david@dasz.at>
* Bug: tidy specs need FileBucket::DipperDavid Schmitt2010-02-171-0/+1
|
* Avoid trying to lock on non-filesDavid Schmitt2010-02-171-6/+47
| | | | This is not supported on windows and makes little sense on POSIX
* Functions are added to a module instead of ScopeLuke Kanies2010-02-172-11/+48
| | | | | | | | | | | | | | | | | We were previously adding them directly to Scope, but now they're in a module that Scope includes. This is the first half of #1175 - we can now maintain environment-specific collections of functions. We need some way of tracking which environment a given function is loaded from. Well, maybe it's the first third - the core functions probably need to be added to all of these modules, or there needs to be a 'common' module that is included by all of them. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* [#3921] Add facts_terminus setting to Puppet settingsRein Henrichs2010-02-171-2/+3
| | | | * defaults to "facter"
* Fixed #3912 - Added client certificate name as an internal fact called ↵James Turnbull2010-02-171-0/+5
| | | | "clientcert"
* {#3866] Rename the method metaclass to singleton_class to avoid the ↵Matt Robinson2010-02-1713-14/+14
| | | | | | | | | | | | deprecation warnings from Rails ActiveSupport The metaid.rb file came straight from why the lucky stiff's "seeing metaclasses clearly" article. Rails used this too, but they recently deprecated the name metaclass in favor of singleton_class to match what ruby-core decided to do. meta, eigen and singlton class were all suggested and in the end singleton was agreed upon. http://redmine.ruby-lang.org/issues/show/1082
* Fixing #3822 - checksums will be loaded from filebucketsLuke Kanies2010-02-171-10/+33
| | | | | | | | | | | | If you have the following code or equivalent: file { "/foo": content => "{md5}foobar" } Puppet will attempt to pull the content associated with that file from whatever the default filebucket is for the resource in question. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* For #3822 - Reducing checksum code duplicationLuke Kanies2010-02-173-95/+90
| | | | | | | | | | | The FileBucket code had a bunch of checksum code that was already available in a library, and it used a checksum format (type + data) that was incompatible with what we were using everywhere else. This just fixes that code duplication. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #3791 - client environment is usedLuke Kanies2010-02-171-18/+36
| | | | | | | | | | | | | Node#environment wasn't being set correctly, in that it had to have the right answer out of the gate or it was never corrected. It was lazy-binding in 0.25 but I managed to make it no longer that way. This resulted in the environment basically not being set during compilation, so the default server environment was always used. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Bug #3748 LDAP group membershipMatt Robinson2010-02-171-2/+2
| | | | | | | | LDAP group membership comparison was happening on an unsorted string. Sorting the string for now, may want to do something smarter by comparing something other than strings later. Signed-off-by: Matt Robinson <matt@puppetlabs.com>
* Fixing #2655 - Adding default parameter values to resourcesLuke Kanies2010-02-171-0/+2
| | | | | | | | We were previously just adding these values as variables in the local scope, but we now add them to the resources so they get passed to the client in the catalog and are thus inspectable. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Refactoring tests - replacing stubs with instancesLuke Kanies2010-02-171-4/+0
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix #3664 - qualified variable parsing in string interpolationBrice Figureau2010-02-171-0/+1
| | | | | | | | | | | "${myclass::var}" was lexed as a CLASSNAME instead of a VARIABLE token, giving an error while parsing because a rvalue can't be a bare CLASSNAME token. This patch fixes the issue by making VARIABLE lexing higher priority than CLASSNAME. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Feature #2935 Puppet[:mode] and Puppet[:name] are read-onlyJesse Wolfe2010-02-171-1/+27
| | | | | | | | | Historically, the Puppet[:name] setting has been settable, but the results of chaning it are poorly defined. The switch to modes instead of executable names seems like a good time to disable this complexity. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Bug: Broken codepath in util/settingsJesse Wolfe2010-02-171-0/+4
| | | | | | | | | An incorrect variable name is used in an error message, causing the error to throw an error. This can't appear in the wild, since it's actually just an argument check for the defaults.rb file. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 settings are in Mode sections instead of executable namesJesse Wolfe2010-02-171-9/+7
| | | | | | | A process's settings are now determined by Puppet::Mode rather than by the executable name. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Modes: root? predicateJesse Wolfe2010-02-173-4/+4
| | | | | | | Use a predicate method to check if we're running as root, rather than comparing the effective user id Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935 Puppet::Mode#master?Jesse Wolfe2010-02-175-20/+20
| | | | | | | Use a predicate function on the Mode object instead of comparing with the executable name everywhere Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* feature #2276 Single Executable: use new names for settings sectionsJesse Wolfe2010-02-173-4/+4
| | | | | | | | The puppet-internal settings sections aren't actually exposed to the user, but to reduce confusion I've renamed them to be consistent with the single-executable application names. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #2935: lazify require graph for applicationsJesse Wolfe2010-02-172-3/+7
| | | | | | | | | Because environments have to declare their mode before puppet tries to load defaults.rb, it reduces the complexity considerably to have application classes to load their lib dependencies at the last possible moment. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* feature #2276 Single Executable: move CommandLine methodsJesse Wolfe2010-02-171-56/+29
| | | | | | | move Util::CommandLine methods into instances instead of on the class, as suggested by Markus Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #2658 - adding backward compatibility for 0.24Luke Kanies2010-02-173-20/+45
| | | | | | | | | | | | | The way stages were implemented caused backward compatibility to be completely broken for 0.24.x. This commit fixes that, mostly by assuming Stage[main] will be the top node in the graph rather than Class[main]. Other stages are not supported in 0.24.x, and explicitly throw a warning (although not an error). Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Adding #2658 - Adding support for run stagesLuke Kanies2010-02-174-21/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to specify a run stage for either a class or a resource. By default, all classes get directly added to the 'main' stage. You can create new stages as resources: stage { [pre, post]: } To order stages, use standard relationships: stage { pre: before => Stage[main] } Or use the new relationship syntax: stage { pre: } -> Stage[main] -> stage { post: } Then use the new class parameters to specify a stage: class { foo: stage => pre } If you set a stage on an individual resource, it will fail; stages can only be set on class resources. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #3671 - --compile Catalogs are pretty-printedLuke Kanies2010-02-171-4/+7
| | | | | | | | A simple fix for this one. This doesn't fix the general case, just the --compile case. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing #2655 - Adding default parameter values to resourcesLuke Kanies2010-02-171-0/+8
| | | | | | | | We were previously just adding these values as variables in the local scope, but we now add them to the resources so they get passed to the client in the catalog and are thus inspectable. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Refactoring tests - replacing stubs with instancesLuke Kanies2010-02-171-27/+17
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>