puppetlabs-puppet/test
Josh Cooper 3ecd3761cd (#19391) Find the catalog for the specified node name
Previously, the test was invoking the Catalog.indirection.find method
but passing in a Node instance. This used to "work" in 2.7.x, because
the compiler terminus only looked at `request.key`, in this case the
node name, and ignored the `request.instance`.

The test appears to verify that we can compile a node with the specified
facts. But the test doesn't verify that the facts are in the returned
catalog (they're not). So in reality, this test is passing when it
shouldn't.

To pass a Node instance through to the compiler, you need to use the
`use_node` option, e.g. :use_node => node.to_yaml. To pass facts, use
the use the `facts` option, e.g. :facts => facts.to_yaml.

Since the test passes in a Node instance, the node is cached instead of
the compiled catalog, which is one of the issues described in
CVE-2013-1652.

This commit changes the test to pass in the node.name, and it ensures we
can compile a catalog for it.
2013-03-11 09:49:46 -07:00
..
data (maint) Ensure every file has a trailing newlines 2012-04-23 15:24:34 -07:00
language (#19391) Find the catalog for the specified node name 2013-03-11 09:49:46 -07:00
lib Use TestHelper in old unit tests 2012-08-13 15:38:44 -07:00
network (#16791) Remove tests for unused behavior 2012-10-26 14:37:20 -07:00
other (#4862) Finally remove the event-loop library. 2012-02-22 14:05:26 -08:00
puppet Port the SemVer test from Test::Unit to RSpec. 2012-08-31 15:16:36 -07:00
rails (#2848) Remove unused xmlrpc code 2011-10-21 10:19:43 -07:00
ral (#9160) Change logging facility to debug for not supported provider features 2012-05-16 15:30:12 -07:00
util (#16791) Remove tests for unused behavior 2012-10-26 14:37:20 -07:00
README Fix for #565: Final merge of changes from source:branches/execute-refactor into source:trunk 2007-04-03 15:51:18 +00:00
Rakefile (#6338) Remove unused version control tags 2011-02-28 12:07:15 -08:00
test Fixed #5684 - Move to Apache 2.0 license 2011-04-11 07:55:12 +10:00

README

$Id$

To run all tests, run: 'rake test'.  To run an individual suite, run the file
directly.  e.g. cd test/util; ./utiltest.rb

You might need to run some tests as root.

If you do not have rake installed:
  gem install rake

## The following information is possibly out of date?

Tests are organized into a dual hierarchy: each subdirectory is
considered a test suite, and each file in the subdirectory is considered
a test case.  You can use any test case as an example of how to write
more of them, but basically the only requirements are that they each have
their own class names, their names each match /tc_.+\.r/, and that they have
the following header:

if __FILE__ == $0
    $:.unshift '..'
    $:.unshift '../../lib'
    $blinkbase = "../.."
end