summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Reorganizing the file structure for indirection terminus types.Luke Kanies2007-10-1527-207/+210
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, for example, the configuration terminus that was a subclass of 'code' would have been stored at lib/puppet/indirector/code/configuration and would have had to have been named 'configuration'. Now, the subclass can be named however the author prefers, and it must be stored at lib/puppet/indirector/configuration/<name>.rb, where <name> is the name you've chosen for the terminus type. The name only matters insomuch as it is used to load the file from disk and find the appropriate class when asked. The additional restriction is that the class constant for the terminus type must have its name as the last word, and the indirection must be the second to last word. Thus, in our example, we can choose any class constant that ends with Configuration::Code; given that there's only one Configuration class at this point, it makes the most sense to define the class as Puppet::Node::Configuration::Code. This is somewhat awkward, because of the class's location on disk, but the only other real option is to autogenerate a Puppet::Indirector::Configuration class constant, which is, I think, uglier.
* | | | Translating the report handler to an indirected model.Luke Kanies2007-10-133-0/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've provided backward compatibility with the old handler. The only terminus type that currently exists for reports is the 'code' terminus, which is used to process reports in the style of the old handler. At some point, we should likely switch at least some of these report types (e.g., 'store') to terminus types.
* | | | Adding version handling through most of the indirection work.Luke Kanies2007-10-123-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | This counts as the first commit where configuration compiling actually uses the caching correctly according to the application model.
* | | | Fixing some small spec failures resulting from test fixes.Luke Kanies2007-10-101-3/+3
| | | | | | | | | | | | | | | | | | | | The problem was in how TransObjects were converted to RAL resources. (Committed while flying over Arkansas.)
* | | | Merge branch 'master' of git://michaelobrien.info/puppet into michaelLuke Kanies2007-10-099-160/+503
|\ \ \ \ | |/ / / |/| | / | | |/ | |/|
| * | All tests should now pass again.Luke Kanies2007-10-084-19/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first real pass towards using caching. The `puppet` executable actually uses the indirection work, instead of handlers and such (and man! is it cleaner). Most of this work was a result of trying to get the client-side story working, with correct yaml caching of configurations, which means this commit also covers converting configurations to yaml, which was a much bigger PITA than it needed to be. I still need to write integration tests, and I also need to cover the server-side story of a normal configuration retrieval.
| * | Adding support for versions and freshness-checkingLuke Kanies2007-10-063-41/+184
| |/ | | | | | | | | | | to the indirection layers. This should hopefully enable the different application models we need in our different executables.
| * Adding a :code setting for specifying code to runLuke Kanies2007-10-053-51/+13
| | | | | | | | | | | | | | | | instead of a manifest, and removing all of the ambiguity around whether an interpreter gets its own file specified or uses the central setting. Most of the changes are around fixing existing tests to use this new system.
| * Making "null" the default node source, so nodes are at least created easilyLuke Kanies2007-10-051-6/+7
| |
| * This commit is focused on getting the 'puppet' executableLuke Kanies2007-10-056-28/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to work. As a result, it involves a lot of integration-level testing, and a lot of small design changes to make the code actually work. In particular, indirections can now have default termini, so that configurations and facts default to their code terminus Also, I've removed the ability to manually control whether ast nodes are used. I might need to add it back in later, but if so it will be in the form of a global setting, rather than the previous system of passing it through 10 different classes. Instead, the parser detects whether there are AST nodes defined and requires them if so or ignores them if not. About 75 tests are still failing in the main set of tests, but it's going to be a long slog to get them working -- there are significant design issues around them, as most of the failures are a result of tests trying to emulate both the client and server sides of a connection, which normally would have different fact termini but in this case must have the same terminus just because they're in the same process and are global. The next step, then, is to figure that process out, thus finding a way to make this all work.
| * Adding the integration tests to the Rakefile for spec,Luke Kanies2007-10-041-33/+41
| | | | | | | | | | | | fixing the integration tests, and extending the Classmethods for the indirector so that indirected classes can set the terminus class and cache class.
* | Homing in on a clean separation of concerns for a low-coupling, ↵Rick Bradley2007-10-062-10/+64
| | | | | | | | high-cohesion "server" model that will handle REST and/or XMLRPC on webrick and/or mongrel.
* | Moving the webrick/mongrel "servers" over to HTTPServer module instead of ↵Rick Bradley2007-10-051-15/+60
| | | | | | | | Server. Using Server as the master class for client connections. Server (former RESTServer) will instantiate the appropriate subclass based upon Puppet configurator setting. There are now tests broken in the network section which I can't seem to figure out yet. Not a happy place to be.
* | Merge branch 'master' of git://reductivelabs.com/puppet into routingRick Bradley2007-10-052-52/+67
|\|
| * Adding another test to the ldap node source -- we makeLuke Kanies2007-10-041-1/+10
| | | | | | | | | | sure we throw an appropriate exception if a parent is specified but we cannot find it.
| * Fixing some terminology so some ldap tests are easier to read.Luke Kanies2007-10-041-3/+3
| |
| * Switching the indirection from using settings for configurationLuke Kanies2007-10-041-48/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to requiring explicit configuration. This means that if you as an application developer want to use a different indirection terminus then you have to specify it; something like: Puppet::Node.terminus_class = :ldap Caches use the same kind of configuration: Puppet::Node.cache_class = :memory Accordingly, I've removed the existing setting definitions from the defaults.rb.
* | Minor tweaks.Rick Bradley2007-10-041-6/+6
| |
* | Allow for multiple REST servers to be active; some terminology changes in ↵Rick Bradley2007-10-041-48/+56
| | | | | | | | spec; fleshing out more behavior, implementing.
* | Added .listening to REST server, handle listen states and transitions.Rick Bradley2007-10-041-4/+39
| |
* | Spec'd a reset() method for clearing out known routes. Uses the unregister ↵Rick Bradley2007-10-041-0/+16
| | | | | | | | method so that any hooks there will be run. Probably a violation of YAGNI, but I'm willing to suffer it :-)
* | Updating first portion of the Network RESTServer spec with example code, ↵Rick Bradley2007-10-041-2/+42
| | | | | | | | getting the added examples to pass.
* | Merge branch 'master' of git://reductivelabs.com/puppet into routingRick Bradley2007-10-041-0/+3
|\|
| * Fixing tests for the Configuration object, since ILuke Kanies2007-10-041-0/+3
| | | | | | | | added the any_failed? test to Transactions.
* | Merge branch 'master' of git://reductivelabs.com/puppet into routingRick Bradley2007-10-044-25/+63
|\|
| * Fixing #817, mostly using the patch by DavidS. I couldLuke Kanies2007-10-031-0/+19
| | | | | | | | | | not directly use the patch because I have refactored too much.
| * Removing the Id tags from all of the filesLuke Kanies2007-10-031-1/+0
| |
| * Fixing #813 -- empty configurations again work.Luke Kanies2007-10-031-0/+17
| |
| * Fixing #814 -- when files are missing, the exceptions shouldLuke Kanies2007-10-031-24/+27
| | | | | | | | now be more reasonable.
* | Merge branch 'master' of git://reductivelabs.com/puppet into routingRick Bradley2007-10-031-9/+42
|\|
| * Adding more behaviours to the Puppet::Module spec,Luke Kanies2007-10-031-9/+42
| | | | | | | | | | | | | | and fixing some bugs in the process. Specifically, modules were no longer correctly handling fully qualified files, and they do so once again.
* | Interpreting "hidden" class from spec drafts as a REST Controller. This ↵Rick Bradley2007-10-031-0/+14
| | | | | | | | name, functionality, and/or location in the tree is subject to change, but it's down now somewhere so we can move forward on it.
* | Added partial spec for the serving of REST information, as well as some ↵Rick Bradley2007-10-033-0/+80
|/ | | | client-side REST terminus behavior.
* Adding more indirection termini, mostly focused on cachingLuke Kanies2007-09-253-0/+120
| | | | information in yaml.
* Adding cache support to indirection. If you haveLuke Kanies2007-09-251-23/+122
| | | | | a '<indirection>_cache' setting, then the indirection will use the value there as the name of the cache.
* I changed the Terminus class to switch camelcaseLuke Kanies2007-09-242-12/+24
| | | | | to underscore-separated words, e.g., FactStore becomes fact_store.
* Taking a first stab at moving configuration compilingLuke Kanies2007-09-233-0/+198
| | | | | | | | | | | | | | | into the indirection system. There are still quite a few unanswered questions, the two most notable being embodied in unimplemented tests in the Configuration Code terminus. This also requires changing the behaviour in a few places. In particular, 'puppet' and the 'module_puppet' cfengine module need to store a Node object in memory with the appropriate classes, since that's now the only way to communicate with the compiler. That integration work has not yet been done, partially because the old configuration handler (which the soon-to-be-deprecated master handler now uses) still exists.
* Adding a "memory" node terminus, which willLuke Kanies2007-09-232-0/+72
| | | | | | be used by 'puppet' and the Cfengine 'module_puppet', since they need to set up the node specially with classes and other weird things.
* Fixing the spec for the checksum terminus to matchLuke Kanies2007-09-231-3/+2
| | | | the changed design in the previous commit.
* Adding my first integration test, verifying thatLuke Kanies2007-09-234-69/+80
| | | | | | | | | | | checksum interaction behaves as I expect when interacting with the file terminus. I've also changed how files and checksums behave a bit. Files now create model instances with the content as the only argument during initialization, and checksums now calculate their checksums rather than having them passed in.
* Adding the first version of checksum support, which willLuke Kanies2007-09-223-1/+263
| | | | acquire the behaviour of FileBuckets.
* Renaming the 'Puppet::Util::Config' class toLuke Kanies2007-09-229-184/+184
| | | | | | | 'Puppet::Util::Settings'. This is to clear up confusion caused by the fact that we now have a 'Configuration' class to model host configurations, or any set of resources as a "configuration".
* Adding the base file terminus. This will, at the least,Luke Kanies2007-09-221-0/+130
| | | | | be used as the back end for filebuckets and the certificate authority.
* Merge branch 'configurations' into indirectionLuke Kanies2007-09-228-33/+521
|\ | | | | | | | | | | | | | | | | Conflicts: lib/puppet/defaults.rb lib/puppet/indirector/facts/yaml.rb spec/unit/indirector/indirection.rb spec/unit/indirector/indirector.rb
| * All tests now pass in this configuration branch, which meansLuke Kanies2007-09-222-0/+36
| | | | | | | | | | | | | | | | it's time to merge it back into the indirection branch. Considering that this work was what drove me to create the indirection branch in the first place, i should now be able to merge both back in the master branch.
| * An intermediate commit so I can start working on a differentLuke Kanies2007-09-205-7/+22
| | | | | | | | | | | | | | | | branch. The file recursion code actually works for the first time in a painful while, but there are still some quirks and design issues to resolve, particularly around creating implicit resources that then fail (i.e., the behaviour of the create_implicit_resource method in Configuration).
| * This is basically another intermediate commit. I feel likeLuke Kanies2007-09-173-3/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've gone too far down the rabbit hole to turn back now, but the code is clearly getting more centralized around the Configuration class, which is the goal. Things are currently a bit muddy between recursion, dynamic resource generation, transactions, and the configuration, and I don't expect to be able to clear it up much until we rewrite all of the tests for the Transaction class, since that is when we'll actually be setting its behaviour. At this point, Files (which are currently the only resources that generate other resources) are responsible for adding their edges to the relationship graph. This puts them knowing more than I would like about how the relationship graph works, but it'll have to do for now. There are still failing tests, but files seem to work again. Now to go through the rest of the tests and make them work.
| * Configurations now set a "configuration" instance variable in resources that ↵Luke Kanies2007-09-151-4/+11
| | | | | | | | are inside a configuration, so the resources can interact with the configuration to get things like relationships.
| * The whole system now uses Configuration objects instead ofLuke Kanies2007-09-154-21/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ever converting the Transportable objects into a tree of components and then converting that into a graph. This is a significant step, and drastically simplifies the model of how to use a configuration. The old code might have looked something like this: file = Puppet::Type.create :path => "/whatever", ... comp = Puppet::Type.create :name => :whatever comp.push file transaction = comp.evaluate transaction.evaluate The new code looks like this: file = Puppet::Type.create :path => "/whatever", ... config = Puppet::Node::Configuration.new config.add_resource file config.apply I did not really intend to do this much refactoring, but I found I could not use a Configuration object to do work without refactoring a lot of the system. The primary problem was that the Client::Master and the Config classes determined how the transactions behaved; when I moved to using a Configuration, this distinction was lost, which meant that configurations were often needing to create other configurations, which resulted in a whole lot of infinite recursion (e.g., Config objects that create directories for Puppet use Configuration objects -- yes, I'm s/Config/Settings/g soon -- and these Configuration objects would need to create directories). Not everything is fixed, but it's very close. I am clearly over the hump, though, so I wanted to get a commit in.
* | Adding the last tests for the ldap node terminus. I managedLuke Kanies2007-09-222-2/+158
| | | | | | | | to forget the tests around the main find() method.