summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | | | | 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
| | * | | | | (#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
| * | | | maint: Fix ActiveRecord confine issueMatt Robinson2010-12-161-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We made a class that inherited from ActiveRecord, but did so outside a block so the confine wasn't skipping it when ActiveRecord wasn't installed. Moving that class inside a before block caused the confine to work properly. Paired-with: Nick Lewis
| * | | | maint: Fix a test that was missing a requireMatt Robinson2010-12-162-0/+2
| | | | | | | | | | | | | | | | | | | | Paired-with: Nick Lewis
| * | | | maint: Fix tests that don't run on their ownMatt Robinson2010-12-1611-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the spec directory I found all the specs that fail when run on their own. for TEST in `find . -name "*.rb" -type f`; do spec $TEST > /dev/null 2>&1 if [[ $? != 0 ]]; then echo $TEST fi done All of them were cases of missing requires. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | | | | Merge branch '2.6.x' into nextNick Lewis2010-12-1612-95/+330
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually Resolved Conflicts: lib/puppet/resource/type_collection.rb spec/unit/configurer_spec.rb spec/unit/indirector/catalog/active_record_spec.rb spec/unit/resource/type_collection_spec.rb spec/unit/transaction/resource_harness_spec.rb
| * | | | Merge branch 'ticket/2.6.next/4487' into 2.6.nextNick Lewis2010-12-131-11/+26
| |\ \ \ \
| | * | | | (#4487) Fix environment column in hosts tableNick Lewis2010-12-131-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An entire environment object was being stored in a string field, causing the ZAML form of the environment to be stored. This was over-ridden to return just the ZAML serialized version of the name. Since the hosts model didn't know how to interpret a serialized value, it just returned the ZAML string as the environment. This patch stringifies the environment before putting it in the hosts table, which stores it properly. This patch also introduces a new method of testing using Tableless ActiveRecord models, which emulate their database schema. This helps to eliminate some stubbing, but it is still impossible to fully and accurately test all ActiveRecord interactions without a real database. Paired-With: Matt Robinson
| * | | | | maint: restore plugin handler safetyJesse Wolfe2010-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous maintenance patch for this file didn't provide as strong of a guarantee of loading plugins as the code it replaced. This patch restores the extremely broad exception catching, but prevents mocha exceptions from being silently ignored.
| * | | | | (#5408) Attributes can be both audited and managedJesse Wolfe2010-12-102-71/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it possible to both audit and manage an attribute. It introduces a new field on Event objects "historical_value", which is the value from state.yaml. The value from the RAL is written to state.yaml, and then the RAL is updated with the desired value. Paired-With: Nick Lewis <nick@puppetlabs.com> Paired-With: Matt Robinson <matt@puppetlabs.com>
| * | | | | maint: missing stubJesse Wolfe2010-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This missing stub was raising an exception that, in versions of Mocha less than 0.9.10, was coincidentally causing the method under test to behave as expected. Paired-With: Nick Lewis <nick@puppetlabs.com>
| * | | | | maint: missing stubJesse Wolfe2010-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This missing stub was raising an exception that, in versions of Mocha less than 0.9.10, was mistaken for the exception that was being tested for. Paired-With: Nick Lewis <nick@puppetlabs.com>
| * | | | | maint: missing line and filename stubsJesse Wolfe2010-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Another missing stub exposed by Mocha 0.9.10
| * | | | | maint: Fully stub partially stubbed test.Jesse Wolfe2010-12-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was succeeding in versions of Mocha before 0.9.10, because the Mocha expectation exceptions were being incorrectly interpreted as if they were File Not Found exceptions.
| * | | | | maint: remove Puppet.settings stubsJesse Wolfe2010-12-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test was stubbing Puppet.settings, instead of setting the values directly. Exceptions thrown by trying to read other settings were getting swallowed when running a version of Mocha older than 0.9.10. Paired-With: Nick Lewis <nick@puppetlabs.com>
| * | | | | maint: test was expecting Catalog.find too few timesJesse Wolfe2010-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our code calls Catalog.find multiple times, but this stub did not allow that. The resulting error was silently ignored on versions of Mocha before 0.9.10 Paired-With: Nick Lewis <nick@puppetlabs.com>
| * | | | | maint: broken test not failing due to over-eager exception catchingJesse Wolfe2010-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A test was not testing what it claimed, but the failure exception was getting swallowed by an unnecessarily broad rescue match. Paired-With: Nick Lewis <nick@puppetlabs.com>
| * | | | | Fix #1757 Change file mode representation to octalJesse Wolfe2010-12-082-5/+5
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the internal representation of a file's mode to a string instead of an integer. This simplifies the problem of displaying the value consistently throughout all of puppet.
| * | | | Merge branch 'ticket/2.6.next/4943' into 2.6.nextNick Lewis2010-12-022-0/+87
| |\ \ \ \
| | * | | | (#4943) Add puppet inspect applicationNick Lewis2010-12-022-0/+87
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "puppet inspect" will load the locally stored YAML catalog and record the current state of the audited properties in the catalog. It uses settings specified in the [agent] configuration section, and will send its inspect report to the specified server. Paired-With: Jesse Wolfe
| * | | | (#5261) Fix #5261 Don't escape Unicode characters in PSONJesse Wolfe2010-12-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the escaping of valid UTF-8 sequences as "\uXXXX". This code was unreliable, as it relied on Iconv's ability to convert those codepoints between UTF-8 and UTF-16, but some versions of Iconv barf on some valid codepoints. Invalid UTF-8 sequences are still passed through unchanged. We believe that this is fine; if you are concerned about complience with the JSON standard, what we are doing is equivalent to: * interpreting binary files as Latin-1 encoded character sequences * JSON-encoding those characters according to RFC 4627 * outputting the JSON as Latin-1 This allows all raw binary files to be transmitted losslessly. Paired-With: Paul Berry <paul@puppetlabs.com>
| * | | | [#5081] Revert "Fix #4349 - Parsing with ignoreimport=true was always ↵Matt Robinson2010-12-011-8/+0
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loading site.pp" The fix for #4349 caused --parse-only not to detect syntax errors when --ignore-import was used by adding a return statement that bypassed the initial import: commit 760e418d254a8d2198d2c6eb466d783a5930ef47 def perform_initial_import + return if Puppet.settings[:ignoreimport] The problem that #4349 fixed was more generally fixed in commit 99c1019e1d3402ec8e476dc859d5aaef82ec4f69 for ticket #4798 so the return statement is no longer needed, so reverting the commit for #4349 does not reintroduce the problem of an import loop error when running puppet doc. Paired-with: Jesse Wolfe
* | | | (#5427) Using Propery::OrderedList for host_aliasStefan Schulte2010-12-142-13/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the propertyclass Puppet::Property::OrderedList to represent the list of host_aliases. This lets us remove the in_sync, should_to_s etc overrides. In the provider class the list is represented by a string (=no array) so there were a few changes necessary as well. Because Puppet::Property::List uses the specified delimiter when converting should values to strings, I changed the delimiter to a simple space instead a tab. This keeps messages produced by puppet in a nice format. The tests had to be changed to work with the new behaviour of host_aliases. There are a few additional tests as well.
* | | | Merge remote branch 'someword/feature/master/5391' into nextPaul Berry2010-12-061-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * someword/feature/master/5391: (#5391) Include additional zfs properties
| * | | | (#5391) Include additional zfs propertiesDerek Olsen2010-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We added the following zfs properties to the zfs provider :recordsize, :aclmode, :aclinherit, :primarycache, :secondarycache Currently zfs users have to chain an exec to the zfs filesystem creation and the inclusion of these properties would allow puppet to set them natively.
* | | | | maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-06306-306/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* | | | | maint: Fix more order dependent test failuresMatt Robinson2010-12-062-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b67f4c68503ca3abf0a55857da452e46fa75abd5 I fixed one place that was causing order dependent test failures in spec/unit/ssl/certificate_request_spec.rb, but missed another case that was causing a similar failure. To find all the order dependent failures with that file I ran the following bash script from the spec directory: for TEST in `find . -name "*.rb" -type f`; do spec $TEST unit/ssl/certificate_request_spec.rb > /dev/null 2>&1 if [[ $? != 0 ]]; then echo $TEST fi done Paired-with: Jesse Wolfe
* | | | | Merge branch '2.6.x' into nextMatt Robinson2010-12-021-1/+0
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5304) Use internal_name rather than real_name for maillist provider Updated CHANGELOG and version for 2.6.4 Revert "(#5304) Use internal_name rather than real_name for maillist provider" Disable remote ralsh by default (#5424) Ship auth.conf as part of installing from source (#5304) Use internal_name rather than real_name for maillist provider Renamed Reductive to Puppet Manually Resolved Conflicts: lib/puppet/provider/maillist/mailman.rb
| * | | | Disable remote ralsh by defaultPaul Berry2010-12-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the default auth.conf so that accesses to "/resource" are no longer allowed. This means that to use "puppet resource -H" you will need to configure the target machine to enable access to the "/resource" URLs.
* | | | | Merge branch 'ticket/next/5211' into nextMatt Robinson2010-12-021-0/+24
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * ticket/next/5211: (#5211) Added patch and tests for checking the size of the arrary which is returned
| * | | | | (#5211) Added patch and tests for checking the size of the arrary which is ↵Steve Nielson2010-12-021-0/+24
| |/ / / / | | | | | | | | | | | | | | | returned
* | | | | (#2495) Better value validation for sshkeyStefan Schulte2010-11-301-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the ticket it is not obvious that aliases do not belong in the resourcename but have to be specified with the property "host_aliases". On the puppet-user list I saw someone using this as a resource @@sshkey {"$fqdn,$hostname,$ipaddress": type => rsa, key => $sshrsakey, } Puppet will now write a correct entry to the know_hosts file, but when it rereads the file, the field $fqdn,$hostname,$ipaddress is split into name ($fqdn) and host_aliases ([$hostname,$ipaddress]). Since we dont find the resource the user specified, puppet will put the same key in the file over and over again. This patch adds a simple validation on resourcename.
* | | | | Maint: Modified uses of indirector.save to call the indirection directly.Paul Berry2010-11-307-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects production code.
* | | | | Maint: Modified tests of indirector.save to call the indirection directly.Paul Berry2010-11-3014-80/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects tests only; the next patch will make the corresponding change to the code.
* | | | | Maint: Moved auto-signing logic into an indirector extensionPaul Berry2010-11-301-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autosigning was previously accomplished by overriding CertificateRequest#save. This meant that it wouldn't work if certificate requests were saved via a direct call to Indirection#save. Changed it to use the indirector :extend mechanism, which works no matter how the save is invoked.
* | | | | Maint: Swap the order of arguments to Indirection#savePaul Berry2010-11-303-6/+3
| | | | | | | | | | | | | | | | | | | | The first argument was often nil, and the second was mandatory.
* | | | | Maint: Make http handler code call the indirector through ".indirection"Paul Berry2010-11-301-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 71ecad9904c8c48c023e90e5fbea5b26b180c9cf we removed the delegation from model class to indirection for the "find", "search", "destroy", and "expire" methods. When we did this we neglected to modify http handler code to call the indirector directly. This patch makes the appropriate changes to http handler code.
* | | | | Maint: Refactor tests to use <class>.indirection.<method>Paul Berry2010-11-2925-305/+223
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. This change affects tests only.
* | | | Merge branch 'ticket/next/5375' into nextPaul Berry2010-11-232-15/+13
|\ \ \ \
| * | | | (#5375) Rework puppet apply to use configurer.runPaul Berry2010-11-232-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'maint/next/make_upstart_tests_more_robust' into nextPaul Berry2010-11-231-2/+1
|\ \ \ \ \