summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Augmentation of tests for prior commitMarkus Roberts2011-02-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | There is no good answer to tests that depend on the order of itteration over hashes.
* | | | | | Fix to fix for #5755 -- backref serialization issues in zamlMarkus Roberts2011-02-011-1/+25
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit addresses the original issue that the change reverted in the previous commit for #5755 was intended to fix by removing the special case on labels in emit (lables, even if they are never generated, are not "new lines" and thus @recent_nl should always be set to false when one is emitted). It also partially addresses a related issue wherein temporary strings generated when field names are constructed recycle their object_id (they are temporary) and thus cause incorrect back references. This commit "fixes" the problem by never generating backrefs to strings (treating them as immutable). It does not address other suspected issues such as thread safety durring serialization due to the use of class variables to store the seen-object hash or the use of object ids as "permanently unique" identifiers. Paired with: Daniel Pittman Advice & Commiseration: Jesse Wolfe
* | | | | Merge branch 'feature/master/5061' into 2.6.nextPaul Berry2011-02-011-0/+22
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * feature/master/5061: (#5061) - allow special hostclass/define variables to be evaluated as defaults.
| * | | | | (#5061) - allow special hostclass/define variables to be evaluated as defaults.Dan Bode2011-02-011-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have always been annoyed that special variables for defines and hostclasses can not be evaluated as param defaults. Special variables are: $name, $title, $module_name. Code example: class x ( foo = $name ) { notice($foo)} should print x, and with my patch, it does. Reviewed-by: Paul Berry <paul@puppetlabs.com>
* | | | | | Merge branch 'ticket/2.6.next/5045' into 2.6.nextMatt Robinson2011-02-012-9/+118
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/5045: (#5045) Cleaning up some tests and code (#5045) External node classifiers should be able to specify params for classes (#5045) Adds support to resource/type to also accept a param hash
| * | | | | (#5045) Cleaning up some tests and codeMatt Robinson2011-01-242-33/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed some variables to be clearer, made tests use less stubbing, added some additional tests and got rid of some unecessary logic. Paired-with: Dan Bode
| * | | | | (#5045) External node classifiers should be able to specify params for classesDan Bode2011-01-241-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It facilitates the support for param classes from the ENC. It adds support for classes to be passed as a hash to the evaluate_classes method. If a hash of classes is specified, it also evaluates duplicates. I also had to convert the hash to an array for tags to be applied correctly. Reviewed-by: Matt Robinson
| * | | | | (#5045) Adds support to resource/type to also accept a param hashDan Bode2011-01-241-0/+25
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The params are added as attributes when the resource is created. Also, even if the class already exists, if params are passed, we still try to create it. Reviewed-by: Matt Robinson
* | | | | Merge branch 'ticket/2.6.next/6107' into 2.6.nextMatt Robinson2011-02-012-0/+61
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/6107: (#6107) Fix an error when auditing a file with empty content
| * | | | | (#6107) Fix an error when auditing a file with empty contentMatt Robinson2011-02-012-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manifest: file { "/tmp/foo" : ensure => present, audit => content, } produced the error: err: /Stage[main]//File[/tmp/foo]/ensure: change from absent to present failed: Could not retrieve content for from filebucket: private method `sub' called for nil:NilClass at /Users/matthewrobinson/work/puppet/test.pp:4 This was due to logic in content assuming that if you didn't specify content while you were auditing it you must have specified a source. The code paths in the file type badly need a cleanup so that these sorts of errors aren't so difficult to track down and things are easier to test. Paired-with: Daniel Pittman
* | | | | | Remove already initialized constant warning from file_spec.rb testsJacob Helwig2011-02-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rspec pulls constants from the implementation into the test, so we don't need to redefine it. Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | (#5566) Treat source only File checksums as syntax errors when used with contentJacob Helwig2011-02-011-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain checksum types (ctime, mtime) only make sense when used with the 'source' File parameter, since there is no way to check them on raw strings. Given the limitations of the current checksumming implementations, it is likely to introduce unexpected behavior when using the 'none' checksum type and either one of the 'source', and 'content' File parameters. Because of this, it is now a syntax error to use a checksum of 'none' with either parameter. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | | Remove order dependency when specifying source and checksum on File typeJacob Helwig2011-02-011-0/+15
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If source was specified after setting the checksum, it would cause the checksum to be set back to :md5. This was completely unnecessary, because the checksum has its own default of :md5. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | Bug #5755 -- ZAML generates extra newline in some hash backreferences.Daniel Pittman2011-01-311-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This data structure generates YAML with an extra newline that violates the syntax rules and all: list = [1] { :a => list, :b => list }.to_yaml This breaks real client use of the YAML catalogs, not to mention our own use of cached catalogs...
* | | | | Spec for #5681 to allow parsing of AIX mount output in mount providerRick Bradley2011-01-312-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | This also adds a fixture file containing the AIX mount output as submitted by the ticket author.
* | | | | Bug #6091 -- test leading double-slash in filenames are allowed.Daniel Pittman2011-01-311-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | They presently are not; this ensures that we verify that before merging a change that fixes bugs in the area.
* | | | | Bug #6061 -- verify that negative {min,max}_password_age are accepted.Daniel Pittman2011-01-281-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the age value to -1 will disable the specific aging value; we should accept that, but continue to reject null or empty values as invalid. Add tests to verify that this code enforces as expected.
* | | | | Feature #5855 -- undefined method 'withenv' in FreeBSD package provider.Daniel Pittman2011-01-261-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The FreeBSD package provider fails to install when any source is given, yielding instead an 'undefined method' error. This adds tests that prove the bug exists.
* | | | | Merge branch 'bug/2.6.next/6009' into 2.6.nextDaniel Pittman2011-01-251-0/+38
|\ \ \ \ \
| * | | | | Fixed #6009 - nested member list vs directory service group providerJames Turnbull2011-01-251-0/+38
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Directory Service group (and user) provider behaves erratically if members is a nested list; this happens with the following manifest: $r = ["root"] $a = ["daemon", "crc"] $n = ["nobody"] group { "testgroup": ensure => present, members => [$r, $a, $n] } This resolves the issue by flattening the list at the time we are using it; while a more general solution might be desirable this resolves the specific issue cleanly enough. Original patch from Clay Caviness. Tests by Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: James Turnbull <james@lovedthanlost.net>
* / / / / (#5931) Prevent errors when calling insync? on audited propertiesPaul Berry2011-01-2512-63/+82
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Created a method safe_insync? which first checks whether the property has a "should" value of nil, and if so returns true. Most insync? methods were already doing this, but a few were not, leading to bugs if a property was being audited but not set. Types should continue to override the insync? method, but callers of insync? should call safe_insync? instead. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | (#5882) Added error-handling for bucketing files in puppet inspectNick Lewis2011-01-131-2/+16
| | | | | | | | | | | | | | | | Paired-With: Paul Berry
* | | | (#5882) Added error-handling to puppet inspect when auditingNick Lewis2011-01-131-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If auditing a resource fails, the report will contain failure events for every audited property of the resource. The report itself will also be marked as "failed". Paired-With: Paul Berry
* | | | (#5171) Made "puppet inspect" upload audited files to a file bucketPaul Berry2011-01-131-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only occurs if the new setting :archive_files is set. Another new setting, :archive_file_server, can be used to specify the server that files should be uploaded to. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | | | Merge branch 'ticket/2.6.next/5838' into 2.6.nextPaul Berry2011-01-1211-434/+362
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/5838: (#5838) Support paths as part of file bucket requests. (#5838) Improve the quality of file bucket specs. (#5838) Make file bucket dipper efficient when saving a file that already exists (#5838) Implemented the "head" method for FileBucketFile::File terminus. (#5838) Reworked file dipper spec to perform less stubbing. (#5838) Added support for HEAD requests to the indirector. (#5838) Refactored error handling logic into find_in_cache. (#5838) Refactored Puppet::Network::Rights#fail_on_deny
| * | | | (#5838) Support paths as part of file bucket requests.Paul Berry2011-01-121-84/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In versions of Puppet 2.6.0-2.6.4, file bucket requests are of the form md5/<checksum>/<path>. The path functionality has been removed, however we still need to support requests coming from older clients. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Improve the quality of file bucket specs.Paul Berry2011-01-122-36/+66
| | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Make file bucket dipper efficient when saving a file that already existsPaul Berry2011-01-121-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before saving to the file bucket, the file bucket dipper now checks to make sure that no file with the given checksum is already present. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Implemented the "head" method for FileBucketFile::File terminus.Paul Berry2011-01-123-265/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to do this it was necessary to refactor FileBucketFile to untangle responsibilities for computing paths, reading files, etc. In the process, removed speculative generalizations and unused functionality. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Reworked file dipper spec to perform less stubbing.Paul Berry2011-01-121-82/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation for adding more functionality to the file dipper. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Added support for HEAD requests to the indirector.Paul Berry2011-01-128-8/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for the indirector to handle REST HEAD requests. These are done using a new indirector method, head(), which should return true if find() would return a result and false if find() would return nil. Access control for the head method is the union of that for the find and save methods. That is, if either find or save is allowed, then head is allowed. This is necessary so that users will not have to change their authconfig to take advantage of the new feature. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#5838) Refactored Puppet::Network::Rights#fail_on_denyPaul Berry2011-01-122-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed into a method that returns the exception to raised rather than raising it. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | | maint: Remove unused Rakefile in spec directoryMatt Robinson2011-01-111-91/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | The Rakefile just created rake tasks so that you could run all the specs in a subdirectory. However, rspec already allows you to just give the subdirectory as an argument and does the same thing, so these rake tasks were unecessary.
* | | | (#5171) Made filebucket able to perform diffsJesse Wolfe2011-01-112-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is now possible to ask the filebucket to diff two files using a URL of the form: https://puppet/production/file_bucket_file/md5/{first file hash}?diff_with={second file hash} The returned diff is a string, the output of the "diff" command. Paired-with: Paul Berry <paul@puppetlabs.com>
* | | | (#5710) Removed unnecessary calls to insync?Paul Berry2011-01-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the resource harness, we were calling insync? on all properties of a resource, even if those properties weren't being managed. This was unsafe. Changed to only call insync? on properties that are mentioned in the manifest. In addition, we discovered that the resource harness's computation of desired_values was incorrect, and was consulting the current system state rather than the desired state. Since this hash was (erroneously) only being consulted to see if it included :ensure, this didn't cause any obvious bugs. However it is now fixed. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | Prep for fixing #5710: Refactor stub provider in resource harness specPaul Berry2011-01-071-33/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved the stub provider to its own method so that it can be re-used in additional spec tests. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | Maint: test partial resource failurePaul Berry2011-01-071-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a resource harness test to verify that the correct events are generated if there is a failure while synchronizing a resource. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | | Merge branch 'ticket/2.6.next/5799' into 2.6.nextNick Lewis2011-01-071-0/+31
|\| | |
| * | | (#5799) Simplify report dir creationNick Lewis2011-01-061-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This report processor was unnecessarily using Puppet to create a single directory. This was causing complex failures in any spec dealing with reports. Paired-With: Paul Berry
* | | | maint: Inspect reports should have audited = true on eventsMatt Robinson2011-01-061-0/+20
|/ / / | | | | | | | | | Paired-with: Jesse Wolfe
* | | (#5771): Fix spec failures associated with rspec upgradeNick Lewis2011-01-053-96/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Due to changes in the spec_helper, some of the specs that use puppettest were failing when run individually. In the future, it would be nice to remove puppettest from the specs entirely, as it's old, crufty, and only used for a couple of things. Paired-With: Matt Robinson
* | | (#5771) Upgrade rspec to version 2Matt Robinson2011-01-0449-224/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | The biggest change is that we no longer need to monkey patch rspec to get confine behavior. Describe blocks can now be conditional like confine used to be. "describe" blocks with "shared => true" are now "shared_examples_for". Paired-With: Nick Lewis
* | | Merge branch 'ticket/2.6.next/5758' into 2.6.nextPaul Berry2011-01-031-6/+56
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/5758: (#5758) Verify that report events are correctly created Prep work for #5758: set audited=true on all audit events Prep work for #5758: clean up initializer for Puppet::Transaction::Event
| * | | (#5758) Verify that report events are correctly createdPaul Berry2011-01-031-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added code to resource_harness_spec to test all the attributes of report events, not just the log messages. Paired-with: Matt Robinson <matt@puppetlabs.com>
* | | | Merge branch 'ticket/2.6.next/5698' into 2.6.nextJesse Wolfe2011-01-031-1/+24
|\ \ \ \ | |/ / / |/| | |
| * | | Fix #5698 puppet inspect shouldn't report of attributes of deleted filesJesse Wolfe2011-01-031-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a resource is absent, then reporting that its properties are all ":absent" is not particularly correct. This patch makes the `inspect` application's reports behave more like `apply` reports, and skip properties other than :ensure for absent resources. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | (#5715) Added attributes resource_type and title to Puppet::Resource::Status.Paul Berry2010-12-301-0/+5
| | | | | | | | | | | | | | | | | | | | These new attributes save report processors from having to parse the "resource" attribute.
* | | | (#5715) Removed attribute source_description from the YAML representation ofPaul Berry2010-12-301-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet::Resource::Status. This attribute is only used for properly generating log messages and was never intended to appear in reports.
* | | | (#5715) Removed unnecessary attributes from YAML of Puppet::Transaction::Event.Paul Berry2010-12-301-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | The removed attributes are file, line, resource, tags, source_description, and default_log_level. These attributes were all redundant with those in Puppet::Resource::Status.
* | | | (#5715) Make certain report attributes always present.Nick Lewis2010-12-303-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The attributes Puppet::Resource::Status#changed, Puppet::Resource::Status#out_of_sync, and Puppet::Transaction::Event#audited used to only appear in reports when their state was true. Now they appear always.