summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | (#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
| |\| | | | |
| * | | | | | maint: Inspect reports should have audited = true on eventsMatt Robinson2011-01-061-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe
* | | | | | | maint: Stop stubbing 'use' on any_instance of Puppet::Util::SettingsNick Lewis2011-01-074-34/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is because of the fix for #5799, which means there will only be a single instance of Puppet::Util::Settings throughout the lifetime of the spec run. Paired-With: Paul Berry
* | | | | | | Merge branch 'ticket/2.6.next/5799' into 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
* | | | | | Merge branch 'intermediate_merge_branch' into nextNick Lewis2011-01-0673-1003/+668
|\ \ \ \ \ \
| * | | | | | Merge branch '2.6.x' into nextNick Lewis2011-01-0673-1003/+668
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
| | * | | | | (#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.
| | * | | | | | (#5715) Changed the type of metric names to always be strings.Paul Berry2010-12-303-36/+32
| | | | | | | |
| | * | | | | | (#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-167-49/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * | | | | (#5375) Rework puppet apply to use configurer.runPaul Berry2010-12-162-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet apply used to contain code that duplicated the functionality of configurer.run. Refactored to share code. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| | * | | | | Merge branch 'ticket/2.6.4/5566' into 2.6.nextJesse Wolfe2010-12-161-1/+9
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | |
| | | * | | | Fix #5566 none, mtime, and ctime checksum types can write file contentsJesse Wolfe2010-12-161-1/+9
| | | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The #write method in lib/puppet/type/file/content.rb relies on the block passed to #sum_stream getting executed. "none", "mtime", and "ctime" aren't real checksums, so they violated that assumption and just returned empty results. This patch causes that block to get executed.
* | | / / / maint: Work-around for a Mocha bugNick Lewis2011-01-063-2/+27
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mocha is leaving behind a copy of stubbed methods in the singleton class of the object on which the method is stubbed. So a later stub to any_instance of the class isn't seen by the original object. This change works around the problem by adding a follow-up "test" that removes the method from the singleton class. See: https://github.com/floehopper/mocha/issues#issue/20 Paired-With: Paul Berry
* | | | | Merge branch '2.6.x' into nextMatt Robinson2010-12-161-12/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: maint: Fix ActiveRecord confine issue maint: Fix a test that was missing a require maint: Fix tests that don't run on their own Manually Resolved Conflicts: spec/unit/network/http/rack/xmlrpc_spec.rb spec/unit/network/http/rack_spec.rb spec/unit/network/http/webrick_spec.rb spec/unit/parser/templatewrapper_spec.rb spec/unit/rails/param_value_spec.rb spec/unit/rails/resource_spec.rb