summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix #2818 - scope variable assigned with undef are not "undef"Brice Figureau2009-12-291-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fixing 2812 authorized_keys without comments failJesse Wolfe2009-11-211-0/+1
| | | | | | | | | | | | | | | | | 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>
* Ticket #2685 (Type error in ssh_authorized_keys)Markus Roberts2009-10-231-0/+1
| | | | | | | | | | | In post processing a Symbol was being passed to StringScanner. StringScanner was not happy with this. The error message lost backtrace information and the test coverage was both inadequate and broken (see #2745). To be fully effective, this patch needs/assumes the patch for Signed-off-by: Markus Roberts <Markus@reality.com>
* Fix for #2745 fakedata tests not workingMarkus Roberts2009-10-231-16/+8
| | | | | | | | | The old fakedata test facility was not playing nicely with the spec tests; although it looped through all the files failures in any example file after the first were being ignored because of the way fakedataparse was interacting with the before blocks. Signed-off-by: Markus Roberts <Markus@reality.com>
* Moving Setting classes into separate filesLuke Kanies2009-08-241-9/+9
| | | | | | | | This isn't really a refactor, just moving code around. I did some simple method renaming, also. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unnecessary debug outputLuke Kanies2009-08-031-1/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding integration tests for #2371 (backup refactor)Luke Kanies2009-08-031-119/+0
| | | | | | Also removed old conflicting file tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing old filebucket testLuke Kanies2009-08-031-110/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* default server in remote filebucketsTill Maas2009-08-031-0/+1
| | | | | | | | | | | | 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
* Fixed global deprecation error in useradd Unit testsJames Turnbull2009-08-021-3/+0
|
* Fixing a small test by stubbing instead of mockingLuke Kanies2009-08-021-2/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing tests broken by caching autoload resultsLuke Kanies2009-08-022-9/+2
| | | | | | | | | These tests tried to load something, verified the loads didn't work, and then created the thing to load. This is a bit silly, so I just removed those sections of the tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating Handler base tests from test/ to spec/Luke Kanies2009-08-021-63/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating Feature tests to specLuke Kanies2009-08-021-95/+0
| | | | | | | | | | 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>
* Fixing cron test to match new behaviourLuke Kanies2009-08-021-1/+1
| | | | | | | 7 was added as a valid weekday in #2293, and this test just corrects that. Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating tests to spec and removing an obsolete testLuke Kanies2009-08-021-70/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Make sure node are referenced by their namesBrice Figureau2009-08-011-1/+1
| | | | | | | | | 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-014-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | 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-014-8/+19
| | | | | | | | | | | | | | | | | | | 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>
* Fixing #2296 - overlapping recursions work againLuke Kanies2009-07-252-101/+1
| | | | | | | | | | | | 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 #2399 - removing client-side rrd graphsLuke Kanies2009-07-232-6/+1
| | | | | | | | This feature has been broken since who knows when, yet no one's noticed. Thus, it's a good candidate for removal. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2403 - provider specificity is richer and betterLuke Kanies2009-07-241-22/+0
| | | | | | | | | | | | | | | | | | | | 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>
* Ruby no longer clobbers puppet autoloadingLuke Kanies2009-07-161-116/+0
| | | | | | | | | 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>
* deprecate NetInfo providers and examples, remove all NetInfo references and ↵Nigel Kersten2009-07-147-155/+6
| | | | tests.
* Fix #2348 - Allow authstore (and REST auth) to match allow/deny against ↵Brice Figureau2009-07-071-7/+3
| | | | | | | | | | | | | | | opaque strings This patch removes the limitation of allow/deny which were only matching ip addresses or hostname (or pattern of). It makes sure any kind of string can be matched (by strict equality) while still keeping the old behaviour. Opaque strings can only contains: alphanumeric characters, - _ and @. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Switching to LoadedCode from ASTSetLuke Kanies2009-07-057-101/+73
| | | | | | | | 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>
* Refactoring part of the file/filebucket integrationLuke Kanies2009-06-141-58/+5
| | | | | | | | | | 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>
* Fix #2333 - Make sure lexer skip whitespace on non-tokenBrice Figureau2009-06-121-0/+4
| | | | | | | | | Comments and multi-line comments produces no token per-se during lexing, so the lexer loops to find another token. The issue was that we were not skipping whitespace after finding such non-token. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2336 - qualified variables only throw warningsLuke Kanies2009-06-111-50/+0
| | | | | | | | | We were previously throwing exceptions. This also ports all of the tests for variable lookup over to rspec. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removed extra whitespace from end of linesIan Taylor2009-06-0682-1348/+1348
|
* Changed tabs to spaces without interfering with indentation or alignmentIan Taylor2009-06-0670-4456/+4456
|
* Fix #2308 - Mongrel should use X-Forwarded-ForBrice Figureau2009-06-051-1/+15
| | | | | | | | | | | | Mongrel puppet code uses REMOTE_ADDR to set the ip address which will be use to authenticate the client access. Since mongrel is always used in a proxy mode with Puppet, REMOTE_ADDR is always the address of the proxy (usually 127.0.0.1), which defeats the purpose. With this changeset, the mongrel code now uses the X-Forwarded-For HTTP header value if it is passed over the REMOTE_ADDR. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing a transaction test that had some broken plumbingLuke Kanies2009-05-261-2/+11
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding modulepath caching to the AutoloaderLuke Kanies2009-05-201-30/+1
| | | | | | | | | There's more caching to add, but this simplifies the interface to the list of paths and then caches that list so we aren't constantly searching the filesystem. Signed-off-by: Luke Kanies <luke@madstop.com>
* Modules now can find their own pathsLuke Kanies2009-05-151-1/+1
| | | | | | | | | | | | Previously, when you created a module you had to specify the path. Now Module instances can use the module path to look up their paths, and there are methods for determining whether the module is present (if the path is present). Also cleaned up the methods for figuring out what's in the module (plugins, etc.). Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix snippets tests failing because of activated storeconfigsBrice Figureau2009-05-152-0/+25
| | | | | | | | | All the snippets tests were failing because some parser and scope tests activated storeconfigs without reseting the state. Activating storeconfigs is not undoable at the moment by just setting storeconfig=false as some terminus are changed. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix some master failing testsBrice Figureau2009-05-153-3/+3
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2207 - type was doing its own tag management leading to subtile bugsBrice Figureau2009-04-291-2/+4
| | | | | | | | | This patch moves Type to use Puppet::Util::Tagging as the other part of Puppet. This brings uniformity and consistency in the way the tags are used and/or compared to each other. Type was storing tags in Symbol format, which produced #2207. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Removing a non-functional and horrible testLuke Kanies2009-04-241-73/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Add dynamic authorization to authstoreBrice Figureau2009-04-231-1/+48
| | | | | | | | | | | | | | | | | | | | | | The idea is to have allow/deny authorization directives that are dynamic: their evaluation is deferred until we perform the authorization checking in allowed?. This is done to allow replacing backreferences in allow/deny directives by parameters of the match that selected this right. For instance, it is possible to: allow $1.$2 And using Right::interpolate() with the result of a regex match using 2 captures, will evaluate $1.$2 to those captures. For instance, if we captured [host, reductivelabs.com], then the allow directive is replaced by: allow host.reductivelabs.com It is then safe to call allowed?, after which we can reset the interpolation. This interpolation is thread-safe. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com> authconfig regex support
* Fixing tests that apparently only worked sometimesLuke Kanies2009-04-221-0/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing the old rails tests.Luke Kanies2009-04-223-476/+0
| | | | | | | | | | | They don't work with the modified code, and we rely almost entirely on manual integration testing for this stuff anyway. We definitely need to add tests where we can, but these tests are totally useless. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing all tests that were apparently broken in the 0.24.x merge.Luke Kanies2009-04-021-4/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing Rakefile; apparently there was a rake or gem incompatibilityLuke Kanies2009-04-021-3/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Merge branch '0.24.x'Luke Kanies2009-04-021-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/ralsh lib/puppet/executables/client/certhandler.rb lib/puppet/parser/functions/versioncmp.rb lib/puppet/parser/resource/reference.rb lib/puppet/provider/augeas/augeas.rb lib/puppet/provider/nameservice/directoryservice.rb lib/puppet/provider/ssh_authorized_key/parsed.rb lib/puppet/type.rb lib/puppet/type/file/checksum.rb spec/integration/defaults.rb spec/integration/transaction/report.rb spec/unit/executables/client/certhandler.rb spec/unit/indirector/ssl_rsa/file.rb spec/unit/node/catalog.rb spec/unit/provider/augeas/augeas.rb spec/unit/rails.rb spec/unit/type/ssh_authorized_key.rb spec/unit/type/tidy.rb test/executables/filebucket.rb test/executables/puppetbin.rb
| * Fixing broken 0.24.x tests in test/.Luke Kanies2009-02-283-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | These tests once again largely were caused by /usr/sbin not being in the path and by ~ not being writable. The only tests still failing are Rails tests, and my guess is that they're all failing because of the recent work by Brice. They should probably just be removed. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fix #1469 - Add an option to recurse only on remote sideBrice Figureau2009-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using recurse and a source, if the client side has many files it can take a lot of CPU/memory to checksum the whole client hierarchy. The idea is that it is not necessary to recurse on the client side if all we want is to manage the files that are sourced from the server. This changeset adds the "remote" recurse value which prevents recursing on the client side when a source is present. Since it also is necessary to limit the remote side recursion a new File{} parameter has been added called "recurselimit". Moreover, the Filetset API is changing to allow the new recurselimit parameter, and passing the recursion depth limit in the recurse parameter as an integer is now deprecated and not supported anymore. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fix #1088 - part2 - Add rspec testsBrice Figureau2009-03-142-0/+14
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | Fixing tests broken in previous commitsLuke Kanies2009-03-112-14/+5
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixed #1849 - Ruby 1.9 portability: `when' doesn't like colons, replace with ↵James Turnbull2009-02-2613-31/+31
| | | | | | | | semicolons