summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | 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>
| * | | | | Merge branch 'ticket/2.6.x/5814' into 2.6.nextMax Martin2011-03-181-18/+466
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/5814: (#5814) Improved cron type specs (#5814) cron_spec shouldn't depend on cron provider
| | * | | | | (#5814) Improved cron type specsStefan Schulte2011-01-091-17/+454
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add specs to test value validation for minute, hour, weekday, month and monthday
| | * | | | | (#5814) cron_spec shouldn't depend on cron providerStefan Schulte2011-01-091-1/+12
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if cron is not installed the specs will throw errors abould not finding a default provider. Because the spec doesn't test provider features it shouldn't depend on any providers. Add stubs to let cron_spec work with no suitable provider
| * | | | | (#4884) Remove typo from spec testMax Martin2011-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the stubs was accidentally stubbing for /bin/foo instead of /bin/true. Reviewed-by:Nick Lewis
| * | | | | (#4884) Modify tests to pass on non-OS X systemsMax Martin2011-03-182-75/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed problems with the spec tests for the new exec type and providers that were causing failures on non-OS X systems. This involved rearranging some of the tests and their describe blocks, which makes the diff look more dramatic than it really is. Paired-with:Matt Robinson, Jacob Helwig
| * | | | | Merge branch ↵Max Martin2011-03-175-84/+786
| |\ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code' into 2.6.next * feature/2.6.next/4884-an-exec-provider-that-executes-unfiltered-bash-code: (#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
| | * | | | (#4884) Revise new exec tests, add a few moreMax Martin2011-03-172-10/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revised a few of the new tests for the exec type and provider to ensure that they were testing what they meant to, and added in a couple of new tests. Reviewed-by:Daniel Pittman
| | * | | | (#4884) Add an shell provider for execsMatt Robinson2011-03-151-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to use shell builtins when the exec is inline bash commands. Paired-with: Max Martin
| | * | | | (#4884) Break the exec type out to have a posix providerDaniel Pittman2011-03-152-83/+706
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for allowing other new providers to handle exec commands differently. Reviewed-by: Max Martin and Matt Robinson
| | * | | | (#4884) Add consistent path validation and behaviorDaniel Pittman2011-03-151-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many path parameters were implementing their own inconsistent validation and behavior. Now those parameters can have a parent class that makes things a lot more consistent. Reviewed-by: Matt Robinson and Max Martin
| | * | | | (#4884) Add expand_path to requiring the spec_helperMatt Robinson2011-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Max Martin
* | | | | | (#6820) Fix Invalid multibyte characterMatt Robinson2011-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | puppet/spec/unit/network/authstore_spec.rb:89: invalid multibyte char (US-ASCII) puppet/spec/unit/network/authstore_spec.rb:89: syntax error, unexpected $end, expecting ']' " 2001:0000:1234:0000:0000:C1C0:ABCD:0876  0", ^ There was a non-breaking space (HEX A0) in that line because according to Markus (who made the original commit), these test lines were copy pasted from a web page. The intent wasn't to test non-breaking speace chacters for IPV6. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | | | | Merge branch 'feature/next/6527-pip_package_provider' into nextMatt Robinson2011-03-221-4/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature/next/6527-pip_package_provider: (#6527) Fix pip tests
| * | | | | | (#6527) Fix pip testsMatt Robinson2011-03-221-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The testing of lazypip forgot to stub which, so they worked when pip was installed, but didn't work when it wasn't. Appropriate stubbing has been put in place, and stubs changed to expects for some stronger assertions about what's happening. Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>