summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Merge branch 'ticket/2.7.next/7523' into 2.7.nextNick Lewis2011-05-171-17/+27
| |\ \ \ \
| | * | | | (#7523) Refactor the grammar to reduce duplicationNick Lewis2011-05-171-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit unifies some paths in the grammar, which had previously been duplicated to avoid shift/reduce conflicts. Merging these paths together and separating only the conflicting structures leads to a cleaner grammar, with fewer holes. Several bugs are fixed as a result: (#3129) Nested class names beginning with numbers work correctly (#5268) Hyphens in class names work correctly (#5817) Hashes and arrays can now be passed to functions (hashes require parentheses) Additionally, expressions are now legal in most places where they would make sense, when previously only bare rvalues were allowed. Paired-With: Markus Roberts Reviewed-By: Matt Robinson
| * | | | | maint: fix spec_helper inclusions again.Daniel Pittman2011-05-1717-45/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got rid of the '../../spec_helper' style requires, but a few of them snuck back in in recent changes. This purges them out, replaced with the header: #!/usr/bin/env rspec require 'spec_helper' Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | | | Merge branch '2.7.next' into nextPieter van de Bruggen2011-05-1757-284/+432
|\| | | | |
| * | | | | Merge branch '2.7.x' into 2.7.nextPieter van de Bruggen2011-05-1754-180/+179
| |\ \ \ \ \ | | |/ / / / | |/| | / / | | | |/ / | | |/| |
| | * | | (#7507) Add more filters for Ruby 1.9 spec failuresPieter van de Bruggen2011-05-171-1/+1
| | | | | | | | | | | | | | | Paired-With: Matt Robinson
| | * | | (#7507) Add ability to filter Ruby 1.9 spec failuresMatt Robinson2011-05-1751-93/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By running: rspec spec --tag ~@fails_on_ruby_1.9.2 We can now just run the specs that pass under Ruby 1.9. Obviously in the long term we want to have all the specs passing, but until then we need notification when we regress. From now on new code will be required to pass under Ruby 1.9, and Jenkins will give us email notification if it doesn't or if we break something that was already working. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| | * | | (#7507) Fix when_invoked action specs in Ruby 1.9Matt Robinson2011-05-173-86/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 is strict about argument arity for methods that are metaprogrammatically defined. A ton of specs that were setting up when_invoked didn't pass options even though they should have been. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | (#7114) Fix specs for ssh authorized key parsed providerNick Lewis2011-05-161-32/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests were unnecessarily creating a stub resource, as well as failing to re-initvars on the provider before each test. This led to test ordering failures, and incompatibilities with the other commits in this series. Now we use a real resource, and properly reinitialize before each test. Paired-With: Josh Cooper
| * | | | (#7114) Improve unit tests for ssh_authorized_keyStefan Schulte2011-05-161-70/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests to check if the type supports valid values for all the properties. Also check if the type rejects values that are invalid. Reviewed-By: Nick Lewis Reviewed-By: Josh Cooper
| * | | | Merge branch 'ticket/2.7.x/7300' into 2.7.nextNick Lewis2011-05-161-0/+41
| |\ \ \ \
| | * | | | (#7300) Add specs for the mount providerStefan Schulte2011-05-011-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add specs to demonstrate that the instances method is currently broken because it does not take the actual mountstate into account. As a result running "puppet resource mount" on the commandline will report every mount that appears in /etc/(v)fstab as unmounted.
| * | | | | Merge branch ↵Jacob Helwig2011-05-161-2/+11
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'tickets/2.7.x/7259-make-active-record-test-requirement-optional' into 2.7.next * tickets/2.7.x/7259-make-active-record-test-requirement-optional: (#7259) Remove ActiveRecord requirement from indirector face spec (#7259) Do not try to load all Terminus classes when configuring the Indirector
| | * | | | | (#7259) Remove ActiveRecord requirement from indirector face specJacob Helwig2011-05-161-2/+11
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "should be able to return a list of terminuses for a given indirection" was calling Puppet::Indirector::Face.terminus_classes, which is just a thin wrapper around Puppet::Indirector::Terminus.terminus_classes, which would attempt to load all Terminus classes. This would cause problems if not all of the prerequisites for all of the Terminus classes were installed (For example: ActiveRecord). Now we only test that the thin wrapper appropriately munges the output from Puppet::Indirector::Terminus.terminus_classes, since the method being wrapped should have its own tests for the behavior that was being tested originally. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | | | | | (#1853) Pacman package providerPaul Boyd2011-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Stub the command method, so it doesn't give an error.
* | | | | | (#1853) Pacman package providerPaul Boyd2011-05-161-0/+237
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support for use Archlinux's pacman package manager in Puppet. Originally written by Miah Johnson, with bug fixes from Thomas Hatch and myself.
* | | | | Merge branch '2.7.x' into 2.7.nextMatt Robinson2011-05-132-20/+26
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (#7469) Add license to test face so tests pass (#7264) Docs: Clarify that subscribe/notify imply require/before (#7468) Stub spec that tries to connect to pypi.python.org Prevent spec failure caused by network device mock leak Fix #7299 - do not require net/ssh for running rake spec Resolved Conflicts: lib/puppet/util/network_device.rb spec/unit/util/network_device_spec.rb
| * | | | (#7469) Add license to test face so tests passMax Martin2011-05-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TestIndirection test face defined in indirection_base_spec did not have copyright or license information defined; this was causing order-dependent test failures when unit tests were run before other specs (as in rake spec). This commit adds license and copyright info to the test face to prevent these failures. Paired-with: Daniel Pittman <daniel@puppetlabs.com>
| * | | | Merge branch 'tickets/2.7.x/7299' into 2.7.xMax Martin2011-05-101-0/+4
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tickets/2.7.x/7299: Prevent spec failure caused by network device mock leak Fix #7299 - do not require net/ssh for running rake spec
| | * | | | Prevent spec failure caused by network device mock leakBrice Figureau2011-05-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were leaking some mocks in the network device singleton from tests to tests. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | | | | (#7468) Stub spec that tries to connect to pypi.python.orgMatt Robinson2011-05-101-20/+24
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed a test failure when I ran the specs without an internet connection. Specs should never need an internet connection to pass. Reviewed-by: Max Martin <max@puppetlabs.com>
* | | | | Revert "(#7220) Add the ability to "inherit" options."Daniel Pittman2011-05-122-121/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9329a1f33b4d7df81ad8661de74f8a3656428570. Conflicts: spec/unit/interface/action_builder_spec.rb spec/unit/interface/action_spec.rb
* | | | | maint: sync 'authconfig' to 'rest_authconfig' settingDaniel Pittman2011-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We changed the name of the authconfig setting to specify 'rest_', but this branch merge didn't sync the change through all the tests. Now resolved by renaming the configuration option in the test also. Paired-With: Jacob Helwig <jacob@puppetlabs.com>
* | | | | Merge branch '2.7.x' into 2.7.nextDaniel Pittman2011-05-0652-618/+742
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: * spec/unit/node/facts_spec.rb Updates: * spec/unit/interface/action{,_builder}_spec.rb => update for 'when_invoked' block being required.
| * | | | (#7353) Remove :for_humans format entirely.Daniel Pittman2011-05-052-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we never shipped this in a real release, we don't need to maintain compatibility. So, remove it entirely from the codebase. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | | Merge branch 'tickets/2.7.x/7179' into 2.7.xPieter van de Bruggen2011-05-041-12/+1
| |\ \ \ \
| | * | | | (#7179) Modify default ACL for /node/<name>.Pieter van de Bruggen2011-05-041-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, it is useful to permit an individual node to query information about itself, and there is no good reason to reject this by default. Paired-With: Nick Lewis
| * | | | | (#7353) Note the :for_humans compatibility issue.Daniel Pittman2011-05-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Where we need special support for :for_humans as an alias for :console, call it out in comments. This makes it clear to someone who wonders why what the actual underlying purpose of the whole thing is. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
| * | | | | (#7353) Unify rendering in the face_bace application.Daniel Pittman2011-05-041-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now move over to using only network FormatHandler rendering code for output, ditching all the support we had in the application. We include a compatibility shim to ensure that the :for_humans format that was supported for a while is now an alias for the :console format we are using moving forward. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
| * | | | | (#7353) Add 'console' format to FormatHandlerDaniel Pittman2011-05-041-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a console rendering format to the Network FormatHandler subsystem; it provides the same human-friendly textual rendering as the Faces application did, except it uses JSON rather than PP as the fall-back rendering mode. This paves the path for unification of all formatting into the same subsystem, rather than the half-measures we used to have. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
| * | | | | Merge branch ↵Daniel Pittman2011-05-031-1/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'bug/2.7.x/7277-improve-secret-agent-face-and-supporting-actions' into 2.7.x
| | * | | | | (#7277)Fixing all secret-agent functions, and the agent itselfLuke Kanies2011-05-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up the behaviours and ensures that we have parity between the basic actions of the agent and the secret_agent. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | | | | | Merge branch 'ticket/2.7.x/7139' into 2.7.xNick Lewis2011-05-031-0/+7
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| | * | | | | (#7139) Accept '/' as a valid path in filesetsNick Lewis2011-05-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was unconditionally removing the trailing file separator ('/'), which is only valid when the file separator isn't the entire path. This fixes 'puppet resource file <path>'. Paired-With: Jacob Helwig
| * | | | | | (#7329) Consistent naming for rendering formats and hooks.Daniel Pittman2011-05-031-0/+8
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We refer to rendering formats pretty consistently as `json`, `yaml`, `s`, and so forth; unqualified names. On the other hand, we refer to the rendering hooks *mostly* as `to_*`, except the `:for_humans` and `:json` formats. Which is kind of confusing because of the internal inconsistency, and because it doesn't match the public name. Fix the code to resolve both, so the `to_*` format still works, but we mostly expect to use the `*` version, to match public expectation.
| * | | | | (#7117) Return the environment as a Puppet::Node::Environment in uri2indirectionJacob Helwig2011-05-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The environment returned by uri2indirection used to be a Puppet::Node::Environment. When this changed to simply being the string of the environment name, this broke assumptions made in other areas of the code. Paired-with: Nick Lewis <nick@puppetlabs.com>
| * | | | | (#7276) Better reporting from the plugin download action.Daniel Pittman2011-05-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of just returning vague values, return useful information when rendering for a human being. Based on work by Luke Kaines <luke@puppetlabs.com> in https://github.com/lak/puppet/commit/a61cc770ca9b2cad744b5b21b9776a834d6ca895 Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| * | | | | (#7279) Adding some basic file actionsLuke Kanies2011-05-031-1/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to download a file into the local filebucket using a puppet URI or from disk. Also, the ability to store into the filebucket. These provide at least basic UI for moving data around using the filebucket service, and act as an example of how further work can be done. Also, update the code to eliminate a couple of redundant checks on arguments, and add some basic testing around the actions. Mostly only that they exist, at this point. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
| * | | | Merge branch 'bug/2.7.x/7314-backtrace-when-face-has-syntax-error' into 2.7.xDaniel Pittman2011-05-023-13/+31
| |\ \ \ \
| | * | | | (#7314) Faces fail horribly when one has a syntax error.Daniel Pittman2011-05-021-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we hit a syntax error in any face, a whole bunch of unrelated face things would blow up in horrible ways. Stack traces for all... Now, instead, we catch that fault but specifically only in the face file and report it through our error logs, then quietly ignore the face. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| | * | | | maint: move the indirector face base out of puppet/faceDaniel Pittman2011-05-022-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to shove the base class Puppet::Face::Indirector next to the actual faces; this made a bunch of things, including testing, confusing. Instead, move it away into the indirector where it lives with the rest of the indirector related things. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| | * | | | maint: reset more global state in testing faces...Daniel Pittman2011-05-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we query for all faces we need to scan the entire Ruby load path, look for everything that looks like a face, and load it up. That is a fairly expensive operation, especially on a platform that has slow I/O. *cough* EC2 *cough* Because of that we only scan once, and assume that the list is static thereafter; this works OK out in the field, but sucks in testing where that global state gets in the way of the rest of our fiddling under the hood. This resets the '@loaded' member of the collection additionally, which is what should be done since we have reset the rest of the collection at the same time. We don't bother to reset it, as an extra scan during tests is not a problem. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * | | | | Merge branch 'bug/2.7.x/7315-puppet-status-can't-render-as-json' into 2.7.xDaniel Pittman2011-05-021-0/+4
| |\ \ \ \ \
| | * | | | | (#7315) Fix `to_pson` method to render correctly.Daniel Pittman2011-05-021-0/+4
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet::Status had an outdated implementation of the `to_pson` hook, so would fail to render when asked. Changes to the faces system exposed this, resulting in a backtrace if the user wanted JSON output on the CLI. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * | | | | (#7304) Improve help from `puppet foo`Daniel Pittman2011-05-021-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses two of the four points: we now quote the subcommand name, and emit 'Usage: ' before the usage information on the puppet command line. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * | | | | (#7317) better error handling in CLI face facade.Daniel Pittman2011-05-021-2/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error handling code in the face CLI facade was pretty terrible: it make a bunch of assumptions about the structure of the error message it got back, and used exceptions to communicate inside the same function. Instead, we handle errors uniformly without raising and catching in the same method, report more nicely, and exit cleanly in all cases. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * | | | Merge branch 'bug/2.7.x/7282-fail-when-no-invocation-given-for-action' into ↵Daniel Pittman2011-05-024-21/+70
| |\ \ \ \ | | |/ / / | |/| | | | | | | | 2.7.x
| | * | | (#7282) action without `when_invoked` should fail...Daniel Pittman2011-05-024-21/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to let actions be declared without the `when_invoked` block, which was usually a sign of either someone writing their method code direct in action declaration, or someone forgetting to add their code at all. This was just let silently by: the error only showed up when you finally tried to invoke the action, and a NoMethod error was raised by the face. ...except for our own testing. We took advantage of this a whole pile of times in there; fixing the original UI issue means fixing all those too. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| * | | | (Maint.) Fix accidental debug output in tests.Pieter van de Bruggen2011-04-291-1/+1
| |/ / / | | | | | | | | | | | | Reviewed-By: Daniel Pittman
| * | | Merge branch 'tickets/2.7.x/7289' into 2.7.xPieter van de Bruggen2011-04-291-109/+176
| |\ \ \