summaryrefslogtreecommitdiffstats
path: root/spec/unit/network
Commit message (Collapse)AuthorAgeFilesLines
* Disable spec tests for unsupported functionality on WindowsJosh Cooper2011-08-192-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby does not support creating symlinks on Windows (though Windows does support them), and since the tidy spec test is designed to reproduce a specific bug (as opposed to testing symlink functionality on Windows) it has been disabled. Ruby on Windows also does not support File.chmod, so the inspect spec test has been disabled. The general issue of File.chmod on Windows is something I know needs to be investigated. Also disabled the cron spec test as this functionality will not be supported on Windows (instead there will be task manager support). Re-enable the autoload spec tests as those now pass on Windows (this is probably due to the cacher changes recently made). The inventory ssl spec is not supported on Windows and so is disabled. However, while researching the failure, it was due to Time.now.strftime("%Z") returning "Pacific Daylight Time" on Windows, instead of "PDT" like it does on other platforms. As a result, the split method was sometimes splitting in the wrong place. As far as I can tell, the inventory code is only called from the CA (to keep track of serial numbers for certs that it has issued). But it's something to watch out for on Windows when calling strftime. Webrick, fileserver and CA functionality are not supported on Windows so these spec tests are disabled. Also fix path issue with catalog spec. Also several spec tests were creating tempfiles manually and calling system("rm -rf ..."), these have been replaced with PuppetSpec::Files.tmpdir. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 75d2e62cab1de7677463c274892f8920cb7e0cbf)
* Remove Puppet::Network::HttpPool keep_alive handlingNick Lewis2011-08-192-112/+4
| | | | | | | | | | | | Keep alive has been disabled since 2008, and seems to have caused problems when it was enabled before then. Since there doesn't seem to be any push to get it working again, just remove it to simplify this code. This also allows us to entirely remove the usage of Puppet::Util::Cacher from HttpPool. Paired-With: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 185a666018c0cf0b2c497f655f942a82cd22e49e)
* Maint: Tagged spec tests that are known to fail on WindowsJosh Cooper2011-08-191-1/+1
| | | | | | | | | | | | | | | | | Many spec tests fail on Windows because there are no default providers implemented for Windows yet. Several others are failing due to Puppet::Util::Cacher not working correctly, so for now the tests that are known to fail are marked with :fails_on_windows => true. To skip these tests, you can run: rspec --tag ~fails_on_windows spec Reviewed-by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 255c5b4663bd389d2c87a2d39ec350034421a6f0) Conflicts: spec/unit/resource/catalog_spec.rb
* maint: remove inaccurate copyright and license statements.Daniel Pittman2011-08-186-24/+0
| | | | | | | | | | | For a while Luke, and other authors, injected a created tag, copyright statement, and "All rights reserved" into every new file they added to the Puppet project. This isn't really true, and we have a global license covering the code, so we have now stripped out all those old tags. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* (#8704) Give better errors for invalid fileserver.confMatt Robinson2011-07-291-0/+32
| | | | | | | | | | | If you tried to just put an allow or deny line in the fileserver.conf without a mount point, you got a really confusing error message: lib/puppet/network/handler/fileserver.rb:285:in `readconfig': undefined method `info' for nil:NilClass (NoMethodError) Now instead we give an error saying no mount point was specified. Reviewed-by: Josh Cooper <josh@puppetlabs.com>
* Deprecate RestAuthConfig#allowed? in favor of #check_authorizationBrice Figureau2011-07-261-1/+1
| | | | | | | | | | | | | | | | | #allowed? was a poorly named method since it isn't actually a predicate method. Instead of returning a boolean, this methods throws an exception when the access is denied (in order to keep the full context of what ACE triggered the deny). Given that #allowed? was overriding the behavior from AuthConfig, we leave a version of #allowed? in place that will issue a deprecation warning before delegating to #check_authorization. Once support for XML-RPC agents is removed from the master, we will be able to remove this delegation, since there should no longer be a reason for a distinction between AuthConfig and RestAuthConfig. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
* Fix #6026 - security file should support inline commentsBrice Figureau2011-07-261-0/+11
| | | | | | | | Auth.conf, namespaceauth.conf and fileserver.conf were not supporting trailing inlined comments. Also this commit fixes some indentation and error management. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #5010 - Allow leading whitespace in auth.confBrice Figureau2011-07-261-0/+12
| | | | | | | The regex used to detect ACE is too lax and would allow trailing spaces to sneak in, which in turn would confuse the ACE parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* maint: Fix order dependent test failureJosh Cooper2011-05-311-0/+1
| | | | | | | | | | | When running spec/unit/network/rights_spec.rb prior to spec/unit/network/authstore_spec.rb, test failures occur due to the AuthStore storing Declarations in current thread state. This is a temporary fix (explicitly clearing thread state for each test run) until the AuthStore can be modified to not rely on thread state. This commit is a follow up to 9834dcdd. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
* (#5966) Add support for hostname regular expressions in auth.confSiim Põder2011-05-311-4/+35
| | | | | | | | | | | | | | | | | | | | When hosting multiple applications (especially with different security levels), you may not want to allow every client to read all the files required for every other client. Currently it is possible to do this when your host and domain names reasonably reflect that grouping, ex: hostXYZ.someapp.domain.com. However, if you have a more flat naming convention, it is difficult to write these ACLs. This patch adds support for matching hostnames with regular expressions, thus extending the ACLs to allow: path /file_content/secrets/appserver allow /appserver[0-9]+.example.com$/ path /file_content/secrets/otherservice allow /^(test-)crazy[0-9]+.pattern.(com|net)$/ Signed-off-by: Josh Cooper <josh@puppetlabs.com> Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* (#7507) Add ability to filter Ruby 1.9 spec failuresMatt Robinson2011-05-174-7/+7
| | | | | | | | | | | | | | | By running: rspec spec --tag ~@fails_on_ruby_1.9.2 We can now just run the specs that pass under Ruby 1.9. Obviously in the long term we want to have all the specs passing, but until then we need notification when we regress. From now on new code will be required to pass under Ruby 1.9, and Jenkins will give us email notification if it doesn't or if we break something that was already working. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* Merge branch 'tickets/2.7.x/7179' into 2.7.xPieter van de Bruggen2011-05-041-12/+1
|\
| * (#7179) Modify default ACL for /node/<name>.Pieter van de Bruggen2011-05-041-12/+1
| | | | | | | | | | | | | | By default, it is useful to permit an individual node to query information about itself, and there is no good reason to reject this by default. Paired-With: Nick Lewis
* | (#7353) Add 'console' format to FormatHandlerDaniel Pittman2011-05-041-0/+62
| | | | | | | | | | | | | | | | | | | | | | This adds a console rendering format to the Network FormatHandler subsystem; it provides the same human-friendly textual rendering as the Faces application did, except it uses JSON rather than PP as the fall-back rendering mode. This paves the path for unification of all formatting into the same subsystem, rather than the half-measures we used to have. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | (#7117) Return the environment as a Puppet::Node::Environment in uri2indirectionJacob Helwig2011-05-031-2/+6
|/ | | | | | | | | The environment returned by uri2indirection used to be a Puppet::Node::Environment. When this changed to simply being the string of the environment name, this broke assumptions made in other areas of the code. Paired-with: Nick Lewis <nick@puppetlabs.com>
* (#7103) Fix HEAD requests in the HTTP handlerNick Lewis2011-04-131-11/+7
| | | | | | | | | HEAD request support was implemented in 2.6.x, and the internal API in the HTTP handler changed in 2.7.x. So when the branches were merged together, HEAD requests ended up using the wrong API without any visible merge conflicts or spec failures. This fixes them to use the correct API. Reviewed-By: Matt Robinson
* maint: clean up the spec test headers in bulk.Daniel Pittman2011-04-1323-39/+23
| | | | | | | We now use a shebang of: #!/usr/bin/env rspec This enables the direct execution of spec tests again, which was lost earlier during the transition to more directly using the rspec2 runtime environment.
* (#6117) Add POST support to indirector requestsNick Lewis2011-04-121-0/+26
| | | | | | | | | POST with a singular indirection is turned into a find in the indirector. When making a large find request from a REST terminus, POST is used, and for small requests, GET is used for backward compatibility. Paired-With: Jesse Wolfe
* maint: just require 'spec_helper', thanks rspec2Daniel Pittman2011-04-0823-23/+23
| | | | | | | | | | | rspec2 automatically sets a bunch of load-path stuff we were by hand, so we can just stop. As a side-effect we can now avoid a whole pile of stupid things to try and include the spec_helper.rb file... ...and then we can stop protecting spec_helper from evaluating twice, since we now require it with a consistent name. Yay. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#6830) Fix badly stubbed Time object in testMatt Robinson2011-03-292-2/+2
| | | | | | | | | Ruby 1.9 won't allow to_i to be called on a symbol. It results in the error: undefined method `to_i' for :now:Symbol Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com>
* (#6820) Fix Invalid multibyte characterMatt Robinson2011-03-231-1/+1
| | | | | | | | | | | | | | | | puppet/spec/unit/network/authstore_spec.rb:89: invalid multibyte char (US-ASCII) puppet/spec/unit/network/authstore_spec.rb:89: syntax error, unexpected $end, expecting ']' " 2001:0000:1234:0000:0000:C1C0:ABCD:0876  0", ^ There was a non-breaking space (HEX A0) in that line because according to Markus (who made the original commit), these test lines were copy pasted from a web page. The intent wasn't to test non-breaking speace chacters for IPV6. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* maint: Change code for finding spec_helper to work with Ruby 1.9Matt Robinson2011-03-222-2/+2
| | | | | | | | | | | | | | | | | Running the specs under Ruby 1.9 didn't work using the lambda to recurse down directories to find the spec_helper. Standardizing the way to find spec_helper like the rest of specs seemed like the way to go. Here's the command line perl I used to make the change: perl -p -i -e "s/Dir.chdir.*lambda.*spec_helper.*$/require File.expand_path(File.dirname(__FILE__) + '\/..\/..\/spec_helper')/" `find spec -name "*_spec.rb"` Then I fixed the number of dots for files that weren't two levels from the spec dir and whose tests failed. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* Merge branch '2.6.x' into nextMatt Robinson2011-03-181-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (36 commits) Updated CHANGELOG for 2.6.7rc1 (#5073) Download plugins even if you're filtering on tags Fix #5610: Prevent unnecessary RAL lookups Revert "Merge branch 'ticket/2.6.x/5605' of git://github.com/stschulte/puppet into 2.6.next" (#6723) Fix withenv environment restoration bug (#6689) Remove extraneous include of Puppet::Util in InventoryActiveRecord Remove extra trailing whitespace from lib/puppet/resource.rb (#5428) More fully "stub" Puppet::Resource::Reference for use with storedconfigs (#6707) Fix typo in rest_authconfig.rb (#6689) Make inventory_active_record terminus search quickly (#5392) Give a better error when realizing a non-existant resource (#2645) Adding a less-stubby test to verify the "system" attribute's behavior Update CHANGELOG for 2.6.6 maint: Remove serialization of InventoryFact values maint: Rename InventoryHost to InventoryNode Fixed #2645 - Added support for creating system users maint: Remove spec run noise maint:Refactor of mount provider integration tests (#6338) Support searching on metadata in InventoryActiveRecord terminus (#6338) Implement search for InventoryActiveRecord facts terminus ... This merge includes essentially reverting #4904's change to the mount type since tests that came in from 2.6.x specified different behavior and what's correct is not clear to me. I've reopened #4904 and added it to our backlog, and talked to Nigel about the RFC that's currently out on the puppet-users mailing list for a bigger refactor of how the mount provider works. Manually Resolved Conflicts: spec/spec_helper.rb spec/unit/indirector/queue_spec.rb
| * maint: Remove spec run noiseMatt Robinson2011-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some warnings and stack traces in the spec output that aren't necessary. The only interesting fix is of the message: lib/puppet/module.rb:79 warning: multiple values for a block parameter (0 for 1) from lib/puppet/util/logging.rb:30 If you call any form of logging on a module you end calling the file method on the module just because logging always checks for that method and calls it if it's defined, but in this case it's not defined in the way that logging expected so passes the wrong paramters. The easy solution is just to call logging on Puppet, which makes sense in this case anyway, and I don't think it's worth a separate ticket to deal with that logging warning. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | Merge branch '2.6.next' into nextMatt Robinson2011-03-071-0/+28
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a particularly nasty merge, so rather than hold up merges into next any longer, I'm going to push this merge with a few outstanding problems. The tests that were failing in the following areas have been marked pending, and will be addressed separately, immediately following this push. TODO: Verify that brice's rdoc change is still valid: tests to show that line numbers from class, define and node get into the ast Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb * 2.6.next: (85 commits) (#5148) Fix failing spec due to timezone (#5148) Add support for PSON to facts (#6338) Remove inventory indirection, and move to facts indirection (#6445) Fix inline docs: puppet agent does not accept --mkusers Update CHANGELOG and version for 2.6.6rc1 (#6541) Fix content with checksum truncation bug (#6418) Recursive files shouldn't be audited (#6541) maint: whitespace cleanup on the file integration spec (#6541) Fix content with checksum truncation bug (#5466) Write specs for output of puppet resource (#5466) Monkey patch Symbol so that you can sort them (#5466) Fixed puppet resource bug with trailing , Update CHANGELOG for 2.6.5 (#4922) Don't truncate remotely-sourced files on 404 (#6338) Remove unused version control tags Maint: Align tabs in a code block in the Augeas type. (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type Maint: Rewrite comments about symlinks to reflect best practice. (#6509) Inline docs: Fix broken lists in Launchd provider. (#6509) Inline docs: Fix broken code blocks in zpool type ... Manually Resolved Conflicts: lib/puppet/application/inspect.rb lib/puppet/defaults.rb lib/puppet/file_bucket/dipper.rb lib/puppet/network/http/handler.rb lib/puppet/node/facts.rb lib/puppet/parser/parser.rb lib/puppet/parser/parser_support.rb lib/puppet/util/command_line/puppet lib/puppet/util/command_line/puppetd lib/puppet/util/command_line/puppetmasterd lib/puppet/util/monkey_patches.rb lib/puppet/util/rdoc/parser.rb spec/unit/application/agent_spec.rb spec/unit/file_bucket/file_spec.rb spec/unit/indirector/file_bucket_file/file_spec.rb spec/unit/network/http/handler_spec.rb spec/unit/parser/parser_spec.rb spec/unit/provider/mount/parsed_spec.rb
| * (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testingDaniel Pittman2011-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We had a combination of bad logic, and bad testing, and a nasty behaviour of Mocha <= 0.9.10 that would result in a false pass for one of our tests. This not only falsely passed, but hid an infinite loop retrying decompression on an invalid data stream; it could be triggered by anything that sent an HTTP request with an invalid compressed body, resulting in a livelock. Paired-with: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
| * (#6376) Add test case for facts find requestMax Martin2011-02-211-1/+5
| | | | | | | | | | | | | | Added test case to ensure indirection name is not changed from "facts" when making an HTTP GET request. Reviewed-by:Paul Berry <paul@puppetlabs.com>
| * (#6376) Add support and testing for _search GET requestsMax Martin2011-02-181-0/+12
| | | | | | | | | | | | | | | | Added support for adding "_search" to the end of any indirection to 'pluralize' it, and added tests to check this functionality and to test hidden side effect of plurality method unpluralizing indirections. Paired-With:Paul Berry <paul@puppetlabs.com>
| * (#5132) Provide a query REST interface for inventoryPaul Berry2011-02-172-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This REST interface returns a list of nodes that match a fact query. Fact queries can use (in)equality testing as a string comparison, and >, <, >=, <= numerical comparisons. Multiple tests can be done as AND comparisons, not OR. The fact queries need to be prefixed by facts, and the comparisons other than equality are specified with a .comparison_type after the fact name. This will be better explained in the REST documentation on the website. Searches that don't match anything now return empty array instead of a 404 error. Conflicts: spec/spec_helper.rb
* | (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testingDaniel Pittman2011-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We had a combination of bad logic, and bad testing, and a nasty behaviour of Mocha <= 0.9.10 that would result in a false pass for one of our tests. This not only falsely passed, but hid an infinite loop retrying decompression on an invalid data stream; it could be triggered by anything that sent an HTTP request with an invalid compressed body, resulting in a livelock. Paired-with: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | Merge branch '2.6.x' into nextMatt Robinson2011-01-194-25/+89
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (21 commits) (#5900) Include ResourceStatus#failed in serialized reports (#5882) Added error-handling for bucketing files in puppet inspect (#5882) Added error-handling to puppet inspect when auditing (#5171) Made "puppet inspect" upload audited files to a file bucket Prep for #5171: Added a missing require to inspect application. Locked Puppet license to GPLv2 (#5838) Support paths as part of file bucket requests. (#5838) Improve the quality of file bucket specs. (#5838) Make file bucket dipper efficient when saving a file that already exists (#5838) Implemented the "head" method for FileBucketFile::File terminus. (#5838) Reworked file dipper spec to perform less stubbing. (#5838) Added support for HEAD requests to the indirector. (#5838) Refactored error handling logic into find_in_cache. (#5838) Refactored Puppet::Network::Rights#fail_on_deny maint: Remove unused Rakefile in spec directory (#5171) Made filebucket able to perform diffs (#5710) Removed unnecessary calls to insync? Prep for fixing #5710: Refactor stub provider in resource harness spec Maint: test partial resource failure maint: Inspect reports should have audited = true on events ... Manually Resolved Conflicts: lib/puppet/file_bucket/dipper.rb lib/puppet/indirector.rb lib/puppet/network/rest_authconfig.rb spec/unit/file_bucket/dipper_spec.rb spec/unit/file_bucket/file_spec.rb spec/unit/indirector_spec.rb
| * (#5838) Added support for HEAD requests to the indirector.Paul Berry2011-01-124-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the ability for the indirector to handle REST HEAD requests. These are done using a new indirector method, head(), which should return true if find() would return a result and false if find() would return nil. Access control for the head method is the union of that for the find and save methods. That is, if either find or save is allowed, then head is allowed. This is necessary so that users will not have to change their authconfig to take advantage of the new feature. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * (#5838) Refactored Puppet::Network::Rights#fail_on_denyPaul Berry2011-01-122-24/+24
| | | | | | | | | | | | | | Changed into a method that returns the exception to raised rather than raising it. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * (#5171) Made filebucket able to perform diffsJesse Wolfe2011-01-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | It is now possible to ask the filebucket to diff two files using a URL of the form: https://puppet/production/file_bucket_file/md5/{first file hash}?diff_with={second file hash} The returned diff is a string, the output of the "diff" command. Paired-with: Paul Berry <paul@puppetlabs.com>
* | Merge branch '2.6.x' into nextNick Lewis2011-01-067-28/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
| * (#5771) Upgrade rspec to version 2Matt Robinson2011-01-047-28/+10
| | | | | | | | | | | | | | | | | | The biggest change is that we no longer need to monkey patch rspec to get confine behavior. Describe blocks can now be conditional like confine used to be. "describe" blocks with "shared => true" are now "shared_examples_for". Paired-With: Nick Lewis
| * maint: Fix a test that was missing a requireMatt Robinson2010-12-161-0/+1
| | | | | | | | Paired-with: Nick Lewis
| * maint: Fix tests that don't run on their ownMatt Robinson2010-12-163-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-0621-21/+21
| | | | | | | | | | | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* | 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: Modified uses of indirector.save to call the indirection directly.Paul Berry2010-11-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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: 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-291-2/+2
| | | | | | | | | | | | 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.
* | maint: Fix tests that don't run on their ownMatt Robinson2010-11-223-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 commit '2.6.3' into nextPaul Berry2010-11-172-14/+5
|\| | | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * Fix for #4955 -- Race condition & memory leak in Puppet::UtilMarkus Roberts2010-11-121-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * (#5233) Randomize tmp dir pathsMatt Robinson2010-11-081-4/+2
| | | | | | | | | | | | | | Standardize how we create tmpdirs by using the puppet function instead of Dir.tmpdir. Paired-with: Paul Berry <paul@puppetlabs.com>