summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* (#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.
* 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.
* [#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.
* [#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
|
* [#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.
* [#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.
* Fix for #4708 - tagmail should allow . in tagnameDan Bode2010-09-231-0/+1
| | | | changed the regex so that tagmail allows . in tagname.
* [#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
* 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
|
* 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>
* Further RST to Markdown fixes for types, values, testsJames Turnbull2010-08-121-2/+2
|
* Maint. Passenger fix broke a testMarkus Roberts2010-08-061-3/+3
| | | | The content-length fix for passenger broke a test; this fixes it.
* Fixes #4485 -- single quoted strings should not treat \n as new lineMarkus Roberts2010-08-051-0/+1
| | | | | | | | | | | | This is the rest of the change for #4303; James and I discussed various ways the solution to that ticket needed to be extended but, as neither of us committed code, nothing changed. This is the least implact extension, which mimics the behaviour of prior versions. It leaves open the question: should '\\x' start with a single or double backslash? If, as now, '\\x' starts with a double backslash (i.e. single quote is the only escapable characterin single quoted strings) a string ending in a backslash can not be represented in a single quoted string.
* [#4364] Fix failing spec due to incorrect loglevelJesse Wolfe2010-08-041-1/+1
| | | | | A spec was failing since it wasn't updated when the #4364 change was made.
* Fix for #4465 -- earlier "feature" patch broke ldapMarkus Roberts2010-08-041-17/+19
| | | | | | | | | The patch for #3904 should not have been accepted; it's buggy and the use case (supporting having nodes in ldap more than once with the same name but distinct records) is ill-conceived. This commit reverts the patch (a7884b47) and the previous attempt to fix it (e6709da4), restoring the old (0.25.x) behaviour.
* [#4467] Make Puppet Master respect facts_terminus settingsRein Henrichs2010-08-042-6/+13
| | | | | | | | | * Remove hard-coded facts terminus in master * Change facts_terminus default to 'yaml' for master and 'facter' for everything else. Paired-with: Matt Robinson <matt@puppetlabs.com> Signed-off-by: Rein Henrichs <rein@puppetlabs.com>
* [#4370] Fixes extlookup precedence getting overwritten between runsMatt Robinson2010-08-032-3/+17
| | | | | | | | | | | | | | | We found the gsub! in extlookup was actually modifying the value for extlookup_precedence, so the next node to call it just got the interpolated value from the first run. We did two things in the code to prevent this: 1. We returned a dup of the ast string object so that modifying it wouldn’t change puppet’s state. We didn’t do this for all possible return values because we depend on using the original ast array object to do array concatenation 2. We fixed extlookup to not do a destructive gsub Reviewed by: Jesse Wolfe
* [#4423] repair parameterized class instantiationJesse Wolfe2010-08-031-0/+7
| | | | | | My earlier #4397 patch was not aware of the parameterized class instantiation syntax, and failed on manifests that instantiate parameterized classes.
* [#4423] class { shouldn't get stored on the namespace stackJesse Wolfe2010-08-031-0/+6
| | | | | | | The new syntax for instantiating parameterized classes was confusing the lexer's notion of namespaces. This is a simple fix to prevent that syntax from polluting the namespaces.
* [#4397]+[#4344] Move type-name resolution out of Puppet::Resource into the ↵Jesse Wolfe2010-08-0310-55/+37
| | | | | | | | | | | | | | | | | | AST resources. Move type-name resolution out of Puppet::Resource into the AST resources. Move find_resource_type out of Puppet::Resource into Scope Thus, never pass unqualified type names to Puppet::Resource objects. Thus, Puppet::Resource objects don't need the namespace property, and Puppet::Resource objects never consult the harddrive to look for .pp files that might contain their type definitions, Thus, performance is improved. Also removes the temporary fix for #4257 that caused #4397 (The code was too eager to look for a class in the topscope) Paired-With: Paul Berry <paul@puppetlabs.com> Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* [#4344] Fix for failing templates when module name matches file in local dir.Paul Berry2010-08-032-4/+4
| | | | | | | | | When the name of a module matches the name of a file in the local directory, puppet agent would sometimes try to read that file and interpret it as puppet code. This happened because files.rb was unintentionally permitting puppet files without an extension. Fixed by changing the glob pattern to only permit ".pp" and ".rb" extensions.
* [#4242] Fixed (removed) a broken unit testNick Lewis2010-08-031-22/+0
| | | | | This test ran into a mocha bug, and was stubbing too much anyway. It's being moved to an acceptance test.
* Fix #4349 - Parsing with ignoreimport=true was always loading site.ppMarkus Roberts2010-07-251-0/+8
| | | | | | | | | With the type collection refactoring, when accessing a fresh collection puppet tries to import the site.pp manifest (perfrom_initial_import). In the case of puppetdoc, we are parsing site.pp by ourselves, so we ended parsing it twice, resulting in an "import loop detected" error. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #4348 - Puppet doc single manifest brokenBrice Figureau2010-07-251-0/+13
| | | | | | | | The refactoring of using environment instances instead of strings for initializing the parser, rdoc wasn't updated, thus was unable to initialize the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* extlookup() is a builtinJesse Wolfe2010-07-251-0/+85
| | | | | | This patch promotes extlookup() to being a builtin function. It also adds test and makes some minor tweaks to the code. The behavior of extlookup has been left unchanged.
* [#4333] old optparse doesn't support default_argv=Jesse Wolfe2010-07-251-12/+2
| | | | | optparse hasn't always had the concept of default_argv. Fortunately, we don't really need it.
* Fix #4319 - source file url sent to the master is invalidBrice Figureau2010-07-251-1/+1
| | | | | | | | | | | We were sending an incorrect (containing a //) url for sourced file content since the file streaming patches. Depending on the webserver in front of puppet it could fail (for instance nginx+mongrel). This patch fixes the offending // in each sourced file urls. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix for #4303 -- reverting to old escaping in '-stringsMarkus Roberts2010-07-251-0/+3
| | | | | Single quoted used to allow escape on single quotes and pass all other characters through without comment; now the do again.
* Fix #4302 - Compilation speed regression compared to 2.6Brice Figureau2010-07-251-3/+32
| | | | | | | | | | | | | | | | | | | | | Each time the compiler was accessing the loaded types, we were checking if the manifests had changed. This incurred a large performance cost compared to 0.25 and introduced race conditions if manifests changed while a thread was in the middle of a compilation. This tentative fix, based on Brice's, makes sure each thread will get access to the same loaded types collection for the durration of a compilation, even if the manifests change. We now only check for changed files at the start of a compilation or if the environment changes, and we maintain a per environment thread lock so that only one thread at a time can be reloading any particular environment (and the need-check is done inside the synchronize block so that only the first will actually load it). As long as the manifests don't change, the threads will share the same collection, so there is only duplication in memory for a brief window surrounding a change. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> Second-author: Markus Roberts <markus@puppetlabs.com>
* Fix #4286 - rename puppetdoc global module <site> to __site__Brice Figureau2010-07-251-3/+3
| | | | | | | | | < and > might be invalid or borderline chars to use for a file name or an url. This patch changes those characters to __. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Temporary tweak to tests for #4242Markus Roberts2010-07-251-0/+5
| | | | | | | The tests introduced with the fix for #4242 have isolation issues apparently due to the creation of a stage resource which is global and persistent. This patch stubs the creation, marks the one test which is thus invalidated pending, and adds comments noting the problem.
* [#4242] Fixed recursion due to parents including their childrenNick Lewis2010-07-251-0/+50
| | | | | | | | | | | | | | | Resources mark themselves as evaluated to prevent being evaluated again. Unfortunately, they were not marking themselves until after they had finished being completely evaluated. Thus, there was nothing actually stopping recursive evaluations. This patch just makes resources mark themselves as evaluated when they start evaluating, and adds tests. The original setting of evaluated was done in an ensure block, so this doesn't change the behavior of a resource which fails to evaluate. The only places evaluated? is checked aren't affected by this change, as they wouldn't want to evaluate it when it's already being evaluated anyway.
* Fix for #3382 -- Empty classes as graph placeholdersMarkus Roberts2010-07-241-2/+12
| | | | | | | | | | As Brice discovered, the problem was that we simply ignored empty classes in the graph when determining application order. This patch instead replaces them with a resource of a new type which we've frequently noted the (internal) need for: a whit, the smallest possible resource, which has no properties or other semantics apart from its existence and its name. This resource then ensures application order through the normal mechanisms.
* Fixing #4268 - manifests always importedLuke Kanies2010-07-192-23/+16
| | | | | | | | | | | | | | The problem is that the environment list gets cleared when Settings#set_value is called, and it was being called every time Settings#use was called, which is more often than obvious but especially if reporting is enabled. Previously we ignored noop when running inside of Settings, and this essentially adds that back in, so we can remove the special noop behaviour in Settings itself. Signed-off-by: Luke Kanies <luke@puppetlabs.com>