summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing most of the broken tests in test/Luke Kanies2010-02-1713-492/+86
| | | | | | | | This involves a bit of refactoring in the rest of the code to make it all work, but most of the changes are fixing or removing old tests. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing Resource::Reference classesLuke Kanies2010-02-179-799/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is hopefully less messy than it first appears, but it's certainly cross-cutting. The reason for all of this is that we previously only looked up builtin resource types from outside the parser, but now that the defined resource types are available globally via environments, we can push that lookup code to Resource. Once we do that, however, we have to have environment and namespace information in every resource. Here I remove the Resource::Reference classes (except the AST class), and use Resource instances instead. I did this because the shared code between the two classes got incredibly complicated, such that they should have had a hierarchical relationship disallowed by their constants. This complexity convinced me just to get rid of References entirely. I also make Puppet::Parser::Resource a subclass of Puppet::Resource. There are still broken tests in test/, but this was a big enough commit I wanted to get it in. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding parameter validation to Puppet::ResourceLuke Kanies2010-02-172-5/+5
| | | | | | | | | | | | | This will allow us to remove all of the parameter validation from the other Resource classes. This is possible because resource types defined in the language are visible outside of the parser, via the environment. This will enable lots of code removal and simplication. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Feature #3394 REST Runner, preparationJesse Wolfe2010-02-171-1/+1
| | | | Rename Puppet::Agent::Runner to Puppet::Run, for consistency
* Feature #3347 REST-ified FileBucketJesse Wolfe2010-02-172-314/+1
| | | | | | | | | | | | | | | | FileBucket Files have been reimplemented as an indirector terminus so that they can be transmitted over REST. The old Network::Client.dipper has been replaced with a compatibility later in FileBucket::Dipper that uses the indirector to access filebucket termini. Slightly revised patch: * No longer allows nil contents in FileBucket outside of initialization * Uses File.exist? instead of the deprecated File.exists? * Tweaks JSON serialization and de-serialization to include "path" Deferred issues: * Feature #3371 "FileBucket should not keep files in memory". * Feature #3372 "Replace FileBucket Dipper with more idiomatic calls"
* Resolving conflicts with ???Markus Roberts2010-02-173-3/+0
|
* Renaming Parser::ResourceType to Resource::TypeLuke Kanies2010-02-171-3/+3
| | | | | | | | | | Basically, these classes (ResourceType and ResourceTypeCollection) don't really belong in Parser, so I'm moving them to the Resource namespace. This will be where anything RAL-related goes from now on, and as we migrate functionality out of Puppet::Type, it should go here. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Renaming LoadedCode to ResourceTypeCollectionLuke Kanies2010-02-171-3/+3
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing old, never-used DSL codeLuke Kanies2010-02-171-215/+0
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fix unit tests in file/target.rbJesse Wolfe2010-02-172-2/+2
|
* Name change of event in ral/type/exec.rbJesse Wolfe2010-02-171-1/+1
|
* Use a helper function to evaluate a resource since the API has changedJesse Wolfe2010-02-172-4/+5
|
* Allow skipped resources to process eventsJesse Wolfe2010-02-171-1/+1
|
* Remove test that tests internal class structures which have changed.Jesse Wolfe2010-02-171-28/+0
|
* Remove stale set_triggerJesse Wolfe2010-02-171-97/+0
| | | | | Delete tests that are superceded by specs in "Changing Transaction to use the new ResourceHarness"
* Fix test failures due to name changes of event symbolsJesse Wolfe2010-02-171-4/+4
|
* Remove rollback test, since rollback was removed.Jesse Wolfe2010-02-171-50/+0
|
* Removing now-obsolete user testsLuke Kanies2010-02-171-285/+0
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing most failing test/ tests.Luke Kanies2010-02-1710-162/+37
| | | | | | | | | This is mostly just adjusting existing tests to meet new APIs, but it's a small amount of fixing the code to meet new standards and an even smaller amount of porting code over. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing some compatibility and old testsLuke Kanies2010-02-172-92/+4
| | | | | | | We all know these tests should be removed, but hey, at least these ones pass now. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Switching transactions to callback-based eventsLuke Kanies2010-02-172-129/+3
| | | | | | | | | | | | | Events are now queued as they are created, and the queues are managed through simple interfaces, rather than collecting events over time and responding to them inline. This drastically simplifies event management, and will make moving it to a separate system essentially trivial. Signed-off-by: Luke Kanies <luke@madstop.com>
* Some tests were leaking state when the test failedJesse Wolfe2010-02-172-2/+7
|
* Typo in method call in test.Jesse Wolfe2010-02-171-1/+1
|
* Supressing warnings (not really failures) in test/unitJesse Wolfe2010-02-172-9/+19
|
* Fix test using wrong Puppet util filesetting groupRein Henrichs2010-02-171-1/+1
|
* Mock user in SUIDManager testsRein Henrichs2010-02-171-2/+7
|
* Removing resources generate testsRein Henrichs2010-02-171-78/+0
| | | | | | Tests that generating resources performs a check and only returns resources that check as true. There is already spec coverage for this behavior.
* Removing old test for service/debian providerRein Henrichs2010-02-171-58/+0
| | | | it has been superceded by an rspec spec.
* Replace test/unit file write test with specRein Henrichs2010-02-171-21/+0
|
* Fix #2389 - Enhance Puppet DSL with HashesBrice Figureau2010-02-172-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bring a new container syntax to the Puppet DSL: hashes. Hashes are defined like Ruby Hash: { key1 => val1, ... } Hash keys are strings, but hash values can be any possible right values admitted in Puppet DSL (ie function call, variables access...) Currently it is possible: 1) to assign hashes to variable $myhash = { key1 => "myval", key2 => $b } 2) to access hash members (recursively) from a variable containing a hash (works for array too): $myhash = { key => { subkey => "b" }} notice($myhash[key][subjey]] 3) to use hash member access as resource title 4) to use hash in default definition parameter or resource parameter if the type supports it (known for the moment). It is not possible to string interpolate an hash access. If it proves to be an issue it can be added or work-arounded with a string concatenation operator easily. It is not possible to use an hash as a resource title. This might be possible once we support compound resource title. Unlike the proposed syntax in the ticket it is not possible to assign individual hash member (mostly to respect write once nature of variable in puppet). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Merge branch '0.25.x'Markus Roberts2010-02-098-79/+25
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/agent.rb lib/puppet/application/puppet.rb lib/puppet/configurer.rb man/man5/puppet.conf.5 spec/integration/defaults.rb spec/unit/configurer.rb
| * Forgot fakedata called in specJames Turnbull2010-02-041-0/+1
| |
| * Minor unit test fixesJames Turnbull2010-01-302-6/+6
| |
| * Fix for #3077 (unit tests broken in 0.25.1-->0.25.4)Markus Roberts2010-01-306-73/+18
| | | | | | | | | | | | Most of these were caused by alias --> host_aliases; one was caused by the canonicalization of resource references and one by the removal of puppet_module.
* | Fixing #1054 - transaction reports are always sentLuke Kanies2010-01-181-44/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This refactors how reports, catalogs, configurers, and transactions are all related - the Configurer class manages the report, both creating and sending it, so the transaction is now just responsible for adding data to it. I'm still a bit uncomfortable of the coupling between transactions, the report, and configurer, but it's better than it was. This also fixes #2944 and #2973. Signed-off-by: Luke Kanies <luke@madstop.com>
* | 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>