summaryrefslogtreecommitdiffstats
path: root/spec/unit
Commit message (Collapse)AuthorAgeFilesLines
...
| * Partially fixing #1772 - broken 'resources' tests.Luke Kanies2008-11-261-0/+27
| | | | | | | | | | | | | | | | The main problem was that the directory_services user provider was returning a string for its uid instead of an integer. I also began a 'resources' spec file. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Removing the included testing gems; you must now install them yourself.Luke Kanies2008-11-255-15/+52
| | | | | | | | | | | | Everything passes, but autotest doesn't include color. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #1708 - user groups specified as names are now detected correctly.Luke Kanies2008-11-241-0/+20
| | | | | | | | | | | | | | | | There was a bug when groups were specified by name -- the group was always compared to the current gid, rather than being converted to an integer and comparing that way. This is now fixed. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Revert "Fixing #1755 - File modes (and other strange properties) will now ↵James Turnbull2008-11-221-14/+0
| | | | | | | | | | | | display correctly" This reverts commit ed4c4050a8ac46c509b20031814646a49ba86e54.
| * Fixing #1764 - a property's 'sync' method is never considered a no-op.Luke Kanies2008-11-211-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *This is a behaviour change.* If the property does not return an event name, then one is generated based on the property name. Previously, the 'sync' method could return nil and it would be considered a noop, but if you need a noop, then you need to modify your 'insync?' method to return 'true' in the noop cases. Also modifying all of the builtin types that didn't handle this explicitly or returned nil in 'sync'. There should be no behaviour change in any of them. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Refactoring the file/owner property to be simpler and cleaner.Luke Kanies2008-11-211-0/+132
| | | | | | | | | | | | | | | | It now looks almost exactly like the group property, and has a much more current data flow (e.g., sync is never no-op, and the sync method doesn't check whether the file is present). Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fixing #1755 - File modes (and other strange properties) will now display ↵Luke Kanies2008-11-211-0/+14
| | | | | | | | | | | | | | | | correctly in ralsh and generated manifests. Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fix #1759 - Comparison operator was using string comparison for numbersBrice Figureau2008-11-201-10/+50
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixing broken tests resulting from the fix to #1747Luke Kanies2008-11-175-1/+8
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
| * Move function existance test to parser evaluationBrice Figureau2008-11-171-0/+77
| | | | | | | | | | | | | | | | The aim is to let --parseonly succeeds even if the function is not (yet) present. This is usefull in commit-hooks and for the inline documentation generation system. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * RSpec tests for the doc system (covers AST.doc, lexer and parser)Brice Figureau2008-11-173-5/+121
| | | | | | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixed #1735 and #1747 - Fixes to confine systemJames Turnbull2008-11-161-19/+13
| |
| * Fixing the provider's confine subsystem so the logs are more useful.Luke Kanies2008-11-133-24/+48
| | | | | | | | | | | | | | | | | | I apparently lost some context in these logs when I switched to this separate subsystem. Note that this also fixes some of the informational issues in Signed-off-by: Luke Kanies <luke@madstop.com>
| * Fix bug #1681: Add filesystem type check to test for per-file SELinux ↵Sean E. Millichamp2008-11-141-0/+41
| | | | | | | | context support
| * Refactoring of SELinux functions to use native Ruby SELinux interfaceSean E. Millichamp2008-11-141-33/+33
| |
| * Fix #1737 - part2 - Fix display of "options"Brice Figureau2008-11-121-0/+12
| |
| * Fix #1737 - ssh_authorized_keys should be able to parse options containing ↵Brice Figureau2008-11-111-0/+7
| | | | | | | | | | | | commas Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * Fixing the augeas type tests to work when augeas is missingLuke Kanies2008-11-051-88/+98
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding more file tests and fixing conflicting testsLuke Kanies2008-11-152-0/+22
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Completely refactoring the tidy type.Luke Kanies2008-11-151-12/+315
| | | | | | | | | | | | | | | | | | | | | | | | This was necessary because of how I changed file recursion. The type works much more intelligently now -- files to be removed have a file resource generated for them, and that resource handles deletion. Also fixes #1717; neither age nor size is required now. Signed-off-by: Luke Kanies <luke@madstop.com>
* | These changes are all about making sure file data is expired when appropriate.Luke Kanies2008-11-152-2/+77
| | | | | | | | | | | | All file tests now pass. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Catalogs always consider resource data to be expired if not mid-transaction.Luke Kanies2008-11-152-1/+14
| | | | | | | | | | | | | | | | | | This way we'll cache when in a transaction, but otherwise always hit the disk so the data is fresh. This works because we really only use resources mid-transaction, but it behaves correctly if we happen to use a resource outside of a transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding caching support to parameters, and using cached attributes for file ↵Luke Kanies2008-11-113-18/+48
| | | | | | | | | | | | | | | | | | source and metadata. As hoped, this drastically simplifies the code around retaining this data. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding cached attribute support to resources.Luke Kanies2008-11-113-10/+24
| | | | | | | | | | | | | | | | | | | | | | | | The Catalog is the expirer, which means that a resource with no catalog will not cache data. Also switching files to use a cached attribute for its stat. And modifying catalogs to expire data at the end of every transaction. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Allowing a nil expirer for caching classes.Luke Kanies2008-11-111-1/+6
| | | | | | | | | | | | | | If there's no expirer, then the value is regenerated every time. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring the Cacher interface to always require attribute declaration.Luke Kanies2008-11-111-100/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously you could dynamically use cached values, but the new interface requires a single static declaration of the attribute: cached_attr(:myattr) { my_init_code() } This is cleaner, because it makes it easy to turn the code into an init method and generally makes the whole thing easier to think about. Most of this commit is going through the different classes that already using the Caching engine. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Changing the Cacher.invalidate method to Cacher.expire.Luke Kanies2008-11-1110-31/+25
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing a critical bug in the Cacher module.Luke Kanies2008-11-111-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically, the first generated value was always considered expired the next time it was asked for. The fix was to create an initial timestamp in the Cacher module, thus providing a floor for validity. This is definitely a murky bug, and is especially hard to test. Also refactoring the internals just a bit. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing tests broken by fileserving and other refactoring.Luke Kanies2008-11-081-5/+0
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing a test broken by previous refactoringLuke Kanies2008-11-071-7/+4
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Finishing the refactoring of the resource generation interface.Luke Kanies2008-11-072-185/+24
| | | | | | | | | | | | | | All of the code works, and there are integration tests all around to prove it. I think. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring and clarifying the resource generation methods.Luke Kanies2008-11-071-0/+247
| | | | | | | | | | | | It now works with the new Catalog#add_resource method. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Refactoring Catalog#add_resource to correctly handle implicit resources.Luke Kanies2008-11-071-71/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It now ignores or removes implicit resources that conflict, and it yields all resources that are valid. This makes it simple for calling classes to pass in a list of resources but only perform a chunk of work for valid (i.e., non-conflicting) resources. This refactor is entirely meant as a way of cleaning up the Transaction#generate interface to the catalog. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Changing the catalog's relationship graph into a normal graph.Luke Kanies2008-11-061-67/+74
| | | | | | | | | | | | | | It was previously another catalog instance, but I was only ever actually using the graphing abilities. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing the PGraph class and subsuming it into SimpleGraph.Luke Kanies2008-11-063-444/+431
| | | | | | | | | | | | | | This class is a holdover from when I was using GRATR, and it's obsolete now. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Moving Catalog#write_graph to SimpleGraph, where it belongs.Luke Kanies2008-11-061-0/+25
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Converting the file 'source' property to a parameter.Luke Kanies2008-11-052-153/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes a lot of sense because source was always more of a metaparameter than a property -- it affected the 'should' values of other properties, but it shouldn't have done any other work. It will hopefully make everything else much cleaner. This is such a large commit mostly because of the need to fix a lot of tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Removing mid-transaction resources from the catalog.Luke Kanies2008-11-051-0/+14
| | | | | | | | | | | | This basically just cleans up dynamic resources. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a method to Checksums to extract the sum typeLuke Kanies2008-11-052-0/+177
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Deduplicating slashes in the fileserving codeLuke Kanies2008-11-041-0/+5
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing the augeas type tests to work when augeas is missingLuke Kanies2008-11-041-88/+98
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Switched all value management in props/params to internal classes.Luke Kanies2008-11-042-22/+609
| | | | | | | | | | | | | | | | | | | | | | This is a significant refactor of some very murky code, and it's all much cleaner and more readable now. All of the 'newvalue' methods and any value-related code is in a ValueCollection class. This puts us in a good position to refactor the Property and Parameter classes more completely. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1677 - fixing the selinux tests in master.Luke Kanies2008-11-041-0/+6
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* | Changing the meaning of the unused Puppet::Type#parameter method to return ↵Luke Kanies2008-11-041-1/+16
| | | | | | | | | | | | | | | | | | | | an instance rather than a value. This parallels and largely obviates the 'property' method. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing #1641 - file recursion now only passes original parameters to child ↵Luke Kanies2008-11-041-20/+25
| | | | | | | | | | | | | | | | | | resources. Previously, parameter values provided by remote sources or default values were all passed to children, which provided strange state maintenance. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Making it so (once again) files with sources set can still be deletedLuke Kanies2008-11-041-0/+10
| | | | | | | | | | | | (which I think is kinda stupid, but apparently people want it). Signed-off-by: Luke Kanies <luke@madstop.com>
* | Fixing and migrating more file tests.Luke Kanies2008-11-042-2/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an unfortunately messy commit; I should have tried harder to separate the different tasks into different commits, but it's not worth going back and doing now. This is the first commit in the long road of fixing the existing file tests, and in the process refactoring and better testing the code. The refactoring in this commit is mostly around the 'stat' instance variable that tests whether the file exists (and provides its metadata if it does) and the 'insync?' method in the source property. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Adding a starting point for spec tests for tidy.Luke Kanies2008-11-041-7/+12
| | | | | | | | | | | | | | | | | | | | So far it just validates that lstat is used instead of stat. Signed-off-by: Luke Kanies <luke@madstop.com> Conflicts: spec/unit/type/tidy.rb
* | Retrieving the CA certificate before the client certificate.Luke Kanies2008-11-031-8/+27
| | | | | | | | | | | | | | | | | | | | | | We have to have a CA cert first, because the host will start using the client cert as soon as it's available, but it's not functional without a CA cert. Also removing extra stupid stuff from wait_for_cert -- the connection is now always recycled, which is much simpler. Signed-off-by: Luke Kanies <luke@madstop.com>
* | Handling the case where a symbol (e.g., :ca) is used for a certificate name.Luke Kanies2008-11-031-2/+2
| | | | | | | | Signed-off-by: Luke Kanies <luke@madstop.com>