summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | 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
| * | | [#4716] ResourceTypeAPI exposes implementation details that are likely to changePaul Berry2010-09-222-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made the following modifications to ResourceTypeAPI: (1) returned nil from “define”, “hostclass”, and “node”. (2) renamed “mk_resource_type” and “munge_type_arguments” to “__mk_resource_type__” and “__munge_type_arguments__” to discourage customers from calling them. (3) Made ResourceTypeAPI a class rather than a module, and changed the parser to evaluate the contents of pure ruby manifests using a instances of this class. (4) Changed ResourceTypeAPI to insert newly instantiated types into Thread.current[:known_resource_types] rather than the default environment's known_resource_types. This effectively backports the fix for issue #4657 to 2.6.x. Also backported the new spec tests from #4657.
* | | | Partial merge to 2.6.2rc1 : Merge commit '2b50f30' into nextJesse Wolfe2010-10-021-15/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2b50f30 simplified and fixed bugs in code that had already been modified extensively by 4da88fb and 6b1dd81. This merge resolution commit is a manual replay of the changes from 2b50f30 onto next. Manually Resolved Conflicts: lib/puppet/parser/type_loader.rb spec/unit/parser/type_loader_spec.rb
| * | | [#4771] Import of manifests with the same name only happens oncePaul Berry2010-09-231-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function import_if_possible, which was supposed to be responsible for making sure that no two threads tried to import the same file at the same time, was not making this decision based on the full pathname of the file, since it was being invoked before pathnames were resolved. As a result, if we attempted to import two distinct files with the same name at the same time (either in two threads or in a single thread due to recursion), one of the files would not always get imported. Fixed this problem by moving the thread-safety logic to happen after filenames are resolved to absolute paths. This made it possible to simplify the thread-safety logic significantly.
* | | | Partial merge to 2.6.2rc1 : Merge commit '7b8cb74' into nextJesse Wolfe2010-10-021-0/+1
|\| | | | | | | | | | | | | | | There are merge conflicts with commits following this one.
| * | | Fix for #4708 - tagmail should allow . in tagnameDan Bode2010-09-231-0/+1
| | | | | | | | | | | | | | | | changed the regex so that tagmail allows . in tagname.
* | | | Merge commit '2.6.1' into nextJesse Wolfe2010-09-132-0/+13
|\| | |
| * | | [#4756] addendum for #4756Jesse Wolfe2010-09-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes spec and unit tests indirectly related to the previous patch-revert. One failure was from trying to test the User Type's roles, when, on many platforms, the roles feature wasn't supported by the default Provider. Other tests could fail on some platforms because they assumed that unsupported attributes would be ignored with a warning, but the code was crashing instead.
| * | | Fix for Bug #4756 - Providers no longer respect missing featuresJames Cammarata2010-09-141-0/+8
| | | | | | | | | | | | | | | | Restored deleted lines from type.rb and reinstated unit tests
* | | | Merge commit '2.6.1rc4' into nextJesse Wolfe2010-09-139-9/+11
|\| | |
| * | | Fix for #4646 -- Missing stubMarkus Roberts2010-09-071-1/+1
| | | | | | | | | | | | | | | | The test was expecting a stub object but wasn't providing one.
| * | | Fix for tests broken by fix for #4489 -- stub standaloneMarkus Roberts2010-09-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | If the file streaming is to be thwarted when running standalone the test for standalone needs to be stubbed when running specs, lest the tests inexplicably fail.
| * | | [#4308] Remove puppettest from specsMatt Robinson2010-09-035-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The less stuff being done in the spec_helper the better for reasoning about what's happening in the tests. puppettest.rb does a lot of things that aren't necessary for the specs, so this patch gets those things out of the spec_helper. Reviewed by: Jesse Wolfe
| * | | Fixed RSpec warning messagesJames Turnbull2010-08-312-2/+2
| | | |
* | | | Merge remote branch 'paul/ticket/next/4685' into nextJesse Wolfe2010-09-092-2/+8
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts resolved manually, by Paul Berry: lib/puppet/parser/ast/astarray.rb lib/puppet/parser/grammar.ra lib/puppet/parser/parser.rb (by rebuilding from grammar.ra)
| * | | | Modified the error message that is generated when a class, definition,Paul Berry2010-09-072-2/+8
| | |/ / | |/| | | | | | | | | | | | | | or node occurs in a conditional construct so that it contains the proper line number.
* | | | Merge remote branch 'paul/ticket/next/4638' into nextJesse Wolfe2010-09-093-42/+35
|\ \ \ \
| * | | | [4638] Cleanup of plurals and inheritance relationships in ASTPaul Berry2010-08-273-42/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the grammar so that the following "plural" constructs always parse as an ASTArray: - funcvalues - rvalues - resourceinstances - anyparams - params - caseopts - casevalues And the following "singluar" construct never parses as an ASTArray: - statement The previous behavior was for these constructs to parse as a scalar when they represented a single item and an ASTArray when they contained zero or multiple items. ("Statement" could sometimes represent a single item because a single resource declaration could represent multiple resources). This complicated other grammar rules and caused ambiguous handling of nested arrays. Also made these changes to the AST class hierarchy: - ResourceInstance no longer derives from ASTArray. This relationship was not meaningful because a ResourceInstance is a (title, parameters) pair, not an array, and it produced complications when we wanted to represent an array of ResourceInstance objects. - Resource no longer derives from ResourceReference. No significant functionality was being inherited and the relationship doesn't make sense in an AST context. - ResourceOverride no longer derives from Resource. No significant functionality was being inherited and the relationship doesn't make sense in an AST context. - Resource can now represent a compound resource instance such as "notify { foo: ; bar: }". This saves the parser from having to use represent a statement as an array of objects. - ASTArray's evaluate method never flattens out arrays of arrays.
* | | | | Merge remote branch 'paul/ticket/next/4570' into nextJesse Wolfe2010-09-081-0/+25
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Fixed issue #4570 (Race conditions when serializing objects to YAML).Paul Berry2010-08-231-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ZAML class was using class variables to keep track of labels and backreferences while serializing object to YAML. This made it possible to get ill-formed or incorrect YAML output if two threads tried to serialize objects at the same time. Changed to use instance variables of the ZAML class, so there is no race condition. Also added some more spec tests to verify that labels are generated properly.
* | | | | Merge commit '2.6.1rc3' into nextJesse Wolfe2010-08-275-29/+68
|\ \ \ \ \ | |_|/ / / |/| | / / | | |/ / | |/| |
| * | | Fix for #4542 -- included classes weren't assigned proper stagesMarkus Roberts2010-08-241-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | This commit unifies the code paths on which classes are added, alters the default stage to respect the stage of the parent if any, and assures that the resource is notified if its stage is assigned (turning an implicit stage into an explicit one).
| * | | Fix for #4518 -- classes not getting added to compiler.classesMarkus Roberts2010-08-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The responsibility for adding classes to the compiler's classes list (for use in constructing classes.txt) moved around a bit in the 0.25 to 2.6 transition before being dropped in a merge conflict resolution. Ooops. This restores it, and adds tests to prevent regression.
| * | | [#4545] Remove obsolete 'trac' specsJesse Wolfe2010-08-211-19/+0
| | | | | | | | | | | | | | | | | | | | The method that these specs were testing has been removed, causing the specs to fail.
| * | | Maint. -- Fix test failures broken by previous commitMarkus Roberts2010-08-211-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This basically involved adding a search method to the yaml indirector, which I did by copying the one from ssl_file and fiddling with it until the tests passed. Since the most straight forward way to do this required extending the interface to the path method I added tests for the additional behaviour.
| * | | [#4298] Puppet apply prints an error if the file to apply doesn't existMatt Robinson2010-08-211-3/+21
| |/ / | | | | | | | | | | | | | | | | | | | | | Also warns you it's skipping files if you pass it more than one file to apply. Reviewed-by: Nick Lewis <nick@puppetlabs.com> Signed-off-by: Matt Robinson <matt@puppetlabs.com>
* | | Merge remote branch 'paul/4472-4483-4496-4521-4522'Jesse Wolfe2010-08-1714-242/+351
|\ \ \ | |/ / |/| | | | | a.k.a. "make_taller_trees"
| * | [#4496]+[#4521]+[#4522] Add structures to the AST to represent type ↵Paul Berry2010-08-1312-97/+225
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definitions (classes, definitions, and nodes). Previously, type definitions were not represented directly in the AST. Instead, the parser would instantiate types and insert them into known_resource_types as soon as they were parsed. This made it difficult to distinguish which types had come from the file that was just parsed and which types had been loaded previously, which led to bug 4496. A side-effect of this change is that the user is no longer allowed to define types inside of conditional constructs (such as if/else). This was allowed before but had unexpected semantics (bugs 4521 and 4522). It is still possible, however, to place an "include" statement inside a conditional construct, and have that "include" statement trigger the autoloading of a file that instantiates types.
| * | Moved perform_initial_import from Puppet::Resource::TypeCollection to ↵Paul Berry2010-08-134-67/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Puppet::Node::Environment. This change is part of an ongoing effort to remove functionality from TypeCollection that is not related to keeping track of a collection of types. This reduces TypeCollection's linkage to the environment, which is a step toward decoupling it from the type loading mechanism. Also, added a spec test to verify that TypeCollection.version is correctly recomputed when types are re-imported.