summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | (Maint) Fix a leaking spec, patching intermittent failures.Pieter van de Bruggen2011-04-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Matt Robinson.
* | | | | | | | Merge remote-tracking branch 'community/feature/puppet-device' into 2.7.xPieter van de Bruggen2011-04-1817-159/+805
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Mike Stahnke
* | | | | | | | Merge branch 'ticket/2.7.x/7131-optional-arguments' into 2.7.xMax Martin2011-04-182-26/+29
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/7131-optional-arguments: (#7131) Remove support for optional arguments to options
| * | | | | | | | (#7131) Remove support for optional arguments to optionsMax Martin2011-04-182-26/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the design decision documented in #7131, optional arguments to options will no longer be supported. This patch causes such optional arguments to raise an error, and tests for this behavior. Also cleaned up some confusing use of the term "subject" in specs. Paired-with: Daniel Pittman
* | | | | | | | | (Maint) Fixing an order-dependent failure.Pieter van de Bruggen2011-04-181-0/+1
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running spec/unit/option_spec.rb before requiring puppet/interface caused a circular require, and a failure. Paired-With: Max Martin
* | | | | | | | Merge branch ↵Daniel Pittman2011-04-174-7/+42
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 'bug/2.7.x/7013-interfaces-should-be-able-to-mark-options-as-required' into 2.7.x
| * | | | | | | | (#7013) Add support for required options.Pieter van de Bruggen2011-04-174-7/+42
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds another hook into the generated wrapper, which invokes a method to validate arguments. This is used to raise an exception when required options have not been passed to the method. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | | maint: Fix the missed failure from the previous commitNick Lewis2011-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two times being used, and the previous fix only fixed one of them. Reviewed-By: Jacob Helwig
* | | | | | | | maint: Fix a broken Puppet::Node::Facts specNick Lewis2011-04-151-1/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was breaking in other timezones because it was comparing to a string literal representation of a time, which really varies between timezones.
* | | | | | | Merge branch ↵Daniel Pittman2011-04-1510-35/+276
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'feature/2.7.x/6978-face-and-action-options-should-have-hooks-for-various-actions' into 2.7.x
| * | | | | | | maint: speed up testing output of the help face.Daniel Pittman2011-04-151-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were generating the help output multiple times and testing it for multiple properties; now we generate it once and test it multiple times. This makes for less clear error reporting, but saving dozens of calls at ~ 1/3rd a second each is worth it. Paired-With: Max Martin <max@puppetlabs.com>
| * | | | | | | (#7059) Use option hooks for the indirector terminus option.Daniel Pittman2011-04-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to open-code terminus setting, which had a bunch of duplicate code. Now, instead, we use the option hooks, resulting in the same behaviour with much less code. Paired-With: Max Martin <max@puppetlabs.com>
| * | | | | | | (#6978) Enforce the calling convention of option hooks.Daniel Pittman2011-04-152-17/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We require that hooks take exactly three arguments; now we enforce that in the DSL, to ensure we give good, and early, errors to users who do the wrong thing. Paired-With: Max Martin <max@puppetlabs.com>
| * | | | | | | (#7059) Set the CA location using option hooks.Daniel Pittman2011-04-151-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we support option hooks, we can use those to set the CA location rather than open-coding each chunk of support. As a side benefit we also set the CA location for inherited actions, as we should. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | | | | | (#6978) Add before and after decorators to actions from options.Daniel Pittman2011-04-156-18/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Options can now add before_action and after_action blocks; these are invoked before or after any action is invoked on the face. This allows these options to declare common behaviour and have it automatically applied to the actions invoked. Option hooks have no defined order of invocation: they will run in a completely random order. Where there are dependencies they should be on the value of the options hash passed to the invocation, not on side-effects of the other invocations. You are not able to influence the arguments, options, or calling of the action body in a before or after decorator. This is by design. The invocation passes to the hook: 1. The action object representing this action. 2. The arguments to the action, as an array. 3. The options for the action, as a hash. Paired-With: Max Martin <max@puppetlabs.com>
| * | | | | | | maint: delete an empty describe block containing no tests.Daniel Pittman2011-04-151-4/+0
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Max Martin <max@puppetlabs.com>
* | | | | | | Merge branch 'tickets/2.7.x/7115' into 2.7.xPieter van de Bruggen2011-04-153-3/+63
|\ \ \ \ \ \ \
| * | | | | | | (#7115) Enable default actions.Pieter van de Bruggen2011-04-153-3/+63
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also enables the 'help' action on the 'help' face to serve as a default action. Reviewed-By: Daniel Pittman Reviewed-By: Nick Lewis
* | | | | | | Merge branch 'tickets/next/7080-serializable_indirector_requests' into 2.7.xLuke Kanies2011-04-147-16/+313
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | |
| * | | | | | Adding json-specific matchersLuke Kanies2011-04-144-24/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These make the JSON tests much easier to read and write. They're the first custom matchers that I can find, so they're breaking a bit of new ground, but the JSON tests were pretty hard to read and there was a lot of duplication, so it seemed worth it. Note that for some reason they're not working on Facts - it seems to get immediately turned into a full instance by the JSON parsing subsystem, and I've no idea why. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | Making watchr resilient to syntax errors in testsLuke Kanies2011-04-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | Adding json support to Puppet::NodeLuke Kanies2011-04-141-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | Fixing a failing test resulting from a fixed bugLuke Kanies2011-04-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were not correctly pulling request attributes out in all cases, but now we do, which caused this test to start failing. We special case the 'ip' attribute in the test now. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | (7080) Adding json support to Indirector RequestLuke Kanies2011-04-141-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We'll be using this to do RPC over mcollective. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | Fixing Facts pson methods more resilientLuke Kanies2011-04-141-1/+19
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They were currently failing if any values were nil, which happened a lot. We also prefer not to include nil values, since it muddies the json unnecessarily. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | Merge branch 'ticket/next/7103' into nextNick Lewis2011-04-131-11/+7
| |\ \ \ \ \ | | |/ / / / | |/| | | |
| | * | | | (#7103) Fix HEAD requests in the HTTP handlerNick Lewis2011-04-131-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HEAD request support was implemented in 2.6.x, and the internal API in the HTTP handler changed in 2.7.x. So when the branches were merged together, HEAD requests ended up using the wrong API without any visible merge conflicts or spec failures. This fixes them to use the correct API. Reviewed-By: Matt Robinson
* | | | | | Merge branch 'feature/master/4258-pkgutil' into 2.7.xMatt Robinson2011-04-141-0/+182
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature/master/4258-pkgutil: (29 commits) (#4258) Fix pkgutil spec test to have the correct provider (#4258) Remove superfluous command check that called pkgutil (#4258) Fix fd leak opening pkgutil config files (#4258) Permit variations of -nv in both pkgutil.conf files (#4258) Stop file and config checks from breaking spec (#4258) Check wgetopts in pkgutil.conf (#4258) Fix hash duplication affecting canonical provider instance (#4258) Use pkgutil -a to reliably determine package common names/aliases (#4258) Update pkgutil spec for recent impl changes (#4258) pkgutil: bug fix: if shortname is not equal to package name (#4258) pkgutil provider: better handling of short package names (#4258) pkgutil provider: misc enhancements Add spec tests for pkgutil package provider * Fix exception on parse failure of pkgutil output * Fix exception when querying latest version for unknown package Fixing indentation Removing blastwave references and unused PAGER Changing indentation to 2-spaces as per 2.6+ style Single package queries made more robust when dealing with pkgutil noise Fixing wget verbose regex These regular expressions will not match anything. pkgutil doesn't output anything that can be matched. ...
| * | | | | (#4258) Fix pkgutil spec test to have the correct providerMatt Robinson2011-04-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The resource being used for testing didn't explicitly set the provider, so it ended up using whatever the default provider was on the system on which it was run. This was problematic when running the specs on a Mac since the default provider is pkgdmg and that provider doesn't seem to be upgradeable. So when you tried: @resource[:ensure] = :latest You got the error: 1) Puppet::Type::Package::ProviderPkgutil when installing should use a command without versioned package Failure/Error: @resource[:ensure] = :latest Puppet::Error: Parameter ensure failed: Provider must have features 'upgradeable' to set 'ensure' to 'latest' # ./lib/puppet/parameter.rb:171:in `fail' # ./lib/puppet/parameter.rb:257:in `validate' # ./lib/puppet/property.rb:300:in `should=' # ./lib/puppet/property.rb:300:in `each' # ./lib/puppet/property.rb:300:in `should=' # ./lib/puppet/property.rb:337:in `value=' # ./lib/puppet/type.rb:416:in `[]=' # ./spec/unit/provider/package/pkgutil_spec.rb:35 Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | | (#4258) Stop file and config checks from breaking specDominic Cleal2011-04-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved all file and config checks into healthcheck method which is then stubbed in the spec.
| * | | | | (#4258) Use pkgutil -a to reliably determine package common names/aliasesDominic Cleal2011-03-191-6/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Populate instances with both the real package name ("CSWsvn") and the alias name ("subversion") from separate "pkgutil -a" call. Fixed cases where pkgutil noise was parsed as aliased package names and also breaking "not in catalog" detection. Updated pkgutil_spec test to show various edge cases.
| * | | | | (#4258) Update pkgutil spec for recent impl changesDominic Cleal2011-03-181-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix test output of pkgutil for commands using --single Fix expected upgrade command to match impl
| * | | | | Add spec tests for pkgutil package providerDominic Cleal2011-02-201-0/+132
| | |/ / / | |/| | |
* | | | | Merge branch '2.6.x' into nextMax Martin2011-04-134-2/+142
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: Updated CHANGELOG for 2.6.8rc1 (#2331) Remove darwinports pkg provider, replace with rewritten macports provider Fixed #7082 - Added system support for groups (#7018) Give more context on the service type's assumptions. Wording tweaks. (#7018) explain internals better in service provider documentation maint: Fix sqlite3 require to really be optional maint: Fix sporadic sqlite error (#6818) Stop from getting Rails 3 named_scope deprecation warning (#6856) Copy dangling symlinks with 'links => manage' File resource. Conflicts (Resolved manually): lib/puppet/type/group.rb spec/unit/indirector/facts/inventory_active_record_spec.rb
| * | | Merge branch 'ticket/2.6.x/7082' into 2.6.nextNick Lewis2011-04-132-2/+19
| |\ \ \
| | * | | Fixed #7082 - Added system support for groupsJames Turnbull2011-04-142-2/+19
| | | | |
| * | | | Merge branch 'tickets/2.6.x/2331-macports-provider' into 2.6.nextNigel Kersten2011-04-131-0/+122
| |\ \ \ \
| | * | | | (#2331) Remove darwinports pkg provider, replace with rewritten macports ↵Nigel Kersten2011-04-131-0/+122
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | provider * Employs port -q installed, much faster than port list installed * Handles upgrades correctly now * Makes use of internal port revision for ensure => latest upgrades * Versionable, now works with ensure => specified_version * Does not handle port variants at all yet. * Does not allow manual specification of revision, only version * Test coverage expanded using newer syntax Paired-With: Daniel Pittman
| * | | | maint: Fix sqlite3 require to really be optionalMatt Robinson2011-04-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You need to specifically rescue LoadError if you want requires to be optional. Paired-with: Nick Lewis
| * | | | maint: Fix sporadic sqlite errorMatt Robinson2011-04-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord::StatementInvalid: SQLite3::IOException: disk I/O error This happened if you ran these tests in the following order since Rails wasn't disconnecting between tests. rspec spec/unit/indirector/facts/inventory_active_record_spec.rb spec/unit/indirector/node/active_record_spec.rb Paired-with: Nick Lewis <nick@puppetlabs.com>
| * | | | (#6856) Copy dangling symlinks with 'links => manage' File resource.Max Martin2011-04-081-0/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying symlinks with 'links => manage', there is no need to examine the content of the link target, since the link is supposed to be copied as-is. Skip copying this value to the resource from the metadata (source), since the content will be nil in the dangling symlink case. Paired-with: Jacob Helwig
* | | | Merge branch 'ticket/next/6928' into nextNick Lewis2011-04-133-0/+26
|\ \ \ \
| * | | | Revert "(#6928) Removed --ignoreimport"Nick Lewis2011-04-133-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07. Despite not needing --ignoreimport as an option anymore, it's still used internally and has to stay.
* | | | | Merge branch 'ticket/next/6928' into nextNick Lewis2011-04-136-111/+7
|\| | | |
| * | | | (#6928) Removed --ignoreimportNick Lewis2011-04-133-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was only used with --parseonly, which is gone. Paired-With: Jesse Wolfe
| * | | | (#6928) Remove --parseonlyNick Lewis2011-04-132-85/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has been removed in favor of 'puppet parser validate <manifest>'. Paired-With: Jesse Wolfe
| * | | | (#6928) Add a Parser face with Validate actionNick Lewis2011-04-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will accept a number of manifests as arguments and check their syntax. If no filenames are specified, it will check the default 'manifest' setting. Paired-With: Jesse Wolfe
* | | | | (#6830) Fix UTF-8 encoding issue for Ruby 1.9Matt Robinson2011-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you're going to use special characters in a file and use Ruby 1.9 you need to specify the character encoding at the top of the file. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | (#7059) handle inherited action binding scopeDaniel Pittman2011-04-131-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We implemented the naive version of inheritance in the faces, in which an action declared on a superclass remains bound to that even when accessed from a subclass. As a consequence our visibility of options on inherited classes is actually much more limited than it should be, and the actions we inherit would never see the options they should correctly have. To fix this we correct the binding bug and handle lookup correctly over inheritance in our code. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* | | | | maint: ensure we handle '-foo=' options correctly in faces.Daniel Pittman2011-04-131-1/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is legal, and defines an option with an argument for optparse; we want to make sure that we stay consistent with that in our code handling the same sort of inputs. This also adds a framework for later testing any other strange naming bits and bobs we find around option handling. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>