summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* Solidifying the RAL/Event integration.Luke Kanies2010-02-174-2/+22
| | | | | | | | | | | | | | This has two changes: * Clarifies how we get the property and resource name (we pass the instance, the event converts to a string) * Logs at the resource's loglevel when there's no error These are related, because the event creator (resource) was passing in a string rather than an instance. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the Change/Event/Property interfaceLuke Kanies2010-02-173-15/+78
| | | | | | | | This gives all logging responsibility to the event, which can now produce logs identical to those produced directly by the property. At this point, the events are entirely supersets of the logs.
* Cleaning up the Log initialization code.Luke Kanies2010-02-171-0/+7
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring the RAL interface to loggingLuke Kanies2010-02-172-3/+51
| | | | | | | | | | | Previously, the Log class knew a lot about RAL objects, but now the Logging module is the only one that does. This greatly simplifies the Log class, which is good, and means that whatever complexity does need to exist is directly exposed in the Logging middleware module. Signed-off-by: Luke Kanies <luke@madstop.com>
* Using Logging module in main Puppet moduleLuke Kanies2010-02-171-0/+12
| | | | | | | We've had essentially duplicate methods in this module forever, and this just removes that duplication. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding tests for "Logging" moduleLuke Kanies2010-02-171-0/+47
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Correcting comments and making report timestamp internalLuke Kanies2010-02-172-6/+5
| | | | | | | | | We had some no-longer-correct comments in the Transaction class, which are now removed. This also moves the timestamp for reports into the report class, so it's created at initialization by the report, rather than by the transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* Failing in app/puppet if facts are not foundLuke Kanies2010-02-171-0/+6
| | | | | | | This is a rare case in puppet, but at least will come up when we support routes. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding Transaction events to Transaction reportsLuke Kanies2010-02-172-1/+33
| | | | | | | This means that every event generated during a transaction, with all of its metadata, will now be in the report. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing a redundant method in ReportLuke Kanies2010-02-171-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unused code and adding a couple of testsLuke Kanies2010-02-171-26/+46
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding tests for the 'report' log destinationLuke Kanies2010-02-171-0/+24
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Extracting event management into a separate classLuke Kanies2010-02-172-248/+278
| | | | | | | | | | Thus pulls all event-related code out of Transaction. The Transaction class currently creates a single instance of this class, so it's nowhere near a "real" event manager, but at least it has very clean integration points and will be easy to upgrade as needed. Signed-off-by: Luke Kanies <luke@madstop.com>
* Changing SimpleGraph.matching_edges to expect one eventLuke Kanies2010-02-171-6/+5
| | | | | | | It previously worked with multiple, but the only caller actually only ever passed one event. Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving event creation to the resourceLuke Kanies2010-02-173-24/+60
| | | | | | | | This allows the Transaction class to reuse the event creation code when it creates noop and restart events. Signed-off-by: Luke Kanies <luke@madstop.com>
* Cleaning up Event creationLuke Kanies2010-02-173-53/+132
| | | | | | | | | | The Property class is now completely responsible for creating the event, and it adds all of the metadata that a log message would normally have. This provides a cleaner definition of responsibility, and will allow further cleaning up in later commits. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding "type" instance method to enhance DemeternessLuke Kanies2010-02-171-0/+4
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Random code cleanupLuke Kanies2010-02-172-105/+125
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Ensure property into separate fileLuke Kanies2010-02-171-0/+13
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Moving Parameter utility classes into separate filesLuke Kanies2010-02-173-244/+255
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Switching transactions to callback-based eventsLuke Kanies2010-02-172-22/+350
| | | | | | | | | | | | | 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>
* Unit tests for path changesMarc Fournier2010-02-171-0/+14
|
* Fix failing specsRein Henrichs2010-02-174-14/+14
| | | | Some variable ns were missed in the rename
* Rename puppet application spec to mainRein Henrichs2010-02-171-74/+74
|
* Renaming applications, mostly removing 'puppet'Luke Kanies2010-02-177-362/+365
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Replace test/unit file write test with specRein Henrichs2010-02-171-11/+36
|
* Allow adding single key to hashesBrice Figureau2010-02-172-48/+82
| | | | | | | | | | This patch allow this syntax: $hash[mykey] = 12 If the key already exist an error is raised. Hashes are essentially write only, like puppet variables. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Raise an error when appending not a hash to a hashBrice Figureau2010-02-171-4/+9
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2389 - Enhance Puppet DSL with HashesBrice Figureau2010-02-173-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix #2929 - Allow checksum to be "none"Brice Figureau2010-02-175-1/+58
| | | | | | | | | | | | | | | | File checksum is "md5" by default. When managing local files (not sourced or content) it might be desirable to not checksum files, especially when managing deep hierarchies containing many files. This patch allows to write such manifests: file { "/path/to/deep/hierarchy": owner => brice, recurse => true, checksum => none } Then puppet(d) won't checksum those files, just manage their ownership. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3186 - require function set relationship only on the last classBrice Figureau2010-02-171-2/+12
| | | | | | | | Due to the fact that resource.set_parameter is overwriting the previous set_parameters, we were losing the previous relationships we set there, either in a previous call of require or in the same call. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #3150 - require function doesn't like ::class syntaxBrice Figureau2010-02-171-0/+11
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed the return types were valid, and removed the copy paste error with the ↵Bryan Kearney2010-02-171-3/+3
| | | | exception logic
* Add AIX package management support (installp&nim)Andrew Forgue2010-02-172-0/+108
| | | | | | | | | | This patch adds support for the native AIX package manager. It allows installation from either the name of an lpp_source (if you have a NIM environment configured, or from a directory containing .bff files. Signed-off-by: Andrew Forgue <andrew.forgue@gmail.com>
* Fixing #3148 Settings#without_noop when run with no noop settingLuke Kanies2010-02-171-0/+7
| | | | | | | Some tests didn't define this setting which caused this method to fail. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Move scope parenting & class_scope from Compiler to ScopeMarkus Roberts2010-02-173-44/+60
| | | | | | | | | | | | | | | | This refactor fixes about a quarter of the test failures on master and (I hope) will simplify some of the integration issues on the testing branch. It is my best guess at The Right Thing To Do (or at least a step in that direction) but I could be persuaded otherwise. The basic idea is to take responsibility for maintaining scope hierarchy and class_name -> class_scope mapping out of the compiler class and put it in the scope class where it arguably belongs. To maintain the semantics, class scopes are all tracked by the "top level" scope, though this could be relaxed if the nesting semantics were ever needed. If this winds up being the right thing to do, related routines (e.g. newscope) should be sorted out as well.
* Fixing tests in pkg providerMarkus Roberts2010-02-171-6/+6
|
* bug #3407 Part 2Jesse Wolfe2010-03-221-1/+1
| | | | | | | My change to the Puppet::Module::InvalidName error's initializer broke a spec in a different file. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fixing #3407 Failing tests in spec/unit/node/environment.rbJesse Wolfe2010-03-221-6/+6
| | | | | | | | | A naked rescue in Puppet::Node::Environment was hiding expectation violations from the Mocha mocks. Specifically, 'modulepath' expectations were failing, as Puppet::Module now calls Puppet::Node::Environment#modulepath internally. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Bug #3406 augeas spec fails if there is not a default providerJesse Wolfe2010-03-221-0/+2
| | | | | | So I stubbed out the default provider. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Bug #3402 Stub returning invalid type for :noopJesse Wolfe2010-03-221-1/+2
| | | | | A stub was causing a test failure by returning a string for a parameter that requires a boolean.
* Bug #3400 Bad mocks causing failing testsJesse Wolfe2010-03-221-1/+3
| | | | | | New code was calling a mocked method that was stubbed too broadly, causing the whole thing to act strangely. I've tightened the existing stub and stubbed the new method call.
* Merge branch '0.25.x'Markus Roberts2010-02-098-45/+128
|\ | | | | | | | | | | | | | | | | | | 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
| * Fixed #3162 - tidy does not remove empty files when "size => 0" is setJames Turnbull2010-02-091-0/+6
| | | | | | | | | | | | Thanks to Stig Sandbeck Mathisen for the fix See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513309
| * 2047: Add a not_include into matchBryan Kearney2010-02-011-0/+10
| |
| * Fix for #3094 (libdir should take ":" delimited path)Markus Roberts2010-01-301-1/+2
| | | | | | | | | | | | | | | | Actually, File::PATH_SEPARATOR, which is generally, but not always, ":"). Since libdir is also the default for the plugin handler, users will need to specify it explicitly if a multipart libdir is given (and it will need to be one of the segments given in the libdir for the plugins to be found).
| * Fix #1842 Net::HTTP#enable_post_connection_check doesn't work anymoreJesse Wolfe2010-01-301-17/+9
| | | | | | | | | | | | | | | | | | | | The setting enable_post_connection_check doesn't exist on very many versions of ruby, and on those systems there's no way to disable domain name checking on HTTPS. The recommended work-around is to replace certificates when they have incorrect hostnames. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
| * Fixing #2914 - pre/post hooks now work for transactionsLuke Kanies2010-01-182-2/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was built to be used with etckeeper to version control files in /etc, but can be used for essentially anything. This patch was built to be added to 0.25.4, so it's a least-modify approach. A better approach would be to refactor application/puppet.rb just a bit so it uses Configurer more. This is a simple patch - it just defines 'prerun_command' and 'postrun_command' settings, and runs the appropriate command around each transaction if they're set. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
| * Fix for #3075 (sshkey host_aliases ignored)Markus Roberts2010-01-151-4/+23
| | | | | | | | | | | | | | In the alias --> host_aliases conversion, I overlooked parsed file provider for sshkeys. Now with tests.
| * Revert "Fix #2845 Cron entries using "special" parameter lose their title ↵James Turnbull2010-01-141-21/+0
| | | | | | | | | | | | | | | | when changed" This reverts commit c99f394bf8c10d13f3fa7d3ab7ab43ecf454c081. The fix broke cron jobs in 0.25.3 and was reverted for the 0.25.4 release.