summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2.6.x' into nextMatt Robinson2010-12-021-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5304) Use internal_name rather than real_name for maillist provider Updated CHANGELOG and version for 2.6.4 Revert "(#5304) Use internal_name rather than real_name for maillist provider" Disable remote ralsh by default (#5424) Ship auth.conf as part of installing from source (#5304) Use internal_name rather than real_name for maillist provider Renamed Reductive to Puppet Manually Resolved Conflicts: lib/puppet/provider/maillist/mailman.rb
| * Disable remote ralsh by defaultPaul Berry2010-12-021-1/+0
| | | | | | | | | | | | | | Changed the default auth.conf so that accesses to "/resource" are no longer allowed. This means that to use "puppet resource -H" you will need to configure the target machine to enable access to the "/resource" URLs.
* | maint: Restore a default value that can cause order dependent test failuresMatt Robinson2010-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | If you ran two tests in the following order: spec spec/integration/network/server/webrick_spec.rb spec/unit/ssl/certificate_request_spec.rb You got the following test failure: Cannot save me; parent directory /dev/null/ssl/certificate_requests does not exist Paired-with: Paul Berry
* | Merge branch 'ticket/next/5211' into nextMatt Robinson2010-12-021-0/+24
|\ \ | | | | | | | | | | | | * ticket/next/5211: (#5211) Added patch and tests for checking the size of the arrary which is returned
| * | (#5211) Added patch and tests for checking the size of the arrary which is ↵Steve Nielson2010-12-021-0/+24
| |/ | | | | | | returned
* | (#2495) Better value validation for sshkeyStefan Schulte2010-11-301-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mentioned in the ticket it is not obvious that aliases do not belong in the resourcename but have to be specified with the property "host_aliases". On the puppet-user list I saw someone using this as a resource @@sshkey {"$fqdn,$hostname,$ipaddress": type => rsa, key => $sshrsakey, } Puppet will now write a correct entry to the know_hosts file, but when it rereads the file, the field $fqdn,$hostname,$ipaddress is split into name ($fqdn) and host_aliases ([$hostname,$ipaddress]). Since we dont find the resource the user specified, puppet will put the same key in the file over and over again. This patch adds a simple validation on resourcename.
* | Maint: Modified uses of indirector.save to call the indirection directly.Paul Berry2010-11-307-12/+12
| | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects production code.
* | Maint: Modified tests of indirector.save to call the indirection directly.Paul Berry2010-11-3018-89/+63
| | | | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects tests only; the next patch will make the corresponding change to the code.
* | Maint: Moved auto-signing logic into an indirector extensionPaul Berry2010-11-301-2/+6
| | | | | | | | | | | | | | | | Autosigning was previously accomplished by overriding CertificateRequest#save. This meant that it wouldn't work if certificate requests were saved via a direct call to Indirection#save. Changed it to use the indirector :extend mechanism, which works no matter how the save is invoked.
* | Maint: Swap the order of arguments to Indirection#savePaul Berry2010-11-304-7/+4
| | | | | | | | The first argument was often nil, and the second was mandatory.
* | Maint: Make http handler code call the indirector through ".indirection"Paul Berry2010-11-301-17/+19
| | | | | | | | | | | | | | | | In commit 71ecad9904c8c48c023e90e5fbea5b26b180c9cf we removed the delegation from model class to indirection for the "find", "search", "destroy", and "expire" methods. When we did this we neglected to modify http handler code to call the indirector directly. This patch makes the appropriate changes to http handler code.
* | Maint: Refactor tests to use <class>.indirection.<method>Paul Berry2010-11-2937-361/+279
| | | | | | | | | | | | Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. This change affects tests only.
* | Merge branch 'ticket/next/5375' into nextPaul Berry2010-11-232-15/+13
|\ \
| * | (#5375) Rework puppet apply to use configurer.runPaul Berry2010-11-232-15/+13
| | | | | | | | | | | | | | | | | | | | | Puppet apply used to contain code that duplicated the functionality of configurer.run. Refactored to share code. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | Merge branch 'maint/next/make_upstart_tests_more_robust' into nextPaul Berry2010-11-231-2/+1
|\ \ \
| * | | Maint: made upstart tests more robust.Paul Berry2010-11-231-2/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests for the upstart provider were attempting to stub Process::Status.exitstatus. However, this doesn't work (presumably because Process::Status is implemented in C). As a result, the upstart spec tests were failing if the most recent exit code was nonzero. Changed the tests so that instead of stubbing Process::Status.exitstatus to return zero, they execute a command that is known to succeed (`true`). Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | (#2866) yum should support downgrade.Dan Bode2010-11-231-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch originally from Grzegorz Nosek with contributions on the test from Oliver Hookins. checks if the current version is greater than the should version, if so, calls yum downgrade. Reviewed-by: Matt Robinson
* | | (#4711) Provide unit tests for yum package provider.Dan Bode2010-11-231-0/+61
|/ /
* | Merge branch 'ticket/2.6.x/5261' into nextJesse Wolfe2010-11-221-0/+15
|\ \
| * | Fix #5261 Don't escape Unicode characters in PSONJesse Wolfe2010-11-221-0/+15
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the escaping of valid UTF-8 sequences as "\uXXXX". This code was unreliable, as it relied on Iconv's ability to convert those codepoints between UTF-8 and UTF-16, but some versions of Iconv barf on some valid codepoints. Invalid UTF-8 sequences are still passed through unchanged. We believe that this is fine; if you are concerned about complience with the JSON standard, what we are doing is equivalent to: * interpreting binary files as Latin-1 encoded character sequences * JSON-encoding those characters according to RFC 4627 * outputting the JSON as Latin-1 This allows all raw binary files to be transmitted losslessly. Paired-With: Paul Berry <paul@puppetlabs.com>
* | maint: Fix tests that don't run on their ownMatt Robinson2010-11-2212-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the spec directory I found all the specs that fail when run on their own. for TEST in `find . -name "*.rb" -type f`; do spec $TEST > /dev/null 2>&1 if [[ $? != 0 ]]; then echo $TEST fi done All of them were cases of missing requires. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | maint: Fix a test that was missing a requireMatt Robinson2010-11-221-0/+1
| | | | | | | | Paired-with: Nick Lewis
* | Merge remote branch 'masterzen/feature/master/4339' into nextPaul Berry2010-11-226-7/+159
|\ \ | | | | | | | | | | | | Manually resolved conflicts: spec/unit/configurer_spec.rb
| * | Fix #4339 - Locally save the last report to $lastrunreportBrice Figureau2010-11-133-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | Using the cache terminus system, when --report is on, we are now caching the last report as a yaml file in the $lastrunreport file (which by default is $statedir/last_run_report.yaml). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #4339 - Allow puppet apply to save last run summaryBrice Figureau2010-11-131-0/+11
| | | | | | | | | | | | | | | | | | | | | Puppet apply inconditionally saves its last run summary like puppet agent. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | Fix #4339 - Save a last run report summary to $statedir/last_run_summary.yamlBrice Figureau2010-11-133-7/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once a configuration run is done, puppetd will save on the node a yaml summary report roughly akin to: --- time: notify: 0.001025 last_run: 1289561427 schedule: 0.00071 config_retrieval: 0.039518 filebucket: 0.000126 resources: changed: 1 total: 8 out_of_sync: 1 events: total: 1 success: 1 changes: total: 1 This is almost an hash version of the current --summarize output, with the notable exception that the time section includes the last run unix timestamp. The whole idea is to be able to monitor locally if a puppetd does its job. For instance this could be used in a nagios check or to send an SNMP trap. The last_run information might help detect staleness, and this summary can also be used for performance monitoring (ie time section). The resource section can also show the number of failed resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | | Maint: Switched spec tests to use a class rather than Array as the log ↵Paul Berry2010-11-182-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | destination. Using an Array as a log destination is unreliable because Puppet's log mechanism stores log destinations in a hash whose key is the destination itself. Since arrays can change their hash when they are modified, this was causing the log destination hash to become corrupted, producing sporadic spec test failures.
* | | Maint: Improved spec testsPaul Berry2010-11-182-15/+12
| | | | | | | | | | | | | | | | | | In configurer_spec.rb, replaced some mock classes with actual Puppet::Transaction::Report objects. In log_spec.rb, stopped using the Array type as a log destination, since doing so was unreliable.
* | | maint: Fix intermittent parser spec failuresNick Lewis2010-11-171-21/+21
| | | | | | | | | | | | | | | | | | The variable 'ast' was being used as shorthand for Puppet::Parser::AST, but a test was also trying to use it as a local variable, causing problems.
* | | Merge branch 'ticket/next/5274' into nextNick Lewis2010-11-172-0/+279
|\ \ \
| * | | (#5274) New tests for new hosttype/parsedproviderStefan Schulte2010-11-172-3/+45
| | | | | | | | | | | | | | | | | | | | Just a few additional tests for the new property "comment" of the host type.
| * | | (#5274) Tests for hostprovider removes commentsStefan Schulte2010-11-172-0/+237
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that the hostprovider will remove all inline comments from the /etc/hosts file, when puppet updates at least one entry. Puppet will also remove comments from entries, the user doesnt want to manage with puppet. To split up changes a bit this commit will only introduce tests for the host type and the hostprovider. A few will fail, indicating the bug: The hostprovider parses all entries and builds a hash. When building the recordhash all comments are discarded. When puppet has to update at least one entry it uses the to_line function to convert the record hash back to a file. Because the comments are not stored in the hash, they cannot be written back to the file.
* | | Merge commit '2.6.3' into nextPaul Berry2010-11-1723-169/+339
|\| | | | | | | | | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * | [#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>