summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | [#4590] SimpleGraph is slowPaul Berry2010-10-074-24/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrote SimpleGraph to use a more efficient internal representation. To preserve compatibility with older clients, graphs are still serialized to YAML using the format used by Puppet 2.6. However, a newer, more compact format can be enabled by setting "use_new_yaml_format" to true. Deserialization from YAML accepts either the old 2.6 format or the newer format. In a later release, once we no longer need to be compatible with 2.6, we will be able to switch to the new format. To make deserialization accept multiple formats, it was necessary to use the yaml_initialize method. This method is not supported in versions of Ruby prior to 1.8.3, so a monkey patch is included to add support for it to Ruby 1.8.1 and 1.8.2. Thanks to Markus Roberts for the SimpleGraph rewrite. Thanks to Jesse Wolfe for figuring out how to write the yaml_initialize monkey patch.
* | | | Merge branch 'feature/next/3747' into nextNick Lewis2010-11-111-0/+50
|\ \ \ \
| * | | | (#3747) Add specs for upstart providerNick Lewis2010-11-111-0/+50
| | |_|/ | |/| | | | | | | | | | Paired-With: Matt Robinson
* / | | Fix #4904 Mounts shouldn't remount unless they are ensure=>mountedJesse Wolfe2010-11-111-5/+27
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After we fixed issue #2730, it is now possible to manage an fstab entry without asking puppet to try to call mount or unmount on that device. That fix failed to address the "refresh" behavior of mounts. We have changed "refresh" to only remount devices that are set to "mounted", so users can truly manage fstab entries without having puppet try to remount them. Paired-With: Paul Berry <paul@puppetlabs.com>
* | | Merge branch 'feature/master/5198' into nextPaul Berry2010-11-091-1/+2
|\ \ \
| * | | (#5198) Added a spec test for new TB unitPaul Berry2010-11-091-1/+2
| | | |
* | | | Merge remote branch 'jamtur01/tickets/2.6.x/5108' into nextPaul Berry2010-11-091-0/+4
|\ \ \ \
| * | | | Fixed to #5108 - Change default of service hasstatus property to trueJames Turnbull2010-10-271-0/+4
| | | | |
* | | | | Merge commit '2.6.3rc2' into nextPaul Berry2010-11-094-117/+164
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | | | | | | Manually resolved conflicts: lib/puppet/parser/ast/resource.rb spec/unit/parser/ast/resource_spec.rb
| * | | | (#4534/#4778) -- Normalize parameterized classesPaul Berry2010-10-273-109/+154
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a reconciliation/melding of Paul's (#4534) Class inheritance with parameterized classes is no longer ignored and Markus's Fix for #4778 -- evaluate parameterized classes when they are instantiated Extracted the code from Resource::Type#mk_plain_resource that evaluates parents and tags the catalog, and moved that into a new method called instantiate_resource. Instantiate_resource is now also called from Parser::Ast::Resource#evaluate, so that the notation "class { classname: }" now executes this code too. Likewise adds class evaluation so that it behaves the same (with regard to lazy / strict evaluation) as include classname
| * / / Fix for #5022 -- Escaped newlines should be elidedMarkus Roberts2010-10-181-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a regression, not covered by a test; previously the string "foo\ bar" would be interpreded as "foobar" but this was changed to "foo\\\nbar" in 2.6.x with my string interpolation refactor. This change restores the behaviour.
* | | Maint: remove unnecessary stubbing from agent_specPaul Berry2010-11-091-20/+21
| | | | | | | | | | | | | | | | | | The agent spec tests were stubbing out all methods related to Puppet settings, making it difficult to keep these tests maintained. The tests now function by setting the settings in question.
* | | Maint: Remove Indirector::Request objects from HTTP Handler and API V1Jesse Wolfe2010-11-024-138/+59
| | | | | | | | | | | | | | | | | | | | | This is a maintenance refactor to reduce the dependencies between the rest API and the implementation of the Indirector. The HTTP Handler code was creating temporary Request objects that were not actually being passed to the Indirector.
* | | (#5166) Inventory service is now searchable by timestamp.Paul Berry2010-11-011-0/+103
| | | | | | | | | | | | | | | It is now possible to specify queries in the form “meta.timestamp.xx” where xx is eq,ne,gt,lt,ge,le when searching the inventory service.
* | | Refactored Puppet::Node::Inventory::Yaml tests in preparation for adding ↵Paul Berry2010-11-011-21/+9
| | | | | | | | | | | | freshness check
* | | Fix #5164 Change Facts timestamp when they are received by the masterJesse Wolfe2010-11-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch causes the puppet master to re-timestamp facts when they are received by the catalog compiler terminus. This makes the timestamps more trustworthy, as it means that they are all based upon the same clock's time. Paired-With: Paul Berry <paul@puppetlabs.com>
* | | Maint: Don't use a stub for a Facts object in the compiler specsJesse Wolfe2010-11-011-1/+2
| | | | | | | | | | | | | | | The catalog compiler spec was overstubbing the Node::Facts object, making it hard to test the interaction between those two systems.
* | | Maint: spec/unit/indirector/catalog/compiler_spec.rb wouldn't run by itselfJesse Wolfe2010-11-011-0/+1
| | | | | | | | | | | | Require puppet/rails so we can run this test alone.
* | | (#5132) Provide a query REST interface for inventoryMatt Robinson2010-10-284-6/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This REST interface returns a list of nodes that match a fact query. Fact queries can use (in)equality testing as a string comparison, and >, <, >=, <= numerical comparisons. Multiple tests can be done as AND comparisons, not OR. The fact queries need to be prefixed by facts, and the comparisons other than equality are specified with a .comparison_type after the fact name. This will be better explained in the REST documentation on the website. Searches that don't match anything now return empty array instead of a 404 error.
* | | (#5148) Fix failing spec due to timezoneNick Lewis2010-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Time.parse(...) will yield a string in the local timezone. So when this spec was run in a non -0700 timezone, it was failing, because it was comparing a string in local time to a string in -0700. This fixes it to compare to the local string representation of the time.
* | | (#5148) Add support for PSON to factsNick Lewis2010-10-281-0/+24
| | | | | | | | | | | | | | | | | | | | | Previously, facts could be fetched via the REST API in PSON, but came back as the to_s representation of a Ruby object, rather than as proper PSON data. This patch adds to_pson and from_pson to facts, so they can be properly used with PSON.
* | | Merge commit '2.6.3rc1' into nextJesse Wolfe2010-10-183-1/+60
|\| |
| * | Fix for #4832 -- Making PSON handle arbitrary binary dataMarkus Roberts2010-10-131-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | The PSON library needlessly assumed that the data to be transmitted was well- formed unicode. This made Latin-1 users (and anyone who needed to serialize arbitrary binary data) sad. This patch goes some of the way to resolving the issues, by passing through non-unicode data rather than just failing, adds tests, and cleans up a pernicious assumption about escape characters in ruby regular expressions not marked "n" (no-encoding).
| * | Minimal fix for #4975 -- only call chage when managing password age rulesMarkus Roberts2010-10-131-0/+42
| | | | | | | | | | | | | | | This is intended to be a minimal fix, with tests, to prevent chage from running unless needed.
| * | Fix for #4963 -- Use correct commands for password expiry on solarisMarkus Roberts2010-10-131-1/+1
| | | | | | | | | | | | | | | This fixes the command / option issues of #4963 as suggested on the ticket; the setting-expiry when not needed aspects are deferred to #4975.
* | | Merge remote branch 'paul/ticket/next/4657' into nextJesse Wolfe2010-10-051-34/+22
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch conflicts with a backport of itself. This merge resolution favors the original patch for the code changes, and the 2.6.2 patch for the specs. Manually Resolved Conflicts: lib/puppet/dsl/resource_type_api.rb lib/puppet/parser/ast/definition.rb lib/puppet/parser/parser_support.rb spec/integration/parser/ruby_manifest_spec.rb spec/unit/dsl/resource_type_api_spec.rb
| * | | [#4657] Customer-supplied .rb files are not compatible with multiple ↵Paul Berry2010-09-022-22/+23
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | environments or staleness check Changed the resource type API to create AST objects rather than directly instantiating resource types. This allows the same code paths to be used to handle the results of parsing both .pp and .rb files. This makes .rb files work properly in multiple environments, because the types are now instantiated by code that is aware of which environment the compilation is happening in. It also reduces the risk of future changes breaking .rb file support. Also, switched to using "instance_eval" rather than "require" to evaluate the contents of the .rb file. This ensures that if the file has to be recompiled (because it became stale), it will actually get re-evaluated. As a side benefit, ResourceTypeAPI is now a class rather than a mixin to Object, so its methods do not pollute the global namespace. To reduce the risk of customers coming to rely on implementation details of the resource type API, changed its methods to return nil, and removed methods from it that were misleadingly labeled as "private".
* | | Merge commit '2.6.2rc1' into nextJesse Wolfe2010-10-048-9/+105
|\ \ \ | | |/ | |/|
| * | Fix for #4896 -- stray newline left over from removed diagnosticMarkus Roberts2010-09-301-1/+2
| | | | | | | | | | | | | | | A newline that was part of a diagnostic was left in, and this caused problems with the serialization of strings in "preserve newlines" mode.
| * | Improvement to #4025: made spec tests work on all platformsPaul Berry2010-09-291-1/+3
| | | | | | | | | | | | | | | | | | The spec test changes for ticket 4025 (binary plist support) failed on non-OSX systems because of a missing stub. Added the missing stub so that the spec tests can now run on all systems.
| * | Adds #3046 - support for password min/max ageNick Lewis2010-09-293-2/+33
| | | | | | | | | | | | | | | | | | | | | This adds a new feature to user providers "manages_password_age", along with properties password_min_age and password_max_age to the user type. These represent password min and max age in days. The useradd and user_role_add providers now support these new properties.
| * | [#4783] (#4783) Fix RRDGraph report generationMatt Robinson2010-09-292-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | The code made assumptions about report structure that weren't valid for 2.6.x. The change has been verified to work with 0.25.x and 2.6.x report formats. Paired with: Rein Henrichs
| * | Add user account expiry to the useradd type and providerDean Wilson2010-09-292-1/+24
| | |
| * | Fixed #4025 (failure in launchd if certain plists are binary).Paul Berry2010-09-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified the launchd provider to use OSX's "plutil" command to read plists. This allows it to handle properly lists in both XML format and binary format. Launchd continues to write out propertly lists in XML format. This is not a problem because the operating system is able to understand both formats.
| * | Fix for #4804 -- escaped backslashes in interpolated stringsMarkus Roberts2010-09-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Part of the ongoing refinement / cleanup of the string interpolation semantics. When scanning for an unescaped string terminator we now also allow an 0 or more pairs of backslashes (that is, escaped backslashes) before the terminator. Thanks to Jacob for the test I should have added.
* | | Partial merge to 2.6.2rc1 : Merge commit '574812e' into nextJesse Wolfe2010-10-041-13/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | The API for AST objects has changed, making the initialization of this spec somewhat more complicated. Also, git seems to have been confused by whitespace changes. Manually Resolved Conflicts: lib/puppet/parser/ast/resource.rb
| * | (#4860) Add regression tests that would have caught bad params methodMatt Robinson2010-09-281-13/+17
| | | | | | | | | | | | | | | This is another case where our test objects were overly mocked so they didn't alert us to problems with our implementation.
* | | Partial merge to 2.6.2rc1 : Merge commit '66cf3a9' into nextJesse Wolfe2010-10-044-29/+147
|\| | | | | | | | | | | There are test failures in commits following this one.
| * | Fix #4226 - Prepend 'Puppet CA: ' to fqdn for default root ca_nameJacob Helwig2010-09-281-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Having a root ca_name that matches the fqdn of the puppet master would cause certificate lookup problems on some clients, resulting in failed SSL negotiation. Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
| * | Port Puppet::SSLCertificates::CA test to rspecJacob Helwig2010-09-281-0/+99
| | | | | | | | | | | | Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
| * | Fixes #4852 - error messages involving Whits now mention Classes insteadNick Lewis2010-09-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Whits are inserted into the dependency graph in the place where an empty class is being required. Unfortunately, when such a class is involved in a loop, the error message shows the cycle as involving Whit[Classname]. This patch changes it to say Class[Classname], which is much easier to understand. It also fixes puppetdoc from generating documentation on the Whit type.
| * | (#4763) Don't call a method that was removed in Rails 3 activerecordMatt Robinson2010-09-221-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling this method caused storeconfigs not to run. ActiveRecord::Base.allow_concurrency was deprecated in Rails 2.2. We support activerecord 2.1 and higher, so we still need to call this method for 2.1. I factored out the code that determines our activerecord version to a method in util so that the code was easier to read and test.
| * | Fixed #4763 - Hardcoded ActiveRecord versionJames Turnbull2010-09-221-1/+1
| | |
| * | Fixes #4822 -- Puppet doc -o option brokenPaul Berry2010-09-221-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The global "-o" option ("--onetime") was overriding the application-specific option "-o" because global options were being sent to the OptionParser after application-specific options. Modified the order in which options are sent to the OptionParser to have the correct behavior. Also merged together the two methods that were applying options so that the order is more explicit.
* | | Partial merge to 2.6.2rc1 : Merge commit '99c1019' into nextJesse Wolfe2010-10-041-7/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This conflict was a little too complicated for diff to figure out, but the resolution is actually fairly mechanical. Some unit tests changed because they were mocking unnecessarily. Manually Resolved Conflicts: lib/puppet/util/rdoc/parser.rb spec/unit/util/rdoc/parser_spec.rb
| * | [#4798] Puppet doc manifests documentation mode brokenPaul Berry2010-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running puppet doc, if the directory containing the user's specified manifest file overlaps with the modules directory (i.e. they are the same directory or one contains the other), Puppet doc would try to parse the overlapping files twice, triggering an exception which made the documentation run fail. Fixed the bug by adding a check to the RDoc::Parser#scan method to prevent re-parsing of files that have already been parsed. Also added a spec test to verify that this works.
* | | Partial merge to 2.6.2rc1 : Merge commit '8cd1540' into nextJesse Wolfe2010-10-022-4/+21
|\| | | | | | | | | | | There are merge conflicts with commits following this one.
| * | [#4692] undefined variables cause :undef to be passed to functionsPaul Berry2010-09-221-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The :undef symbol, which we use internally to distinguish between undefined variables and variables whose value is the empty string, is being leaked in calls to functions (e.g. "split"). This is a departure from 0.25.x behavior, where undefined variables evaluated to "". This patch restores the 0.25.x behavior.
| * | Fix #4743: Allow the audit meta-parameter to accept both 'all', and :allJacob Helwig2010-09-221-0/+7
| | |
* | | Partial merge to 2.6.2rc1 : Merge commit 'f950061' into nextJesse Wolfe2010-10-022-26/+39
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Some specs were in conflict, as they had been recently modified to use the API functionality that f950061 removes. This merge commit simply restores the verson of those specs from f950061. Manually Resolved Conflicts: spec/unit/dsl/resource_type_api_spec.rb