summaryrefslogtreecommitdiffstats
path: root/spec
Commit message (Collapse)AuthorAgeFilesLines
* (#5148) Fix failing spec due to timezoneNick Lewis2011-03-041-1/+1
| | | | | | | Time.parse(...) will yield a string in the local timezone. So when this spec was run in a non -0700 timezone, it was failing, because it was comparing a string in local time to a string in -0700. This fixes it to compare to the local string representation of the time.
* (#5148) Add support for PSON to factsNick Lewis2011-03-041-0/+24
| | | | | | | Previously, facts could be fetched via the REST API in PSON, but came back as the to_s representation of a Ruby object, rather than as proper PSON data. This patch adds to_pson and from_pson to facts, so they can be properly used with PSON.
* (#6338) Remove inventory indirection, and move to facts indirectionNick Lewis2011-03-032-221/+214
| | | | | | | | The inventory indirection was just providing the search method for facts. Because the route is now facts_search instead of inventory, it can just be implemented as the search method for facts. Reviewed-By: Daniel Pittman
* (#6541) maint: whitespace cleanup on the file integration specMatt Robinson2011-03-021-29/+32
|
* (#6541) Fix content with checksum truncation bugMatt Robinson2011-03-021-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch for #6107 fd73874147a1aaa3a047f904a0bc1ae67780a2e4 introduced a bug when content was an invalid checksum. Rather than error the checksum was invalid, it would overwrite the file with empty string, essentially truncating it. The problem with #6107 is that when I wrote it, I didn't realize that the content parameter was munged to be nil when it was a checksum, and then chunking method special cased nil content to mean you should check the filebucket. #6107 intended to fix the case where content REALLY WAS nil, and handle that by returning an empty string. This patch fixes it so that we check to see if we really passed in a checksum when chunking, and only then going to the filebucket. Surprisingly it is possible to have a content checksum should value set from source, so we have to be careful not to assume the use of the filebucket whenever there's a checksum. The following manifest produces this situation: file { "/tmp/mydir" : source => '/tmp/sourcedir', recurse => true, } I've said it before, and sure I'll say it again, but long term the file provider really needs a refactor. I'll write some acceptance tests for file behavior right after committing this so that the refactoring will be easier. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
* (#5466) Write specs for output of puppet resourceMatt Robinson2011-02-281-13/+17
| | | | Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* Merge branch 'maint/2.6.next/revert-5935' into 2.6.nextNick Lewis2011-02-281-13/+0
|\
| * Revert "(#5935) Allow functions to accept negated values"Nick Lewis2011-02-211-13/+0
| | | | | | | | | | | | | | | | This reverts commit e3c59df2b246fe5e764272f21b631a5d2f28687f. This commit is being reverted because the solution is incomplete, and a better solution is out of scope for this release. A more complete solution will be implemented in the future.
* | Merge branch 'ticket/2.6.next/4922' into 2.6.nextNick Lewis2011-02-281-137/+38
|\ \
| * | (#4922) Don't truncate remotely-sourced files on 404Nick Lewis2011-02-281-137/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were 'handling' 404's on remote file content retrieval by returning nil rather than raising an exception. This caused no content to be written to the temporary file, but still appeared successful, so the destination file was overwritten, instead of preserved. Now we just handle 404 like any other error. Note that the root cause of these 404s seems to have been #4319, which has been fixed. However, in the event we do happen to get a 404 here, it's better not to have code to specifically handle it incorrectly. Paired-With: Max Martin Reviewed-By: Matt Robinson
* | | Merge branch 'ticket/2.6.x/4914' into maint/2.6.next/revert-6309Paul Berry2011-02-283-269/+436
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.x/4914: (#4914) Improved stubbing in mount/parsed_spec tests. (#4914) Improved parsed_spec for mount (#4914) Remove mount specs (#4914) Specs for mounted? match new behaviour (#4914) Add specs for modified mount provider (#4914) Add specs for modified mount type (#4914) Update property blocks (#4914) Query property_hash for mountstate (#4914) Prefetch mountstate (#4914) Join lines for better readability Conflicts: lib/puppet/provider/mount.rb lib/puppet/provider/mount/parsed.rb spec/unit/provider/mount/parsed_spec.rb spec/unit/provider/mount_spec.rb spec/unit/type/mount_spec.rb
| * | | (#4914) Improved stubbing in mount/parsed_spec tests.Paul Berry2011-02-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few of the spec tests were attempting to stub Puppet::Type::Mount#default_target so that it pointed to a temporary file rather than /etc/fstab, but they were creating the stub after the first call to default_target, so both /etc/fstab and the temporary file were being read. This caused errors when running spec tests on platforms where /etc/fstab is unreadable by non-privileged users. Fixed the problem by moving the stub declaration earlier in the test.
| * | | (#4914) Improved parsed_spec for mountStefan Schulte2011-02-201-47/+192
| | | | | | | | | | | | | | | | | | | | Add specs for the new prefetching and the correct parsing of vfstab on Solaris and fstab on other systems
| * | | (#4914) Remove mount specsStefan Schulte2011-02-201-80/+3
| | | | | | | | | | | | | | | | | | | | Remove mount specs that seem to only test if the parsedfile provider is working correctly or are obsolete specs.
| * | | (#4914) Specs for mounted? match new behaviourStefan Schulte2011-01-301-37/+13
| | | | | | | | | | | | | | | | | | | | The question if a filesystem is mounted or not can be answered without calling mount and the specs have to reflect that.
| * | | (#4914) Add specs for modified mount providerStefan Schulte2011-01-251-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change specs - No need to call flush before mounting (explicitly), because the type and syncothers will to that for us - Add tests regarding the prefetched mount status
| * | | (#4914) Add specs for modified mount typeStefan Schulte2011-01-251-110/+182
| | | |
* | | | Revert "(#6309) Ensure the correct device is mounted when managing mounts"Paul Berry2011-02-257-191/+105
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6cb365a887d47606bdfae0ff540038b0c49b7451, which fixed bug #6309 but introduced bug #6411. In addition, it conflicts with a significant patch to the mount provider that addresses #4914. After merging in the fix for #4914 I will determine whether bug #6309 still exists, and if so work on an improved fix for it.
* | | (#3999) Allow disabling of default SELinux context detection for filesJesse Wolfe2011-02-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In most cases on a system with SELinux, it is preferred to use the SELinux matchpathcon call to determine the default context that a file should have to make sure that files Puppet modifies are labeled with the correct SELinux security context. In the event that you wanted to override some or all of the default context, you can use the SELinux attributes Puppet provides to do that. If left unspecified the defaults will apply if matchpathcon has defaults. This patch adds a new selinux_ignore_defaults parameter which will cause Puppet to assume no defaults, allowing the file's SELinux label to be left unmodified, if desired. Originally-by: Sean Millichamp <sean@bruenor.org> Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
* | | (#6322) --noop should not suppress error codesJesse Wolfe2011-02-252-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | The noop option has been suppressing exit statuses. This is counterintuitive, as per discussion at http://projects.puppetlabs.com/issues/6322 This patch causes noop runs to return the same exit codes as real runs. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* | | (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testingDaniel Pittman2011-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a combination of bad logic, and bad testing, and a nasty behaviour of Mocha <= 0.9.10 that would result in a false pass for one of our tests. This not only falsely passed, but hid an infinite loop retrying decompression on an invalid data stream; it could be triggered by anything that sent an HTTP request with an invalid compressed body, resulting in a livelock. Paired-with: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | (#5552) Display help when no subcommand is given.Daniel Pittman2011-02-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when the command line was empty we would try and invoke an empty method; this was less helpful than telling people what they could actually do, so we adapt our code to do precisely that. Paired-With: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | (#5552) Clean up subcommand handling inside puppet cert.Daniel Pittman2011-02-221-14/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now have a regular, testable mechanism for handling the legacy '--' version of subcommands, as well as a modern bareword subcommand pattern. This makes it sensible to test command handling and avoid regressions. We identified a few quirks in the command line as part of this process. Pair-With: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
* | | Merge branch 'ticket/2.6.next/6376-_search-support' into 2.6.nextMax Martin2011-02-211-1/+5
|\ \ \
| * | | (#6376) Add test case for facts find requestMax Martin2011-02-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added test case to ensure indirection name is not changed from "facts" when making an HTTP GET request. Reviewed-by:Paul Berry <paul@puppetlabs.com>
* | | | Merge branch '2.6.x' into 2.6.nextJacob Helwig2011-02-214-47/+101
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: Updated CHANGELOG for 2.6.5rc5 (#6337) Fix Ruby warning on 1.8.6 about "future compatibility" (#6353) Restore the ability to store paths in the filebucket (#6126) Puppet inspect now reports status after run completes.
| * | | | (#6353) Restore the ability to store paths in the filebucketPaul Berry2011-02-213-46/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2274d5104f6e413a2b8899a3c3111a17bbb2f4d7 optimized network usage for the case where a file is already in the filebucket. However, it took away the ability to store paths. This change restores the ability to store paths while maintaining optimal network usage for the case where the file is already in the filebucket with the given path. This is expected to be the most common case. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | (#6126) Puppet inspect now reports status after run completes.Daniel Pittman2011-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now emit timing and output a status message at the end of a successful inspect run. Paired-With: Nick Lewis <nick@puppetlabs.com> Signed-Off-By: Daniel Pittman <daniel@puppetlabs.com>
* | | | | Merge branch 'tickets/2.6.x/6309-check-what-is-mounted' into 2.6.nextJacob Helwig2011-02-187-115/+191
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tickets/2.6.x/6309-check-what-is-mounted: Remove pending tests from parsed mount provider (#6309) Ensure the correct device is mounted when managing mounts Clean up whitespace, and commented out code in parsed mount provider
| * | | | | Remove pending tests from parsed mount providerJacob Helwig2011-02-181-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| * | | | | (#6309) Ensure the correct device is mounted when managing mountsJacob Helwig2011-02-187-105/+191
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the mount type would only check if anything was mounted at the desired point, when 'ensure => mounted' was specified. Now we check not only whether something is mounted at the desired point, but also that it is the thing we wish to be mounted there. There is also a chance that the mount point directory could be "automagically" removed for us, when unmounting incorrect devices, so we attempt to re-create the directory after unmounting to give the mount of the correct device a better chance at succeeding. Paired-with: Matt Robinson <matt@puppetlabs.com> Paired-with: Nick Lewis <nick@puppetlabs.com> Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | / / / Merge branch 'tickets/2.6.x/6364-fix-mount-provider-on-aix' into 2.6.nextJacob Helwig2011-02-181-7/+7
|\| | | | | |/ / / |/| | | | | | | | | | | * tickets/2.6.x/6364-fix-mount-provider-on-aix: (#6364) Adjust mis-translated regex in mount provider for AIX
| * | | (#6364) Adjust mis-translated regex in mount provider for AIXJacob Helwig2011-02-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit to simplify the regex used to parse the output from the mount command on AIX (50c12e55b6f8462f6904ae061e661d1d10c7590a) mis-translated it. The original regex was grabbing the 3rd space-separated element, not the 2nd. This mis-translation caused the provider to grab the device information instead of the mount point, and compare that to the desired mount point. This would cause Puppet to think that the mount was never actually mounted under normal circumstances. The code from 50c12e5 was passing the tests because the fixture data did not include the mandatory leading whitespace that the original regex was looking for. The updated fixture data is pulled from the mount manpage from AIX v6r1. Reviewed-by: Paul Berry <paul@puppetlabs.com>
| * | | (#5977) fix spec test failure when new applications are introduced.Daniel Pittman2011-02-141-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test here was previously fragile, in that it would break when new applications were introduced, and in that it depended on the order of items returned from reading the directories on disk. It is now insensitive to those changes, and still verifies that the results we require occur, reducing long term maintenance cost. Reviewed-by: James Turnbull <james@puppetlabs.com>
* | | | (#6376) Add support and testing for _search GET requestsMax Martin2011-02-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for adding "_search" to the end of any indirection to 'pluralize' it, and added tests to check this functionality and to test hidden side effect of plurality method unpluralizing indirections. Paired-With:Paul Berry <paul@puppetlabs.com>
* | | | (#5166) Inventory service is now searchable by timestamp.Paul Berry2011-02-171-0/+103
| | | | | | | | | | | | | | | | | | | | It is now possible to specify queries in the form “meta.timestamp.xx” where xx is eq,ne,gt,lt,ge,le when searching the inventory service.
* | | | Refactored Puppet::Node::Inventory::Yaml tests in preparation for adding ↵Paul Berry2011-02-171-21/+9
| | | | | | | | | | | | | | | | freshness check
* | | | (#5132) Provide a query REST interface for inventoryPaul Berry2011-02-174-6/+151
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This REST interface returns a list of nodes that match a fact query. Fact queries can use (in)equality testing as a string comparison, and >, <, >=, <= numerical comparisons. Multiple tests can be done as AND comparisons, not OR. The fact queries need to be prefixed by facts, and the comparisons other than equality are specified with a .comparison_type after the fact name. This will be better explained in the REST documentation on the website. Searches that don't match anything now return empty array instead of a 404 error. Conflicts: spec/spec_helper.rb
* | | (#5935) Allow functions to accept negated valuesNick Lewis2011-02-171-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | function(-1) was failing because the grammar wasn't allowing negated values in function calls. This fix makes the negation of any value which was previously legal as a function argument also now legal as a function argument. Paired-With: Max Martin Paired-With: Markus Roberts
* | | (#6346) Move the trap calls onto Signal so they're easier to stubMatt Robinson2011-02-166-18/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once you stub signal traps in tests, you can hit ctrl+c in the middle of a spec run and it will stop the run instead of puppet catching the SIGINT. I had trouble easily tracking down all the places to stub traps when the trap was being called as a private method on applications and daemons, but calling trap on Signal is equivalent since Kernel calls Signal.trap and Object mixes in Kernel to provide trap as a private method on all objects. A bigger solution would be to refactor everywhere we call trap into a method that's called consistently since right now we sprinkle SIGINT and SIGTERM trap handling over applications and daemons in inconsistent ways, returning different error codes and using different messages. I've captured this info in ticket #6345. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | (Fixes #6269) merge changes from masterzen that resolve the issue.Daniel Pittman2011-02-121-0/+7
|\ \ \ | | | | | | | | | | | | parser.rb manually rebuilt to resolve global grammer chances.
| * | | Fix #6269 - Hashes only work with two levels of accessBrice Figureau2011-02-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following manifest was failing: $hash = { 'a' => { 'b' => { 'c' => 'it works' } } } $out = $hash['a']['b']['c'] because of a typo in the grammar. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | | | Merge branch 'masterzen/tickets/2.6.x/5516' into ↵Daniel Pittman2011-02-121-0/+6
|\ \ \ \ | | | | | | | | | | | | | | | bug/2.6.next/5516-hashes-can't-be-used-in-selectors
| * | | | Fix #5516 - Hashes can't be used in selectorsBrice Figureau2011-02-121-0/+6
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following manifest was producing a parse error: $int = { 'eth0' => 'bla' } $foo = $int['eth0'] ? { 'bla' => 'foo', default => 'bleh' } because selectors didn't support hash access. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* | | | (#5977) fix spec test failure when new applications are introduced.Daniel Pittman2011-02-121-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test here was previously fragile, in that it would break when new applications were introduced, and in that it depended on the order of items returned from reading the directories on disk. It is now insensitive to those changes, and still verifies that the results we require occur, reducing long term maintenance cost. Reviewed-by: James Turnbull <james@puppetlabs.com>
* | | | misc: ast_context has two arguments, not one.Daniel Pittman2011-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | This updates the spec expectation to reflect that, eliminating a warning during the spec run.
* | | | Merge branch 'masterzen/tickets/2.6/5720' into ↵Daniel Pittman2011-02-123-3/+58
|\ \ \ \ | |_|/ / |/| | | | | | | bug/2.6.next/5720-puppetdoc-fails-on-parameterized-class
| * | | Fix #5720 - puppetdoc misses some class commentsBrice Figureau2011-02-112-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that the fix for #5252 wasn't complete, and class, nodes and definition were still using the current lexer line number instead of the line number of the class/define/node token. This combined with some missing comments stack pushing/pop on parenthesis prevented puppetdoc to correctly get the documentation of some class (including parametrized ones). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | | Fix #6281 - Make sure puppetdoc analyzes all filesBrice Figureau2011-02-111-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can happen that when parsing a file puppet parses other manifests if they get imported (this is at least true for site.pp, even in ignoreimport=true). Thus those files are now "watched". But puppetdoc needs to analyze all files, and since 99c101 we are now checking if the file was already parsed to not reparse it again. If that was the case, though, we weren't analyzing the produced code. Thus it was possible to not produce documentation for the site.pp content. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
| * | | Fix #6280 - puppetdoc crashing on string interpolationBrice Figureau2011-02-111-3/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following manifest was crashing puppetdoc: class test { include "test::$operatingsystem" } Because the quoted string is "rendered" as a concat AST, which in turn ended being an array when entering RDoc. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>