summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow variable $0 to $9 to be interpolated, if ephemeralBrice Figureau2009-08-011-0/+30
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Implement ephemeral scope variablesBrice Figureau2009-08-012-9/+63
| | | | | | | | | | Those variables have been created to be short lived and used mainly to define temporary special variables. They do not persist after a call to unset_ephemeral_var. Also Scope#set_ephemeral_from can be used to promote a regexp MatchData to ephemeral values. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2472. Load Facter facts when ralsh is invoked, plus test.Nigel Kersten2009-08-011-0/+5
|
* Fixing typo in two tests which caused them to always passMarkus Roberts2009-07-311-2/+2
|
* Fixing #2440 - catalogs can now be compiled on demandLuke Kanies2009-07-311-0/+63
| | | | | | | | | This uses the locally cached yaml facts and prints the catalog in json. It's meant to be used one-time, but you have to use puppetmasterd since we assume it's the executable correctly configured for compilation. Signed-off-by: Luke Kanies <luke@madstop.com>
* Exiting from app failures instead of raisingLuke Kanies2009-07-311-7/+10
| | | | | | | This protects the user from seeing stack traces in normal situations. It makes sense here because this is explicitly for user interactions. Signed-off-by: Luke Kanies <luke@madstop.com>
* Minimal patch to fix #2290 (/tmp permissions)Markus Roberts2009-07-311-0/+4
| | | | | | | | | | | | | | | | | This patch rectifies the specified problem by resetting the permissions to 1777 after the offending tests have run. I am providing it for testing but suspect there may be a deeper bug hiding behind this one--specifically, it isn't clear to me that an analogous problem could not occur in production use (which this patch to the spec would not fix). This patch also fixes the specific test isolation failure which was causing ticket #2290; if spec/unit/util/storage.rb was run by "rake spec" before spec/integration/network/server/webrick.rb without any intervening tests which did a Puppet.settings.clear, the the webrick test would change the permissions on /tmp. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2448 - fix the broken runit provider and testsBrice Figureau2009-07-291-1/+13
| | | | | | | The runit provider was broken when the daemontools provider was enhanced.This patch aims to fix this. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2362. Do not validate users/groups when supplied with numeric uid/gidsNigel Kersten2009-07-292-0/+10
|
* Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctlyBrice Figureau2009-07-254-0/+49
| | | | | | | | | | AST nodes don't have a valid to_s that is producing a correct representation of said node. This patch adds some of the AST node to_s to produce correct values that can be used verbatim by puppetdoc to render the documentation. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2296 - overlapping recursions work againLuke Kanies2009-07-252-6/+22
| | | | | | | | | | | | This fixes the behaviour when you have file recursions that overlap - we again correctly use the most specific information. It's still a bit expensive when you do this, but at least it behaves correctly, and it should be a rare circumstance. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing mocks to remove warningsLuke Kanies2009-07-251-18/+18
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2423 - no more strange dependency cyclesLuke Kanies2009-07-251-0/+23
| | | | | | | | | | | | | | | We were getting strange dependency cycles because our class structure mirrored our scope structure. We can't change the scope structure without switching from a dynamically scoped language to a lexically scoped language, which is too big of a change to make right now. Instead, I'm changing the resource graph so that all classes default to just having an edge to the 'main' graph. This will be a behaviour change for many, in that you were getting automatic dependencies from this old behaviour, but it will bring consistency. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing a test broken by changing the default os x package typeLuke Kanies2009-07-241-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing selinux tests broken in the fix for #1963Luke Kanies2009-07-241-3/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2445 - fixing the mount test mockLuke Kanies2009-07-241-1/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2421 - file renaming errors now propagateLuke Kanies2009-07-241-0/+11
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2403 - provider specificity is richer and betterLuke Kanies2009-07-242-0/+48
| | | | | | | | | | | | | | | | | | | | We have extended the concept of provider specificity so it now includes both specified defaults and class depth, so: * We are much more likely to choose the correct provider; e.g., 'init' will be chosen over 'base' * We're much less likely to print this warning, because it's only printed when provider specificities are equal which is much rarer lib/puppet/provider.rb | 4 ++-- lib/puppet/type.rb | 4 ++-- spec/unit/type.rb | 17 +++++++++++++++++ test/ral/manager/type.rb | 22 ---------------------- 4 files changed, 21 insertions(+), 26 deletions(-) Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2439 - let puppetdoc use loaded_codeBrice Figureau2009-07-241-0/+7
| | | | | | | | Since there isn't any unit test for puppetdoc rdoc code (my fault), nobody noticed it was using direct access to the parser AST array. This changeset fixes the way puppetdoc uses the parser results. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #2436 - Changed ralsh to use Puppet::Type.new and avoid deprecation noticeJames Turnbull2009-07-231-3/+3
|
* Fix #2425 - make sure client can contact CA server with RESTBrice Figureau2009-07-213-0/+24
| | | | | | | The various REST SSL terminii were never setup to use the ca_server/ca_port if one is setup. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2424 - take 2, make sure default mounts allow every clientsBrice Figureau2009-07-211-0/+13
| | | | | | | | If there isn't any default mounts for plugins/modules, puppet auto creates them. The issue is that they don't have any authorization attached, so they default to deny all. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2378 and #2391 testsBrice Figureau2009-07-204-2/+50
| | | | | | | Fix #2378 - Add some integration tests for catalog filtering Fix #2391 - Fix up some of the tests Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2424 - File server can't find module in environmentBrice Figureau2009-07-182-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Actually, the issue is: * when the web server gets the request, it creates an indirection request, filling attributes like ip or node from the HTTP request. To do this, all the interesting attributes are given in a hash (called options, see P::I::Request#new). Once the request is properly initialized the options hash doesn't contain the ip or node information (see set_attributes) * the request is then transmitted to the file_serving layer, which happily wants to use the node attribute to find environments or perform authorization. Unfortunately it fetches the node value from the request options hash, not the request itself. Since this node information is empty, puppet fails to find the proper mount point, and fails the download. This change makes sure we pass all the way down the node and fix the authorization check. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix small typo in the fix for #2394Brice Figureau2009-07-181-1/+1
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Feature #2378 - Implement "thin_storeconfigs"Brice Figureau2009-07-182-0/+85
| | | | | | | | | | | | | | | Thin storeconfigs is a limited version of storeconfigs that is more performant and still allows the exported/collected resources system wich is the primary use of storeconfigs. It works by storing to the database only the exported resources, tags and host facts. Since usually those exported resources are less than the number of total resources for a node, it is expected to be faster than regular storeconfigs (especially for the first run). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2391 - Exported resources never make to the storeconfigs dbBrice Figureau2009-07-185-1/+115
| | | | | | | | | | | | | | | | | | The issue is that when we convert Puppet::Parser::Resource catalog to a Puppet::Resource catalog before storing it to the database, we don't allow virtual resource to be converted. Unfortunately exported resources are virtual by design, and as such aren't converted, and we lose them, so it isn't possible to store them in the database. Unfortunately, the client will get the exported resources too. The fix is dual-fold: * we make sure exported resource are skipped when the transaction is applied as a last safeguard * we filter-out the catalog through the catalog compiler terminus before the catalog is returned to the client Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2261 - Make sure query string parameters are properly escapedBrice Figureau2009-07-175-20/+30
| | | | | | | | | | | | | | | | The problem is that URI.escape by default doesn't escape '+' (and some other characters). But some web framework (at least webrick) unescape the query string behind Puppet's back changing all '+' to spaces corrupting facts containing '+' characters (like base64 encoded values). The current fix makes sure we use CGI.escape for all query string parameters. Indirection keys/path are still using URI escaping because this part of the URI format shouldn't be handled like query string parameters (otherwise '/' url separators are encoded which changes the uri path). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2245 - provider lists are not lost on type reloadLuke Kanies2009-07-161-0/+22
| | | | | | | | | | We've moved the @providers class instance variable from the individual Puppet::Type subclasses into a single class instance variable in the Puppet::Type base class, and are using an accessor to retrieve the per-class providers hash. Signed-off-by: Luke Kanies <luke@madstop.com>
* Ruby no longer clobbers puppet autoloadingLuke Kanies2009-07-162-1/+107
| | | | | | | | | We basically just make sure that we tell Ruby about files we've loaded, so you can 'require' these files and doing so will essentially no-op, rather than clobbering the already-loaded code. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #2410 - default acl logs as info instead of warn.Sam Livingston-Gray2009-07-141-2/+2
| | | | Signed-off-by: Sam Livingston-Gray <geeksam@gmail.com>
* Adding test for current auth config warning.Sam Livingston-Gray2009-07-141-0/+5
| | | | This is a step in fixing bug #2410.
* Fixed #2394 - warn once on module mount deprecation.Sam Livingston-Gray2009-07-131-1/+1
| | | | Signed-off-by: Sam Livingston-Gray <geeksam@gmail.com>
* Add test for current module mount deprec warning.Sam Livingston-Gray2009-07-131-1/+2
|
* Fixes #2258,#2257,#2256. Maintain correct type for integers/booleans, allow ↵Nigel Kersten2009-07-111-0/+38
| | | | correct values, and fix rule array handling
* Allow boolean value for boolean cli parameterBrice Figureau2009-07-101-0/+7
| | | | | | | | This is to fix puppetdoc boolean parameters. Puppetdoc defers sending parameters to Puppet::Util::Setting, and in this case, boolean parameters are stored as a boolean value. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2364 - Associates the correct comment to the right statementBrice Figureau2009-07-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the problem that we associate documentation in the lexer and not in the parser (which would be to complex and unmaintenable to do), and since the parser reads new tokens before reducing the current statement (thus creating the AST node), we could sometimes associate comments seen after a statement associated to this one. Ex: 1. $foo = 1 2. # doc of next class 3. class test { When we parse the first line, the parser can reduce this to the correct VarDef only after it lexed the CLASS token. But lexing this token means we already pushed on the comment stack the "doc of next class" comment. That means at the time we create the AST VarDef node, the parser thinks it should associate this documentation to it, which is incorrect. As soon as the parser uses token line number, we can enhance the lexer to allow comments to be associated to current AST node only if the statement line number is greater or equal than the last comment line number. This way it is impossible to associate a comment appearing later in the source than a previous statement. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Make sure the parser sees the correct line numberBrice Figureau2009-07-101-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Careful inspection of the parser code show that when we associate a source line number for an AST node, we use the current line number of the currently lexed token. In many case, this is correct, but there are some cases where this is incorrect. Unfortunately due to how LALR parser works the ast node creation of a statement can appear _after_ we lexed another token after the current statement: 1. $foo = 1 2. 3. class test When the parser asks for the class token, it can reduce the assignement statement into the AST VarDef node, because no other grammar rule match. Unfortunately we already lexed the class token so we affect to the VarDef node the line number 3 instead of 1. This is not a real issue for error reporting, but becomes a real concern when we associate documentation comments to AST node for puppetdoc. The solution is to enhance the tokens lexed and returned to the parser to carry their declaration line number. Thus a token value becomes a hash: { :value => tokenvalue, :line } Next, each time we create an AST node, we use the line number of the correct token (ie the foo line number in the previous example). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2367 - Mongrel::HTTPRequest returns a StringIO objectJames Turnbull2009-07-081-1/+1
| | | | | | | | When the PUT body is large enough that Mongrel::HTTPRequest#body returns a StringIO object instead of a String. StringIO#to_s then returns "<StringIO#8236987299>" instead of the string contents. When that string is passed to YAML it returns false which is then passed to save_object without any real time checking. This is a combination of patches from Jordan Curzon and Ricky Zhou.
* Fix #2082 - puppetca shouldn't list revoked certificatesBrice Figureau2009-07-073-7/+15
| | | | | | | | This patch does two things: * it enhance puppetca to list revoked certificates (prefixed by -) * it fixes the ca crl verification which was broken Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2392 - use Content-Type for REST communicationBrice Figureau2009-07-057-30/+137
| | | | | | | | | | | | | | | | | | | There were two problems: * server->client communications is using Content-Type with the direct format name instead of the format mime-type. * client->server communications is not using Content-Type to send the format of the serialized object. Instead it is using the first member of the Accept header. The Accept header is usually reserved for the other side, ie what the client will accept when the server will respond. This patch makes sure s->c communication contains correct Content-Type headers. This patch also adds a Content-Type header containing the mime-type of the object sent by the client when saving. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Switching to LoadedCode from ASTSetLuke Kanies2009-07-053-33/+21
| | | | | | | | I also took the opportunity to clean up and simplify the interface to the parts of the parser that interact with this. Mostly it was method renames. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a special class to handle loaded classes/defines/nodesLuke Kanies2009-07-051-0/+106
| | | | | | | | | This class is extracted from the Parser class, and the main driver for it is to enable us to put mutexes around some of the hashes to see if they're the source of a race condition. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2238 - Deal with nil hash keys from mongrel paramsJordan Curzon2009-07-021-0/+5
| | | | | | | | Mongrel::HttpRequest.query_parse outputs a params hash with nil keys given certain query strings. Network::HTTP::Handler.decode_params needs to check the incoming values. Signed-off-by: Jordan Curzon <curzonj@gmail.com>
* Fixing #2197 - daemontools tests now passLuke Kanies2009-06-261-13/+38
| | | | | | | This actually involved a bit of rewriting of the code, but the code's simpler now, too. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using the logging utilities to clean up module warningsLuke Kanies2009-06-191-1/+15
| | | | | | | This just makes it easier to add context to warnings and other logs from the module. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1064 - Deprecating module 'plugins' directoriesLuke Kanies2009-06-191-8/+32
| | | | | | | | | You should now use 'lib' instead of 'plugins'. The old directory still works, but you get a warning for every module that uses it. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing deprecated :pluginpath settingLuke Kanies2009-06-191-3/+3
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2094 - filebucket failures are clearer nowLuke Kanies2009-06-161-0/+16
| | | | | | We just add a bit of information to the exception. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring part of the file/filebucket integrationLuke Kanies2009-06-143-10/+58
| | | | | | | | | | The goal of this commit is to fix ordering issues that could result when the filebuckets are added to the catalog after the resources that use them. This condition showed up somewhat arbitrarily. Signed-off-by: Luke Kanies <luke@madstop.com>