1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
#######################################################
#
# Regression test for RedMine #3572.
#
#######################################################
body common control
{
inputs => { "../../default.cf.sub" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
#######################################################
bundle agent init
{
vars:
"digits" string => "42";
}
#######################################################
bundle agent test
{
vars:
"number" int => "$(init.digits)";
"floaty" real => "$(init.digits)";
# RedMine #3572: this stanza should make no difference, but actually
# caused the numbers to be unexpanded, hence not "42" but literally
# "$(init.digits)", which doesn't parse as a number !
classes:
"ignored" not => "any";
# (In fact, even an empty classes stanza provoked the bug - but is
# that even valid ?)
}
#######################################################
bundle agent check
{
classes:
"iok" expression => strcmp("$(test.number)", "$(init.digits)");
"rok" expression => strcmp("$(test.floaty)", "42.000000");
"ok" and => { "iok", "rok" };
reports:
DEBUG.!iok::
"Read $(init.digits) as int $(test.number)";
DEBUG.!rok::
"Read $(init.digits) as real $(test.floaty)";
ok::
"$(this.promise_filename) Pass";
!ok::
"$(this.promise_filename) FAIL";
}
|