summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Refactor en route to #5027 -- remove usestring parameter from lookupvarMarkus Roberts2011-04-122-23/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usestring parameter to lookupvar was objectionable for several reasons; first, it performed a function orthogonal to the main purpose of the method, second its default was the least common value, and third it was causing other code to work for reasons that were not obvious (extlookup). This refactor breaks the value-transforming function out into a seperate method which allows the user to specify the value to be used in lieu of :undef and removes the parameter. The function, Scope#undef_as(default,exp) is written so that it can be used in user code (templates, functions, etc.) if needed. This refactor will introduce a user-visible behaviour change in the case where users were counting on lookupvar to return "" for undefined variables. The best solution is to have them use undef_as, replacing: lookupvar('myvar') with undef_as('',lookupvar('myvar')) (with the option to specify another default value if desired). If this is too objectionable, we could rename the existing lookupvar as raw_lookupvar and define def lookupvar(v) undef_as('',raw_lookupvar(v)) end to restore the present behaviour.
* Fixed #5684 - Move to Apache 2.0 licenseJames Turnbull2011-04-111-2/+2
| | | | | | | | | | | | | | For details of why we're moving please see: https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion Removed explicit GPL licenses where appropriate Replaced selected GPL licenses with Apache 2.0 Replaced LICENSE with Apache 2.0 Updated README
* (5200) -- replace containers with sentinalsMarkus Roberts2011-04-065-89/+22
| | | | | | | | | | | | | | | | | | | | | This commit removes the last remaining use of topsort (in SimpleGraph#splice!) by fixing #5200 in a way that is compatible with graph fontiers. Instead of replacing containers with many-to-many relationships, we now replace them with a pair of sentinals (whits) that bracket them. Thus a graph consisting of two containers, each containing ten resources, and a dependency between the containers, which would have gone from 21 edges to 100 edges will instead have only 43, and a graph consisting of two containers (e.g. stages) each containing a similar graph, which would have gone from 45 edges to 400 will only go to 95. This change had minor consequences on many parts of the system and required lots of small changes for consistancy, but the core of it is in Catelog#splice! (which replaces SimpleGraph#splice!) and Transaction#eval_generate. Everything else is just adjustments to the fact that some one-step edges are now two-step edges and tests, event propagation, etc. need to reflect that. Paired-with: Jesse Wolfe
* (#4576) Raise an error when a node is classified into a non-existent classJesse Wolfe2011-03-241-1/+1
| | | | | | | | | | In 2.6.x, this was upgraded from "info" to "warning". This change for Statler escalates the warning to an exception which will abort the compile. This makes compiling fail consistently when you try to use an undefined class from any of: node classifiers, the class keyword, and the include function. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
* Merge branch '2.6.next' into nextMax Martin2011-03-231-169/+82
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: Fixed #6562 - Minor kick documentation fix (#6658) Propagate ENC connection errors to the agent (#4884) Remove typo from spec test (#4884) Modify tests to pass on non-OS X systems (#4884) Revise new exec tests, add a few more (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace (#4884) Get rid of open3 require since it wasn't being used (#5814) Improved cron type specs (#5814) cron_spec shouldn't depend on cron provider Manually Resolved Conflicts: lib/puppet/util/command_line/puppetrun spec/spec_helper.rb spec/unit/type/exec_spec.rb spec/unit/type_spec.rb test/ral/type/exec.rb
| * (#4884) Fix Test::Unit exec testsMatt Robinson2011-03-151-176/+87
| | | | | | | | | | | | | | | | | | | | | | | | Mostly this is whitespace cleanup, but other than that it's changing a couple method names and calling run on the new exec providers instead of the types. We started moving these tests into spec, but they weren't very self contained so were hard to map over cleanly. For now leaving them since they serve as a more integration level set of tests. Paired-with: Max Martin
* | Merge branch '2.6.next' into nextMatt Robinson2011-03-078-2/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a particularly nasty merge, so rather than hold up merges into next any longer, I'm going to push this merge with a few outstanding problems. The tests that were failing in the following areas have been marked pending, and will be addressed separately, immediately following this push. TODO: Verify that brice's rdoc change is still valid: tests to show that line numbers from class, define and node get into the ast Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb * 2.6.next: (85 commits) (#5148) Fix failing spec due to timezone (#5148) Add support for PSON to facts (#6338) Remove inventory indirection, and move to facts indirection (#6445) Fix inline docs: puppet agent does not accept --mkusers Update CHANGELOG and version for 2.6.6rc1 (#6541) Fix content with checksum truncation bug (#6418) Recursive files shouldn't be audited (#6541) maint: whitespace cleanup on the file integration spec (#6541) Fix content with checksum truncation bug (#5466) Write specs for output of puppet resource (#5466) Monkey patch Symbol so that you can sort them (#5466) Fixed puppet resource bug with trailing , Update CHANGELOG for 2.6.5 (#4922) Don't truncate remotely-sourced files on 404 (#6338) Remove unused version control tags Maint: Align tabs in a code block in the Augeas type. (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type Maint: Rewrite comments about symlinks to reflect best practice. (#6509) Inline docs: Fix broken lists in Launchd provider. (#6509) Inline docs: Fix broken code blocks in zpool type ... Manually Resolved Conflicts: lib/puppet/application/inspect.rb lib/puppet/defaults.rb lib/puppet/file_bucket/dipper.rb lib/puppet/network/http/handler.rb lib/puppet/node/facts.rb lib/puppet/parser/parser.rb lib/puppet/parser/parser_support.rb lib/puppet/util/command_line/puppet lib/puppet/util/command_line/puppetd lib/puppet/util/command_line/puppetmasterd lib/puppet/util/monkey_patches.rb lib/puppet/util/rdoc/parser.rb spec/unit/application/agent_spec.rb spec/unit/file_bucket/file_spec.rb spec/unit/indirector/file_bucket_file/file_spec.rb spec/unit/network/http/handler_spec.rb spec/unit/parser/parser_spec.rb spec/unit/provider/mount/parsed_spec.rb
| * Merge branch 'ticket/2.6.next/4914' into 2.6.nextPaul Berry2011-02-287-0/+43
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.6.next/4914: Revert "(#6309) Ensure the correct device is mounted when managing mounts" (#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
| | * Merge branch 'ticket/2.6.x/4914' into maint/2.6.next/revert-6309Paul Berry2011-02-287-0/+43
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 parsed_spec for mountStefan Schulte2011-02-206-0/+36
| | |/ | | | | | | | | | | | | Add specs for the new prefetching and the correct parsing of vfstab on Solaris and fstab on other systems
| * / (#6338) Remove unused version control tagsMatt Robinson2011-02-281-2/+0
| |/ | | | | | | | | | | | | Older version control systems like CVS and SVN used to use these $Id$ tags for version information. Paired-with: Nick Lewis
* | (#6551) remove deprecated 'env' parameter to the 'exec' typeDaniel Pittman2011-03-031-43/+0
| | | | | | | | | | | | We deprecated this back in 0.24, so we can eliminate it in the next release. We ran through our deprecation period full of constant complaints to the users. Now we just fail.
* | Merge branch '2.6.x' into nextNick Lewis2011-01-063-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Rakefile lib/puppet/resource/type_collection.rb lib/puppet/simple_graph.rb lib/puppet/transaction.rb lib/puppet/transaction/report.rb lib/puppet/util/metric.rb spec/integration/indirector/report/rest_spec.rb spec/spec_specs/runnable_spec.rb spec/unit/configurer_spec.rb spec/unit/indirector_spec.rb spec/unit/transaction/change_spec.rb
| * (#5771): Fix spec failures associated with rspec upgradeNick Lewis2011-01-051-0/+2
| | | | | | | | | | | | | | | | | | Due to changes in the spec_helper, some of the specs that use puppettest were failing when run individually. In the future, it would be nice to remove puppettest from the specs entirely, as it's old, crufty, and only used for a couple of things. Paired-With: Matt Robinson
| * [3782] Test isolation problem in test/ral/providers/cron/crontab.rbPaul Berry2010-12-171-1/+4
| | | | | | | | | | | | | | | | | | | | | | The test in question (test_parse_line) was nondeterministic because it was relying on the sort order of a Hash whose keys were symbols. When the sort order caused a blank line to appear at the end of the file under test, the blank line was elided by the crontab parser, causing a failure. Modified the test to execute in a deterministic order that doesn't place the blank line at the end.
| * (#5493) Add report_format, puppet_version, and configuration_version to ReportsNick Lewis2010-12-162-2/+2
| | | | | | | | | | | | | | | | | | Current report formats are: 0: 0.25 reports and earlier 1: 0.26.1 - 0.26.4 reports 2: 0.26.5 and beyond Paired-With: Jesse Wolfe
* | Merge branch '2.6.x' into nextNick Lewis2010-12-165-12/+6
|\| | | | | | | | | | | | | | | | | Manually Resolved Conflicts: lib/puppet/resource/type_collection.rb spec/unit/configurer_spec.rb spec/unit/indirector/catalog/active_record_spec.rb spec/unit/resource/type_collection_spec.rb spec/unit/transaction/resource_harness_spec.rb
| * (#5408) Attributes can be both audited and managedJesse Wolfe2010-12-102-5/+2
| | | | | | | | | | | | | | | | | | | | This patch makes it possible to both audit and manage an attribute. It introduces a new field on Event objects "historical_value", which is the value from state.yaml. The value from the RAL is written to state.yaml, and then the RAL is updated with the desired value. Paired-With: Nick Lewis <nick@puppetlabs.com> Paired-With: Matt Robinson <matt@puppetlabs.com>
| * Fix #1757 Change file mode representation to octalJesse Wolfe2010-12-082-1/+4
| | | | | | | | | | | | This patch changes the internal representation of a file's mode to a string instead of an integer. This simplifies the problem of displaying the value consistently throughout all of puppet.
| * maint: Remove bogus mongrel testMatt Robinson2010-12-021-6/+0
| | | | | | | | | | | | | | Why test that mongrel responds to daemonize? EVERYTHING responds to daemonize thanks to activesupport. Paired-with: Paul Berry
* | (#5427) Remove redundant testunit testsMatt Robinson2010-12-141-205/+0
| | | | | | | | | | | | These tests are now better tested in the specs. Paired-with: Nick Lewis
* | maint: Use expand_path when requiring spec_helper or puppettestMatt Robinson2010-12-0686-86/+86
| | | | | | | | | | | | | | | | | | Doing a require to a relative path can cause files to be required more than once when they're required from different relative paths. If you expand the path fully, this won't happen. Ruby 1.9 also requires that you use expand_path when doing these requires. Paired-with: Jesse Wolfe
* | Merge branch '2.6.x' into nextMatt Robinson2010-12-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5304) Use internal_name rather than real_name for maillist provider Updated CHANGELOG and version for 2.6.4 Revert "(#5304) Use internal_name rather than real_name for maillist provider" Disable remote ralsh by default (#5424) Ship auth.conf as part of installing from source (#5304) Use internal_name rather than real_name for maillist provider Renamed Reductive to Puppet Manually Resolved Conflicts: lib/puppet/provider/maillist/mailman.rb
| * Renamed Reductive to PuppetJames Turnbull2010-11-291-1/+1
| | | | | | | | I swear I've done this before. *confused*
* | Maint: Modified uses of indirector.save to call the indirection directly.Paul Berry2010-11-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects production code.
* | Maint: Modified tests of indirector.save to call the indirection directly.Paul Berry2010-11-301-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | This change replaces calls to <model object>.save with calls to <model class>.indirection.save(<model object>). This makes the use of the indirector explicit rather than implicit so that it will be easier to search for all indirector call sites using grep. This is an intermediate refactor on the way towards allowing indirector calls to be explicitly routed to multiple termini. This patch affects tests only; the next patch will make the corresponding change to the code.
* | Maint: Refactor tests to use <class>.indirection.<method>Paul Berry2010-11-294-13/+13
| | | | | | | | | | | | Replaced uses of the find, search, destroy, and expire methods on model classes with direct calls to the indirection objects. This change affects tests only.
* | Maint: Switched spec tests to use a class rather than Array as the log ↵Paul Berry2010-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | destination. Using an Array as a log destination is unreliable because Puppet's log mechanism stores log destinations in a hash whose key is the destination itself. Since arrays can change their hash when they are modified, this was causing the log destination hash to become corrupted, producing sporadic spec test failures.
* | Merge branch 'ticket/next/5274' into nextPaul Berry2010-11-181-3/+6
|\ \
| * | (#5274) Fixed some "rake unit" tests that were inadvertently broken byPaul Berry2010-11-181-3/+6
| | | | | | | | | | | | commit:ee7d2f92f9d3ec45b5c3a9cd3fe2f5832b17f23b
* | | Merge branch 'ticket/next/5274' into nextNick Lewis2010-11-171-0/+19
|\| |
| * | (#5274) New tests for new hosttype/parsedproviderStefan Schulte2010-11-171-0/+5
| | | | | | | | | | | | | | | Just a few additional tests for the new property "comment" of the host type.
| * | (#5274) Tests for hostprovider removes commentsStefan Schulte2010-11-171-0/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that the hostprovider will remove all inline comments from the /etc/hosts file, when puppet updates at least one entry. Puppet will also remove comments from entries, the user doesnt want to manage with puppet. To split up changes a bit this commit will only introduce tests for the host type and the hostprovider. A few will fail, indicating the bug: The hostprovider parses all entries and builds a hash. When building the recordhash all comments are discarded. When puppet has to update at least one entry it uses the to_line function to convert the record hash back to a file. Because the comments are not stored in the hash, they cannot be written back to the file.
* | Merge commit '2.6.3' into nextPaul Berry2010-11-174-30/+10
|\| | | | | | | | | | | Resolved conflicts manually: spec/integration/indirector/bucket_file/rest_spec.rb spec/integration/indirector/certificate_revocation_list/rest_spec.rb
| * Fix test failures that fixing #4726 exposed.Jesse Wolfe2010-11-162-7/+4
| | | | | | | | | | | | | | | | | | The patch for #4726 causes old unit tests of the rrd reporting infrastructure to run on my machine. These tests were calling the old report api, which does not succeed. Also, the rrd settings had unintentionally been moved out of the :metrics section, making it possible that the rrd report directory would fail to get created during testing.
| * Fix for #4299 -- Don't require whichMarkus Roberts2010-11-123-16/+5
| | | | | | | | | | | | We already had an internal implementation of which hiding under an assumed name (Puppet::Util.binary); this commit calls it out of hiding and uses it consisantly.
| * Maint. fix for test broken by 00eedac5Markus Roberts2010-11-101-14/+5
| | | | | | | | | | As per Nigel, this fixes the test broken by commit 00eedac5 in which a :combine was added in lib but the corresponding change was not made in the test.
* | Partial merge to 2.6.2rc1 : Merge commits 'd057b90' and '6dd1930' into nextJesse Wolfe2010-10-042-7/+4
|\ \ | | | | | | | | | | | | This commit merges in d057b90 with the addition of commit 6dd1930 to fix some tests that are confined to machines where rrd is installed.
| * | Fix test failures that fixing #4726 exposed.Jesse Wolfe2010-10-042-7/+4
| |/ | | | | | | | | | | | | | | | | The patch for #4726 causes old unit tests of the rrd reporting infrastructure to run on my machine. These tests were calling the old report api, which does not succeed. Also, the rrd settings had unintentionally been moved out of the :metrics section, making it possible that the rrd report directory would fail to get created during testing.
* | Partial merge to 2.6.2rc1 : Merge commit '66cf3a9' into nextJesse Wolfe2010-10-041-87/+0
|\| | | | | | | There are test failures in commits following this one.
| * Port Puppet::SSLCertificates::CA test to rspecJacob Helwig2010-09-281-87/+0
| | | | | | | | Signed-off-by: Jacob Helwig <jacob@puppetlabs.com>
* | Merge commit '2.6.1' into nextJesse Wolfe2010-09-131-1/+4
|\|
| * Fix for Bug #4756 - Providers no longer respect missing featuresJames Cammarata2010-09-141-1/+4
| | | | | | | | Restored deleted lines from type.rb and reinstated unit tests
* | Merge commit '2.6.1rc4' into nextJesse Wolfe2010-09-135-46/+27
|\|
| * [#4308] Remove puppettest from specsMatt Robinson2010-09-035-46/+27
| | | | | | | | | | | | | | | | | | The less stuff being done in the spec_helper the better for reasoning about what's happening in the tests. puppettest.rb does a lot of things that aren't necessary for the specs, so this patch gets those things out of the spec_helper. Reviewed by: Jesse Wolfe
* | Merge remote branch 'paul/ticket/next/4638' into nextJesse Wolfe2010-09-092-10/+9
|\ \
| * | [4638] Cleanup of plurals and inheritance relationships in ASTPaul Berry2010-08-272-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the grammar so that the following "plural" constructs always parse as an ASTArray: - funcvalues - rvalues - resourceinstances - anyparams - params - caseopts - casevalues And the following "singluar" construct never parses as an ASTArray: - statement The previous behavior was for these constructs to parse as a scalar when they represented a single item and an ASTArray when they contained zero or multiple items. ("Statement" could sometimes represent a single item because a single resource declaration could represent multiple resources). This complicated other grammar rules and caused ambiguous handling of nested arrays. Also made these changes to the AST class hierarchy: - ResourceInstance no longer derives from ASTArray. This relationship was not meaningful because a ResourceInstance is a (title, parameters) pair, not an array, and it produced complications when we wanted to represent an array of ResourceInstance objects. - Resource no longer derives from ResourceReference. No significant functionality was being inherited and the relationship doesn't make sense in an AST context. - ResourceOverride no longer derives from Resource. No significant functionality was being inherited and the relationship doesn't make sense in an AST context. - Resource can now represent a compound resource instance such as "notify { foo: ; bar: }". This saves the parser from having to use represent a statement as an array of objects. - ASTArray's evaluate method never flattens out arrays of arrays.
* | | [3782] Test isolation problem in test/ral/providers/cron/crontab.rbPaul Berry2010-08-311-1/+4
|/ / | | | | | | | | | | | | | | | | | | | | The test in question (test_parse_line) was nondeterministic because it was relying on the sort order of a Hash whose keys were symbols. When the sort order caused a blank line to appear at the end of the file under test, the blank line was elided by the crontab parser, causing a failure. Modified the test to execute in a deterministic order that doesn't place the blank line at the end.
* | Merge remote branch 'paul/4472-4483-4496-4521-4522'Jesse Wolfe2010-08-174-49/+40
|\ \ | |/ |/| | | a.k.a. "make_taller_trees"
| * [#4496]+[#4521]+[#4522] Add structures to the AST to represent type ↵Paul Berry2010-08-134-49/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definitions (classes, definitions, and nodes). Previously, type definitions were not represented directly in the AST. Instead, the parser would instantiate types and insert them into known_resource_types as soon as they were parsed. This made it difficult to distinguish which types had come from the file that was just parsed and which types had been loaded previously, which led to bug 4496. A side-effect of this change is that the user is no longer allowed to define types inside of conditional constructs (such as if/else). This was allowed before but had unexpected semantics (bugs 4521 and 4522). It is still possible, however, to place an "include" statement inside a conditional construct, and have that "include" statement trigger the autoloading of a file that instantiates types.