summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | 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>
* | | | (#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>
* | | | (#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) Upgrade rspec to version 2Matt Robinson2011-01-0436-142/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | (#5715) Changed the type of metric names to always be strings.Paul Berry2010-12-302-20/+20
| | | |
* | | | (#5715) Add status attribute to reports.Paul Berry2010-12-301-3/+18
| | | |
* | | | (#5715) Made the changes/total and events/total metrics always presentPaul Berry2010-12-301-0/+10
| | | | | | | | | | | | | | | | Previously these metrics were omitted when their values were zero.
* | | | (#5715) Refactor in preparation for adding a status attribute to reports.Paul Berry2010-12-303-30/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed Puppet::Transaction::Report#calculate_metrics to finalize_report, in preparation for adding more functionality to this method. Removed Puppet::Transaction#send_report and Puppet::Transaction#generate_report. The former was never used, and the latter was unnecessary.
* | | | (#5715) Removed Puppet::Transaction::Report#external_times from YAML output.Paul Berry2010-12-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This attribute was never intended to be serialized to YAML; it exists merely as temporary storage for metrics that have not yet been placed in the report's metrics attribute.
* | | | (#5715) Added total time metric to apply reports.Paul Berry2010-12-301-0/+9
| | | | | | | | | | | | | | | | | | | | This was a feature that was present in 0.25.x and was inadvertently dropped from 2.6.x.
* | | | (#5715) Removed redundant attribute Transaction::Event#versionPaul Berry2010-12-302-2/+2
| | | |
* | | | (#5715) Removed redundant attribute Resource::Status#versionPaul Berry2010-12-301-2/+2
| | | |
* | | | (#5715) Removed Puppet::Util::Log#version.Paul Berry2010-12-306-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | This attribute was only relevant in reports, and in reports it was redundant with Puppet::Transaction::Report#configuration_version and Puppet::Transaction::Report#puppet_version.
* | | | (#5715) Removed the unused attribute Puppet::Transaction::Event#nodePaul Berry2010-12-301-1/+1
| | | |
* | | | (#5715) Removed Resource::Status#skipped_reason. It was never used.Paul Berry2010-12-301-1/+1
| | | |
* | | | (#5715) Prep work: Fixed add_statuses in report_spec.Paul Berry2010-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Report_spec contained a helper method called add_statuses which claimed to add a status object n times. It actually always added it 3 times, and fortunately callers always specified n=3. Changed this to be more sane.
* | | | Merge branch 'ticket/2.6.next/5723' into 2.6.nextNick Lewis2010-12-291-3/+3
|\ \ \ \ | |/ / / |/| | |
| * | | (#5723) Fix failing type/package specsNick Lewis2010-12-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These tests were failing because they were overly constraining what the code could do. Because of a bug in Mocha 0.9.8, these failures weren't caught when the code causing them was first made. These failures were introduced in 7fff7808e25491a5ea1e207b8de3ade0c4f95f4f. Paired-With: Paul Berry
* | | | Implement #5168 and #5169 ctime and mtime are propertiesJesse Wolfe2010-12-203-0/+90
| | | | | | | | | | | | | | | | | | | | File ctime and mtime are now implemented as read-only properties, so they can be examined with audit.
* | | | Modified the behavior of Puppet::Resource::Status as follows:Paul Berry2010-12-173-7/+53
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | - #change_count now only counts events that represent successful changes. It does not count failures, audits, or noops. - #changed is equivalent to #change_count > 0. - #out_of_sync_count (a new attribute) counts all events except audits. - #out_of_sync is equivalent to #out_of_sync_count > 0. This should hopefully make the summary statistics in reports more useful.
* | | (#5408) Reworked ResourceHarness so that code is clearer and all behaviors ↵Paul Berry2010-12-174-550/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are tested This patch removes the Puppet::Transaction::Change class and replaces it with a method, Puppet::Transaction::ResourceHarness#apply_parameter. The new code is shorter, more thoroughly unit tested, and addresses known bugs in the interaction between auditing and performing changes. This code does not address drawbacks in the report output (for example a resource is still flagged as changed even if it merely contains audit information); those will be addressed in a follow-up patch.
* | | (#5493) Add report_format, puppet_version, and configuration_version to ReportsNick Lewis2010-12-165-47/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Current report formats are: 0: 0.25 reports and earlier 1: 0.26.1 - 0.26.4 reports 2: 0.26.5 and beyond Paired-With: Jesse Wolfe