summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* Removed misguided case sensitivity testsMarkus Roberts2009-08-182-19/+0
| | | | | | | | Removed two failing tests added in the process of reproducing #2493 because they enforced case-insensitivity in excess of that provided by 0.24.8 and thus contrary to user expectations. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fixes #2513. debian service provider now uses invoke-rc.d to determine ↵Nigel Kersten2009-08-181-0/+89
| | | | enabled? status
* Fixing fact-missing problem when puppet.conf is reparsedLuke Kanies2009-08-181-0/+14
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix for #2531; adds tests to confirm problem and related cases,Markus Roberts2009-08-181-0/+94
| | | | | | | notes fixes specific issue by eliminating the specal case for opaque strings which caused them to be strings when everything else was arrays; adds nots and pending tests where FQDN support could be added but stops short of a full refactor.
* Fixed spec typoJames Turnbull2009-08-151-1/+1
|
* Fixes #2493Markus Roberts2009-08-145-44/+126
| | | | | | | | | | | | Added downcasing into find_or_load (which replaced fqfind) to get back the old behaviour. Adjusted tests so that they would catch the problem & confirmed that they fail without the downcasing. Added tests to confirm the existance of #2493; improved existing autoload tests (removed inter-test interactions) and noted (with a TODO) that there was dead code in the feature loading test; added analogus case sensitivity tests where apropriate.
* Fix #2517 - Stack overflow when CA cert missingMarkus Roberts2009-08-131-1/+10
| | | | | | | | | | | | | | This was a "There's A Hole In The Bucket" problem caused when trying to establish a connection to get a certificate before there was a certificate with which to establish the connection, ad infinitum. The solution was to test for the presence of the CA cert as well as the host cert before attempting to use them. This patch modifies existing tests to pass with the new code (by stubbing out the additional FileTests) and adds a new test which catches the original problem. Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix #2516 - Fix format detection when content-type contains charsetBrice Figureau2009-08-133-0/+26
| | | | | | | | | | | | | | | | | | Even though Puppet never transmist a charset information in its response/request content-type, some proxy (especially Apache with the infamous AddDefaultCharset configuration) may add this "incorrect" information. This patch makes sure that only the mime-type is used when looking for the format associated with a response or a request. The patch also provides a better error message when the client or server code is fed with a request whose mime-type can not be mapped to a known format. It also fixes a typo noticed by the original reporter. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2507 - Add missing integration testsBrice Figureau2009-08-132-4/+65
| | | | | | | | Some of the integration tests were either missing or not complete, especially tests about exported non virtual resources or virtual and exported resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2507 - Exported resources were not correctly collected.Brice Figureau2009-08-136-8/+24
| | | | | | | | | | | | | | | | | | | | | | #2507 contains two issues: * a crash when we filters-out an unwanted resource which had edges pointing to it. * resources are losing their virtuality when they are transformed from Puppet::Parser::Resource to Puppet::Resource. This means we weren't able to distinguish anymore between an exported resource collected in the same node as it was exported and an exported resource collected in another node. The net result is that we can't apply exported resources that are collected in the same node because they are filtered out by the catalog filter (see the commits for #2391 for more information). The fix is to keep the virtuality of the resources so that we can differentiate those two types of exported resources. We keep this until the catalog is ready to be sent, where we filter out the virtual resouces only, the other still exported ones needs to be sent to the client. To be real sure, the transaction also skips virtual resources. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2360 - Removed annoying log messageAndrew Shafer2009-08-131-6/+12
| | | | | | This change will effect all the properties implemented with list.rb (groups, roles, auths, profiles). The change will match [] values for should as insync when none exist. (so no more log message)
* Fixing more tests broken from missing librariesLuke Kanies2009-08-106-15/+31
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing ActiveRecord Indirector tests to skip w/out RailsLuke Kanies2009-08-104-6/+9
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2489 - queue integration tests are skipped w/out jsonLuke Kanies2009-08-101-2/+4
| | | | | | | | | All of the tests were failing because we had a call outside of any of the tests, just to autoload the constant. Removed that call and stubbed things so the tests don't run without json. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2541 - file cache is more resilient to failureLuke Kanies2009-08-101-0/+30
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Add shellquote() function.Thomas Bellman2009-08-081-0/+92
| | | | | | | | | | This adds a new function shellquote() which can be used for quoting arguments in shell commands used in the exec type. This only supports Unixoid operating systems. Other systems would likely require some other quoting. Signed-off-by: Thomas Bellman <bellman@nsc.liu.se>
* Fixes #2499. Allows execs to specify an array for the returns parameterNigel Kersten2009-08-081-2/+14
|
* Removed extraneous debuggingroot2009-08-041-4/+0
|
* Updated two more testsJames Turnbull2009-08-042-0/+5
|
* Logs now assume resource params have metadataLuke Kanies2009-08-031-7/+0
| | | | | | | | | | | We were previously not assuming they had it, because I figured there were just a couple that didn't. On closer inspection, none of them did. The previous commit fixed that, so this commit fixes the assumption. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding metadata delegation from param to resourceLuke Kanies2009-08-032-6/+15
| | | | | | | | | | This is for file, line, version, and tags, with the parameter name added to the tags. This is mostly so logs generated by the parameters work better. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding integration tests for #2371 (backup refactor)Luke Kanies2009-08-031-0/+106
| | | | | | Also removed old conflicting file tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding many tests for #2371, and slightly refactoringLuke Kanies2009-08-031-28/+120
| | | | | | | | This mostly focuses on adding all of the detailed tests for this new code, but it also cleans the code up just a little bit. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes for Redmine 2371.Steven Jenkins2009-08-031-0/+68
| | | | | | | | | | | This changes the condition checking of handlebucket, as well as moves it (and remove_backup) into a separate module. It additionally refactors common code out of handlebucket into separate private methods. Some new RSpec tests which use mock and stubs are added as well, including removing the old test/ral/type/filebucket.rb tests since they are already covered by RSpec tests.
* Fixes #2464, #2457. Deprecate reportserver for report_server. Add ↵Nigel Kersten2009-08-042-1/+47
| | | | report_port setting. Add tests.
* Fixes #2483 - Log only copies metadata from RAL objectsLuke Kanies2009-08-041-7/+22
| | | | | | | | | | | | | | | | | | | We were previously trying to figure out what data was available based on what methods existed, but that caught a different method profile from modules. This fixes it so we only look for this data from Puppet::Type or Puppet::Parameter instances. I had to add the ability to skip data that's not available, since File's 'ensure' parameter doesn't have 'file' data, I assume because of the metaprogramming we do around the 'file' value for 'ensure'. It's a workaround for now, and there's a test in there to verify it, anyway. Signed-off-by: Luke Kanies <luke@madstop.com>
* rack: don't directly use the forbidden HTTP_CONTENT_TYPE env var (fixes rack ↵Christian Hofstaedtler2009-08-031-2/+2
| | | | specification conformance)
* Cleaning up tests for #2469Luke Kanies2009-08-031-11/+55
| | | | | | | This is a small refactor of the filebucket type, and a larger refactor of the tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* default server in remote filebucketsTill Maas2009-08-031-0/+30
| | | | | | | | | | | | With the path parameter set to false, the server defaults to Puppet[:server]. This allows to use a remote filebucket without syncing the servername there with the one used on the config file. To use the default server, this manifest can be used: filebucket { main: path => false } A related bug report is: http://projects.reductivelabs.com/issues/2456
* Fixes #2444 - Various JSON test failuresMarkus Roberts2009-08-031-3/+17
|
* Fixed #2294 - Classes sometimes cannot be foundMarkus Roberts2009-08-031-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | This patch should fix the race condition causing ticket 2294; it extends the loading logic so that: * initial load attempts are processed (as before), * recursive load attempts return immediately (as before), * but subsequent concurrent load attempts from different threads wait on a semaphore (condition variable) and then retry (e.g. use the now-valid results of the first thread). This is a slight modification of the solution I'd originally proposed, to prevent a deadlock that could have arisen if three or more threads simultaneously attempted to load the same item. Though it solves the bug as reported, it has room for improvement: * Failures aren't cached, so repeated attempts will be made to import invalid items each time they are encountered * It doesn't address any of the underlying referential ambiguity (module vs. filename) * The threading logic should probably be refactored into a separate class (as a start I encapsulated it in an ad hoc singleton class, so at least it isn't cluttering up the load method) Signed-off-by: Markus Roberts <Markus@reality.com>
* Adding #2477 - puppet can apply provided catalogsLuke Kanies2009-08-023-26/+142
| | | | | | | | | | | | This provides the other half of #2440 - you can compile catalogs into json with puppetmasterd, and now you can take those json catalogs and apply them. This allows you to use whatever mechanism you want to ship the catalogs around. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing problems my Feature refactor causedLuke Kanies2009-08-021-3/+5
| | | | | | | | | The problems were that I wasn't propagating return values sufficiently, such that false values didn't travel enough, and the 'name' attribute was necessary in the private method but wasn't actually passed in. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing ruby warning in definition testLuke Kanies2009-08-021-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a test for the Exec typeLuke Kanies2009-08-021-0/+13
| | | | | | | | I thought I'd found a bug, but I couldn't reproduce it. This test was supposed to demonstrate the bug, but is at least good enough to leave in. Signed-off-by: Luke Kanies <luke@madstop.com>
* Speeding a test up through stubbingLuke Kanies2009-08-021-0/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing a test broken by the regex featuresLuke Kanies2009-08-021-0/+14
| | | | | | | | Unsetting scope vars was broken, but it was only ever used in testing (and apparently rarely at that), so it wasn't caught. Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating Handler base tests from test/ to spec/Luke Kanies2009-08-021-0/+25
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating Feature tests to specLuke Kanies2009-08-022-0/+124
| | | | | | | | | | This was to fix a failing test/unit test. Test coverage is now a bit better, more maintainable, and I refactored the code just slightly to make it a bit cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating tests to spec and removing an obsolete testLuke Kanies2009-08-021-0/+19
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Configuration version information is now in logsLuke Kanies2009-08-012-0/+42
| | | | | | | | | | The log instances have file, line, and config version information, although it's not currently printed. It's available in the reports, and you can strip it out with your own processors. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding support for an external catalog versionLuke Kanies2009-08-014-0/+52
| | | | | | | | This allows you to specify a command used to determine the catalog version. Also added an integration test to verify the version cascades. Signed-off-by: Luke Kanies <luke@madstop.com>
* Cleaning up duplication in another test fileLuke Kanies2009-08-011-31/+28
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing duplication in the test structureLuke Kanies2009-08-011-10/+10
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Implement node matching with regexesBrice Figureau2009-08-014-12/+121
| | | | | | | This patch enhance AST::HostName to support regexes, and modifies the parser to allow regex to be used as node name. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>]
* Make sure node are referenced by their namesBrice Figureau2009-08-013-17/+191
| | | | | | | | | This patch uses the unused AST::HostName as the only way to reference a node in the AST nodes array. The AST::HostName respect the hash properties of the underlying string, to keep the O(1) hash properties. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Enhance selector and case statements to match with regexpBrice Figureau2009-08-012-0/+299
| | | | | | | | | | | | | | | | | | | | | | | | | The case and selector statements define ephemeral vars, like 'if'. Usage: case statement: $var = "foobar" case $var { "foo": { notify { "got a foo": } } /(.*)bar$/: { notify{ "hey we got a $1": } } } and for selector: $val = $test ? { /^match.*$/ => "matched", default => "default" } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2033 - Allow regexp in if expressionBrice Figureau2009-08-012-0/+125
| | | | | | | | | | | | | | | | | | | This changeset introduces regexp in if expression with the use of the =~ (match) and !~ (not match) operator. Usage: if $uname =~ /Linux|Debian/ { ... } Moreover this patch creates ephemeral variables ($0 to $9) in the current scope which contains the regex captures: if $uname =~ /(Linux|Debian)/ { notice("this is a $1 system") } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add AST::Regex, an AST leaf node representing a regexBrice Figureau2009-08-011-1/+120
| | | | | | Add a regex rule (unused for the moment) to the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add regex, match and not match token to the lexerBrice Figureau2009-08-011-0/+14
| | | | | | | | | | The lexer recognizes regex delimited by / as in: /^$/ The match operator is defined by =~ The not match operator is defined by !~ Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>