-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5536 from larsewi/expand
ENT-9491: Fixed bug in double expansion of foreign list variables
- Loading branch information
Showing
2 changed files
with
125 additions
and
4 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
68 changes: 68 additions & 0 deletions
68
tests/acceptance/01_vars/01_basic/double_expansion_list.cf
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,68 @@ | ||
############################################################################## | ||
# | ||
# Test double expansion of list from remote bundle (ENT-9491) | ||
# | ||
############################################################################## | ||
|
||
body common control | ||
{ | ||
bundlesequence => { "check" }; | ||
} | ||
|
||
bundle agent test(parent_bundle) | ||
{ | ||
meta: | ||
"description" -> { "ENT-9491", "CFE-1644" } | ||
string => "Test double expension of list from remote bundle"; | ||
|
||
reports: | ||
"$($(parent_bundle).str)" | ||
comment => "Double expansion of remote string works prior to fix", | ||
bundle_return_value_index => "foo"; | ||
|
||
"$($(parent_bundle).lst)" | ||
comment => "But double expansion of remote list does not work prior to fix", | ||
bundle_return_value_index => "bar"; | ||
|
||
"$(check.lst)" | ||
comment => "Single expansion of remote list works prior to fix", | ||
bundle_return_value_index => "baz"; | ||
|
||
"$($(parent_bundle)#lst)" | ||
comment => "We force mangle the variable, it works, but should this be possible?", | ||
bundle_return_value_index => "qux"; | ||
|
||
} | ||
|
||
bundle agent check | ||
{ | ||
vars: | ||
"str" | ||
string => "EXPANDED"; | ||
"lst" | ||
slist => { "EXPANDED" }; | ||
|
||
methods: | ||
"holder" | ||
usebundle => test("$(this.bundle)"), | ||
useresult => "ret"; | ||
|
||
reports: | ||
"$(this.promise_filename) Pass" | ||
if => and(strcmp("$(ret[foo])", "EXPANDED"), | ||
strcmp("$(ret[bar])", "EXPANDED"), | ||
strcmp("$(ret[baz])", "EXPANDED"), | ||
strcmp("$(ret[qux])", "EXPANDED")); | ||
|
||
"$(this.promise_filename) FAIL" | ||
unless => and(strcmp("$(ret[foo])", "EXPANDED"), | ||
strcmp("$(ret[bar])", "EXPANDED"), | ||
strcmp("$(ret[qux])", "EXPANDED"), | ||
strcmp("$(ret[baz])", "EXPANDED")); | ||
|
||
DEBUG:: | ||
"$(const.dollar)($(const.dollar)(parent_bundle).str) => $(ret[foo])"; | ||
"$(const.dollar)($(const.dollar)(parent_bundle).lst) => $(ret[bar])"; | ||
"$(const.dollar)(check.lst) => $(ret[baz])"; | ||
"$(const.dollar)($(const.dollar)(parent_bundle)#lst) => $(ret[qux])"; | ||
} |