forked from jeffmccune/puppet-acceptance
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for [#4293] define something and use it
This test appears to only come up in agent/server mode. I could not trigger the bug in 2.6.0rc4 using stand alone apply mode. This test doesn't fail on any of the 2.6.0 release candidates, as far as I can tell. I'm not sure if the bug and fix were transitional between release candidates or not... Updated list of issues needing tests. Signed-off-by: Jeff McCune <jeff@puppetlabs.com>
- Loading branch information
Jeff McCune
committed
Jul 23, 2010
1 parent
d798a9a
commit 493ee2b
Showing
2 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
spec/ticket_4293_define_and_use_a_define_within_a_class_spec.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
# | ||
# 2010-07-22 Jeff McCune <jeff@puppetlabs.com> | ||
# | ||
# AffectedVersion: 2.6.0rc4 | ||
# FixedVersion: 2.6.0 | ||
# | ||
# Description: using a defined type in the class it's declared in | ||
# causes an error. | ||
# | ||
|
||
set -u | ||
source spec/setup.sh | ||
|
||
OUTPUT="/tmp/puppet-$$.out" | ||
|
||
execute_manifest <<'PP' >"${OUTPUT}" | ||
class foo { | ||
define do_notify($msg) { | ||
notify { "Message for $name: $msg": } | ||
} | ||
do_notify { 'test_one': msg => 'a_message_for_you' } | ||
} | ||
include foo | ||
PP | ||
|
||
if egrep -q '^notice.*?Foo::Do_notify.*?a_message_for_you' "${OUTPUT}" ; then | ||
exit $EXIT_OK | ||
else | ||
exit $EXIT_FAILURE | ||
fi | ||
|