summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a failing test in #3115Jesse Wolfe2010-02-171-0/+8
| | | | Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Feature #3115 REST-ified status()Jesse Wolfe2010-02-173-0/+35
| | | | | | | | | | | | | | | | | | This patch re-implements the status() remote procedure as a REST interface. A running server returns key-value pairs, currently the only implemented key is "is_alive" which will always be set to true. Some future tool will consume this by: Puppet::Status.indirection.terminus_class = :rest Puppet::Status.find('https://puppet:8140/production/status/default') Now with unit tests. plus fixes a typo. plus integration test and default security setting. plus tests suggested by Brice. Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* Fix #3229 - use original value in case/selector regex matchingBrice Figureau2010-02-173-20/+13
| | | | | | | | | | | | | | | | | | | | | | | The issue is that case/selectors are downcasing the value before it is compared to the options. Unfortunately regex are matching in a case sensitive way, which would make the following manifest fail: $var = "CaseSensitive" case $var { /CaseSensitive/: { notice("worked") } default: { fail "miserably" } } This patch fixes the issue by making sure the regexp match is done one the original (not downcased) value, but still doing a case sensitive match. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Cleaning up a test.Luke Kanies2010-02-171-3/+3
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing unused Checksum::File terminusLuke Kanies2010-02-171-139/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Converting File terminus to use formats.Luke Kanies2010-02-172-75/+95
| | | | | | | | | | This fixes most of #1943, except the checksum indirection still uses this. This basically always chooses the most recent file when finding files, and saves the file with the default format. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding filename extension support to formats.Luke Kanies2010-02-173-0/+20
| | | | | | | | This is toward fixing #1943 - we need the ability to easily convert between file extensions and file formats. Signed-off-by: Luke Kanies <luke@madstop.com>
* Resolving conflicts with ???Markus Roberts2010-02-171-2/+2
|
* Renaming Parser::ResourceType to Resource::TypeLuke Kanies2010-02-1713-154/+154
| | | | | | | | | | 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>
* Removing Interpreter classLuke Kanies2010-02-176-182/+33
| | | | | | | It's no longer necessary, given the new ResourceTypeCollection class. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* All non-transient parser references are goneLuke Kanies2010-02-178-95/+155
| | | | | | | | | We now use references to the ResourceTypeCollection instances through the environment, which is much cleaner. The next step is to remove the Interpreter class. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing callers to Parser to only pass environmentLuke Kanies2010-02-171-2/+1
| | | | | | | We previously passed a hash of options but now just the environment. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Using the RTC helper to find the known resource typesLuke Kanies2010-02-171-18/+18
| | | | | | | | | | We previously defined the method statically. This also renames the method to match how the environment thinks of them - known resource types, rather than resource type collection. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding helper module for finding known resource typesLuke Kanies2010-02-171-0/+25
| | | | | | | This is so everyone doesn't have to define the same method everywhere. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Moving Rails initialization to Compiler terminusLuke Kanies2010-02-172-16/+32
| | | | | | | It was previously handled by the Interpreter, but we're planning on getting of that. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Parser now uses Environment resource type collectionLuke Kanies2010-02-171-24/+30
| | | | | | | | | This is the last step enabling us to make it so no one needs to maintain these references to the parser. Instead, everyone will just get access to the type collection from the Environment. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding 'known_resource_types' to EnvironmentLuke Kanies2010-02-172-4/+148
| | | | | | | Each environment now has its own known collection of resource types, and it is responsible for caching as necessary. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Renaming LoadedCode to ResourceTypeCollectionLuke Kanies2010-02-174-60/+60
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Storing per-environment LoadedCode instancesLuke Kanies2010-02-173-31/+40
| | | | | | | | | | | | This will soon replace all of the env/parser mungling we have to do. A given process will only be able to have one collection of code per environment in memory. This is somewhat limiting, in theory, but some global means of looking up code collection (LoadedCode instances) must exist for the pure ruby stuff to work. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding support for parsing ruby filesLuke Kanies2010-02-171-0/+23
| | | | | | | This doesn't work without the later commits - it just relies on Ruby to read in Ruby files. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing test structureLuke Kanies2010-02-171-4/+4
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding []/[]= support to Parser::ResourceLuke Kanies2010-02-171-0/+10
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fix for #3366 - --tags '' treated as boolean 'true'Markus Roberts2010-02-171-2/+16
| | | | | This is the patch from Mike Pountney <Mike.Pountney@gmail.com> off the list with the additional test Luke requested.
* Fix for #3424 and tests to prove it.Markus Roberts2010-02-171-0/+38
| | | | | | | | The original pure ruby yaml patch missed some edge cases; specifically, classes that were modified by the syck version to directly call it and thus never reached the pure ruby version. This adds monkey patches to all of those case which we might reasonably care about (omitting, for example, calls within the syck version to itself) and tests which show that the monkey patch works.
* Resolving conflicts with testingMarkus Roberts2010-02-171-1/+5
| | | | | | | | | | | | | | | | Jesse writes: ethanrowe:tickets/master/2239 leaks state in the spec. After the spec is run, Puppet::Application is left in a :restart_requested state, and several important behaviors, particularly Puppet::Transaction#evaluate are disabled. It's order dependent, so changing the mtime of spec files makes the failures appear and disappear. This spec file was generally pretty good about keeping state from getting out, but one test was missing a stub for a dangerous call. I wouldn't be surprised if this cleared up other errors in testing.
* Fix 2239 (step five): introduce new Puppet::Transaction#stop_processing? ↵Ethan Rowe2010-02-171-0/+50
| | | | flag and associated check thereof within the resource evaluation code. This should allow for the transaction to bail out of its processing if it finds that a stop has been requested, based on the state of Puppet::Application.stop_requested?.
* Fix 2239 (step four): Refactored Puppet::Daemon's stop/restart methods to ↵Ethan Rowe2010-02-171-16/+31
| | | | set status flags appropriately in Puppet::Application, and removed call to now-deprecated @agent.configure_delayed_restart. This should get the restart and stop behavior for daemons and their agents working nicely with the new global process status interface of Puppet::Application.
* Fix 2239 (step three): Refactored Puppet::Agent to base starting/restarting ↵Ethan Rowe2010-02-171-51/+73
| | | | behaviors and predicates on new run-status interface of Puppet::Application.
* Fix 2239 (step two): introduce Puppet::Application.controlled_run method to ↵Ethan Rowe2010-02-171-3/+31
| | | | provide simple status-restricted execution of a passed in block; this can replace the process status checks and properly handle delayed restart behavior for Puppet::Agent.
* Fix 2239 (step one): introduce global settings represeting application run ↵Ethan Rowe2010-02-171-0/+99
| | | | | | | | state with methods for setting the state and appropriately-named predicates for querying state, all in the Puppet::Application class itself. To be used by Puppet::Daemon and Puppet::Agent and Puppet::Transaction for better response to TERM, INT, HUP.
* Generated resources' events are actually bound to the resource thatJesse Wolfe2010-02-171-1/+1
| | | | generated them.
* Mark resource/status as failed if they are associated with a failingJesse Wolfe2010-02-171-4/+4
| | | | | | | event. This restores behavior for resource dependencies that was broken in the #2759 series.
* Resolving conflicts with reinh:feature/master/single_executableMarkus Roberts2010-02-171-1/+1
| | | | Puppet is now main, and the variable got renamed to reflect that.
* Fixing most failing test/ tests.Luke Kanies2010-02-171-0/+7
| | | | | | | | | 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 Configurer interface to transaction reportLuke Kanies2010-02-171-1/+1
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing fingerprint tests to work with new log validationLuke Kanies2010-02-171-2/+2
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing "require" function to use new class interfaceLuke Kanies2010-02-171-2/+2
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing broken selinux testsLuke Kanies2010-02-171-2/+1
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing feature validation when passed one itemLuke Kanies2010-02-173-7/+15
| | | | | | | | When I changed how the validation errors worked I accidentally caused the feature list to need to be an array rather than supporting either. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Changing method profile for other event queueingLuke Kanies2010-02-171-9/+9
| | | | | | | | It wasn't clear in the first refactor if this was necessary, but doing the performance optimization made it clear it was. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Changing the method profile of EventManager#queue_eventLuke Kanies2010-02-172-15/+16
| | | | | | | It now takes multiple events instead of just one. This will help simplify a bunch of performance optimizations. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Moving Metric management to the reportsLuke Kanies2010-02-176-61/+195
| | | | | | | | | | | | This is one less bit that the transaction does. The resource status objects had nearly enough information to do everything, so I just added that last bit, and moved everything over. It's all much cleaner now. I had to change some existing, internal APIs, but mostly this should be hidden from outside users. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Removing mention of @changes in TransactionLuke Kanies2010-02-171-0/+22
| | | | | | This is handled in the Status instances now. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Cleaning up the report tests a bitLuke Kanies2010-02-171-19/+20
| | | | Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Fixing #2759 - reports now have complete change infoLuke Kanies2010-02-173-21/+12
| | | | | | | | This includes every event generated in the transaction and a Resource::Status object for each resource managed, with per-resource information in it. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* ResourceHarness now doesn't check params with no 'should'Luke Kanies2010-02-171-0/+9
| | | | | | | | | | | I hadn't been skipping parameters that didn't have a 'should' value set. This almost always resulted in the right behaviour, because most properties correctly just short-circuit to being in sync if the 'should' value is nil, but this encodes it at the harness, which is where it should be. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Changing Transaction to use the new ResourceHarnessLuke Kanies2010-02-174-57/+148
| | | | | | | | | | | | This is a much messier commit than I would like, mostly because of how 'file' works. I had to fix multiple special cases, and I had to move others. The whole system appears to now work, though, and we're ready to change reports to receive resource status instances rather than events. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Renaming some methods in Transaction::ChangeLuke Kanies2010-02-171-42/+11
| | | | | | | | | | | Renaming 'go' to 'apply', which is a much more reasonable name. Also removing the 'backward' and 'forward' methods, since they're not actually used anywhere. (Well, 'forward' was used, but it just called 'go'.) Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding Transaction::ResourceHarness classLuke Kanies2010-02-171-0/+230
| | | | | | | | | This is the interface class between Transactions and Resources. It's a relatively ugly class, but it will hopefully allow us to move most/all of the messy interface code into this one, relatively small class. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
* Adding first version of Resource::Status classLuke Kanies2010-02-171-0/+103
| | | | | | | This is the class that will be returned in reports, and they'll contain the events being created. Signed-off-by: Luke Kanies <luke@reductivelabs.com>