summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fixing #2960 Test Failed: 'Puppet::Type::Mount::ProviderParsed when ↵Jesse Wolfe2009-12-221-1/+3
| | | | | | | | | | | | | | | | | | | | modifying the filesystem tab should write the mount to disk when :flush is called I found this doing idempotency tests (#2879), but there are apparently other ways for external state to leak into this test, as reported by James. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing testsMarkus Roberts2009-12-221-30/+11
| | | | | | | | Signed-off-by: Markus Roberts <Markus@reality.com>
| * Fix #2970 spec/unit/provider/ssh_authorized_key/parsed.rb has order dependenciesJesse Wolfe2009-12-201-1/+3
| | | | | | | | | | | | | | | | Some tests in this file were leaking a global setting, some other tests depended on those changes, and some tests were incompatible with that setting. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2816 MySQL server has gone awayJesse Wolfe2009-12-201-4/+6
| | | | | | | | | | | | As suggested in the ticket, set :reconnect to true. Our in-house Rails experts suggest that this is unlikely to cause any problems. The setting is silently ignored before Rails 2.3
| * Fix for #2765 (--no-fqdn regression in puppetrun)Markus Roberts2009-12-202-8/+32
| | | | | | | | | | | | | | | | | | This is basically the fix suggested on the ticket, cleaned up and ruby-ized, with tests. The only functional modification is leaving the default on entry2hash as --no-fqdn to preserve 0.25.1 behaviour as the default. Signed- ff-by: Markus Roberts <Markus@reality.com>
| * Fix for #2657 (retain old setting if config has syntax error)Markus Roberts2009-12-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to be regression introduced by threading changes. The fix was to rearrange things to keep the old behaviour (don't clear the settings until you know the config file parses) and the new (don't nest calls to synchronize) by: 1. Splitting clear into two parts--clear, which works as before, and unsafe_clear which it calls and which expects synchronization to be handled externally. 2. Rearranging the code to recover the previous calling order 3. Trapping syntax errors and turning them into logged messages and a no-op effect. 4. Fixing reparse to not wrap a call to this code with a synchronize. 5. Tests. Signed-off-by: Markus Roberts <Markus@reality.com>
| * Fix #2966 spec/unit/util/queue.rb can't be run twiceJesse Wolfe2009-12-201-2/+10
| | | | | | | | | | | | | | | | This spec wasn't cleaing up after itself, and raised several exceptions when trying to register the same queue type again. Part of the #2879 test idempotency suite. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing #2963 spec/unit/util/autoload.rb depends on global stateJesse Wolfe2009-12-201-0/+2
| | | | | | | | | | | | | | An Autoload spec was depending on files having not yet been autoloaded. Detected as part of #2879. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixed RSpec deprecation errorJames Turnbull2009-12-191-1/+1
| |
| * Fix for #2951 (SELinux test errors on OS X)Markus Roberts2009-12-181-2/+19
| | | | | | | | | | | | | | | | | | This makes the SELinux library marginally more robust by dealing consistently with a missing proc/mounts, and also resoves the test failures in a way that allows meaningful test runs on non-SELinux systems. Signed-off-by: Markus Roberts <Markus@reality.com>
| * Fix for #2890 (the cached certificates that would not die)Markus Roberts2009-12-192-75/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements the two-part suggestion from the ticket; 1) a client that receives a certificate that doesn't match its current private key does not accept, store or use the certificate--instead it removes any locally cached copies and acts as if the certificate had never been found. 2) a puppetmaster that receives a csr from a client for whom it already has a signed certificate now honors the request and considers it to supercede any previously signed certificates. In order to make the cache expiration work as expected, I changed a few assumptions in the caching system: * The expiration of a cached certificate is the earlier of the envelope expiration and the certificate's expiration, as opposed to just overriding the cache value * Telling the cache to expire an item now removes it from the cache if possible, rather than just setting an expiration date in the past and hoping that somebody notices. Signed-off-by: Markus Roberts <Markus@reality.com>
| * Fix for #2950 (parens needed warning)Markus Roberts2009-12-171-1/+1
| |
| * Fixed test typoJames Turnbull2009-12-181-1/+1
| |
| * Fix for #2869 (SELinux tests failing under some load orderings)Markus Roberts2009-12-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that the setup for the tests was expecting the defaultprovider for Selboolean and Selmodule to be called, rather than stubbing it. This worked as long as no other spec which initializes the providers was run before it. The fix here (stubbing rather than expecting) is minimal but not ideal; if there were some other provider for these types it could result in a test indetermenacy (different results depending on which provider) but I'm not seeing an easy way to address that. Signed-off-by: Markus Roberts <Markus@reality.com>
| * Adds partial IPv6 support to authstoreMarkus Roberts2009-12-181-0/+175
| | | | | | | | | | | | | | | | This removes some of the IPv4 centricism from authstore's handling of IP addresses. It isn't full IPv6 support (and doesn't even fully handle all the cases within its limited scope, as ruby's IPAddr library does not work with hybrid addresses), but it should simplify adding IPv6 support when the time comes.
| * Fix 2948 Failing rests in spec/unit/rails.rbJesse Wolfe2009-12-181-4/+4
| | | | | | | | | | | | Specs didn't reflect some recent changes. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2923 failing tests in spec/unit/ssl/host.rbJesse Wolfe2009-12-171-2/+2
| | | | | | | | | | | | | | The fix for #2661 changed the behavior of Puppet::SSL::Host enough to confuse these mocks. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2851 spec/unit/network/rest_authconfig.rb test descriptions changeJesse Wolfe2009-12-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Some test names change arbitrarily since they were interpolating hashes instead of strings. This patch replaces, for example: - should insert methodfindacl/certificate_revocation_list/caauthenticatedtrue if not present with: - should insert /certificate_revocation_list/ca if not present Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2855 Inadvertent zlib dependencyJesse Wolfe2009-12-162-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | Disables the b64_zlib_yaml format if zlib cannot be loaded. I've added a --no-zlib to make it possible to test this on a single machine, but it might also be useful if someone finds themselves failing to connect to a server that doesn't have zlib installed. FactHandler' format is still hard-coded to YAML rather than using facts.class.default_format Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * 2850 spec/unit/application/puppetd.rb generates warnings if run with certain ↵Jesse Wolfe2009-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | other tests Puppet[:libdir] is nil due to stubbing, causing an exception in autoload. Depending on the order of loaded libs, sometimes this exception is logged using Kernel#warn, but sometimes it's logged using Puppet.err Only Kernel#warn writes to the terminal during unit testing!
| * 2876 spec/unit/indirector/catalog/compiler.rb changes behaviourJesse Wolfe2009-12-161-1/+2
| | | | | | | | | | | | | | 1) Improve test so it doesn't fail if an autoload happens. 2) Improve test so it doesn't show a warning. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix 2936 Insufficient mocks for webrick in spec/unit/network/http/webrick.rbJesse Wolfe2009-12-151-2/+2
| | | | | | | | | | Fixing #2877 introduced some spec failures, by using more of the webrick API than was mocked here.
| * Fix for #2921 (test not checking for what it really wanted)Markus Roberts2009-12-151-1/+1
| |
| * Fixing 2907 rspec crash when spec/unit/application/puppetrun.rb is run after ↵Jesse Wolfe2009-12-111-1/+1
| | | | | | | | | | | | | | | | | | spec/unit/util/ldap/connection.rb the ldap/connection spec creates a mock LDAP class that causes `require 'ldap'` to explode. If `require 'ldap'` happens first, then we're OK. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2858 spec/unit/application/puppetmasterd.rb fails if run twiceJesse Wolfe2009-12-101-0/+1
| | | | | | | | | | | | @puppetmasterd.options[:node] leaks from test to test Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Feature 2827 Option to disable managing internal filesJesse Wolfe2009-12-091-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | Add a flag "manage_internal_file_permissions" which is enabled by default. Disabling this flag prevents Puppet from managing the owner, group, or mode of files created from Puppet::Util::Settings::FileSetting I think this is a wide enough net to follow Luke's suggestion of "disable management of everything", and it certainly satisfies the requests I'm aware of, but if I've missed anything, let me know. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2849 puppet changes sshkey alias every run if it is blankJesse Wolfe2009-12-091-0/+19
| | | | | | | | | | | | | | | | Puppet was mis-parsing sshkey aliases when the last alias is an empty string. This is due to the counter-intuitive behavior of Ruby's String#split. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Avoiding rspec bug which causes 'be_all' tests to always passMarkus Roberts2009-12-041-1/+1
| |
| * Fixing 2725 Error message when permissions incorrect on file server directoryJesse Wolfe2009-12-022-0/+18
| | | | | | | | | | | | | | No message was being displayed on the server if a file could not be opened by the file server. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2783, take2 - puppetdoc should use environment to get ↵Brice Figureau2009-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | modulepath/manifestdir I was told that setting manifestdir in environment is not supported. Only the manifest setting seems to be supported in environments. This patch changes how puppetdoc handles manifestdir, instead of getting it through the manifestdir variable, we now get the manifest settings and infer the directory from this, exactly as the parser is doing. This allows puppetdoc to handle what user are doing with environments. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fix #2818 - scope variable assigned with undef are not "undef"Brice Figureau2009-12-293-10/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following manifest doesn't work: $foo = undef case $foo { undef: { notice("undef") } default: { notice("defined") } } This is because "undef" scope variable are returned as an empty string. This patch introduces a behavior change: Now, unassigned variable usage returns also undef. This might produce some issues in existing manifests, although care has been taken to allow correct behavior in the most commonly used patterns. For instance: case $bar { undef: { notice("undef") } default: { notice("defined") } } will print "undef". But matching undef in case/selector/if will also match "". case $bar { "": { notice("empty") } default: { notice("defined") } } will print "empty". Of course "" doesn't match undef :-) Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Merge branch '0.25.x'Luke Kanies2009-12-2135-79/+823
|\| | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppetd.rb lib/puppet/parser/ast/leaf.rb lib/puppet/util/rdoc/parser.rb
| * Fixing #2791 fs_find should follow symlinksJesse Wolfe2009-11-251-0/+36
| | | | | | | | | | | | | | | | | | Symlinks confuse the "What file system am I on?" logic. This patch just runs the paths through a beefed up version of the standard 'realpath' method. Includes some of Markus's suggested changes. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2792 selinux tries to set properties on unsupported filesystesJesse Wolfe2009-11-251-0/+6
| | | | | | | | | | | | | | | | | | Check that a specific file supports selinux properties before trying to set them. This patch is functionally identical to the one Darrell Fuhriman submitted with the bug report. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing 2812 authorized_keys without comments failJesse Wolfe2009-11-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is technically a duplicate of #1531, I think this change prevents the problem that appears in #2812, without touching the underlying issues of #1531. ssh_authorized_key was failing on keys in ~/.ssh/authorized_keys that lack a comment field - it would generate a Ssh_authorized_key resource with the name set to nil, which raises "ArgumentError: Field 'name' is required." Fixed by setting such keys' name fields to an empty string. This prevents the error from being raised and the authorized_keys files round-trip successfully. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix 2768 maillist resource is brokenJesse Wolfe2009-11-201-0/+42
| | | | | | | | | | | | | | | | | | | | Replace deprecated method call. This code was not tested before, so I've tried to capture what I think the method was trying to do. This version includes Luke's suggested change to better preserve the original behavior. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing #2789 puppetrun fails without --tagJesse Wolfe2009-11-191-0/+10
| | | | | | | | | | | | | | | | | | Puppet::Transaction was handling "tags" strings differently depending on whether they came in from Puppet[:tags] or another source. This was causing puppetrun's tags to be misparsed if there was not exactly one --tag parameter. I've moved the code to Util::Tagging.
| * Fixing 904 RDoc::usage incompatible with rubygemsJesse Wolfe2009-11-191-0/+103
| | | | | | | | | | | | | | Monkey-patch workaround for RDoc so it doesn't get confused by rubygems stub executables. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2671, preferred_serialization_format does not complain about invalid valuesBruce Williams2009-11-171-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `supported_formats` to warn when the `preferred_serialization_format` setting is invalid (and ignored in favor of the default value). I built the tests for this behavior alongside the existing FormatHandler tests for *valid* `preferred_serialization_format` values (and did some restructuring to extract common setup code to `before` blocks). Signed-off-by: Bruce Williams <bruce@codefluency.com>
| * Fixing #2764 ActiveRecord 2.1 supportJesse Wolfe2009-11-171-0/+11
| | | | | | | | | | | | | | | | | | | | Suprisingly, I found that setting allow_concurrency made the "MySQL server has gone away" stop occuring even if the MySQL server drops connections. This may be the only change needed to restore compatibility with ActiveRecord 2.1.x Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix failing tests introduced by #2797Brice Figureau2009-11-171-4/+4
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fix #2810 - adapt tidy to new FileSet apiBrice Figureau2009-11-171-1/+14
| | | | | | | | | | | | | | In #1469 we changed the FileSet internal api and missed that tidy was still using the old version. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fix #2783 - Puppetdoc rdoc should use environment to get modulepath/manifestdirBrice Figureau2009-11-151-4/+13
| | | | | | | | | | | | | | Puppetdoc wasn't using the current environment to find the correct modulepath and manifestdir. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Add Environment#manifestdir and small refactoringBrice Figureau2009-11-151-22/+38
| | | | | | | | | | | | | | | | This adds a new environment cached attribute: manifestdir. It is modeled on the code of modulepath, but returns the manifestdir. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Least kludgy patch for #2675Markus Roberts2009-11-143-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This makes parameters responsible for the canonicalization of their values and provides a default (passthrough) implementation. It changes munge to pre- canonicalize the value and resource references to builtin types to canonicalize titles (which map to resorce namevars) with the corresponding parameter's classes's canonicalization. It adds a canonicalization routine to file paths that normalizes the behaviour (trailing slashes are ignored) and DRYs up the related code. Signed-off-by: Markus Roberts <Markus@reality.com>
| * Fixing 2806 Specifying multiple tags fails to apply any of themJesse Wolfe2009-11-132-0/+20
| | | | | | | | | | | | | | | | | | Fix code that was passing an Array of code to a method that was expecting a single tag. Includes Markus's suggestions Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2681 Incorrectly duplicating resourcesRein Henrichs2009-11-131-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that resources whose refs are included in the catalog are skipped to avoid duplication. * Refactor to avoid early bailout on resources that cannot be ensured absent. * Remove check for managed? in generate Checking if a resource is managed is unnecessary when checking for its inclusion in the catalog. * Add test coverage for Puppet::Type::Resources#generate
| * Fixing #2767 invoke-rc.d warningsJesse Wolfe2009-11-121-1/+1
| | | | | | | | | | | | | | | | Errors written to STDERR by Debian's invoke-rc.d are spurious, since we're only using it to query whether a service can be started. I'm adding the --quiet flag to suppress those messages. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fix #2797 - tags are not inherited by recursed file sub childBrice Figureau2009-11-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | This problem affects all types that generate sub-resources at evaluation or pre-transaction time. Thus it is fixed in the transaction, where we make sure we assign all parent tags to the generated child resource. A more correct fix would be to make sure we copy the whole context (ie file, line, version, tags). This fix is planned for Rowlf. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fix #2796 - Fix puppetdoc rdoc selector parsingBrice Figureau2009-11-122-1/+17
| | | | | | | | | | | | | | | | | | This patch fix this bug by adding more to_s methods to ast member so that puppetdoc can just to_s the AST to reconstruct the original puppet code. Of course this is not perfect, but should work most of the time. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>