summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yamlBrice Figureau2011-04-052-2/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once a configuration run is done, puppetd will save on the node a yaml summary report roughly akin to: --- time: notify: 0.001025 last_run: 1289561427 schedule: 0.00071 config_retrieval: 0.039518 filebucket: 0.000126 resources: changed: 1 total: 8 out_of_sync: 1 events: total: 1 success: 1 changes: total: 1 This is almost an hash version of the current --summarize output, with the notable exception that the time section includes the last run unix timestamp. The whole idea is to be able to monitor locally if a puppetd does its job. For instance this could be used in a nagios check or to send an SNMP trap. The last_run information might help detect staleness, and this summary can also be used for performance monitoring (ie time section). The resource section can also show the number of failed resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Merge branch 'tickets/2.6.x/3127' into 2.6.nextJames Turnbull2011-04-041-1/+11
| |\ | | | | | | | | | | | | * tickets/2.6.x/3127: Fixed #3127 - Fixed gem selection regex
| | * Fixed #3127 - Fixed gem selection regexJames Turnbull2011-04-041-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Previously if the gem json_pure was installed and you requested the gem json then the regex matched too soon and falshly indicated that the json gem was already installed. Also updated to add the --no-ri and no-rdoc options and fix tests.
| * | (#5437) Invalidate cached TypeCollection when there was an error parsingJacob Helwig2011-04-012-15/+23
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The caching of the TypeCollection in Puppet::Node::Environment would cause parse errors to occur (and be reported) only once and never again, until the file had changed on disk. This would also cause empty catalogs to be sent down to the agents further hiding the problem. Now, when a file fails to parse, it will be re-parsed every time on every following compilation, causing the parse error to be reported every time, and preventing sending down empty catalogs to agents. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | Merge branch 'feature/next/resource_application_order' into nextMarkus Roberts2011-04-065-104/+133
|\ \
| * | (5200) -- replace containers with sentinalsMarkus Roberts2011-04-065-84/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing containers with many-to-many relationships, we now replace them with a pair of sentinals (whits) that bracket them. Thus a graph consisting of two containers, each containing ten resources, and a dependency between the containers, which would have gone from 21 edges to 100 edges will instead have only 43, and a graph consisting of two containers (e.g. stages) each containing a similar graph, which would have gone from 45 edges to 400 will only go to 95. This change had minor consequences on many parts of the system and required lots of small changes for consistancy, but the core of it is in Catelog#splice! (which replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is just adjustments to the fact that some one-step edges are now two-step edges and tests, event propagation, etc. need to reflect that. Paired-with: Jesse Wolfe
| * | (6911) Cleanup and renaming of transaction internalsMarkus Roberts2011-04-011-13/+3
| | | | | | | | | | | | | | | | | | | | | The preceeding changes left some rough edges in the Transactions (a short, badly named method that was only used in one place and would be clearer in- line, a return value that was carfully retained and never used, etc.) This commit clears some of that up.
| * | (6911) Core change -- replace topsort with frontier ordered by salted SHA1Markus Roberts2011-04-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the core change of the ticket; rather than using a topological sort to statically determine the order in which resources should be applied, we use the graph wrapper introduced in the prior commit to dynamically determine the order in which to apply resources based on 1) the status of the resource (ready, done) 2) the explicit & implied dependencies, 3) the salted SHA1 of the title (for stability). Further work is needed: 1) Resolving the handling of failed resources 2) Tests of the new behavior, to the extent posible 3) Newly-dead-code removal in simple_graph & transaction 4) Fix the name-prefix ordering hack in eval_generate by either: a) Moving the logic into file b) Refactoring Type#eval_generate to return a tree c) ....? 5) Rough performace testing to look for hotspots 6) Investigation of possible interaction with #3788, #5351, #5414, #5876, #6020, #6810, and #6944 which may simplify or complicate their resolution. Paired-with: Jesse Wolfe
| * | (6911) Cleanup of generate_additional_resourcesMarkus Roberts2011-03-311-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The previous commit left only one meaningful value for the method parameter of generate_additional_resources, making it a constant not a parameter. This commit removes it. Paired-with: Jesse Wolfe
| * | (6911) Refactor to localize eval_generate dependency assumptionsMarkus Roberts2011-03-312-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | To implement #6911 we will need to be able to make incremental descisions about order of application based only on the contents of the resource graph and local "working data." This commit begins to pull the needed structure into a method (visit_resources) while, for the moment, maintaining the original semantic. Paired-with: Jesse Wolfe
* | | Merge branch 'feature/master/5528-certificates_signing_api' into nextMax Martin2011-04-053-54/+341
|\ \ \ | |/ / |/| | | | | | | | * feature/master/5528-certificates_signing_api: (#5528) Add REST API for signing, revoking, retrieving, cleaning certs
| * | (#5528) Add REST API for signing, revoking, retrieving, cleaning certsMax Martin2011-04-053-54/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new Indirector terminus, certificate_status, which allows for signing, revoking, listing, and cleaning SSL certificates over HTTP via REST. Documentation for these new features can be found in our REST API documentation on the docs site: http://docs.puppetlabs.com/guides/rest_api.html This documentation has not been updated as of the writing of this commit, but will be very soon. Puppet::SSL::Host is now fully integrated into the Indirector. Paired-with:Matt Robinson, Jacob Helwig, Jesse Wolfe, Richard Crowley, Luke Kanies
* | | Merge branch '2.6.x' into nextMax Martin2011-03-302-4/+16
|\ \ \ | | |/ | |/| | | | | | | | | | | | | * 2.6.x: (#5908) Add support for new update-rc.d disable API (#6862) Add a default subject for the mail_patches rake task Fixed #6256 - Creation of rrd directory.
| * | (#5908) Add support for new update-rc.d disable APIMax Martin2011-03-301-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for the new disable API to update-rc.d and added spec tests to check this functionality. This change was made because in versions of sysv-rc >= 2.88, 'update-rc.d stop' is broken and actually enables the service. We only changed the disable case as the enable case still works on systems which use sysv-rc 2.88 or greater (atm, only Debian Lenny). We wanted to change as little as possible because update-rc.d prints a message stating that the new enable/disable API is unstable and may change in the future. Paired-with:Matt Robinson, Jacob Helwig
| * | Merge branch 'tickets/2.6.x/6256' into 2.6.nextJames Turnbull2011-03-261-2/+2
| |\ \ | | | | | | | | | | | | | | | | * tickets/2.6.x/6256: Fixed #6256 - Creation of rrd directory.
| | * | Fixed #6256 - Creation of rrd directory.James Turnbull2011-03-261-2/+2
| | | | | | | | | | | | | | | | Added :metrics to the settings used by the master
| * | | Merge branch 'ticket/2.6.next/5477' into 2.6.nextJesse Wolfe2011-03-254-18/+35
| |\ \ \
| | * | | (#5477) Allow watch_file to watch non-existent files, especially site.ppJesse Wolfe2011-03-254-18/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Backported this change to 2.6.x Paired-With: Jacob Helwig <jacob@puppetlabs.com>
* | | | | Merge branch 'tickets/master/6494' of https://github.com/domcleal/puppet ↵Jesse Wolfe2011-03-291-0/+54
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | into next
| * | | | | (#6494) Add setm command to Augeas providerDominic Cleal2011-02-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Augeas setm command can set the value of multiple nodes in a single operation. Takes a base path, then a subnode path expression (relative to the base) and then the value itself.
| * | | | | (#6494) Add mv command to Augeas providerDominic Cleal2011-02-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves the first node to the position of the second, deleting it and its children if it already exists.
| * | | | | (#6494) Add defnode command to Augeas providerDominic Cleal2011-02-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses Augeas' defnode command which creates a variable pointing to a node, creating it with 'set' if it doesn't already exist.
| * | | | | (#6494) Add defvar command to Augeas providerDominic Cleal2011-02-251-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses Augeas' native defvar command to define variables for certain expressions that can then be referenced later with $variable.
* | | | | | Merge branch 'tickets/master/6324' of https://github.com/domcleal/puppet ↵Jesse Wolfe2011-03-291-0/+137
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into next
| * | | | | | Fix non-existent method called in SMF manifest import exception message, ↵Dominic Cleal2011-02-191-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | updated spec
| * | | | | | (#6324) Use real service resource object instead of a stubDominic Cleal2011-02-191-10/+3
| | | | | | |
| * | | | | | (#6324) Add spec for SMF service providerDominic Cleal2011-02-181-0/+133
| |/ / / / /
* | | | | | Merge branch 'feature/master/6144' of https://github.com/ghoneycutt/puppet ↵Jesse Wolfe2011-03-291-0/+1
|\| | | | | | | | | | | | | | | | | | | | | | | into next
* | | | | | Merge branch 'feature/2.6.next/5909' of https://github.com/bodepd/puppet ↵Jesse Wolfe2011-03-291-0/+135
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | into next
| * | | | | | (5909) Function to dyncamically generate resources.Dan Bode2011-03-161-0/+135
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function allows you to dynamically generate resources, passing them as a hash to the create_resources function. This was originally written to be used together with an ENC. Resources can be programitally generated as yaml and passed to a class. classes: webserver::instances: instances: instance1: foo: bar instance2: foo: blah Then puppet code can consume the hash parameters and convert then into resources class webserver::instances ( $instances = {} ) { create_resources('webserver::instance', $instances) } Now I can dynamically determine how webserver instances are deployed to nodes by updating the YAML files.
* | | | | | (#6830) Fix tests that depended on special inherited behaviorMatt Robinson2011-03-2913-63/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | class Foo def self.inherited(subclass) puts "#{subclass.inspect} inherited from #{self}" end end class Bar < Foo end a = Class.new(Bar) do def self.to_s "some other class" end end In Ruby 1.9 this prints Bar inherited from Foo #<Class:0x0000010086c198> inherited from Bar In Ruby 1.8 the to_s override used to be in effect so printed: Bar inherited from Foo some other class inherited from Bar Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | (#6830) Fix overly stubbed testsMatt Robinson2011-03-291-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 1.9 calling .each on a stub calls to_a, and if you're not stubbing to_a you get: unexpected invocation: #<Mock:option1>.to_a() Could have stubbed to_a also, but less stubbing is better in these cases Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | (#6830) Fix badly stubbed Time object in testMatt Robinson2011-03-292-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 won't allow to_i to be called on a symbol. It results in the error: undefined method `to_i' for :now:Symbol Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | Merge branch 'ticket/next/5477' into nextJesse Wolfe2011-03-254-19/+36
|\ \ \ \ \ \
| * | | | | | (#5477) Allow watch_file to watch non-existent files, especially site.ppJesse Wolfe2011-03-254-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Paired-With: Max Martin <max@puppetlabs.com> Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | | Merge commit '2.6.next^1' into nextJesse Wolfe2011-03-252-2/+22
|\ \ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | These changes were superseded by existing commits in next: lib/puppet/parser/compiler.rb spec/unit/parser/compiler_spec.rb
| * | | | | | Merge branch 'ticket/2.6.next/5221' into 2.6.nextNick Lewis2011-03-241-0/+8
| |\ \ \ \ \ \ | | |_|_|_|/ / | |/| | | | |
| | * | | | | (#5221) Add test for fix to fileset with trailing separatorNick Lewis2011-03-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Pieter van de Bruggen
| * | | | | | Merge branch 'feature/2.6.next/4576' of https://github.com/bodepd/puppet ↵Jesse Wolfe2011-03-241-2/+1
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | into 2.6.next
| | * | | | | | (4576) - if ENC declares invalid class, it is logged at warning.Dan Bode2011-03-161-2/+1
| | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | used to be at info, so you had to run the master on verbose to see it an ENC was trying to declare a class that could not be loaded.
| * | | | | | (#4769) Fix negative timeout support for newer rubiesNick Lewis2011-03-241-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In new versions of Ruby, negative timeouts are unsupported. So munge negatives to zero in the parameter. Reviewed-By: Jacob Helwig
* | | | | | | (#6855) ResourceType#search now accepts a regexLuke Kanies2011-03-251-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We treat the regex relatively plainly, but this is more reasonable than just '*'. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Max Martin <max@puppetlabs.com>
* | | | | | | Merge branch 'tickets/master/6850-resource_type_listing_and_converting' into ↵Luke Kanies2011-03-254-20/+202
|\ \ \ \ \ \ \ | |_|_|_|/ / / |/| | | | | | | | | | | | | next
| * | | | | | Fixing #6851 - ResourceType#find/search loads typesLuke Kanies2011-03-252-8/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we could only find types from site.pp, but we now automatically load the specified type (for find) or all types. This also adds a TypeLoader#import_all capable of importing all manifests (ruby or puppet) on a given system. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | | | Fixing Module#path detectionLuke Kanies2011-03-251-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason FileTest.exist? was returning false, and FileTest.directory? returns true. I've also added much better tests for this behavior. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| * | | | | | Fixed #6850 - Clean up ResourceType#to_psonLuke Kanies2011-03-251-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no value in including the code when we convert a resource type to JSON, since you can't convert it back again, so this removes it. I also cleaned up a few of the other attributes which were producing unnecessary information. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* | | | | | | (#4576) Raise an error when a node is classified into a non-existent classJesse Wolfe2011-03-241-19/+5
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2.6.x, this was upgraded from "info" to "warning". This change for Statler escalates the warning to an exception which will abort the compile. This makes compiling fail consistently when you try to use an undefined class from any of: node classifiers, the class keyword, and the include function. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | Merge branch '2.6.next' into nextMax Martin2011-03-236-126/+1253
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: Fixed #6562 - Minor kick documentation fix (#6658) Propagate ENC connection errors to the agent (#4884) Remove typo from spec test (#4884) Modify tests to pass on non-OS X systems (#4884) Revise new exec tests, add a few more (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace (#4884) Get rid of open3 require since it wasn't being used (#5814) Improved cron type specs (#5814) cron_spec shouldn't depend on cron provider Manually Resolved Conflicts: lib/puppet/util/command_line/puppetrun spec/spec_helper.rb spec/unit/type/exec_spec.rb spec/unit/type_spec.rb test/ral/type/exec.rb
| * | | | | Merge branch 'ticket/2.6.next/6658' into 2.6.nextMatt Robinson2011-03-181-3/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/6658: (#6658) Propagate ENC connection errors to the agent
| | * | | | | (#6658) Propagate ENC connection errors to the agentMatt Robinson2011-03-181-3/+2
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the master failed to run the External Node Classifier script it would log an error on the master, but the agent didn't get back the full error or the stack trace for it's logs. By raising when there's an ENC script problem on the master, this causes the error messages to propagate to the agent. Paired-with: Jacob Helwig <jacob@puppetlabs.com>