summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix #3552 single executable should display usageJesse Wolfe2010-02-172-85/+86
| | | | | | | | | Added some tests to make the single executable command behavior explicit. Added logic to display the usage message if we're on a tty and no arguments are passed. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fix for #3690 failing to calculate error codesJesse Wolfe2010-02-173-3/+28
| | | | | | | | | | | | | | | | | | | | | This failure was getting caused by what I believe to be a bug in Puppet::Configurer where it always generated a new Puppet::Transaction::Report, even if one existed in an outer scope. In puppetd --test, a different Report was getting queried to generate the exit status than the one that was passed to the transaction -- this Report had no Metrics and would fail when queried. This obscured a second bug that Metrics could return nil for values if the Transaction had applied an empty Catalog, but Transaction::Report assumes that values will always be integers. It could be argued that an empty Report should be populated with empty Metrics before a Transaction is run, which would have prevented Report#exit_status from raising an exception ... which would have made these bugs much harder to track down. So, I've decided to leave that unchanged. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #3668 - fixed autoloading classes from modulesLuke Kanies2010-02-173-80/+255
| | | | | | | | | | | This involved essentially moving all of the importing and loading code out of the Parser and into a new 'TypeLoader' class. The parser and the ResourceTypeCollection classes now delegate to that class for all file handling. Most of the code paths are also now much cleaner, and a bit of redundancy was removed. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix #3656 JSON serialization of dependenciesJesse Wolfe2010-02-171-0/+7
| | | | | | | | | | | | | | | | | | | | The pson serialization of resources was behaving incorrectly on parameters that are references to other resources: 1. Dependency parameters (require, subscribe, notify) were getting serialized as anonymous objects that looked like partially constructed resources 2. During de-serialization the pson parser would inflate them into hashes (rather than into resources) 3. The outer resource would try to coerce the hash into a resource by passing it to Resource.new 4. Resource.new would fail with a cryptic message, since it does not accept a hash as its first parameter (but the error is obfuscated by Resource.new's complicated argument handler) This patch solves the problem by explicitly converting dependency parameters into strings in the pson serialization. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixes #3582 - Adds dbport configuration option for specifying database portJames Turnbull2010-02-171-5/+14
|
* Adding indirector support to Resource TypesLuke Kanies2010-02-173-0/+131
| | | | | | | | | | Also adding JSON support. This is so that we can remotely retrieve information about resource types and classes, such as what arguments are required. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix #3552 single executable should display usageJesse Wolfe2010-02-171-0/+70
| | | | | | | | | Added some tests to make the single executable command behavior explicit. Added logic to display the usage message if we're on a tty and no arguments are passed. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Added support for flat packages in the pkgdmg package provider.Roy Nielsen2010-02-171-5/+16
| | | | | | | | | | | | | | Added a test in: ./spec/unit/provider/package/pkgdmg.rb To test flat package support. The case where a package is a .pkg bundle, curl will attempt to download and not work. The "installer" command will then fail, as the source will be "not found" and the resource will fail. The puppet run will continue. Signed-off-by: Roy Nielsen <rsn@lanl.gov>
* Fixing #2864 Added support for AIX System Resource Controller (SRC) - ↵Andrew Forgue2010-02-171-0/+97
| | | | | | | | | | | | | service start stop This provider supports start/stop and restart of AIX services using the native AIX service manager, called the System Resource Controller. Currently it will not stop and start (but only refresh) a service that uses sockets or message queues as its communication method. It will run stopsrc and then startsrc for services that use signals as their communication method. Signed-off-by: Andrew Forgue <andrew.forgue@gmail.com>
* Fixes #2836. Add hold support to dpkg providerNigel Kersten2010-02-171-2/+53
|
* Fixes #1223 Add Zypper support for SuSE machinesRein Henrichs2010-02-171-0/+81
| | | | | | | | | | | | | | | | | | | Zypper is the replacement for `rug' from earlier SuSE releases. Zypper is backward compatible with the rug command (mostly) and supports most of the same commands that rug does. This version fixes a number of bugs in the original: * when installing with a specified version, fix bug where the package name was being doubled ("foo" became "foofoo"). * fix bug where package name and version were separated by a "=" when it should have been a "-". * Update specs to reflect the implementation's use of the "-l" flag as recommended in http://groups.google.com/group/puppet-dev/msg/d86416c079bd3faf Signed-off-by: Rein Henrichs <reinh@reinh.com>
* Fix for #3399 zone type should handle exclusive IP stacksRein Henrichs2010-02-172-11/+67
| | | | | | | | | | * corrected missing status * added cloning and support for default router * RH: Fix spec to return accurate value for @resource[:clone] * RH: Add spec for untested install case when @resource[:clone] returns a (non-falsy) value Signed-off-by: Rein Henrichs <rein@puppetlabs.com>
* Adding #3518 - basic dot format supportLuke Kanies2010-02-171-0/+10
| | | | | | | This allows you to ask for a node's catalog in dot format, for inputting into graphviz et al. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing #3533 - Removing all transaction cleanupLuke Kanies2010-02-171-37/+0
| | | | | | | | | | It's really slow and has no actual functionality any more, since we just remove the catalogs from memory anyway. This should be a good speed boost for very little effort. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix for #2910 -- Tidy/matches is too tricky to useMarkus Roberts2010-02-171-1/+24
| | | | | | | | | | | | | The semantic interaction of tidy/matches and tidy/recurse is tricky to get right; it only makes sense to use matches with recursion (a fixed path will either statically match or it won't, no need for a run-time check) but there was nothing to warn users of this fact. To compound matters, the example in the matches parameter doc string even made this mistake. This patch: 1) fixes the doc string; 2) prohibits the use of match without a value of recurse capable of generating files to match, 3) fixes tests that were passing for the wrong reason and adds tests on the prohibition added in (2).
* Bug #3451: Don't leak the terminus class setting from ↵Jesse Wolfe2010-02-171-0/+8
| | | | | | | Puppet::Resource::Catalog's spec This issue causes other specs to fail, because they depend on the default terminus being unchanged.
* Write ssh_authorized_keys as userMarkus Roberts2010-02-171-25/+29
| | | | | | | | | | | | This is a targeted fix to the issue of permissions when writing ssh authorized key files by 1) requiring that an existing users be specified on the resource and 2) doing the write as that user. It's based on Michael DeHaan's initial implementation of Luke's idea, but with a number of simplifications (mostly by testing necessary conditions as early as possible so the code isn't cluttered up with a lot of checks). The tests in this version are modified slightly to remove some additional implementation couplings that were added in master.
* Fixing bad testMarkus Roberts2010-02-171-1/+1
| | | | | | | | | | | Actually, just moving the bad around. The test as written depended on the implementation details of Parser#file=; when those changed, it broke the test and this patch fixes the test by updating it's unwarranted assumptions to match the current details. The real solution should probably be to ban all such tests and yank them from the code base without mercy, but that's a task for another day, after we solve world peace and cure the common cold.
* Fix for #3556 Plussignment value meldingMarkus Roberts2010-02-171-0/+18
| | | | | | | | | | | | | | The plussignment operator was constructing the new parameter value by modifying the param object's value in place (so as to preserve the file and line information for debugging). However, when multiple resources are overridden by the same plussignment this would result in all of the resources sharing the same value (the union of all the prior values and the new value), which is wrong. Instead, we need to give each resource its own copy of the value (e.g., a copy of the param object), which this patch implements. Signed-off-by: Markus Roberts <Markus@reality.com>
* Partial fix to #2837 - changed warning message to debugJames Turnbull2010-02-171-2/+3
|
* Fixes #3295 - generate() now sets the working directory to the directory ↵Paul Lathrop2010-02-171-0/+41
| | | | | | containing the specified command. Also adds rspec tests for generate().
* Revert the guts of #2890Markus Roberts2010-02-172-45/+72
| | | | | | | | | | This patch reverts the semantically significant parts of #2890 due to the issues discussed on #3360 (security concerns when used with autosign, inconsistency between REST & XMLRPC semantics) but leaves the semantically neutral changes (code cleanup, added tests) in place. This patch is intended for 0.25.x, but may also be applied as a step in the resolution of #3450 (refactored #2890, add "remove_certs" flag) in Rolwf.
* Adding :catalog_terminus settingLuke Kanies2010-02-173-12/+35
| | | | | | | | | | This will rarely be used, but it enables even more architectural flexibility, such as precompiling catalogs and storing them in memcached or equivalent. With this setup, a single host can probably serve all catalogs and you would then just have as many compiling hosts as needed. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding support for only using cached catalogsLuke Kanies2010-02-171-1/+21
| | | | | | | | | This basically allows a sysadmin to control when a client will compile a new catalog - with this option enabled, the client will use the cached catalog as long as it has one, only recompiling when run with the option disabled. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fix #3155 - prevent error when using two matching regex in cascadeBrice Figureau2010-02-174-8/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following manifest: case $var { /match/: { if $var =~ /matchagain/ { } } } is failing because the "=~" operators when matching sets an ephemeral variable in the scope. But the case regex also did it, and since they both belong to the same scope, and Puppet variables are immutables, the scope raises an error. This patch fixes this issue by adding to the current scope a stack of ephemeral symbol tables. Each new match operator or case/selector with regex adds a new scope. When we get out of the case/if/selector structure the scope is reset to the ephemeral level we were when entering it. This way the following manifest produces the correct output: case $var { /match(rematch)/: { notice("1. \$0 = $0, \$1 = $1") if $var =~ /matchagain/ { notice("2. \$0 = $0, \$1 = $1") } notice("3. \$0 = $0, \$1 = $1") } } notice("4. \$0 = $0") And the output is: 1. $0 = match, $1 = rematch 2. $0 = matchagain, $1 = rematch 3. $0 = match, $1 = rematch 4. $0 = Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Making a Puppet::Module test more resilientLuke Kanies2010-04-131-0/+1
| | | | | | It would fail if a directory unexpectedly existed. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing and porting Transaction Report testsLuke Kanies2010-04-122-1/+112
| | | | | | | There are still a few unported tests, but it's at least better now. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing Property#change_to_s in rare case failuresLuke Kanies2010-04-121-1/+15
| | | | | | | | | If we were removing a field, which really only 'cron' does, then we got an exception. This is fixed, and now tested. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing Hash functionality with non-constant keysLuke Kanies2010-04-121-5/+27
| | | | | | | It was only apparently working with constant keys, not, say, AST strings. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Porting/removing group test/unit testsLuke Kanies2010-04-121-0/+20
| | | | | | | Most of it was just complicated, and the rest useless. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Porting a simple set of tests from test/unitLuke Kanies2010-04-121-0/+19
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Cleaning up content/source codeLuke Kanies2010-04-122-36/+5
| | | | | | | | | | This is probably a slight refactor, but only because it fixed a bug (content not being copied over correctly from metadata), which required that slight refactor. Mostly this just makes the code a bit cleaner. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Making SshAuthorizedKeys tests less brittleLuke Kanies2010-04-121-2/+11
| | | | | | | Also making them less likely to try to modify the local filesystem in any way. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fix tests that use or stub find_by_checksum, which I just changed theJesse Wolfe2010-04-102-11/+12
| | | | signature of.
* Update YAML dir test to match behaviorJesse Wolfe2010-04-091-2/+2
|
* Fix heisenbug in spec/unit/provider/mount/parsed.rbJesse Wolfe2010-04-091-0/+1
| | | | | spec/unit/provider/mount/parsed.rb would show a failure when spec/unit/type/mount.rb had been run prior.
* Remove test for old RDoc work-aroundJesse Wolfe2010-04-091-96/+0
|
* Fixing various broken Resource::Type testsLuke Kanies2010-04-091-18/+19
| | | | | | Also making the code a bit cleaner. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Renaming and fixing puppetrun tests.Luke Kanies2010-04-091-7/+7
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing calls to "class_scope" in Scope testsLuke Kanies2010-04-091-3/+3
| | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Fixing all 'require' function testsLuke Kanies2010-04-091-7/+12
| | | | | | | This involved making some tests better, but mostly just involved fixing calls to use new APIs and such. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Removing any mentions of :casesensitive settingLuke Kanies2010-04-093-25/+33
| | | | | | | | | | | | | | | | | It is a setting that was added years ago as a backward compatibility option and even if it still works, which is questionable, it has no purpose any longer. It just complicated the code and didn't do much, so it's gone now. Also simplified the interface of Leaf#evaluate_match, since it was now using none of the passed-in options. Finally, removed/migrated the last of the Selector/CaseStatement test/unit tests. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* Puppet::Parser::AST::Leaf#evaluate_match "insensitive" renamed toJesse Wolfe2010-04-091-2/+2
| | | | "sensitive"
* Puppet::Parser::Resource.new parameters have changedJesse Wolfe2010-04-091-1/+1
|
* Add stub to Puppet::Parser::Collector test to prevent runaway stubJesse Wolfe2010-04-091-1/+5
| | | | failures
* Converted File[checksum] to a parameter not propertyLuke Kanies2010-02-173-60/+76
| | | | | | | | | At the same time I removed all of the code in checksum that managed tracking changes to the checksum over time. I'll add it back in as I fix the fact that changes aren't being tracked like the should at the moment. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding "checksum?" helper method to Checksums moduleLuke Kanies2010-02-171-0/+16
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Refactoring File[source] tests somewhatLuke Kanies2010-02-171-37/+26
| | | | | | | | | Replaced use of a stub resource with a real resource. This is in preparation for turning the 'checksum' property into a parameter. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Resolving conflicts with luke:tickets/testing/2954Markus Roberts2010-02-171-11/+11
|
* Adding virtual and exported resource support to the DSLLuke Kanies2010-02-172-58/+80
| | | | | | | | | | | Also changed the internals - we're no longer using Resource instances with the ruby block, instead we're using a simple new class. We had to do this because Resource has too many methods - e.g., 'file' returned the file name rather than created a new resource type. Signed-off-by: Luke Kanies <luke@reductivelabs.com>