summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* [#5322] (#5322) Remove spec file that adds little value and causes failuresMatt Robinson2010-11-161-533/+0
| | | | | | | | | | | | | | spec/integration/indirector/rest_spec.rb has been deleted in puppet’s next branch because it was found that the things being tested were already covered in spec/unit/network/http/*. Also, the tests being deleted were so overly mocked they weren’t testing much, and firing up webrick as part of the tests was slow and causes intermittent failures on Hudson. This was discussed on the dev mailing list in the really long thread "No puppet developer patches to the puppet-dev list". Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* Fix for #4279 -- mount detection on HP-UXMarkus Roberts2010-11-161-1/+8
| | | | | This is based on the discussion on ticket, simplified slightly and with test adjustment.
* Fix for #5298 -- Collections need to do type lookupMarkus Roberts2010-11-161-0/+4
| | | | | | | | | | | | | When the responsibility for type-name resolution was moved to the AST nodes in commit 449315a2c705df2396852462a1d1e14774b9f117, at least one instance was missed: the space ship operator Myclass <<| tag == foo |>> fails unless Myclass has been previously loaded. This commit adds the lookup to AST::Collection nodes in the same way it was added to the other node types. Note that I haven't audited the other note types for similar cases.
* Fixed #5296 - test warnings messagesJames Turnbull2010-11-165-14/+14
|
* (#5297) Fix schedule tests that were missing stubs for Time.nowMatt Robinson2010-11-161-0/+4
| | | | Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* Fix #5289 -- Bad copy/paste changes message on test failureMarkus Roberts2010-11-133-3/+5
| | | | | | | | | | In my fix for #4894 (commit a097b939ab52bafb681cf7c5dcaf11717add07e6) I made and tested the fix in one case and then copied most of it (all but a variable initialization, Doh!) to two other locations. This caused tests that would have failed with a socket-in-use error to fail with a different error rather than retrying. Also fixed the spelling of "simultaneous."
* Fix for #4299 -- Don't require whichMarkus Roberts2010-11-123-18/+9
| | | | | | We already had an internal implementation of which hiding under an assumed name (Puppet::Util.binary); this commit calls it out of hiding and uses it consisantly.
* Fix #5020 - Prefer finding node name from REST uri over certnameBrice Figureau2010-11-121-8/+9
| | | | | | | | | | | | | | | | | | | | | | This is a behavior change. Before this patch, we always used the currently connected node's certname to compile the catalog, despite the value of the catalog URI REST request. With this patch we now use the URI as the compiled node name. This is safe because the default auth.conf (and default inserted rules when no auth.conf is present) only allow the given connected node to compile its own catalog. But this also allows for greater flexibility with auth.conf. For instance it can be used by a monitoring system to check multiple nodes catalogs with only one certificate: path ~ ^/catalog/([^/]+)$ method find allow $1 allow monitoring-station.domain.com Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix for #4894 -- retry tests if port is in useMarkus Roberts2010-11-123-6/+28
| | | | | | If multiple processes are running the spec tests they may conflict trying to listen on a port. If this happens the test waits 0.1 seconds and retries for up to 100 times before marking the test pending due to too many conflicts.
* Fix for #4955 -- Race condition & memory leak in Puppet::UtilMarkus Roberts2010-11-123-39/+12
| | | | | | | | | | | | | | The Puppet::Util.sync method was not thread safe and also leaked memory. I'm not certain, but I believe the first is ironic and the second is merely a bug. This patch addresses the problem by 1) refactoring so the sync objects are never returned (and thus no one can cache a reference to one) 2) adding reference counting 3) deleting them when they are no longer needed 4) doing the thread safty dance. It wasn't the first (or even second) solution considered, but it's the one that I was able to make work in a way that I'm convinced is correct. Its main advantage is that it puts all the tricky bits in one place.
* Fix #4921 - race condition in Parser Functions creationBrice Figureau2010-11-121-0/+21
| | | | | | | The autoloading is not thread safe, which means two threads could both autoload the same function at the same time. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #5252 - line number mis-attribution during parsingBrice Figureau2010-11-111-2/+9
| | | | | | | | | | | | | | | It is a resurgence of #2366 that appeared because of the commit 8971d8. Before this commit, for associating documentation comments, we were preferring line numbers coming from the parser currently reducing rule, instead of the current lexer line number (which can be in advance of several tokens due to the nature of LALR parsers). We now merge the ast line number before fetching the comment from the lexer. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix for #2568 -- Add a dbconnections option to set AR pool sizeMarkus Roberts2010-11-101-0/+74
| | | | | The dbconnection option, if set to a positive integer, will be passed to active record as the connection pool size (pool).
* Maint. Removing code for which no CLA has been signedMarkus Roberts2010-11-101-22/+8
| | | | | Multiple attemps were made to contact the author of this code in order to obtain a Contributor Licence Agreement, but we were unable to do so.
* Fix #4923 - close process race when truncating existing fileBrice Figureau2010-11-102-15/+53
| | | | | | | | | | | | | | | | | | | | | Using File.open(file, "w") calls open(2) with O_CREAT|O_TRUNC which means when the file exists it is immediately truncated. But the file is not locked yet, so another process can either write or read to the file, leading to file corruption. The fix is to truncate only when the file is exclusively locked. This can be done on some operating system with O_EXLOCK open(2) flag. I chose the more portable option of: * open * flock * truncate * write * close It might also be good to flush and fsync the file after writing it, otherwise in case of crash an incomplete file can stay on disk. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* (#4573) FreeBSD service provider now supports versions <7 and >8Nick Lewis2010-11-101-0/+50
| | | | | | | | | | | | Running "/etc/rc.d/SERVICE rcvar" outputs different formats for different versions of FreeBSD. This patch adds support for those formats, as well as tests. Based on patches from: o Joost van Beurden o Russell Jackson Paired-With: Matt Robinson
* Fix #3808 - puppetdoc should use --force-update only if RDoc supports itBrice Figureau2010-11-101-1/+9
| | | | | | This should allow to run puppetdoc on ruby 1.8.5. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #5127 - error when accessing array elementsBrice Figureau2010-11-101-0/+42
| | | | | | | | | | | Accesing an array with an integer index (ie $array[1]) is producing a ruby error: can't convert String into Integer This is because the array index is not properly converted to an number before the array element lookup is performed. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* (#5242) Fix schedule specs that fail near daylight savingsMatt Robinson2010-11-101-43/+15
| | | | | | | | | I fixed a few of these in a previous patch, but Hudson found more. I replaced the pattern of using Time.now and then doing date math to calculate intervals with the pattern of hard setting the intervals using utc times for the test. Reviewed-by: Paul Berry <paul@puppetlabs.com>
* [#5225] Fix spec failure that depended on time changeMatt Robinson2010-11-081-6/+2
| | | | | | | | | | | | Turns out that: zero = Time.now # Reset the current time to X:00:00 current = zero - (zero.hour * 3600) - (zero.min * 60) - zero.sec current is actually 1am on a day where the time falls back (Nov 7th), not midnight as the test expected. Reviewed-by: Paul Berry <paul@puppetlabs.com>
* (#5233) Randomize tmp dir pathsMatt Robinson2010-11-084-10/+6
| | | | | | | Standardize how we create tmpdirs by using the puppet function instead of Dir.tmpdir. Paired-with: Paul Berry <paul@puppetlabs.com>
* (#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.
* 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.
* 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.
* Fixes #4792 (Duplicate definition since 2.6.1 upgrade)Paul Berry2010-09-301-0/+21
| | | | | | | | | | | | | | | The evaluate_definitions method was first figuring out which resources needed to be evaluated (using unevaluated_resources), and then evaluating them one by one. As a result, if evaluating one resource triggered another resource to be evaluated, the latter resource could get evaluated twice. This bug could occur, for example, if both resources were classes that were included into the node by an external node classifier, and if the first of the two classes included the second. Modified Resource#evaluate to be idempotent. Also added an integration test to verify the fix.
* 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-295-1/+286
| | | | | | | | 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.
* (#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-282-2/+13
| | | | | | | | 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-222-25/+23
| | | | | | | | | | 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-222-1/+49
| | | | | | | | | | | | 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-223-21/+160
| | | | | | | | | | | | | | | | | | | | | | 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-232-16/+4
| | | | | | | | | | | | | | | 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.